Method and apparatus for improving precision of fundamental wave measurement

By calculating the frequency deviation value of RCH and adjusting the bandpass filter coefficient, the problem of frequency less than fundamental wave interference and frequency deviation in fundamental wave metering is solved, the fundamental wave metering accuracy and signal amplitude are improved, and the hardware cost is reduced.

WO2024245464A1PCT designated stage expired Publication Date: 2024-12-05HANGZHOU VANGO TECH
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/107774
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-08-03
Filing Date
2024-07-26
Publication Date
2024-12-05

AI Technical Summary

Technical Problem

The prior art cannot effectively filter out interference signals in the power grid with a frequency smaller than the fundamental wave during fundamental measurement, and fails to consider the impact of sampling frequency frequency deviation on the filter amplitude and frequency characteristics, resulting in distortion of the fundamental signal and degradation of the metering accuracy.

Method used

The number of clocks is sent through the UART module, the frequency deviation value of RCH is calculated, and the bandpass filter coefficient is adjusted according to the frequency deviation value. The adder and multiplier are calculated and multiplexed in a pipeline manner to realize real-time correction of the bandpass filter coefficient and improve the Fundamental wave metering accuracy.

Benefits of technology

The measurement accuracy of fundamental current and voltage is improved, the phase, frequency, effective value and other factors are reduced, and the hardware cost is reduced, and the extraction of higher accurate characteristic parameters of fundamental signals is realized.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024107774_05122024_PF_FP_ABST
    Figure CN2024107774_05122024_PF_FP_ABST
Patent Text Reader

Abstract

An apparatus and method for improving the precision of fundamental wave measurement. The apparatus comprises: a UART module, which is used for sending to a calculation module and a control module baud_cnt, i.e., the number of clock cycles required for sending one symbol; the calculation module, which is used for calculating a frequency bias of an RCH, calculating, in a pipelined manner and according to the frequency bias of the RCH, a band-pass filter coefficient b in a fundamental wave measurement apparatus, and adjusting a band-pass filter according to the band-pass filter coefficient b; the control module, which is used for flow control in the pipelined manner; and a register, which is used for receiving and saving relevant data during the operation of the UART module, the calculation module and the control module. The method uses an apparatus for improving the precision of fundamental wave measurement, and comprises calculating a band-pass filter coefficient b, and adjusting a band-pass filter according to the band-pass filter coefficient b.
Need to check novelty before this filing date? Find Prior Art

Description

A method and device for improving fundamental wave measurement accuracy Technical Field

[0001] The present invention relates to a method and a device for improving measurement accuracy, and a method and a device for improving fundamental wave measurement accuracy. Background Art

[0002] With the intelligentization of power grids, smart grid-related services have shown a demand for power metering capabilities. The minimum frequency of the periodically varying voltage or current in a power grid is called the fundamental wave. my country's power grid stipulates that the fundamental wave frequency is 50 Hz, while other signals with frequencies that are not integer multiples of the fundamental wave are called harmonics. Harmonics can significantly impact the accuracy of energy meters, so they must be filtered out when measuring the fundamental wave. To filter out harmonics, the most common method is to input the full wave into a BPF (band-pass filter) with a center frequency of 50 Hz. The resulting signal after filtering is the fundamental wave. The BPF coefficients are related to the system clock. When using a design without an external crystal oscillator, the resistance-capacitance high-speed internal clock signal (RCH) is typically used as the system clock. Because the RCH frequency varies with external temperature, it can also fluctuate. If the BPF coefficients do not change with the system clock, the fundamental wave signal obtained by the BPF will be distorted to a certain extent.

[0003] In the process of solving the above problems, the existing technology still has defects, such as:

[0004] Patent Document 1: Smart Electricity Meter with Fundamental Wave Measurement Function and Its Measurement Method, CN103852637B. This document processes voltage and current signals through low-pass filters to filter out harmful harmonics in the power grid, thereby reducing the interference of harmonics on fundamental wave measurement. However, using only low-pass filters cannot filter out interference signals in the power grid with frequencies lower than the fundamental wave. Furthermore, the impact of sampling frequency deviation on the filter's amplitude-frequency characteristics is not considered.

[0005] Patent Document 2: A method and related components for measuring the frequency of an input signal, CN110007144A. This document determines the RCH clock frequency through communication frames sent by the MCU, and then calculates the frequency of the input signal with the known RCH clock frequency. Furthermore, reactive power can be compensated based on the actual RCH clock frequency. The calculated input signal frequency is only the full-wave frequency, not the fundamental frequency, and other characteristic parameters of the fundamental wave, such as RMS and phase, cannot be compensated.

[0006] Summary of the Invention

[0007] Purpose of the invention: The technical problem to be solved by the present invention is to provide a method and device for improving the fundamental wave measurement accuracy in view of the shortcomings of the existing technology.

[0008] In order to solve the above technical problems, the present invention discloses a method and device for improving fundamental wave measurement accuracy. Among them, a device for improving fundamental wave measurement accuracy includes:

[0009] The UART module is used to send the clock frequency baud_cnt required to send one code element to the calculation module and the control module;

[0010] a calculation module, configured to calculate a frequency deviation value of the RCH, and calculate a bandpass filter coefficient b in the fundamental wave metering device in an assembly line manner based on the frequency deviation value of the RCH, and adjust the bandpass filter according to the bandpass filter coefficient b;

[0011] A control module, used for process control of the pipeline method;

[0012] Registers are used to receive and store relevant data during the operation of the UART module, calculation module and control module.

[0013] Furthermore, the frequency deviation value bias of the RCH is calculated based on the clock number baud_cnt sent by the UART module. The specific method includes:

[0014] Among them, baud_rate is the preset baud rate, f s is the system frequency.

[0015] Furthermore, the calculation method of the bandpass filter coefficient b includes:

[0016] Among them, f0 is the center frequency of the bandpass filter, a is another coefficient, a=1-2 -8 ;

[0017] When there is a frequency offset in the RCH, the bandpass filter coefficient b is calculated as follows:

[0018] After simplification and first-order linear fitting method, the bandpass filter coefficient b is finally obtained as follows:

[0019] b=m+(b0-m)×(-2.005×bias_avg+3.005)

[0020] Where m is -(1+a), b0 represents the value of coefficient b currently stored in the register, and bias_avg represents the average frequency deviation.

[0021] Furthermore, the calculation module only includes a multiplier and an adder.

[0022] Furthermore, the calculation module calculates the bandpass filter coefficient b in a pipeline manner, and the specific method is as follows:

[0023] Step S1, using a multiplier, multiplying a preset baud rate baud_rate by a clock number baud_cnt;

[0024] Step S2: using a multiplier, multiplying the result obtained in step S1 by the inverse of the theoretical frequency value of the RCH to obtain the frequency deviation value bias of the RCH;

[0025] Step S3: using a multiplier, multiply the RCH frequency offset value bias obtained in step S2 by a constant of -2.005;

[0026] Step S4, using an adder, adding the constant 3.005 to the result obtained in step S3, and saving the result r0 in a register;

[0027] Step S5, using an adder, adding -m to the coefficient b0 stored in the front register;

[0028] Step S6, using a multiplier, multiplying r0 by the result obtained in step S5;

[0029] In step S7, an adder is used to add m to the result obtained in step S6 to obtain a bandpass filter coefficient b, and the coefficient b is stored in a register to replace b0.

[0030] Furthermore, when the frequency offset value bias of the RCH is calculated according to the clock number baud_cnt, a sliding average method is adopted.

[0031] Furthermore, the sliding average method is used to obtain the average frequency deviation bias_avg, which is calculated as follows:

[0032] Among them, N is the length of the sliding window, L is the coordinate of the current starting position of the sliding window, bias i is the i-th frequency deviation value in the sliding window.

[0033] Furthermore, the first initial value of the value b0 representing the coefficient stored in the current register is calculated as follows:

[0034] The center frequency f0 of the bandpass filter is equal to the system frequency f s Substitute the value into the calculation formula of the bandpass filter coefficient b when there is no frequency deviation to obtain the initial value of b0.

[0035] Furthermore, the center frequency f0 of the bandpass filter iss , preset according to the actual environment of fundamental wave measurement.

[0036] The present invention also provides a method for improving fundamental wave measurement accuracy, which uses the above-mentioned device for improving fundamental wave measurement accuracy, comprising the following steps:

[0037] Step 1: Use the UART module to send the number of clocks required to send one code element, baud_cnt, to the calculation module through the baud rate adaptive method;

[0038] Step 2: The calculation module calculates the bandpass filter coefficient b in the fundamental wave measurement device and saves the coefficient to a register;

[0039] Step 3: Adjust the bandpass filter in the fundamental wave measurement device according to the bandpass filter coefficient b and perform measurement. Beneficial effects:

[0040] 1. The present invention provides an algorithm that can improve the measurement accuracy of the phase, frequency, effective value, etc. of fundamental current and voltage. The algorithm is easy to implement in hardware, can be integrated inside the chip, and can be automatically adjusted in real time.

[0041] 2. The present invention derives the true RCH frequency through the UART baud rate adaptation module (UART, Universal Asynchronous Receiver and Transmitter), and then compares it with the theoretical RCH frequency to obtain the RCH frequency deviation value. Finally, the BPF coefficient is recalculated based on this frequency deviation value, which can restore the fundamental signal to a greater extent, thereby extracting more accurate characteristic parameters such as phase, frequency, and effective value.

[0042] 3. The present invention simplifies the above method by deduction, so that it can be implemented based on adders and multipliers with lower hardware cost, and also adopts a pipeline method to multiplex adders and multipliers, further reducing the hardware cost of implementing the algorithm. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments, and the above and / or other advantages of the present invention will become more apparent.

[0044] FIG1 is a schematic diagram of a fitting error curve of a second-order Taylor expansion of y=cos(z).

[0045] Figure 2a is a schematic diagram of the first-order linear fitting.

[0046] Figure 2b is a schematic diagram of the fitting error.

[0047] FIG3 is a block diagram of the overall solution of the present invention. DETAILED DESCRIPTION

[0048] The present invention provides a method and device capable of improving fundamental wave measurement accuracy, specifically a method and a hardware implementation thereof for improving the measurement accuracy of the phase, frequency, and effective value of fundamental wave current and voltage when an internal RCH clock is used without an external crystal oscillator.

[0049] Among them, a method that can improve the fundamental wave measurement accuracy, the specific algorithm derivation process is as follows:

[0050] The frequency deviation calculation formula of RCH is:

[0051] Where baud_rate is the baud rate, which the user needs to configure in the register first, baud_cnt is the number of clocks required for the baud rate adaptive module to send one code, and f s is the system frequency, which is equal to the theoretical value of the RCH frequency.

[0052] Here we choose a second-order elliptical bandpass filter, whose prototype transfer function is:

[0053] Where coefficient a = 1-2 -8 , the coefficient b is:

[0054] Where f0 is the center frequency of the bandpass filter, which is selected as the fundamental frequency here. When the temperature changes, the frequency of RCH will also change accordingly. Substituting the frequency deviation value of RCH into the above formula, the coefficient b is:

[0055] The cost of directly implementing the cos() function through hardware is very high, so it needs to be simplified. According to the Taylor expansion formula of the cosine function:

[0056] Select the second-order Taylor expansion formula and substitute it into it, and we get:

[0057] When the temperature changes from -40 to 125 degrees Celsius, the offset range of the RCH frequency affected by temperature is ±4%, that is, bias∈[0.96,1.04]. Let:

[0058] Here, f0=50Hz, f s =12.8kHz as an example, we get z∈[0.02360,0.02557], and perform error analysis on the second-order cosine Taylor expansion. The results are shown in Figure 1.

[0059] From Figure 1, we can see that the maximum error is -1.781×10 -6 %, select the second-order Taylor expansion and bring it into the bandpass filter coefficient calibration formula to obtain:

[0060] In order to further simplify the calculation, -(1+a) is recorded as m, and Let n be the value, then

[0061] Let the value of b in register be b0, then:

[0062] b0=m+n

[0063] Substitute b0 into the expression of b, and we get:

[0064] By converting the above formula, there are no frequency values ​​f0 and f in the expression of coefficient b. s , which is convenient for expanding its application. For example, in some countries the fundamental frequency is 60Hz, and f s The frequency can also be customized by the user. The above expression requires a divider, and the cost of directly implementing a divider in hardware is also very high. Here we use a first-order linear fitting method (reference: https: / / baike.baidu.com / item / %E7%BA%BF%E6%80%A7%E6%8B%9F%E5%90%88 / 5511930?fr=aladdin) to approximate This function is fitted through the point (1,1), where there is no frequency deviation, and b = b0. Figure 2a shows the fitted line, and Figure 2b shows the error analysis. Figure 2 shows that the maximum error is -0.5%, achieved when bias = 1.04.

[0065] The final expression of b is:

[0066] b=m+(b0-m)×(-2.005×bias_avg+3.005)

[0067] From this expression, we can see that the coefficient b of the bandpass filter can be corrected in real time according to the frequency deviation value of the system frequency. Therefore, the fundamental signal obtained by the corrected bandpass filter has higher accuracy. Taking the effective value as an example, the effective value calculation formula of n consecutive signals is:

[0068] where x i is the signal amplitude obtained by the bandpass filter. Since the bandpass filter designed in the present invention can adapt to the system frequency, its amplitude-frequency characteristic is better and the accuracy of the signal amplitude is higher, so the accuracy of the obtained effective value will also be higher.

[0069] The above scheme uses a UART baud rate adaptation module to determine the frequency deviation of the current clock, which is then reflected in the bandpass filter coefficients. This allows for greater restoration of the fundamental signal, thereby improving the accuracy of frequency, phase, and effective value measurements. However, directly implementing this algorithm is very expensive in terms of hardware. The present invention simplifies the algorithm through derivation, enabling its implementation using adders and multipliers, which have lower hardware costs. Furthermore, the adders and multipliers are multiplexed in a pipelined manner, further reducing the hardware cost of implementing the algorithm.

[0070] The present invention also proposes a device capable of improving fundamental wave measurement accuracy, the overall scheme of which is as follows:

[0071] As shown in Figure 3, the overall solution is divided into four parts:

[0072] 1. UART module (reference: https: / / www.tw.studiodahu.com / baike-UART), which uses baud rate adaptation to send baud_cnt, the number of clocks required to send one symbol, to the calculation module and also sends a valid signal to the control module.

[0073] 2. The calculation module. Based on the expression for b, the hardware resources required to calculate b include an adder (subtraction is implemented by addition) and a multiplier. The calculation module performs the addition and multiplication to obtain the final b and sends it to the register.

[0074] 3. Register. The register sends b0 and baud_rate to the calculation module, and receives b obtained by the calculation module.

[0075] 4. Control module. To conserve hardware resources, the adder and multiplier are pipelined (see: https: / / blog.csdn.net / weixin_45614076 / article / details / 126432252). The control module controls the pipeline. When the UART sends a valid signal to the control module, the pipeline starts. The control module also generates a write register signal to indicate when b is written to the register.

[0076] Among them, the calculation module adopts pipeline design, as follows:

[0077] In the first step, a multiplier is used to multiply baud_rate by baud_cnt.

[0078] In the second step, a multiplier is used to multiply the result obtained in the first step by the inverse of the RCH theoretical frequency value. This step obtains the frequency deviation value bias.

[0079] In the third step, use the multiplier to multiply the bias obtained in the second step by the constant -2.005.

[0080] In the fourth step, use the adder to add the constant 3.005 to the result obtained in the third step and save the result in register r0.

[0081] Step 5. Use the adder to add -m to b0.

[0082] In the sixth step, use the multiplier to multiply r0 by the result obtained in the fifth step.

[0083] In the seventh step, use an adder to add m to the result obtained in the sixth step. This step obtains the final coefficient b.

[0084] As shown in Table 1, adders and multipliers are reused for the pipeline design of the control module.

[0085] Table 1 Pipeline design

[0086] In addition, in some embodiments, the following method may also be used:

[0087] 1. When calculating the RCH frequency deviation value, the sliding average (reference: https: / / www.zhihu.com / question / 577769924 / answer / 2859349950?utm_id=0) can be used to reduce the error caused by UART baud rate adaptation, thereby further improving the fundamental wave measurement accuracy.

[0088] 2. In addition to using the UART baud rate adaptive module to obtain the RCH frequency deviation value, you can also use a temperature sensor to obtain temperature changes and then convert them into RCH frequency deviation values.

[0089] 3. The algorithm uses first-order linear fitting to implement division. In addition, multi-order linear fitting can be used to implement division. This will have higher accuracy, but the pipeline will be more complicated and the implementation cost will be higher.

[0090] 4. In addition to pipelining adders and multipliers, adders and multipliers themselves can also be pipelined to convert single-cycle operations to multi-cycle operations, thereby further reducing implementation costs.

[0091] In a specific implementation, the present application provides a computer storage medium and a corresponding data processing unit, wherein the computer storage medium is capable of storing a computer program that, when executed by the data processing unit, can execute the invention content of the method and apparatus for improving fundamental wave measurement accuracy provided by the present invention, as well as some or all of the steps in each embodiment. The storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

[0092] Those skilled in the art can clearly understand that the technical solutions in the embodiments of the present invention can be implemented by means of computer programs and their corresponding general hardware platforms. Based on this understanding, the technical solutions in the embodiments of the present invention, in essence or in other words, the part that contributes to the prior art, can be embodied in the form of a computer program, i.e., a software product. The computer program software product can be stored in a storage medium and includes a number of instructions for enabling a device including a data processing unit (which can be a personal computer, server, single-chip microcomputer, MUU or network device, etc.) to execute the methods described in various embodiments of the present invention or certain parts of the embodiments.

[0093] The present invention provides a method and apparatus for improving fundamental wave measurement accuracy. There are numerous methods and approaches for implementing this technical solution. The foregoing merely illustrates preferred embodiments of the present invention. It should be noted that those skilled in the art may make improvements and modifications without departing from the principles of the present invention, and such improvements and modifications are also within the scope of protection of the present invention. Any components not specified in this embodiment may be implemented using existing technologies.

Claims

1. A device for improving fundamental wave measurement accuracy, characterized in that: include: The UART module is used to send the clock number baud_cnt required to send one code element to the calculation module and the control module; A calculation module, used for calculating the frequency deviation value of RCH, and according to the frequency deviation value of RCH, calculating the bandpass filter coefficient b in the fundamental wave metering device in an assembly line manner, and adjusting the bandpass filter according to the bandpass filter coefficient b; A control module, used for process control of the assembly line method; Registers are used to receive and save relevant data during the operation of the UART module, calculation module and control module.

2. The device for improving fundamental wave measurement accuracy according to claim 1, characterized in that: The calculation of the frequency deviation value bias of RCH is performed according to the clock number baud_cnt sent by the UART module. The specific method includes: Among them, baud_rate is the preset baud rate, f s is the system frequency.

3. The device for improving fundamental wave measurement accuracy according to claim 1, characterized in that: The calculation method of the bandpass filter coefficient b includes: Among them, f0 is the center frequency of the bandpass filter, a is another coefficient, a = 1-2 -8 ; When there is a frequency deviation in the RCH, the calculation method of the bandpass filter coefficient b is as follows: After simplification and first-order linear fitting method, the bandpass filter coefficient b is finally obtained as follows: b=m+(b0-m)×(-2.005×bias_avg+3.005) Wherein, m is -(1+a), b0 represents the value of coefficient b stored in the current register, and bias_avg represents the average frequency deviation.

4. The device for improving fundamental wave measurement accuracy according to claim 3, characterized in that: The calculation module only includes a multiplier and an adder.

5. The device for improving fundamental wave measurement accuracy according to claim 4, characterized in that: The calculation module calculates the bandpass filter coefficient b in a pipeline manner, and the specific method is as follows: Step S1, using a multiplier to multiply a preset baud rate baud_rate by a clock number baud_cnt; Step S2, using a multiplier, multiplying the result obtained in step S1 by the inverse of the theoretical frequency value of RCH to obtain the frequency deviation value bias of RCH; Step S3, using a multiplier, multiplying the frequency deviation value bias of the RCH obtained in step S2 by a constant -2.005; Step S4, using an adder, adding the constant 3.005 to the result obtained in step S3, and saving the result r0 in a register; Step S5, using an adder, adding -m to the coefficient b0 stored in the front register; Step S6, using a multiplier, multiplying r0 by the result obtained in step S5; Step S7, using an adder, adding m to the result obtained in step S6 to obtain a bandpass filter coefficient b, and storing the coefficient b in a register to replace b0.

6. The device for improving fundamental wave measurement accuracy according to claim 2, characterized in that: When the frequency deviation value bias of RCH is calculated according to the clock number baud_cnt, a sliding average method is adopted.

7. The device for improving fundamental wave measurement accuracy according to claim 6, characterized in that: The sliding average method is used to obtain the average frequency deviation bias_avg, and the calculation method is as follows: Among them, N is the length of the sliding window, L is the coordinate of the current starting position of the sliding window, bias i is the i-th frequency deviation value in the sliding window.

8. The device for improving fundamental wave measurement accuracy according to claim 3, characterized in that: The value b0 of the coefficient stored in the current register is calculated as follows: The center frequency f0 of the bandpass filter is equal to the system frequency f s Substitute it into the calculation formula of the bandpass filter coefficient b when there is no frequency deviation to obtain the initial value of b0.

9. The device for improving fundamental wave measurement accuracy according to claim 8, characterized in that: The center frequency f0 of the bandpass filter is s , preset according to the actual environment of fundamental wave measurement.

10. A method for improving fundamental wave measurement accuracy, using the above-mentioned device for improving fundamental wave measurement accuracy, characterized in that: The following steps are involved: Step 1: Use the UART module to adjust the clock required to send a symbol through the baud rate adaptive method. The number baud_cnt is sent to the calculation module; Step 2, the calculation module calculates the bandpass filter coefficient b in the fundamental wave measurement device and saves the coefficient to a register; Step 3: adjust the bandpass filter in the fundamental wave measuring device according to the bandpass filter coefficient b, and perform measurement.

Citation Information

Patent Citations

  • Harmonic and inter-harmonic detection method based on Hanning-window FFT algorithm and traversal filtering

    CN103197143A

  • Input signal frequency measuring method and relevant component

    CN110007144A

  • Calibrator phasor measurement method suitable for field PMU testing

    CN110389312A

  • Method and device for improving fundamental wave metering precision

    CN116953347A

  • Detecting method of fundamental wave component of single-phase ac signal

    JP2008141935A