Improved windowing FFT electric energy measuring and calculating method and device based on quasi-synchronous sampling
Through the improved windowed FFT method based on quasi-synchronous sampling, the problem of amplitude, phase and frequency measurement errors in electric energy measurement is solved, and high-accuracy and fast electric energy measurement is achieved, which is suitable for electric energy measurement with different power factors.
Patent Information
- Application Number
- CN202410740119.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-07
- Publication Date
- 2024-10-11
AI Technical Summary
In the existing technology, due to the non-ideal characteristics of the signal and the limitations of the algorithm, the measurement results of amplitude, phase and frequency in electric energy measurement have errors, low accuracy, long calculation time, and poor adaptability.
Using an improved windowed FFT method based on quasi-synchronous sampling, by calculating the fundamental frequency and each harmonic frequency of voltage and current, windowing the time domain sampling sequence for FFT operation, calculating the spectrum expression, and calculating the frequency based on three spectral lines Correct the coefficient to obtain the amplitude ratio coefficient, and use this coefficient to obtain the amplitude correction formula, reconstruct the frequency components of the voltage and current to obtain the fundamental electric energy, each harmonic electric energy and the total electric energy.
It improves the accuracy and speed of electric energy measurement and has good applicability. It can measure fundamental electric energy, harmonic electric energy and total electric energy with high accuracy under different power factors, and solves the problems of measurement error and long calculation time.
Smart Images

Figure CN118760828A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of electric energy calculation, and in particular to an improved windowed FFT electric energy calculation method and device based on quasi-synchronous sampling. Background Art
[0002] In the related technology, by selecting better main lobe and side lobe performance and correcting the amplitude, phase and frequency during the calculation process, the full-phase data processing method can be combined with the DFT (Discrete Fourier Transform) algorithm, and the full-phase data processing can be performed through the interpolation algorithm. Polynomial fitting can also be used to obtain practical interpolation correction formulas, and the calculation formulas for the signal fundamental wave and each harmonic frequency, amplitude, and initial phase angle are derived, thereby solving the fundamental wave electric energy and each harmonic electric energy.
[0003] However, in the related art, due to the non-ideal characteristics of the signal and noise interference, measurement errors of the amplitude and phase may occur, thereby affecting the measurement accuracy. When the signal frequency components are complex or variable, interpolation may introduce additional errors, reducing the measurement accuracy. In addition, since the fitting accuracy and applicability are affected by the polynomial order and the distribution of data points, the accurate calculation of the amplitude, phase and frequency may be affected. In addition, the calculation complexity is high and the calculation time is long, which urgently needs to be improved. Summary of the invention
[0004] The present application provides an improved windowed FFT (Fast Fourier Transform) electric energy measurement method and device based on quasi-synchronous sampling to solve the problems in the related art that, due to the non-ideal characteristics of the signal itself and the limitations of the algorithm itself, there may be errors in the measurement results of amplitude, phase and frequency, resulting in low measurement accuracy, long calculation time, poor adaptability, etc.
[0005] The first aspect of the present application provides an improved windowed FFT electric energy measurement method based on quasi-synchronous sampling, comprising the following steps: calculating the fundamental frequency and each harmonic frequency of the voltage and current; based on the fundamental frequency and each harmonic frequency of the voltage and current, time-domain windowing the time-domain sampling sequence, and performing FFT operation to obtain the spectrum expression of the voltage and current; based on the spectrum expression, calculating the three spectrum lines with the largest amplitude near the actual fundamental and harmonic frequencies in the voltage and current spectrum; calculating the frequency correction coefficient of the voltage and current according to the three spectrum lines to obtain the amplitude ratio coefficient, and obtaining the amplitude correction coefficient formula from the amplitude ratio coefficient; using the amplitude correction coefficient formula to respectively obtain the amplitude, phase angle and frequency of the voltage and current; reconstructing the frequency components of the voltage and current based on the amplitude, phase angle and frequency of the voltage and current to obtain the fundamental electric energy, each harmonic electric energy and total electric energy.
[0006] Optionally, in one embodiment of the present application, the calculation formula of each harmonic frequency is:
[0007]
[0008] Among them, t1 and t2 are the starting time of the two sampling sequences, f Um 、f Im are the frequencies corresponding to the voltage, current fundamental wave and each harmonic, and are the phase angles of the current at time t1 and time t2, and are the phase angles of the voltage at time t1 and time t2 respectively.
[0009] Optionally, in one embodiment of the present application, the spectrum expression is:
[0010]
[0011] Where m is the harmonic order, f Um 、f Im are the frequencies corresponding to the voltage, current fundamental wave and each harmonic respectively, Δf is the frequency resolution, U m and I m are the amplitudes of the corresponding mth harmonics, and k is the ordinal number of the spectral line in the spectrum.
[0012] Optionally, in one embodiment of the present application, the amplitude correction coefficient formula is:
[0013] h(β)=0.571428571+0.165185638·β 2 -0.00135262344·β 4-0.0000156524316 · β 6
[0014] Among them, β is the amplitude ratio parameter.
[0015] Optionally, in one embodiment of the present application, the amplitude, phase angle and frequency of the voltage and current are respectively:
[0016] A=(2y1+y2+y3)·h(β) / (2·LN),
[0017]
[0018] f0=k0·Δf=k0·f s / (LN),
[0019] Where Δf is the frequency resolution, f s is the sampling frequency, LN is the total number of sampling points, α is the frequency correction coefficient, β is the amplitude ratio parameter, y1, y2, y3 are the three spectral lines with the largest amplitude, h(β) is the amplitude correction parameter, k1 is the serial number corresponding to the spectral line with the largest amplitude y1, and k0 is the serial number corresponding to the spectral line with the actual maximum amplitude y0.
[0020] Optionally, in one embodiment of the present application, the fundamental wave electric energy, each harmonic electric energy and the total electric energy are respectively:
[0021] W F =(u recon-F ×i recon-F ) / (LN)×t,
[0022] W H-m =(u recon-m ×i recon-m ) / (LN)×t,(m∈H),
[0023]
[0024] Among them, W F The fundamental electric energy is W H-m is the harmonic power, W TOTAL is the total electric energy, F, H, and TOTAL are the serial numbers of the fundamental frequency, the harmonic frequency, and all signal components, respectively, t is the total time of the sampling sequence, and u recon-m is the reconstructed voltage, i recon-m is the reconstructed current, LN is the total number of sampling points, and m is the harmonic order.
[0025] The second aspect of the present application provides an improved windowed FFT electric energy measurement device based on quasi-synchronous sampling, including: a first calculation module, used to calculate the fundamental frequency and each harmonic frequency of the voltage and current; a processing module, used to time-domain window the time-domain sampling sequence based on the fundamental frequency and each harmonic frequency of the voltage and current, and perform FFT operation to obtain the spectrum expression of the voltage and current; a second calculation module, used to calculate the three spectral lines with the largest amplitude near the actual fundamental and harmonic frequencies in the voltage and current spectrum based on the spectrum expression; a correction module, used to calculate the frequency correction coefficient of the voltage and current according to the three spectral lines to obtain the amplitude ratio coefficient, and obtain the amplitude correction coefficient formula from the amplitude ratio coefficient; a third calculation module, used to use the amplitude correction coefficient formula to respectively obtain the amplitude, phase angle and frequency of the voltage and current; a fourth calculation module, used to reconstruct the frequency components of the voltage and current based on the amplitude, phase angle and frequency of the voltage and current, and obtain the fundamental electric energy, each harmonic electric energy and total electric energy.
[0026] Optionally, in one embodiment of the present application, the calculation formula of each harmonic frequency is:
[0027]
[0028] Among them, t1 and t2 are the starting time of the two sampling sequences, f Um 、f Im are the frequencies corresponding to the voltage, current fundamental wave and each harmonic, and are the phase angles of the current at time t1 and time t2, and are the phase angles of the voltage at time t1 and time t2 respectively.
[0029] Optionally, in one embodiment of the present application, the spectrum expression is:
[0030]
[0031]
[0032] Where m is the harmonic order, f Um 、f Im are the frequencies corresponding to the voltage, current fundamental wave and each harmonic respectively, Δf is the frequency resolution, U m and I m are the amplitudes of the corresponding mth harmonics, and k is the ordinal number of the spectral line in the spectrum.
[0033] Optionally, in one embodiment of the present application, the amplitude correction coefficient formula is:
[0034] h(β)=0.571428571+0.165185638·β 2 -0.00135262344·β 4 -0.0000156524316 · β 6
[0035] Among them, β is the amplitude ratio parameter.
[0036] Optionally, in one embodiment of the present application, the amplitude, phase angle and frequency of the voltage and current are respectively:
[0037] A=(2y1+y2+y3)·h(β) / (2·LN),
[0038]
[0039] f0=k0·Δf=k0·f s / (LN),
[0040] Where Δf is the frequency resolution, f s is the sampling frequency, LN is the total number of sampling points, β is the frequency correction coefficient, β is the amplitude ratio parameter, y1, y2, y3 are the three spectral lines with the largest amplitude, h(β) is the amplitude correction parameter, k1 is the serial number corresponding to the spectral line with the largest amplitude y1, and k0 is the serial number corresponding to the spectral line with the actual maximum amplitude y0.
[0041] Optionally, in one embodiment of the present application, the fundamental wave electric energy, each harmonic electric energy and the total electric energy are respectively:
[0042] W F =(u recon-F ×i recon-F ) / (LN)×t,
[0043] W H-m =(u recon-m ×i recon-m ) / (LN)×t,(m∈H),
[0044]
[0045] Among them, W F The fundamental electric energy is W H-m is the harmonic power, W TOTAL is the total electric energy, F, H, and TOTAL are the serial numbers of the fundamental frequency, the harmonic frequency, and all signal components, respectively, t is the total time of the sampling sequence, and u recon-m is the reconstructed voltage, i recon-m is the reconstructed current, LN is the total number of sampling points, and m is the harmonic order.
[0046] The third aspect of the present application provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the improved windowed FFT electric energy measurement method based on quasi-synchronous sampling as described in the above embodiment.
[0047] The fourth aspect of the present application provides a computer-readable storage medium, which stores a computer program. When the program is executed by a processor, it implements the above-mentioned improved windowed FFT electric energy measurement method based on quasi-synchronous sampling.
[0048] The fifth aspect of the present application provides a computer program product, including a computer program, which, when executed, implements the above-mentioned improved windowed FFT electric energy measurement method based on quasi-synchronous sampling.
[0049] The embodiment of the present application can calculate the fundamental frequency and each harmonic frequency of the voltage and current, add time domain window to the time domain sampling sequence, and perform FFT operation to obtain the spectrum expression of the voltage and current, and then calculate the frequency correction coefficient of the voltage and current according to the three spectrum lines to obtain the amplitude ratio coefficient, and obtain the amplitude correction coefficient formula from the amplitude ratio coefficient, and can respectively obtain the amplitude, phase angle and frequency of the voltage and current, so as to reconstruct the frequency components of the voltage and current, obtain the fundamental electric energy, each harmonic electric energy and total electric energy, and can perform high-precision measurement of the fundamental electric energy, harmonic electric energy and total electric energy under different power factors, effectively improve the accuracy and speed of measurement, and have good applicability. Thus, it solves the problem that in the related art, due to the non-ideal characteristics of the signal itself and the limitations of the algorithm itself, the measurement results of the amplitude, phase and frequency may have errors, resulting in low measurement accuracy, long calculation time, poor adaptability and other problems.
[0050] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0052] Figure 1 A flowchart of an improved windowed FFT electric energy measurement method based on quasi-synchronous sampling provided according to an embodiment of the present application;
[0053] Figure 2 A schematic diagram of relative error of fundamental wave electric energy measurement according to an embodiment of the present application (PF=1);
[0054] Figure 3A schematic diagram of relative error in harmonic power measurement according to an embodiment of the present application (PF=1);
[0055] Figure 4 A schematic diagram of relative error in total electric energy calculation according to an embodiment of the present application (PF=1);
[0056] Figure 5 A schematic diagram of relative error of fundamental wave electric energy measurement according to an embodiment of the present application (PF=0.5L);
[0057] Figure 6 A schematic diagram of relative error of harmonic power measurement according to an embodiment of the present application (PF=0.5L);
[0058] Figure 7 A schematic diagram of relative error of total electric energy calculation according to an embodiment of the present application (PF=0.5L);
[0059] Figure 8 A schematic diagram of relative error of fundamental wave electric energy measurement according to an embodiment of the present application (PF=0.8C);
[0060] Fig. 9 A schematic diagram of relative error of harmonic power measurement according to an embodiment of the present application (PF = 0.8C);
[0061] Fig.10 A schematic diagram of relative error of total electric energy calculation according to an embodiment of the present application (PF=0.8C);
[0062] Fig.11 A block diagram of an improved windowed FFT electric energy measurement device based on quasi-synchronous sampling provided according to an embodiment of the present application;
[0063] Fig.12 It is a schematic diagram of the structure of an electronic device provided according to an embodiment of the present application. DETAILED DESCRIPTION
[0064] Embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.
[0065] The following describes the improved windowed FFT electric energy measurement method and device based on quasi-synchronous sampling according to an embodiment of the present application with reference to the accompanying drawings.
[0066] Before introducing the improved windowed FFT electric energy measurement method based on quasi-synchronous sampling in the embodiment of the present application, the relevant technology is first introduced in detail below, wherein the electric energy meter is a measuring instrument used in electric energy trade settlement, and can be divided into active electric energy meter, reactive electric energy meter and standard electric energy meter according to its use. The standard electric energy meter is a high-accuracy measuring instrument used to calibrate and verify the accuracy of other electric energy meters. Its accuracy level is higher than that of the commonly used electric energy meter, and it can provide very accurate electric energy measurement values. Common ones include 0.1 level, 0.05 level, 0.02 level, etc., which contain commonly used electric energy measurement algorithms such as dot product sum algorithm, fast Fourier transform algorithm and quasi-synchronous sampling algorithm. Both the dot product sum algorithm and the quasi-synchronous sampling algorithm can only give the total electric energy, while the fast Fourier transform algorithm is limited by aliasing, spectrum leakage and fence effect, and the accuracy of the calculation of fundamental electric energy and harmonic electric energy is low.
[0067] With respect to the above-mentioned related technologies, due to the non-ideal characteristics of the signal itself and the limitations of the algorithm itself, errors may occur in the measurement results of amplitude, phase and frequency, resulting in low measurement accuracy, long calculation time and poor adaptability. The present application provides an improved windowed FFT electric energy measurement method based on quasi-synchronous sampling. In this method, the fundamental frequency and each harmonic frequency of the voltage and current can be calculated, the time domain sampling sequence can be windowed in the time domain, and the frequency spectrum expression of the voltage and current can be obtained by performing FFT operation. Then, the frequency correction coefficients of the voltage and current can be calculated according to the three spectral lines to obtain the amplitude ratio coefficient, and the amplitude correction coefficient formula can be obtained from the amplitude ratio coefficient. The amplitude, phase angle and frequency of the voltage and current can be obtained respectively, so as to reconstruct the frequency components of the voltage and current, obtain the fundamental electric energy, each harmonic electric energy and the total electric energy, and can perform high-accuracy measurement of the fundamental electric energy, harmonic electric energy and total electric energy under different power factors, effectively improve the accuracy and speed of the measurement, and have good applicability. This solves the problem in the related art that due to the non-ideal characteristics of the signal itself and the limitations of the algorithm itself, there may be errors in the measurement results of amplitude, phase and frequency, resulting in low measurement accuracy, long calculation time, poor adaptability, etc.
[0068] Specifically, Figure 1 A flowchart of an improved windowed FFT electric energy measurement method based on quasi-synchronous sampling provided in an embodiment of the present application.
[0069] like Figure 1 As shown, the improved windowed FFT electric energy measurement method based on quasi-synchronous sampling includes the following steps:
[0070] In step S101 , the fundamental frequency and harmonic frequencies of voltage and current are calculated.
[0071] Specifically, the embodiment of the present application assumes that the model of the sinusoidal periodic voltage and current signal is:
[0072]
[0073] Where m is the harmonic order, when m=1 it represents the fundamental wave; f Um 、f Im are the frequencies corresponding to the fundamental wave of voltage, current and each harmonic respectively; U m ,I m They are the amplitudes of voltage, current fundamental wave and each harmonic respectively; φ m They are the initial phase angles of the voltage, current fundamental wave and each harmonic respectively; M is the highest harmonic order.
[0074] Assume that the number of sampling points in each fundamental wave cycle is N, then u(t) and i(t) are sampled at equal intervals in this measurement interval, and the number of sampling points is LN+1. Here, 10 fundamental wave cycles (0.2s) are taken as one measurement interval, that is, L=10. The voltage and current sampling points are respectively recorded as u(n) and i(n), n=1,2,...,LN+1. According to the recursive operation of the numerical integration formula, it can be expressed as follows:
[0075]
[0076] Wherein, the subscript q is the subinterval number for calculating the average value using the recursive formula, q = 1, 2, ..., (L-1) N + 1, and the sampling points corresponding to the qth subinterval of the voltage and current sampling sequence with a length of N are u(q), u(q+1) ..., u(q+N) and i(q), i(q+1) ..., i(q+N) respectively; ρ n (n=q,q+1,...,q+N) is the weight coefficient, which is determined by the numerical integration formula and N; the superscript l is the number of iterations, l=1,2,...,10.
[0077] Furthermore, in the embodiment of the present application, the real and imaginary parts of the fundamental wave and each harmonic after FFT operation of equations (1) and (2) can be recorded as UB m ,UD m and IB m ,ID m , which can be specifically expressed as follows:
[0078] U=UB m +jUD m (7)
[0079] I=IB m +jID m (8)
[0080] in,
[0081]
[0082]
[0083] Among them, UB in equations (9)-(12) m ,IB m ,UD m ,ID m The calculation can be performed according to the recursive calculation formula shown in formula (3)-(6), and the values after L iterations can be recorded as
[0084] Assume that sampling starts at time t0, and the phase angles of the fundamental wave and harmonics of voltage and current at that time are recorded as and The specific details can be shown as follows:
[0085]
[0086] The sampling sequence is extracted from time t1 and time t2 respectively. According to equations (13)-(14), the phase angles of voltage and current at the two moments can be expressed as:
[0087]
[0088] Therefore, according to the corresponding relationship between frequency and phase angle, the embodiment of the present application can use equations (15)-(18) to obtain the frequency f of the mth harmonic in the voltage and current: Um and f Im .
[0089] Optionally, in one embodiment of the present application, the calculation formula for each harmonic frequency is:
[0090]
[0091] Among them, t1 and t2 are the starting time of the two sampling sequences, f Um 、f Im are the frequencies corresponding to the voltage, current fundamental wave and each harmonic, and are the phase angles of the current at time t1 and time t2, and are the phase angles of the voltage at time t1 and time t2 respectively.
[0092] The embodiment of the present application calculates the fundamental frequency and harmonic frequencies of voltage and current, which helps to understand the harmonic distribution in the power system, provides basic data for subsequent analysis and processing, and can effectively improve the accuracy of power metering, which helps to evaluate the power quality of the power grid.
[0093] In step S102, based on the fundamental frequency and each harmonic frequency of the voltage and current, the time domain sampling sequence is windowed in the time domain, and an FFT operation is performed to obtain the frequency spectrum expression of the voltage and current.
[0094] Specifically, the embodiment of the present application can take 4 RV-I type windows as an example, and its time domain expression is:
[0095]
[0096] Where C is the number of terms in the window function; a c The constraints need to be met: And in the 4 RV-Ⅰ windows: a0=1, a1=1.5, a2=0.6, a3=0.1.
[0097] Furthermore, in the embodiment of the present application, a 4-term RV-I window of length LN can be used to window the voltage and current signals in equations (1) and (2) to obtain a truncated signal, which can be specifically shown as follows:
[0098] u w (n)=u(n)w(n) (22)
[0099] i w (n)=i(n)w(n) (23)
[0100] Therefore, ignoring the influence of the sidelobe leakage of the peak spectrum line at -f, the frequency domain expressions as shown in equations (22) and (23) can be obtained.
[0101] Optionally, in one embodiment of the present application, the spectrum expression is:
[0102]
[0103] Where m is the harmonic order, f Um 、f Im are the frequencies corresponding to the voltage, current fundamental wave and each harmonic respectively, Δf is the frequency resolution, U m and I m are the amplitudes of the corresponding mth harmonics, and k is the ordinal number of the spectral line in the spectrum.
[0104] The embodiment of the present application adds time-domain windows to the time-domain sampling sequence based on the fundamental frequency and harmonic frequencies of the voltage and current, and performs FFT operations to obtain the spectrum expressions of the voltage and current, which helps to improve the accuracy of spectrum analysis, reduce spectrum leakage, and effectively improve the accuracy of identifying and quantifying fundamental and harmonic components.
[0105] In step S103, based on the spectrum expression, three spectrum lines with the largest amplitudes near the actual fundamental wave and harmonic wave frequencies in the voltage and current spectrum are calculated.
[0106] In the actual implementation process, the embodiment of the present application can use the peak detection algorithm to find the three spectrum lines with the largest amplitude near the actual fundamental and harmonic frequencies in the voltage and current spectrum, which can be specifically expressed as follows:
[0107]
[0108] Among them, k1 is the highest peak spectrum line, k2 and k3 are the spectrum lines closest to the left and right sides of k1, and the position relationship of the three spectrum lines is: k2 <k1<k3。
[0109] The embodiment of the present application helps to more clearly identify and distinguish different harmonic components by analyzing the three spectral lines with the largest amplitudes, and can more accurately determine the actual frequencies and amplitudes of the fundamental wave and harmonics, thereby reducing measurement errors.
[0110] In step S104, the frequency correction coefficients of the voltage and the current are calculated according to the three spectrum lines to obtain the amplitude ratio coefficient, and the amplitude correction coefficient formula is obtained from the amplitude ratio coefficient.
[0111] Specifically, the embodiment of the present application can calculate the frequency correction coefficient α according to the actual frequency spectrum line and the highest spectrum line, which can be specifically expressed as follows:
[0112] α=k0-k1 (27)
[0113] Furthermore, the embodiment of the present application can calculate the amplitude ratio parameter β according to the three spectral lines, which can be specifically shown as follows:
[0114]
[0115] Among them, Δf is the frequency resolution, that is, the sampling frequency f s The ratio to the total number of sampling points LN.
[0116] In addition, in the embodiment of the present application, the amplitude correction coefficient formula h(β) can be obtained by a polynomial fitting formula.
[0117] Optionally, in one embodiment of the present application, the amplitude correction coefficient formula is:
[0118] h(β)=0.571428571+0.165185638·β 2 -0.00135262344·β 4 -0.0000156524316 · β 6 (29)
[0119] Among them, β is the amplitude ratio parameter.
[0120] The embodiment of the present application can calculate the frequency correction coefficients of voltage and current based on three spectral lines to obtain the amplitude ratio coefficient, and obtain the amplitude correction coefficient formula from the amplitude ratio coefficient, which helps to correct errors in FFT analysis, improve the measurement accuracy of voltage and current amplitudes, and can more accurately analyze power quality, identify and quantify harmonics and other interference.
[0121] In step S105, the amplitude, phase angle and frequency of the voltage and current are respectively obtained using the amplitude correction coefficient formula.
[0122] In the actual implementation process, the embodiment of the present application can use the correction formula combining equations (26)-(29) to obtain the amplitude, phase angle and frequency of voltage and current.
[0123] Optionally, in one embodiment of the present application, the amplitude, phase angle and frequency of the voltage and current are respectively:
[0124] A=(2y1+y2+y3)·h(β) / (2·LN) (30)
[0125]
[0126] f0=k0·Δf=k0·f s / (LN) (32)
[0127] Where Δf is the frequency resolution, f s is the sampling frequency, LN is the total number of sampling points, α is the frequency correction coefficient, β is the amplitude ratio parameter, y1, y2, y3 are the three spectral lines with the largest amplitude, h(β) is the amplitude correction parameter, k1 is the serial number corresponding to the spectral line with the largest amplitude y1, and k0 is the serial number corresponding to the spectral line with the actual maximum amplitude y0.
[0128] The embodiment of the present application can use the amplitude correction coefficient formula to respectively obtain the amplitude, phase angle and frequency of voltage and current, which can correct measurement errors and improve the accuracy of voltage and current amplitudes. The precise information is helpful for power quality monitoring and stable operation of the power system.
[0129] In step S106, the frequency components of the voltage and current are reconstructed based on the amplitude, phase angle and frequency of the voltage and current to obtain the fundamental wave electric energy, each harmonic electric energy and the total electric energy.
[0130] Specifically, the embodiment of the present application can reconstruct each frequency component according to the amplitude, phase angle and frequency of the voltage and current obtained by equations (30)-(32), wherein the reconstructed voltage u recon-m (t), current i recon-m (t) can be expressed as:
[0131]
[0132] Among them, F, H, and TOTAL correspond to the serial number of the fundamental frequency, the serial number of the harmonic frequency, and the serial number of all signal components, respectively. Um 、f Im are the reconstructed voltage and current frequency values, A Um , A Im are the amplitudes of the reconstructed voltage and current frequency components, θ Um ,θ Im are the phase angles of the reconstructed voltage and current frequency components, and then the fundamental wave electric energy W can be obtained F 、Each harmonic power W H-m And the total electrical energy W TOTAL .
[0133] Optionally, in one embodiment of the present application, the fundamental wave electric energy, each harmonic electric energy and the total electric energy are respectively:
[0134] W F =(u recon-F ×i recon-f ) / (LN)×t (35)
[0135] W H-m =(u recon-m ×i recon-m ) / (LN)×t,(m∈H) (36)
[0136]
[0137] Among them, W F The fundamental electric energy is W H-m is the harmonic power, W TOTAL is the total electric energy, F, H, and TOTAL are the serial numbers of the fundamental frequency, the harmonic frequency, and all signal components, respectively, t is the total time of the sampling sequence, and u recon-m is the reconstructed voltage, i recon-m is the reconstructed current, LN is the total number of sampling points, and m is the harmonic order.
[0138] The embodiments of the present application can provide comprehensive power quality analysis by reconstructing the frequency components of voltage and current and calculating power parameters, which helps to evaluate the operating status of the power system, optimize power usage, reduce power loss, and ensure the economical and safe operation of the power system.
[0139] According to the improved windowed FFT electric energy calculation method based on quasi-synchronous sampling proposed in the embodiment of the present application, the fundamental frequency and each harmonic frequency of the voltage and current can be calculated, and the time domain sampling sequence can be windowed in the time domain, and the frequency spectrum expression of the voltage and current can be obtained by performing FFT operation, and then the frequency correction coefficient of the voltage and current can be calculated according to three spectral lines to obtain the amplitude ratio coefficient, and the amplitude correction coefficient formula can be obtained by the amplitude ratio coefficient, and the amplitude, phase angle and frequency of the voltage and current can be obtained respectively, so as to reconstruct each frequency component of the voltage and current, obtain the fundamental electric energy, each harmonic electric energy and the total electric energy, and can be measured with high accuracy under different power factors for the fundamental electric energy, harmonic electric energy and the total electric energy, effectively improve the accuracy and speed of the measurement, and have good applicability. Thus, it is solved that in the related art, due to the non-ideal characteristics of the signal itself and the limitations of the algorithm itself, the measurement results of the amplitude, phase and frequency may cause errors, resulting in low measurement accuracy, long calculation time, poor adaptability and other problems.
[0140] Next, an improved windowed FFT electric energy measurement device based on quasi-synchronous sampling proposed in an embodiment of the present application is described with reference to the accompanying drawings.
[0141] Fig.11 It is a block diagram of an improved windowed FFT electric energy measurement device based on quasi-synchronous sampling according to an embodiment of the present application.
[0142] like Fig.11 As shown, the improved windowed FFT electric energy measuring device 10 based on quasi-synchronous sampling includes: a first calculating module 100 , a processing module 200 , a second calculating module 300 , a correcting module 400 , a third calculating module 500 and a fourth calculating module 600 .
[0143] Specifically, the first calculation module 100 is used to calculate the fundamental frequency and each harmonic frequency of the voltage and current;
[0144] The processing module 200 is used to add a time-domain window to the time-domain sampling sequence based on the fundamental frequency and each harmonic frequency of the voltage and current, and perform FFT operation to obtain the frequency spectrum expression of the voltage and current;
[0145] The second calculation module 300 is used to calculate the three spectrum lines with the largest amplitudes near the actual fundamental wave and harmonic wave frequencies in the voltage and current spectrum based on the spectrum expression;
[0146] The correction module 400 is used to calculate the frequency correction coefficients of the voltage and the current according to the three spectrum lines to obtain the amplitude ratio coefficient, and obtain the amplitude correction coefficient formula from the amplitude ratio coefficient;
[0147] The third calculation module 500 is used to obtain the amplitude, phase angle and frequency of the voltage and current respectively by using the amplitude correction coefficient formula;
[0148] The fourth calculation module 600 is used to reconstruct the frequency components of the voltage and current based on the amplitude, phase angle and frequency of the voltage and current, and obtain the fundamental wave electric energy, each harmonic electric energy and the total electric energy.
[0149] Optionally, in one embodiment of the present application, the calculation formula for each harmonic frequency is:
[0150]
[0151]
[0152] Among them, t1 and t2 are the starting time of the two sampling sequences, f Um 、f Im are the frequencies corresponding to the voltage, current fundamental wave and each harmonic, and are the phase angles of the current at time t1 and time t2, and are the phase angles of the voltage at time t1 and time t2 respectively.
[0153] Optionally, in one embodiment of the present application, the spectrum expression is:
[0154]
[0155] Where m is the harmonic order, f Um 、f Im are the frequencies corresponding to the voltage, current fundamental wave and each harmonic respectively, Δf is the frequency resolution, U m and I m are the amplitudes of the corresponding mth harmonics, and k is the ordinal number of the spectral line in the spectrum.
[0156] Optionally, in one embodiment of the present application, the amplitude correction coefficient formula is:
[0157] h(β)=0.571428571+0.165185638·β 2 -0.00135262344·β 4 -0.0000156524316 · β 6
[0158] Among them, β is the amplitude ratio parameter.
[0159] Optionally, in one embodiment of the present application, the amplitude, phase angle and frequency of the voltage and current are respectively:
[0160] A=(2y1+y2+y3)·h(β) / (2·LN),
[0161]
[0162] f0=k0·Δf=k0·f s / (LN),
[0163] Where Δf is the frequency resolution, f s is the sampling frequency, LN is the total number of sampling points, α is the frequency correction coefficient, β is the amplitude ratio parameter, y1, y2, y3 are the three spectral lines with the largest amplitude, h(β) is the amplitude correction parameter, k1 is the serial number corresponding to the spectral line with the largest amplitude y1, and k0 is the serial number corresponding to the spectral line with the actual maximum amplitude y0.
[0164] Optionally, in one embodiment of the present application, the fundamental wave electric energy, each harmonic electric energy and the total electric energy are respectively:
[0165] W F =(u recon-F ×i recon-F ) / (LN)×t,
[0166] W H-m =(u recon-m ×i recon-m ) / (LN)×t,(m∈H),
[0167]
[0168] Among them, W F The fundamental electric energy is W H-m is the harmonic power, W TOTAL is the total electric energy, F, H, and TOTAL are the serial numbers of the fundamental frequency, the harmonic frequency, and all signal components, respectively, t is the total time of the sampling sequence, and u recon-m is the reconstructed voltage, i recon-m is the reconstructed current, LN is the total number of sampling points, and m is the harmonic order.
[0169] It should be noted that the above explanation of the embodiment of the improved windowed FFT power measurement method based on quasi-synchronous sampling is also applicable to the improved windowed FFT power measurement device based on quasi-synchronous sampling in this embodiment, and will not be repeated here.
[0170] According to the improved windowed FFT electric energy calculation device based on quasi-synchronous sampling proposed in the embodiment of the present application, the fundamental frequency and each harmonic frequency of the voltage and current can be calculated, the time domain sampling sequence can be windowed in the time domain, and the frequency spectrum expression of the voltage and current can be obtained by performing FFT operation, and then the frequency correction coefficient of the voltage and current can be calculated according to three spectral lines to obtain the amplitude ratio coefficient, and the amplitude correction coefficient formula can be obtained by the amplitude ratio coefficient, and the amplitude, phase angle and frequency of the voltage and current can be obtained respectively, so as to reconstruct each frequency component of the voltage and current, obtain the fundamental electric energy, each harmonic electric energy and the total electric energy, and can be measured with high accuracy for the fundamental electric energy, harmonic electric energy and the total electric energy under different power factors, effectively improve the accuracy and speed of the measurement, and have good applicability. Thus, it is solved that in the related art, due to the non-ideal characteristics of the signal itself and the limitations of the algorithm itself, the measurement results of the amplitude, phase and frequency may cause errors, resulting in low measurement accuracy, long calculation time, poor adaptability and other problems.
[0171] Fig.12 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device may include:
[0172] A memory 1201 , a processor 1202 , and a computer program stored in the memory 1201 and executable on the processor 1202 .
[0173] When the processor 1202 executes the program, the improved windowed FFT electric energy measurement method based on quasi-synchronous sampling provided in the above embodiment is implemented.
[0174] Furthermore, the electronic device further comprises:
[0175] The communication interface 1203 is used for communication between the memory 1201 and the processor 1202 .
[0176] The memory 1201 is used to store computer programs that can be executed on the processor 1202 .
[0177] The memory 1201 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0178] If the memory 1201, the processor 1202 and the communication interface 1203 are implemented independently, the communication interface 1203, the memory 1201 and the processor 1202 can be connected to each other through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.12 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0179] Optionally, in a specific implementation, if the memory 1201, the processor 1202 and the communication interface 1203 are integrated on a chip, the memory 1201, the processor 1202 and the communication interface 1203 can communicate with each other through an internal interface.
[0180] The processor 1202 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.
[0181] An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-mentioned improved windowed FFT electric energy measurement method based on quasi-synchronous sampling.
[0182] An embodiment of the present application also provides a computer program product, including a computer program, which, when executed, implements the above-mentioned improved windowed FFT electric energy measurement method based on quasi-synchronous sampling.
[0183] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0184] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0185] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or N executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.
[0186] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or N wirings (electronic devices), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways as necessary and then storing it in a computer memory.
[0187] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above embodiment, the N steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. If implemented by hardware, as in another embodiment, it can be implemented by any one or a combination of multiple of the following technologies known in the art: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0188] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0189] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0190] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present application. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present application.
Claims
1. An improved windowed FFT electric energy measurement method based on quasi-synchronous sampling, characterized in that: The following steps are involved: Calculate the fundamental frequency and harmonic frequencies of voltage and current; Based on the fundamental frequency and each harmonic frequency of the voltage and current, time-domain windowing is performed on the time-domain sampling sequence, and an FFT operation is performed to obtain the frequency spectrum expression of the voltage and current; Based on the spectrum expression, three spectrum lines with the largest amplitudes near the actual fundamental wave and harmonic wave frequencies in the voltage and current spectrum are calculated; Calculating the frequency correction coefficients of the voltage and current according to the three spectrum lines to obtain an amplitude ratio coefficient, and obtaining an amplitude correction coefficient formula from the amplitude ratio coefficient; The amplitude, phase angle and frequency of the voltage and current are respectively obtained by using the amplitude correction coefficient formula; The frequency components of the voltage and current are reconstructed based on the amplitude, phase angle and frequency of the voltage and current to obtain fundamental wave electric energy, each harmonic electric energy and total electric energy.
2. The method according to claim 1, characterized in that The calculation formula of each harmonic frequency is: Among them, t1 and t2 are the starting time of the two sampling sequences, f Um 、f Im are the frequencies corresponding to the voltage, current fundamental wave and each harmonic, and are the phase angles of the current at time t1 and time t2, and are the phase angles of the voltage at time t1 and time t2 respectively.
3. The method according to claim 2, characterized in that The spectrum expression is: Where m is the harmonic order, f Um 、f Im are the frequencies corresponding to the voltage, current fundamental wave and each harmonic respectively, Δf is the frequency resolution, U m and I m are the amplitudes of the corresponding mth harmonics, k is the ordinal number of the spectral line in the spectrum, φ m They are the initial phase angles of the voltage, current fundamental wave and each harmonic respectively.
4. The method according to claim 3, characterized in that The amplitude correction coefficient formula is: h(β)=0.571428571+0.165185638·β 2 -0.0013526344·β 4 -0.0000156524316·β 6 Among them, β is the amplitude ratio parameter.
5. The method according to claim 4, characterized in that The amplitude, phase angle and frequency of the voltage and current are respectively: A=(2y1+y2+y3)·h(β) / (2·LN), f0=k0·Δ=k0·f s / (LN), Wherein, Δf is the frequency resolution, fs is the sampling frequency, LN is the total number of sampling points, α is the frequency correction coefficient, β is the amplitude ratio parameter, y1, y2, y3 are the three spectral lines with the largest amplitudes, h(β) is the amplitude correction parameter, k1 is the serial number corresponding to the spectral line with the largest amplitude y1, and k0 is the serial number corresponding to the spectral line with the actual maximum amplitude y0.
6. The method according to claim 5, characterized in that The fundamental wave electric energy, each harmonic electric energy and total electric energy are respectively: W F =(u recon-F ×i recon-F ) / (LN)×t, W H-m =(u recon-m ×i recon-m ) / (LN)×t,(m∈H), Among them, W F The fundamental electric energy is W H-m is the harmonic power, W TOTAL is the total electric energy, F, H, and TOTAL are the serial numbers of the fundamental frequency, the harmonic frequency, and all signal components, respectively, t is the total time of the sampling sequence, and u recon-m is the reconstructed voltage, i recon-m is the reconstructed current, LN is the total number of sampling points, and m is the harmonic order.
7. An improved windowed FFT electric energy measurement device based on quasi-synchronous sampling, characterized in that: include: The first calculation module is used to calculate the fundamental frequency and harmonic frequencies of voltage and current; A processing module, used for adding a time-domain window to the time-domain sampling sequence based on the fundamental frequency and each harmonic frequency of the voltage and current, and performing FFT operation to obtain the frequency spectrum expression of the voltage and current; A second calculation module is used to calculate three spectrum lines with the largest amplitudes near the actual fundamental wave and harmonic wave frequencies in the voltage and current spectrum based on the spectrum expression; A correction module, used for calculating the frequency correction coefficients of the voltage and current according to the three spectrum lines to obtain an amplitude ratio coefficient, and obtaining an amplitude correction coefficient formula from the amplitude ratio coefficient; A third calculation module is used to use the amplitude correction coefficient formula to respectively obtain the amplitude, phase angle and frequency of the voltage and current; The fourth calculation module is used to reconstruct the frequency components of the voltage and current based on the amplitude, phase angle and frequency of the voltage and current, and obtain the fundamental wave electric energy, each harmonic electric energy and the total electric energy.
8. The device according to claim 7, characterized in that The calculation formula of each harmonic frequency is: Among them, t1 and t2 are the starting time of the two sampling sequences, f U m、f I m are the frequencies corresponding to the fundamental wave of voltage, current and each harmonic respectively, and are the phase angles of the current at time t1 and time t2, and are the phase angles of the voltage at time t1 and time t2 respectively.
9. The device according to claim 8, characterized in that The spectrum expression is: Where m is the harmonic order, f U m、f I m is the frequency corresponding to the voltage, current fundamental wave and each harmonic, Δf is the frequency resolution, U is the frequency resolution, m and I m are the amplitudes of the corresponding mth harmonics, k is the ordinal number of the spectral line in the spectrum, φm is the initial phase angle of the voltage, current fundamental wave and each harmonic.
10. The device according to claim 9, characterized in that The amplitude correction coefficient formula is: h(β)=0.571428571+0.165185638·β 2 -0.00135262344·β 4 -0.0000156524316·β 6 Among them, β is the amplitude ratio parameter.
11. The device according to claim 10, characterized in that The amplitude, phase angle and frequency of the voltage and current are respectively: A=(2y1+y2+y3)·h(β) / (2·LN), f0=k0·Δf=k0·f s / (LN), Where Δf is the frequency resolution, f s is the sampling frequency, LN is the total number of sampling points, α is the frequency correction coefficient, β is the amplitude ratio parameter, y1, y2, y3 are the three spectral lines with the largest amplitude, h(β) is the amplitude correction parameter, k1 is the serial number corresponding to the spectral line with the largest amplitude y1, and k0 is the serial number corresponding to the spectral line with the actual maximum amplitude y0.
12. The device according to claim 11, characterized in that The fundamental wave electric energy, each harmonic electric energy and total electric energy are respectively: W F =(u recon-F ×i recon-F ) / (LN)×t, W H-m =(u recon-m ×i recon-m ) / (LN)×t,(m∈H), Among them, W F The fundamental electric energy is W H-m is the harmonic power, W TOTAL is the total electric energy, F, H, and TOTAL are the serial numbers of the fundamental frequency, the harmonic frequency, and all signal components, respectively, t is the total time of the sampling sequence, and u recon-m is the reconstructed voltage, i recon-m is the reconstructed current, LN is the total number of sampling points, and m is the harmonic order.
13. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the improved windowed FFT electric energy measurement method based on quasi-synchronous sampling as described in any one of claims 1 to 6.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that: The program is executed by a processor to implement the improved windowed FFT electric energy measurement method based on quasi-synchronous sampling as described in any one of claims 1 to 6.
15. A computer program product comprising a computer program, characterized in that When the computer program is executed, it is used to implement the improved windowed FFT electric energy measurement method based on quasi-synchronous sampling as described in any one of claims 1 to 6.
Citation Information
Cited By
Wide-frequency-range harmonic analysis method for electric energy meter and acquisition terminal
CN119780522A
A wide-frequency-range harmonic analysis method for electricity meters and data acquisition terminals
CN119780522B
Electric energy metering data analysis method and system based on digital signal processing
CN120993103A
Electric energy correction method and device under harmonic working condition and electronic equipment
CN121142427A
