Accurate electric energy metering method
By configuring the RN8302B metering chip and optimizing parameters, the problem of large energy metering errors under conditions of rapid current direction switching is solved, accurate measurement of forward and reverse energy is achieved, and the accuracy and precision of energy metering are improved.
Patent Information
- Application Number
- CN202510576519.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-06
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2045-05-06
AI Technical Summary
Under conditions where the current direction switches rapidly, the existing energy metering scheme of smart meters causes the forward and reverse energy to cancel each other out, resulting in energy omissions and increased metering errors. This is especially true in application scenarios such as distributed energy grid connection, industrial equipment start-up and shutdown, and V2G charging and discharging, where metering accuracy is insufficient.
The RN8302B metering chip is used, and half-wave metering mode and two-level pulse constant mode are configured. Through the SPI communication protocol between the main control MCU and the metering chip, the first-level and second-level pulse constants are configured respectively, and the energy metering accumulation threshold is set. The forward and reverse energy register data are periodically read to calculate the energy increment. Based on the accumulation threshold, it is determined whether to accumulate the energy metering value. Experimental verification and optimization of configuration parameters are carried out to improve accuracy.
Under the condition of rapid switching of current direction, accurate measurement of forward and reverse electric energy is achieved, which avoids electric energy cancellation, improves the accuracy of electric energy measurement, reduces errors and ensures the accuracy of electric energy measurement.
Smart Images

Figure CN120594936A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electric energy metering, and in particular to a method for accurate electric energy metering. Background Art
[0002] Smart meters utilize integrated circuits, offering significant advantages over traditional induction meters in both performance and functionality. Furthermore, traditional induction meters typically measure energy using electromagnetic induction, where current and voltage coils generate magnetic flux, driving the rotation of an aluminum disk. Existing smart meter energy measurement solutions mostly utilize electronic methods, sampling current and voltage signals through analog-to-digital converters. The instantaneous power is calculated by multiplying the voltage and current values, and the instantaneous power is then accumulated to calculate the energy value.
[0003] However, in power grid conditions where the power flow rapidly switches direction—that is, where forward and reverse currents rapidly alternate—such as in distributed energy grid integration, industrial equipment startup and shutdown, and V2G charging and discharging, existing energy metering solutions used by smart meters cancel out the forward and reverse energy at the moment the current direction switches, resulting in energy omissions and increased errors.
[0004] Therefore, for the working conditions where the forward current and reverse current change rapidly, an electric energy metering method is developed to avoid the mutual cancellation of the forward electric energy and the reverse electric energy when measuring electric energy, and to prevent electric energy leakage. This method plays a substantial and important role in improving the accuracy of electric energy metering and reducing the error of electric energy metering under the working conditions where the current direction switches rapidly. Summary of the Invention
[0005] In order to avoid the mutual cancellation of forward and reverse electric energy when measuring electric energy under the condition of rapid current direction switching, prevent electric energy leakage, and achieve accurate electric energy measurement, the present invention provides a method for accurate electric energy measurement. The technical solution is as follows: A method for accurate electric energy measurement, comprising the steps of: selecting a metering chip and configuring a communication protocol between a main control MCU and the metering chip; obtaining a Value; Based on value, respectively configure the primary pulse constant of the metering chip and secondary pulse constant , and set the energy metering accumulation threshold; the main control MCU periodically reads the data of the forward energy register and reverse energy register in the metering chip, and calculates the accumulated forward energy increment and reverse energy increment in the current cycle respectively; based on the set energy metering accumulation threshold, it determines whether the forward energy metering value or the reverse energy metering value is accumulated in the current cycle; based on the technical standards, test verification is carried out, accuracy is evaluated, and the configuration parameters of the metering chip are adjusted and optimized.
[0006] Preferably, a metering chip is selected and the communication protocol between the main control MCU and the metering chip is configured, including selecting a metering chip with model RN8302B, configuring the metering chip to a half-wave metering mode, selecting a two-level pulse constant mode, and using an SPI channel to configure the communication protocol between the main control MCU and the metering chip.
[0007] Preferably, based on the functional parameters of the metering chip, obtain Values, including obtaining standard voltage values , standard current value , the crystal oscillator frequency of the metering chip , meter constant , rated voltage , calibration current ,calculate Value, where The value is calculated as: , Where, Represents the rounding function.
[0008] Preferably, based on value, respectively configure the primary pulse constant of the metering chip and secondary pulse constant , and set the energy metering accumulation threshold, including the first-level pulse constant Set to 2, with a small energy window, to accumulate the forward and reverse energy respectively; set the secondary pulse constant Set to The energy metering accumulation threshold is 1 / 4 of the value. , .
[0009] Preferably, the main control MCU periodically reads the data of the forward power register and the reverse power register in the metering chip, and respectively calculates the accumulated forward power increment and reverse power increment in the current cycle, including storing the sampled forward half-wave power signal or the reverse half-wave power signal in the corresponding forward power register or the reverse power register in the metering chip; the main control MCU periodically reads the data of the forward power register And the data of the reverse energy register , the cumulative positive energy increment in the current cycle is , , the accumulated reverse energy increment in the current cycle is , , where Indicates taking the absolute value, and Both represent the benchmark values corresponding to the current period. and The initial value of is 0.
[0010] Preferably, based on the set energy metering accumulation threshold, it is judged whether the current cycle accumulates the forward energy metering value or the reverse energy metering value, including the forward energy increment , reverse power increase Respectively with the energy metering accumulation threshold Compare and judge whether the current cycle accumulates positive energy metering pulses or reverse energy metering pulses; when When the forward electric energy measurement value is increased by 1, the corresponding reference value of the next cycle renew, , the current cycle of energy metering process ends, when When the forward electric energy measurement value remains unchanged, the reference value corresponding to the next cycle remains unchanged, the current cycle of energy metering process ends; similarly, when When the reverse energy measurement value is increased by 1, the corresponding reference value of the next cycle renew, , the current cycle of energy metering process ends, when When the reverse power measurement value and The current cycle of electric energy metering process ends.
[0011] Preferably, based on the technical standards, test verification is carried out to evaluate the accuracy and adjust and optimize the configuration parameters of the metering chip, including applying the nominal voltage to the voltage circuit of the meter, setting the power factor to 1, applying current to the current circuit of the meter and repeatedly switching between the forward and reverse current directions, and the switching between the forward and reverse states of the current should be completed within one cycle of the nominal frequency; the tolerance of the forward and reverse switching cycles is one cycle of the nominal frequency; reading the precise electric energy of the electric energy meter before and after the test, calculating the electric energy change value and comparing it with the standard electric energy change value to obtain the accuracy, and calculating the forward and reverse errors respectively; based on the obtained accuracy and forward and reverse errors, adjusting and optimizing Value, and the primary pulse constant of the metering chip , secondary pulse constant .
[0012] Compared with the prior art, the present invention has the following beneficial effects: The present invention provides a method for accurately measuring electric energy. The method can measure forward electric energy and reverse electric energy separately under the working condition of rapid switching of current direction, avoid mutual cancellation of forward electric energy and reverse electric energy when measuring electric energy, thereby preventing electric energy leakage, improving electric energy measurement accuracy, reducing electric energy measurement errors, and realizing accurate measurement of electric energy. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] The above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood by reading the following detailed description with reference to the accompanying drawings. In the accompanying drawings, several embodiments of the present invention are shown in an illustrative and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein: Figure 1 This is the implementation flow chart of the electric energy metering method; Figure 2 This is the flow chart of the main control MCU measuring electric energy in the electric energy metering method; Figure 3 This is a schematic diagram of the operation of the metering chip in the electric energy metering method; DETAILED DESCRIPTION The technical features of the present invention are further described in detail below with reference to the accompanying drawings so that those skilled in the art can understand them.
[0014] A precise electric energy measurement method is applied to the electronic smart meter structure. Under the condition of rapid current switching, the forward and reverse electric energy are measured separately. Its operation logic is as follows: Figures 1 to 3 The specific operation steps are as follows: Step S1: Select a metering chip and configure the communication protocol between the main control MCU and the metering chip; Specifically, a metering chip model RN8302B is selected, the metering chip is configured to half-wave metering mode, the pulse output mode of the metering chip is selected to be cascade mode, and the two-level pulse constant mode is selected, and the SPI channel is used to configure the communication protocol between the main control MCU and the metering chip.
[0015] In addition, the total phase power accumulation mode of the accumulator in the metering chip is selected as the algebraic sum mode; the symbol source for total phase power accumulation is selected as the instantaneous total phase power symbol, that is, the half-wave power symbol; the electric energy accumulation mode of the forward electric energy register in the metering chip is selected as the algebraic sum integration mode; and the electric energy accumulation mode of the reverse electric energy register in the metering chip is selected as the absolute value sum mode.
[0016] Step S2: Based on the functional parameters of the metering chip, obtain value; Specifically, get the standard voltage value , standard current value , the crystal oscillator frequency of the metering chip , meter constant , rated voltage , calibration current ,calculate Value, where The value is calculated as: , Where, represents the rounding function; The detection voltage of the meter is set to the rated input voltage, and the effective value of the voltage at the input end of the voltage channel of the metering chip is The theoretical calculated value of the detection voltage by the metering chip is Utheoretical, and the voltage value displayed on the LCD after conversion by the main control MCU is U indicated value. The standard voltage effective value is ,but The following conditions should be met: 0.8< <1.2, ensure that the voltage channel gain correction of the metering chip is within a reasonable range; , K should be an integer and easy for the main control MCU to convert, so that the main control MCU can convert the effective value register value into the LCD display voltage value; Based on the functional parameters of the computing chip and the parameters of the electric meter, U theory can be calculated as follows: , therefore, according to The value of calculation is obtained ; At the same time, set the meter's detection current to the rated input current and use the same principle to calculate the standard current effective value. .
[0017] In addition, since the selected metering chip model is RN8302B, its crystal oscillator frequency 8.192Mhz, rated voltage , calibration current The value is determined according to the actual application scenario and the relevant parameters of the meter itself. Generally, the meter constant The value range is 1000imp / KWH~20000imp / KWH, the meter constant The larger the value, the higher the metering accuracy.
[0018] Step S3: Based on value, respectively configure the primary pulse constant of the metering chip and secondary pulse constant , and set the energy metering accumulation threshold; Specifically, the first-order pulse constant Set to 2, with a small energy window, to accumulate the forward and reverse electric energy respectively. The smaller the energy window, the higher the measurement frequency and the higher the measurement accuracy. Set to The energy metering accumulation threshold is 1 / 4 of the value. , .
[0019] In addition, the pulse output mode of the metering chip is selected to be is the high frequency pulse constant output, The value of is used as the frequency of the pulse output of the metering chip to control the flashing of the meter indicator light; the increase of the forward energy register and the reverse energy register is only Related, and It doesn't matter, when making comparison, Compare with the high 16 bits of the absolute value of the fast pulse count register of the combined phase and each fast pulse count register of the split phase. If it is greater than or equal to If the value of the forward energy register or the reverse energy register is set, the corresponding forward energy register or reverse energy register will increase by 1.
[0020] Step S4: The main control MCU periodically reads the data of the forward power register and the reverse power register in the metering chip, and calculates the accumulated forward power increment and reverse power increment in the current cycle respectively; Specifically, such as Figure 3 As shown, the sampled forward half-wave power signal or reverse half-wave power signal is stored in the forward energy register or reverse energy register in the metering chip respectively. The direction of the energy is determined by the power direction. If the power is positive, the energy data is recorded in the forward energy register. If the power is negative, the energy data is recorded in the reverse energy register. The main control MCU periodically reads the forward energy register. And the data of the reverse energy register , such as the cycle is 1S; in order to enhance accuracy and reduce errors, the stored data in the forward energy register and the reverse energy register will not be cleared. Therefore, when performing energy metering, it is necessary to calculate the energy increment of the current cycle; the accumulated forward energy increment in the current cycle is , , the accumulated reverse energy increment in the current cycle is , , where Indicates taking the absolute value, and Both represent the benchmark values corresponding to the current period. and The initial value of is 0.
[0021] Step S5: Based on the set energy metering accumulation threshold, determine whether the current cycle accumulates the forward energy metering value or the reverse energy metering value; Specifically, such as Figure 2 As shown, the forward and reverse electric energies are measured respectively, and the forward electric energy increment is , reverse power increase Respectively with the energy metering accumulation threshold Compare and judge whether the current cycle accumulates positive energy metering pulses or reverse energy metering pulses; when When the forward electric energy measurement value is increased by 1, the corresponding reference value of the next cycle renew, , the current cycle of energy metering process ends, when When the forward electric energy measurement value remains unchanged, the reference value corresponding to the next cycle remains unchanged, the current cycle of energy metering process ends; similarly, when When the reverse energy measurement value is increased by 1, the corresponding reference value of the next cycle renew, , the current cycle of energy metering process ends, when When the reverse power measurement value and The current cycle of electric energy metering process ends.
[0022] In addition, the conversion relationship between the electric energy measurement value and the actual electric energy is the same as the meter constant. The positive energy measurement value plus 1 indicates that the positive actual energy in the current cycle increases. kilowatt-hour; similarly, the reverse energy metering value plus 1 indicates that the reverse actual electric energy of the current cycle increases kilowatt-hour.
[0023] Step S6: Based on the technical standards, conduct test verification, evaluate the accuracy, and adjust and optimize the configuration parameters of the metering chip; Specifically, according to the technical requirements and technical standards of the State Grid for rapid change of power flow direction, a test verification was carried out. The nominal voltage was applied to the voltage circuit of the meter, the power factor was set to 1, and the current was applied to the current circuit of the meter and repeatedly switched between the forward and reverse current flow directions. During the forward current period, 10I tr During the reverse current period, a 10I current in the opposite direction is applied. trCurrent, that is, the rated current of 10A is applied; the time period for repeated switching of the current direction is 5s in the forward direction and 5s in the reverse direction, and the total test duration is 4h; the forward time and reverse time of the current do not need to be synchronized with the zero crossing point of the grid frequency, and the switching between the forward state and the reverse state of the current should be completed within one cycle of the nominal frequency; the tolerance of the forward and reverse switching cycles is one cycle of the nominal frequency; the precise electric energy of the electric energy meter is read before and after the test, the electric energy change value is calculated and compared with the standard electric energy change value to obtain the accuracy, and the forward and reverse errors are calculated respectively; based on the obtained accuracy and forward and reverse errors, the optimization is adjusted. Value, and the primary pulse constant of the metering chip , secondary pulse constant .
[0024] The embodiments described in the present invention are merely descriptions of preferred implementations of the present invention and are not limited to the precise structures described above and shown in the accompanying drawings. Various modifications and changes can be made without departing from the scope of protection thereof. Without departing from the design concept of the present invention, various variations and improvements made to the technical solutions of the present invention by engineers and technicians in this field should fall within the scope of protection of the present invention.
Claims
1. A method for accurate electric energy measurement, characterized by: Select the metering chip and configure the communication protocol between the main MCU and the metering chip; based on the functional parameters of the metering chip, obtain Value; Based on value, respectively configure the primary pulse constant of the metering chip and secondary pulse constant , and set the energy metering accumulation threshold; The main control MCU periodically reads the data of the forward power register and the reverse power register in the metering chip, and calculates the accumulated forward power increment and reverse power increment in the current cycle respectively; Based on the set energy metering accumulation threshold, determine whether the current cycle accumulates the forward energy metering value or the reverse energy metering value; Based on technical standards, conduct experimental verification, evaluate accuracy, and adjust and optimize the configuration parameters of the metering chip.
2. The electric energy metering method according to claim 1, wherein: Select the metering chip and configure the communication protocol between the main control MCU and the metering chip, including selecting the metering chip model RN8302B, configuring the metering chip to half-wave metering mode, selecting the two-level pulse constant mode, and using the SPI channel to configure the communication protocol between the main control MCU and the metering chip.
3. The electric energy metering method according to claim 2, wherein: Based on the functional parameters of the metering chip, obtain Values, including obtaining standard voltage values , standard current value , the crystal oscillator frequency of the metering chip , meter constant , rated voltage , calibration current ,calculate Value, where The value is calculated as: , Where, Represents the rounding function.
4. The electric energy metering method according to claim 3, wherein: based on value, respectively configure the primary pulse constant of the metering chip and secondary pulse constant , and set the energy metering accumulation threshold, including the first-level pulse constant Set to 2 to accumulate the forward and reverse energies separately in a small energy window; The secondary pulse constant Set to The energy metering accumulation threshold is 1 / 4 of the value. , .
5. The electric energy metering method according to claim 4, characterized in that: The main control MCU periodically reads the data of the forward electric energy register and the reverse electric energy register in the metering chip, and calculates the accumulated forward electric energy increment and reverse electric energy increment in the current cycle, including storing the sampled forward half-wave power signal or reverse half-wave power signal in the corresponding forward electric energy register or reverse electric energy register in the metering chip respectively; The main control MCU periodically reads the forward power register And the data of the reverse energy register , the cumulative positive energy increment in the current cycle is , , the accumulated reverse energy increment in the current cycle is , , where Indicates taking the absolute value, and Both represent the benchmark values corresponding to the current period. and The initial value of is 0.
6. The electric energy metering method according to claim 5, characterized in that: Based on the set energy metering accumulation threshold, it is determined whether the current cycle accumulates the forward energy metering value or the reverse energy metering value, including the forward energy increment. , reverse power increase Respectively with the energy metering accumulation threshold Compare and judge whether the current cycle accumulates positive energy metering pulses or reverse energy metering pulses; when When the forward electric energy measurement value is increased by 1, the corresponding reference value of the next cycle renew, , the current cycle of energy metering process ends, when When the forward electric energy measurement value remains unchanged, the reference value corresponding to the next cycle remains unchanged, the current cycle of energy metering process ends; similarly, when When the reverse energy measurement value is increased by 1, the corresponding reference value of the next cycle renew, , the current cycle of energy metering process ends, when When the reverse power measurement value and The current cycle of electric energy metering process ends.
7. The electric energy metering method according to claim 6, wherein: Based on the technical standards, test verification is carried out to evaluate the accuracy and adjust and optimize the configuration parameters of the metering chip, including applying the nominal voltage to the voltage circuit of the meter, setting the power factor to 1, applying current to the current circuit of the meter and repeatedly switching between the forward and reverse current flow directions. The switching between the forward and reverse states of the current should be completed within one cycle of the nominal frequency; the tolerance of the forward and reverse switching cycles is one cycle of the nominal frequency; the precise electric energy of the electric energy meter is read before and after the test, the electric energy change value is calculated and compared with the standard electric energy change value to obtain the accuracy, and the forward and reverse errors are calculated respectively; based on the obtained accuracy and forward and reverse errors, the optimization is adjusted. Value, and the primary pulse constant of the metering chip , secondary pulse constant .
Citation Information
Patent Citations
Method for accumulating aggregate capacitances of smart meter capable of realizing bidirectional metering
CN102200544A
Real-time bidirectional independent electric-energy metering system
CN104237632A
Intelligent electric energy meter fusing multiple terminal monitoring functions
CN110007137A
Method and system for improving metering precision of three-phase cost control intelligent electric meter based on MCU
CN112782470A
Electric energy metering method and device and electric energy meter
CN114047380A