CN110212892B - High-precision electric energy meter variable threshold value integral differential pulse generation method - Google Patents
High-precision electric energy meter variable threshold value integral differential pulse generation method Download PDFInfo
- Publication number
- CN110212892B CN110212892B CN201910494504.6A CN201910494504A CN110212892B CN 110212892 B CN110212892 B CN 110212892B CN 201910494504 A CN201910494504 A CN 201910494504A CN 110212892 B CN110212892 B CN 110212892B
- Authority
- CN
- China
- Prior art keywords
- pulse
- pwm
- threshold value
- electric energy
- variable threshold
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 22
- 238000004364 calculation method Methods 0.000 claims abstract description 22
- 238000006243 chemical reaction Methods 0.000 claims description 3
- 230000010354 integration Effects 0.000 description 4
- 238000005070 sampling Methods 0.000 description 3
- 230000007547 defect Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000007689 inspection Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03K—PULSE TECHNIQUE
- H03K3/00—Circuits for generating electric pulses; Monostable, bistable or multistable circuits
- H03K3/01—Details
- H03K3/017—Adjustment of width or dutycycle of pulses
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03K—PULSE TECHNIQUE
- H03K5/00—Manipulating of pulses not covered by one of the other main groups of this subclass
- H03K5/22—Circuits having more than one input and one output for comparing pulses or pulse trains with each other according to input signal characteristics, e.g. slope, integral
- H03K5/26—Circuits having more than one input and one output for comparing pulses or pulse trains with each other according to input signal characteristics, e.g. slope, integral the characteristic being duration, interval, position, frequency, or sequence
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03K—PULSE TECHNIQUE
- H03K7/00—Modulating pulses with a continuously-variable modulating signal
- H03K7/08—Duration or width modulation ; Duty cycle modulation
Landscapes
- Physics & Mathematics (AREA)
- Nonlinear Science (AREA)
- Measurement Of Current Or Voltage (AREA)
- Measuring Frequencies, Analyzing Spectra (AREA)
Abstract
The invention relates to a variable threshold value integral differential pulse generation method for a high-precision electric energy meter, which comprises the following steps: step S1: providing a PWM device of an MCU based on an ARM M0-M4 kernel for generating pulses; step S2: obtaining voltage signal and current signal, obtaining P by convolution according to signal period n (ii) a And step S3: will P n And a threshold value P th Comparing, if the difference is higher than the threshold value, carrying out variable threshold differential calculation, and outputting a pulse by a PWM output configuration register; otherwise, performing variable threshold integral calculation, and outputting a pulse by a PWM output configuration register; and step S4: sharing the remaining output P e And seamlessly switching two outputs. The invention generates the pulses with different thresholds by different methods, generates the pulses from 0.00001HZ to 1MHZ and makes up for the blank that no wide dynamic pulse is generated in China. The problem that the limit of the generated pulse of the general MCU is too low is solved, and the pulse bandwidth which cannot be achieved by the existing algorithm under the same device is greatly expanded.
Description
Technical Field
The invention relates to the field of electric power, in particular to a variable threshold value integral differential pulse generation method for a high-precision electric energy meter.
Background
The integral method is used in all electric energy meter second impulse calculating methods at the present stage, the principle is that the MCU obtains a Ut sequence through calculation after the ADC samples voltage, and obtains an It through calculation after equivalent voltage sampling of a current sampling resistor, the dot product of the Ut sequence and the equivalent voltage sampling is the instantaneous power Pt,is the electrical energy. In practice, the pulse constant used by a common electric meter is low, such as D =3200imp/kwh, and the high-precision standard meter constant is at least 100 times that of the meter to be detected.
The pulse of a common electric meter is generally generated by a timer, an over-integration algorithm is used, one pulse is generated every time 1 pulse of electric energy is accumulated, the frequency of the pulse is below 1KHZ due to a low constant, and the common MCU timer can easily realize the pulse.
The high-precision standard electric energy meter exists as an inspection device, the pulse frequency is about 100 times of that of a common electric energy meter, the common highest frequency can reach 100KHZ, some high-precision meters can achieve the pulse frequency of 150KHZ, and the MCU is required to be very high at the time by using an integration algorithm. 150KHZ is approaching the limit for general purpose MCUs.
The prior art has the following defects:
1 general integration, limited by resources, generating a 100KHZ signal requires 10 microseconds of frequent interrupts, which nearly reaches the timer interrupt limit of general-purpose MCUs.
2 a small amount of high-precision standard meters can reach very high frequency by using a differential algorithm, but the low frequency cannot be very low, if the low frequency is 1HZ, the response time is 1 second, (the low frequency is 0.1HZ, and the response time is 10 seconds), so that a large error can be brought to dynamic electric energy metering, and the method can only be applied to high-frequency special occasions.
Disclosure of Invention
In view of this, the invention aims to provide a variable threshold integral differential pulse generation method for a high-precision electric energy meter, which solves the problem that the limit of a pulse generated by a general MCU is too low, and greatly expands the problem that the existing algorithm can not reach the pulse bandwidth under the same device.
The invention is realized by adopting the following scheme: a variable threshold value integral differential pulse generation method of a high-precision electric energy meter is characterized by comprising the following steps: the method comprises the following steps:
step S1: providing a PWM device of an MCU based on an ARM M0-M4 kernel for generating pulses;
step S2: acquiring a detected voltage signal and a detected current signal, and obtaining P by convolution according to signal periods n ;
And step S3: will P n And a threshold value P th Comparing if it is higher than the threshold P th Performing variable threshold differential calculation, and outputting pulses by a PWM output configuration register; otherwise, performing variable threshold integral calculation, and outputting pulse by the PWM output configuration register;
and step S4: shared residual output P e Seamlessly switching two outputs; the common remaining output P e Has a minimum unit of 1 KWH/pulse constant for pulse output, and the residual energy P is not satisfied with one unit in each calculation e And (4) showing.
Further, the specific content of step S3 is:
the low-frequency area adopts an integral mode, the frequency is 0.00001HZ to 100HZ, a timer is used for generating an interruption in a 100us period, if the electric energy generated in the area reaches 1 pulse standard, the PWM is stopped after generating a pulse through the PWM, namely the PWM equipment is closed immediately after being started, and only one pulse can be generated, the pulse setting is lower than 100us, and the frequency corresponding to the period of 100us is 10KHZ, so that two or more pulses cannot be generated in the interval;
the high frequency region adopts differential mode, frequency is 100Hz-1MHz, an interrupt is generated by using 100us period of timer, and average power P in 100us interval is interrupted every two timers n A 1 is to P n Converting into corresponding PWM frequency, accumulating error mantissa to next calculation, counting PWM, and accumulating the counted error mantissa to new P after next 100us interrupt generation n +1 calculates the new PWM parameter setting and accumulates the mantissa error to the next calculation.
Further, the one pulse standard specifically is: 1/pulse constant; the pulse constant is the number of pulses per kilowatt hour of the electronic electric energy meter; the power meter constants will be plotted on the power surface board in units of imp/kwh, expressed as number of pulses per kilowatt-hour.
Further, the P is n The conversion to the corresponding PWM frequency is specifically: p n Pulse constant.
Compared with the prior art, the invention has the following beneficial effects:
the invention generates the pulses with different thresholds by different methods, generates the pulses from 0.00001HZ to 1MHZ and makes up for the blank that no wide dynamic pulse is generated in China. The problem that the limit of the generated pulse of the general MCU is too low is solved, and the pulse bandwidth which cannot be achieved by the existing algorithm under the same device is greatly expanded.
Drawings
FIG. 1 is a flow chart of an embodiment of the present invention.
Detailed Description
The invention is further explained below with reference to the drawings and the embodiments.
As shown in fig. 1, the present embodiment provides a method for generating a variable threshold integral-differential pulse of a high-precision electric energy meter, which includes the following steps:
step S1: providing a PWM device of an MCU based on an ARM M0-M4 kernel for generating pulses;
step S2: acquiring a detected voltage signal and a detected current signal, and convolving according to a signal period to obtain P n ;
And step S3: will P n And a threshold value P th Comparing if it is higher than the threshold P th Performing variable threshold differential calculation, and outputting a pulse by a PWM output configuration register; otherwise, performing variable threshold integral calculation, and outputting pulse by the PWM output configuration register;
and step S4: shared residual output P e Seamlessly switching two outputs; the common residual output P e Has a minimum unit of 1 KWH/pulse constant for pulse output, and the residual energy P is not satisfied with one unit in each calculation e And (4) showing.
In this embodiment, the specific content of step S3 is:
the low-frequency area adopts an integral mode, the frequency is 0.00001HZ to 100HZ, a universal timer (generally any (arbitrarily representing and not limiting hardware resources)) is used for generating an interruption in a period of 100us (microseconds), if the electric energy generated in the area reaches a 1-pulse standard, the PWM is stopped after a pulse is generated through PWM, namely the PWM equipment is closed immediately after being started, only one pulse can be generated, the pulse setting is lower than 100us, and the frequency corresponding to the period of 100us is 10KHZ, so that two or more pulses cannot be generated in the interval;
the high frequency region adopts differential mode, frequency is 100HZ-1MHz, a timer is used for 100us (microsecond) period to generate an interrupt, and average power P in every two timer interrupt intervals 100us n From P to P n Convert to corresponding PWM frequency and error (since PWM is digital circuit producing precision)Degree limitation, e.g. a failure of 100.63HZ to generate a signal of only 100.6HZ, 0.03HZ, will bring about an error of 0.03% that cannot be directly erased in a high-precision calculation so that this error is added up to the next calculation to ensure precision) mantissas are accumulated to the next calculation, and for PWM counting, the error mantissas of the counting error (the difference between the count and the time at which 1 pulse has been stopped) are added up to a new P after the next 100us interruption of generation n +1 calculates the new PWM parameter setting and accumulates the mantissa error to the next calculation.
In this embodiment, the one pulse standard specifically includes: 1/pulse constant; the pulse constant is the number of pulses per kilowatt hour of the electronic electric energy meter; the power meter constants will be plotted on the power surface board in units of imp/kwh, expressed as number of pulses per kilowatt-hour.
In this embodiment, P is defined as n The conversion to the corresponding PWM frequency is specifically: p n Pulse constant.
Preferably, the frequency point division of the low frequency region and the high frequency region in this embodiment is set according to the actual power calculation cycle, and different items may have a certain difference.
The integration method adopted in the region 1 is effective for designing the pulse with lower frequency, and if the requirement of the designed high-frequency pulse on the MCU is too high (the IO level must be inverted in the interruption of the timer by the timer), the integration method is used for limiting the high frequency by interrupting the frequency. The differential method adopted by the area 2 has high-frequency effect, the automatic reversal IO port of the PWM device does not need to be interrupted too frequently, the defect is that the low-frequency response is slow, if the differential method and the PWM are used for setting a pulse of 0.1HZ, the device cannot be normally interrupted within 10S of one period after being set (at least one period is completed after the PWM is started), namely 10 seconds cannot be responded. Therefore, the embodiment generates the pulses with different thresholds by different methods, perfectly generates the pulses from 0.00001HZ to 1MHZ, and makes up for the blank that no wide dynamic pulse is generated in China.
The above description is only a preferred embodiment of the present invention, and all equivalent changes and modifications made in accordance with the claims of the present invention should be covered by the present invention.
Claims (3)
1. A variable threshold value integral differential pulse generation method of a high-precision electric energy meter is characterized by comprising the following steps: the method comprises the following steps:
step S1: providing a PWM device of an MCU based on an ARM M0-M4 kernel for generating pulses;
step S2: acquiring a detected voltage signal and a detected current signal, and convolving according to a signal period to obtain P n ;
And step S3: will P n And a threshold value P th Comparing if it is higher than the threshold P th Performing variable threshold differential calculation, and outputting pulses by a PWM output configuration register; otherwise, performing variable threshold integral calculation, and outputting pulse by the PWM output configuration register;
and step S4: sharing the remaining output P e Seamlessly switching two outputs; the common remaining output P e Has a minimum unit of 1 KWH/pulse constant for pulse output, and the residual energy P is not satisfied with one unit in each calculation e Represents;
the specific content of the step S3 is as follows:
the low frequency region adopts an integral mode, the frequency is 0.00001HZ to 100HZ, a timer is used for generating an interruption in a period of 100us, if the electric energy generated in the region reaches a pulse standard, the PWM is stopped after a pulse is generated through the PWM, namely the PWM equipment is immediately closed after being started, so that only one pulse can be generated, the pulse setting is lower than 100us, and the frequency corresponding to the period of 100us is 10KHZ, so that two or more pulses cannot be generated in the region;
the high frequency region adopts differential mode, frequency is 100Hz-1MHz, an interrupt is generated by using 100us period of timer, and average power P in 100us interval is interrupted every two timers n A 1 is to P n Converting into corresponding PWM frequency, accumulating error mantissa to next calculation, counting PWM, and accumulating the counted error mantissa to new P after next 100us interrupt generation n +1 calculates the new PWM parameter setting and accumulates the mantissa error to the next calculation.
2. The method for generating the variable threshold value integral differential pulse of the high-precision electric energy meter according to claim 1, characterized in that: the one pulse standard specifically is: 1/pulse constant; the pulse constant is the number of pulses per kilowatt hour of the electronic electric energy meter; the power meter constants will be plotted on the power surface board in units of imp/kwh, expressed as number of pulses per kilowatt-hour.
3. The method for generating the variable threshold value integral differential pulse of the high-precision electric energy meter according to claim 2, characterized in that: the P is n The conversion to the corresponding PWM frequency is specifically: p n Pulse constant.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910494504.6A CN110212892B (en) | 2019-06-06 | 2019-06-06 | High-precision electric energy meter variable threshold value integral differential pulse generation method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910494504.6A CN110212892B (en) | 2019-06-06 | 2019-06-06 | High-precision electric energy meter variable threshold value integral differential pulse generation method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110212892A CN110212892A (en) | 2019-09-06 |
CN110212892B true CN110212892B (en) | 2022-10-04 |
Family
ID=67791501
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910494504.6A Active CN110212892B (en) | 2019-06-06 | 2019-06-06 | High-precision electric energy meter variable threshold value integral differential pulse generation method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110212892B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113433509B (en) * | 2021-07-02 | 2022-12-02 | 威胜集团有限公司 | Calibration method of metering ammeter, electric energy meter and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
GB1312651A (en) * | 1969-04-19 | 1973-04-04 | Bosch Gmbh Robert | Electronic pulse devices |
US4075486A (en) * | 1976-02-05 | 1978-02-21 | Outokumpu Oy | Method and device for diminishing the background effect in a proportional counter |
CN101047371A (en) * | 2007-03-19 | 2007-10-03 | 成都理工大学 | Full digital sliding pulse signal generator |
TW201424215A (en) * | 2012-12-05 | 2014-06-16 | Inno Tech Co Ltd | Multifunctional digital pulse width modulation controller |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6853227B2 (en) * | 2001-04-17 | 2005-02-08 | K-Tek Corporation | Controller for generating a periodic signal with an adjustable duty cycle |
-
2019
- 2019-06-06 CN CN201910494504.6A patent/CN110212892B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
GB1312651A (en) * | 1969-04-19 | 1973-04-04 | Bosch Gmbh Robert | Electronic pulse devices |
US4075486A (en) * | 1976-02-05 | 1978-02-21 | Outokumpu Oy | Method and device for diminishing the background effect in a proportional counter |
CN101047371A (en) * | 2007-03-19 | 2007-10-03 | 成都理工大学 | Full digital sliding pulse signal generator |
TW201424215A (en) * | 2012-12-05 | 2014-06-16 | Inno Tech Co Ltd | Multifunctional digital pulse width modulation controller |
Also Published As
Publication number | Publication date |
---|---|
CN110212892A (en) | 2019-09-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6204504B2 (en) | RF pulse synchronization, processing, and control with RF metrology | |
WO2015085830A1 (en) | Apparatus for testing dynamic characteristics of electronic energy meter | |
CN109752584B (en) | Method for measuring effective value of periodic signal | |
CN105699738A (en) | PWM-based AC signal effective value measurement method | |
CN105548667A (en) | Alternating current signal effective value measuring device | |
CN103185837A (en) | Method for measuring frequency of power system | |
CN110212892B (en) | High-precision electric energy meter variable threshold value integral differential pulse generation method | |
CN102253281A (en) | Method for measuring power grid frequency by resisting harmonic interference and automatically changing phase based on software | |
US10107842B2 (en) | Low jitter pulse output for power meter | |
CN111934760A (en) | Signal processing transmission delay characteristic detection device and method and terminal equipment | |
CN101937017A (en) | Dynamic direct-current removing method for intelligent electric meter during alternating-current sampling | |
DK171802B1 (en) | Method and apparatus for converting an electrical signal to a proportional frequency and using the device in an electricity counter. | |
CN103135650A (en) | Current/frequency conversion circuit linearity and symmetry digital compensation method | |
CN108061564B (en) | Single-wire transmission identification and synchronization method for incremental encoder phase signals | |
CN104391176A (en) | Software and hardware frequency measurement circuit compatible with electric power system signals | |
CN109975598B (en) | Periodic signal effective value measuring circuit | |
CN108008183B (en) | Electric quantity measuring method, system, equipment and computer storage medium | |
KR101444582B1 (en) | Apparatus and method for detecting frequency | |
CN110007166B (en) | Method for rapidly measuring energy efficiency of frequency converter | |
CN204649825U (en) | Based on the high speed true effective value rectifying system of FPGA | |
CN117054737B (en) | Method and device for calculating power supply frequency through autocorrelation filtering | |
RU2229138C1 (en) | Meter measuring parameters of harmonic processes | |
RU2096788C1 (en) | Statistic analyzer of quality of electric power characteristics | |
CN110261676B (en) | Method for metering electric quantity of exponential time domain function with uncertain initial time | |
Pardhu et al. | Design and simulation of digital frequency meter using VHDL |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |