A method of accurate electrical energy metering
By configuring the RN8302B metering chip and optimizing parameters, the problem of energy metering error under the condition of rapid current direction switching was solved, realizing accurate energy metering in smart meters, improving metering accuracy and reducing errors.
Patent Information
- Application Number
- CN202510576519.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-06
- Publication Date
- 2026-08-25
- Estimated Expiration
- 2045-05-06
AI Technical Summary
Under conditions of rapid current direction switching, the existing energy metering scheme of smart meters causes positive and negative energy to cancel each other out, resulting in energy leakage and increased metering errors. In particular, the metering accuracy is insufficient in application scenarios such as distributed energy grid connection, industrial equipment start-up and shutdown, and V2G charging and discharging.
The RN8302B metering chip is used, configured with half-wave metering mode and two-level pulse constant mode. 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 read periodically, the energy increment is calculated, and the energy metering value is determined based on the accumulation threshold. Experiments are conducted to verify and optimize the configuration parameters.
It enables the separate measurement of forward and reverse electrical energy under conditions of rapid current direction switching, avoiding mutual cancellation, improving the accuracy of electrical energy measurement, reducing errors, and achieving precise measurement of electrical energy.
Smart Images

Figure CN120594936B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of electrical energy metering technology, and in particular to a method for accurate electrical energy metering. Background Technology
[0002] Smart meters utilize electronic integrated circuits, giving them significant advantages in both performance and functionality compared to traditional induction meters. Furthermore, traditional induction meters typically measure energy based on electromagnetic induction, using current and voltage coils to generate magnetic flux that drives an aluminum disc. Existing smart meter solutions mostly employ electronic methods, sampling current and voltage signals via an analog-to-digital converter, calculating instantaneous power by multiplying the voltage and current values, and then accumulating this instantaneous power to determine the energy value.
[0003] However, in applications where the power flow direction changes rapidly in the power grid—that is, when forward and reverse currents alternate rapidly, such as distributed energy grid connection, industrial equipment start-up and shutdown, and V2G charging and discharging—the existing energy metering schemes used by smart meters cause the forward and reverse energy to cancel each other out at the moment of current direction switching. This leads to missed energy readings and increased errors.
[0004] Therefore, for operating conditions where forward and reverse currents change rapidly, it is necessary to develop an energy metering method to avoid the mutual cancellation of forward and reverse energy during energy metering, thereby preventing energy omissions. This method plays a substantial and important role in improving energy metering accuracy and reducing energy metering errors under operating conditions where current direction changes rapidly. Summary of the Invention
[0005] To prevent the cancellation of forward and reverse electrical energy during rapid current direction switching and thus avoid missed energy measurement, this invention provides a method for accurate electrical energy measurement, the technical solution of which is as follows: A method for accurate electricity metering includes the following steps: selecting a metering chip and configuring the communication protocol between the main control MCU and the metering chip; obtaining data based on the functional parameters of the metering chip. Value; based on The values are configured to represent the primary pulse constants of the metering chip. and second-order pulse constant The system sets an energy metering accumulation threshold; the main control MCU periodically reads the data from the forward energy register and reverse energy register in the metering chip, and calculates the cumulative forward energy increment and reverse energy increment in the current cycle, respectively; based on the set energy metering accumulation threshold, it determines whether to accumulate the forward energy metering value or the reverse energy metering value in the current cycle; based on technical standards, it conducts experimental verification, evaluates the accuracy, and adjusts and optimizes the configuration parameters of the metering chip.
[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 of model RN8302B, configuring the metering chip in 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, the following methods are used to obtain... Values, including obtaining standard voltage values. Standard current value Crystal oscillator frequency of metering chip meter constant Rated voltage , Calibration current ,calculate Value, of which, The formula for calculating the value is: , In the formula, This represents the floor function.
[0008] Preferred, based on The values are configured to represent the primary pulse constants of the metering chip. and second-order pulse constant And set the power metering accumulation threshold, including setting the first-level pulse constant. Set to 2, and accumulate forward and reverse electrical energy separately using a small energy window; set the second-order pulse constant. Set as 1 / 4 of the value, the cumulative threshold for electricity metering is , .
[0009] Preferably, the main control MCU periodically reads data from the forward energy register and the reverse energy register in the metering chip, and calculates the cumulative forward energy increment and reverse energy increment within the current period, respectively. This includes storing the sampled forward half-wave power signal or reverse half-wave power signal in the corresponding forward energy register or reverse energy register in the metering chip; the main control MCU periodically reads data from the forward energy register. and the data of the reverse energy register The cumulative positive energy increment during the current period is , The cumulative increase in reverse electrical energy during the current period is , In the formula, This indicates taking the absolute value. and Both represent the baseline value corresponding to the current period. and The initial values of all are 0.
[0010] Preferably, based on a set energy metering accumulation threshold, it is determined whether to accumulate positive or negative energy metering values in the current period, including adding positive energy increments. Reverse energy increment Each with the accumulated threshold of electricity metering The comparison is performed to determine whether a positive or negative energy metering pulse is accumulated in the current cycle; when At that time, the positive energy metering value is incremented by 1, and the corresponding base value for the next cycle is... renew, The current cycle of electricity metering has ended, when At that time, the positive energy metering value remains unchanged, and the corresponding reference value for the next cycle is... If the current cycle of electricity metering remains unchanged, the current cycle's electricity metering process ends; similarly, when... When the reverse energy metering value is incremented by 1, the corresponding base value for the next cycle is set. renew, The current cycle of electricity metering has ended, when At that time, the reverse energy metering value and The current cycle of electricity metering has ended.
[0011] Preferably, based on technical standards, experimental verification is conducted to evaluate accuracy and adjust and optimize the configuration parameters of the metering chip. This includes 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 forward and reverse current flows. The switching between the forward and reverse current states should be completed within one cycle of the nominal frequency; the allowable tolerance for the forward and reverse switching cycle is one cycle of the nominal frequency. The precise energy of the meter is read before and after the test, the change in energy is calculated and compared with the standard change in energy to obtain accuracy, and the forward and reverse errors are calculated separately. Based on the obtained accuracy and forward and reverse errors, adjustments and optimizations are made. Value, and the first-level pulse constant of the metering chip. Second-order pulse constant .
[0012] Compared with the prior art, the beneficial effects of the present invention are as follows: This invention provides a method for accurate electrical energy measurement, which can measure forward and reverse electrical energy separately under conditions of rapid current direction switching, avoiding mutual cancellation of forward and reverse electrical energy during measurement, thereby preventing missed measurement of electrical energy, improving the accuracy of electrical energy measurement, reducing electrical energy measurement errors, and achieving accurate measurement of electrical energy. Attached Figure Description
[0013] The above and other objects, features, and advantages of exemplary embodiments of the present invention will become readily apparent upon reading the following detailed description with reference to the accompanying drawings. In the drawings, several embodiments of the invention are illustrated by way of example and not limitation, and like or corresponding reference numerals denote like or corresponding parts, wherein: Figure 1 This is a flowchart illustrating the implementation of this electricity metering method; Figure 2 This is a flowchart of the main control MCU metering of electrical energy in this electrical energy metering method; Figure 3 This is a schematic diagram of the operation of the metering chip in this energy metering method; Detailed Implementation The technical features of the present invention will be further described in detail below with reference to the accompanying drawings so that those skilled in the art can understand them.
[0014] A method for accurate energy metering, applied to the structure of an electronic smart meter, measures forward and reverse energy separately under conditions of rapid current direction switching. Its operating logic is as follows: Figures 1-3 As shown, the specific operating steps are as follows: Step S1: Select the metering chip and configure the communication protocol between the main control MCU and the metering chip; Specifically, the metering chip model RN8302B is selected, configured in half-wave metering mode, the pulse output mode of the metering chip is selected as cascade mode, and a two-stage pulse constant mode is selected. The communication protocol between the main control MCU and the metering chip is configured using the SPI channel.
[0015] In addition, the phase power accumulation mode of the accumulator in the metering chip is selected as algebraic sum mode; the symbol source for phase power accumulation is selected as instantaneous phase power symbol, i.e. half-wave power symbol; the energy accumulation mode of the forward energy register in the metering chip is selected as algebraic sum integration mode; and the energy accumulation mode of the reverse energy register in the metering chip is selected as absolute value sum mode.
[0016] Step S2: Based on the functional parameters of the metering chip, obtain... value; Specifically, obtain the standard voltage value. Standard current value Crystal oscillator frequency of metering chip meter constant Rated voltage , Calibration current ,calculate Value, of which, The formula for calculating the value is: , In the formula, Represents the floor function; Specifically, the meter's detection voltage is set to the rated input voltage, and the effective voltage value at the input terminal of the metering chip's voltage channel is... The theoretical value of the voltage measured by the metering chip is Utheoretical. The voltage value displayed on the LCD after conversion by the main control MCU is Uindicated. The standard effective voltage value is... ,but The following conditions must be met: 0.8 < <1.2, ensuring that the voltage channel gain correction of the metering chip is within a reasonable range; K should be an integer and be easy for the main control MCU to convert, so that the main control MCU can convert the effective value register value into the voltage value displayed on the LCD. Based on the functional parameters of the computing chip and the parameters of the electricity meter, U can be theoretically calculated using the following formula: Therefore, it can be based on Value calculation and acquisition ; At the same time, the detection current of the meter is set to the rated input current, and the standard effective value of the current is calculated using the same principle. .
[0017] Furthermore, since the selected metering chip is model RN8302B, its crystal oscillator frequency... 8.192MHz, rated voltage , Calibration current The value is determined based on the actual application scenario and the relevant parameters of the meter itself. Generally, the meter constant... The value range is 1000imp / kWh to 20000imp / kWh, the meter constant. The larger the value, the higher the metering accuracy.
[0018] Step S3: Based on The values are configured to represent the primary pulse constants of the metering chip. and second-order pulse constant And set the cumulative threshold for electricity metering; Specifically, the first-order pulse constant Set to 2, using a small energy window, to accumulate forward and reverse electrical energy separately. The smaller the energy window, the higher the metering frequency and the higher the metering accuracy; set the secondary pulse constant. Set as 1 / 4 of the value, the cumulative threshold for electricity metering is , .
[0019] In addition, the pulse output mode of the metering chip is selected as... For high-frequency pulse constant output, The value is used as the frequency of the pulse output of the metering chip to control the flashing of the meter's indicator light; the increase of the positive energy register and the reverse energy register is only related to... Related, and Irrelevant, when making comparisons, Compare the absolute values of the combined phase fast pulse count register and each phase fast pulse count register with the high 16 bits. If the absolute values are greater than or equal to... If the value is 1, then the corresponding forward or reverse energy register is incremented by 1.
[0020] Step S4: The main control MCU periodically reads the data from the forward energy register and the reverse energy register in the metering chip, and calculates the cumulative positive energy increment and reverse energy increment in the current cycle respectively; Specifically, such as Figure 3 As shown, the sampled positive half-wave power signal or negative half-wave power signal is stored in the positive energy register or negative energy register in the metering chip, respectively. The direction of energy is determined by the power direction. If the power is positive, the energy data is recorded in the positive energy register; if the power is negative, the energy data is recorded in the negative energy register. The main control MCU periodically reads the positive energy register. and the data of the reverse energy register For example, if the period is 1 second; to enhance accuracy and reduce errors, the stored data in the forward and reverse energy registers will not be cleared. Therefore, when performing energy metering, it is necessary to calculate the energy increment for the current period; the cumulative positive energy increment in the current period is... , The cumulative increase in reverse electrical energy during the current period is , In the formula, This indicates taking the absolute value. and Both represent the baseline value corresponding to the current period. and The initial values of all are 0.
[0021] Step S5: Based on the set energy metering accumulation threshold, determine whether to accumulate positive energy metering value or reverse energy metering value in the current cycle; Specifically, such as Figure 2 As shown, forward and reverse electrical energy are measured separately, and the increment of forward electrical energy is... Reverse energy increment Each with the accumulated threshold of electricity metering The comparison is performed to determine whether a positive or negative energy metering pulse is accumulated in the current cycle; when At that time, the positive energy metering value is incremented by 1, and the corresponding base value for the next cycle is... renew, The current cycle of electricity metering has ended, when At that time, the positive energy metering value remains unchanged, and the corresponding reference value for the next cycle is... If the current cycle of electricity metering remains unchanged, the current cycle's electricity metering process ends; similarly, when... When the reverse energy metering value is incremented by 1, the corresponding base value for the next cycle is set. renew, The current cycle of electricity metering has ended, when At that time, the reverse energy metering value and The current cycle of electricity metering has ended.
[0022] Furthermore, the conversion relationship between the measured electricity value and the actual electrical energy is related to the meter constant. Relatedly, adding 1 to the positive energy meter reading indicates an increase in the actual positive energy for the current cycle. kilowatt-hour; similarly, adding 1 to the reverse energy meter value indicates an increase in the actual reverse energy in the current cycle. Kilowatt-hours.
[0023] Step S6: Based on technical standards, conduct experimental verification, evaluate accuracy, and adjust and optimize the configuration parameters of the metering chip; Specifically, in accordance with the State Grid's new technical requirements and standards for rapid changes in power flow direction, experimental verification was conducted. The nominal voltage was applied to the meter's voltage circuit, with the power factor set to 1. Current was applied to the meter's current circuit, repeatedly switching between forward and reverse current flows. During the forward current period, 10I was applied. tr The current, 10I in the opposite direction is applied during the reverse current period. trThe applied current is the rated current of 10A; the current direction switching time period is 5s forward and 5s reverse, with a total test duration of 4 hours; the forward and reverse current times do not need to be synchronized with the zero-crossing point of the grid frequency, and the switching between the forward and reverse states should be completed within one cycle of the nominal frequency; the allowable tolerance for the forward and reverse switching cycle is one cycle of the nominal frequency; the precise energy of the energy meter is read before and after the test, the energy change value is calculated and compared with the standard energy change value to obtain the accuracy, and the forward and reverse errors are calculated separately; based on the obtained accuracy and forward and reverse errors, adjustments and optimizations are made. Value, and the first-level pulse constant of the metering chip. Second-order pulse constant .
[0024] The embodiments described in this invention are merely preferred embodiments of the 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. Any variations and improvements made by those skilled in the art to the technical solutions of this invention without departing from the design concept of this invention should fall within the scope of protection of this invention.
Claims
1. A method for accurate electrical energy metering, characterized in that: Select a 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 in half-wave metering mode, selecting a two-level pulse constant mode, and using the SPI channel to configure the communication protocol between the main control MCU and the metering chip. 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, of which, The formula for calculating the value is: , In the formula, Represents the floor function; based on The values are configured to represent the primary pulse constants of the metering chip. and second-order pulse constant And set the power metering accumulation threshold, including: setting the first-level pulse constant. Set to 2, and accumulate forward and reverse electrical energy separately using a small energy window; set the second-order pulse constant. Set as 1 / 4 of the value, the cumulative threshold for electricity metering is , ; The main control MCU periodically reads data from the forward energy register and reverse energy register in the metering chip, and calculates the cumulative forward energy increment and reverse energy increment within the current period, including: storing the sampled forward half-wave power signal or reverse half-wave power signal in the corresponding forward energy register or reverse energy register in the metering chip; the main control MCU periodically reads the forward energy register... and the data of the reverse energy register The cumulative positive energy increment during the current period is , The cumulative increase in reverse electrical energy during the current period is , In the formula, This indicates taking the absolute value. and Both represent the baseline value corresponding to the current period. and The initial values are all 0; Based on the set electricity metering accumulation threshold, it is determined whether to accumulate positive or negative electricity metering values in the current period, including: accumulating positive electricity increments. Reverse energy increment Each with the accumulated threshold of electricity metering The comparison is performed to determine whether a positive or negative energy metering pulse is accumulated in the current cycle; when At that time, the positive energy metering value is incremented by 1, and the corresponding base value for the next cycle is... renew, The current cycle of electricity metering has ended, when At that time, the positive energy metering value remains unchanged, and the corresponding reference value for the next cycle is... If the current cycle of electricity metering remains unchanged, the current cycle's electricity metering process ends; similarly, when... When the reverse energy metering value is incremented by 1, the corresponding base value for the next cycle is set. renew, The current cycle of electricity metering has ended, when At that time, the reverse energy metering value and If unchanged, the current cycle of electricity metering has ended; Based on technical standards, conduct experimental verification, evaluate accuracy, and adjust and optimize the configuration parameters of the metering chip.
2. The electricity metering method according to claim 1, characterized in that: Based on technical standards, experimental verification was conducted to evaluate accuracy and adjust and optimize the configuration parameters of the metering chip. This included applying the nominal voltage to the meter's voltage circuit, setting the power factor to 1, applying current to the meter's current circuit, and repeatedly switching between forward and reverse current flows. The switching between the forward and reverse current states should be completed within one cycle of the nominal frequency; the allowable tolerance for the forward and reverse switching cycle is one cycle of the nominal frequency. The precise energy of the meter was read before and after the test, the change in energy was calculated and compared with the standard change in energy to obtain accuracy, and the forward and reverse errors were calculated separately. Based on the obtained accuracy and forward and reverse errors, adjustments and optimizations were made. Value, and the first-level pulse constant of the metering chip. Second-order 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