Harmonic power determination method and device, electricity meter and readable storage medium
By sampling and resampling the electrical signal, combined with fast Fourier transform, the harmonic power is directly calculated, which solves the problems of low calculation accuracy and low efficiency in the prior art, and achieves more efficient and accurate harmonic power calculation.
Patent Information
- Application Number
- CN202510095889.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-21
- Publication Date
- 2025-05-13
AI Technical Summary
In the calculation of harmonic power, the accuracy is lost due to the fitting error introduced by the MCU when performing trigonometric function operations. There are many calculation steps and are time-consuming, which reduces the calculation efficiency and accuracy.
By sampling electrical signals and resampling, each harmonic data is obtained using Fast Fourier Transform (FFT), and the harmonic power is directly calculated, reducing the calculation steps and eliminating the fitting error caused by trigonometric function operation interpolation.
It improves the accuracy and efficiency of harmonic power calculation, reduces calculation time, and avoids errors caused by trigonometric function operation interpolation.
Smart Images

Figure CN119986124A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electric energy metering, and in particular to a method and device for determining harmonic power, an electric meter and a readable storage medium. Background Art
[0002] At present, when calculating harmonic parameters, the FFT (Fast Fourier Transform) algorithm is usually used. After the electrical signal passes through FFT, the real and imaginary values of each harmonic are obtained, and then the parameters such as the harmonic content, effective value, phase, power and total distortion are calculated.
[0003] Among them, when calculating the power of each harmonic, the following formula is usually used:
[0004]
[0005] Where n is the harmonic order, P n is the active power of the nth harmonic, Q n is the reactive power of the nth harmonic, U nRMS is the effective value of the voltage of the nth harmonic, I nRMS is the effective value of the current of the nth harmonic, is the angle between the voltage and current of the nth harmonic.
[0006] However, although the effective value and phase angle of each harmonic of each phase have been calculated when performing harmonic analysis in the electric meter, which provides a prerequisite for calculating harmonic power using the above formula, in the actual MCU (Micro Control Unit), whether the result after FFT operation is used to calculate the phase angle by inverse tangent, or the above formula is used to calculate the sine and cosine values, because the MCU performs trigonometric function operations through normalization, table lookup and linear interpolation, it will directly introduce the fitting error caused by two interpolations, resulting in the problem of precision loss, reducing the accuracy of harmonic power calculation. In addition, in the process of calculating harmonic power in the above manner, when viewing the library function source code for sine and cosine value calculation, calling it once requires at least one judgment, four floating point multiplications, five floating point additions and subtractions, and two table lookup operations. There are many calculation steps, and the harmonic power calculation takes a long time, which reduces the efficiency of harmonic power calculation. Summary of the invention
[0007] The present invention aims to solve at least one of the technical problems existing in the prior art or related art.
[0008] To this end, a first aspect of the present invention is to propose a method for determining harmonic power.
[0009] A second aspect of the present invention is to provide a device for determining harmonic power.
[0010] A third aspect of the present invention is to provide an electricity meter.
[0011] A fourth aspect of the present invention is to provide a readable storage medium.
[0012] In view of this, according to one aspect of the present invention, a method for determining harmonic power is proposed, the method comprising: sampling an electrical signal according to a first sampling parameter to obtain a first sampling sequence; determining a second sampling parameter according to the first sampling parameter and the first sampling sequence; resampling the first sampling sequence according to the second sampling parameter to obtain a second sampling sequence; performing a fast Fourier transform on the second sampling sequence to obtain nth harmonic data of the electrical signal, where n is a positive integer; and determining the harmonic power of the nth harmonic according to the nth harmonic data.
[0013] The execution subject of the technical solution of the method for determining harmonic power provided by the present invention may be an electric meter, or a device for determining harmonic power, or may be determined according to actual use requirements, which is not specifically limited here. In order to more clearly describe the method for determining harmonic power provided by the present invention, the execution subject of the method for determining harmonic power is a device for determining harmonic power for explanation below.
[0014] Specifically, in the method for determining harmonic power provided by the present invention, in the process of calculating the power of each harmonic of an electrical signal, the device for determining harmonic power samples the electrical signal for the first time according to the set first sampling parameter to obtain a first sampling sequence. Further, the device for determining harmonic power calculates the second sampling parameter according to the above-mentioned first sampling sequence and the first sampling parameter, and then resamples the first sampling sequence obtained by the first sampling according to the calculated second sampling parameter to obtain a second sampling sequence. Further, the device for determining harmonic power performs a fast Fourier transform on the second sampling sequence obtained after resampling to obtain the nth harmonic data of the electrical signal, where n is a positive integer, that is, to obtain the harmonic data of each order of the electrical signal. Further, the device for determining harmonic power calculates the harmonic power of the nth harmonic of the electrical signal according to the nth harmonic data obtained after the fast Fourier transform. In this way, after sampling and resampling the electrical signal, the harmonic power is directly calculated based on the result after fast Fourier transform, which reduces the calculation steps, reduces the time consumption of harmonic power calculation, improves the calculation efficiency of harmonic power, eliminates the fitting error caused by trigonometric function interpolation in traditional calculation methods, and improves the accuracy of harmonic power calculation.
[0015] The method for determining harmonic power according to the present invention may also have the following additional technical features:
[0016] In some technical schemes, optionally, the first sampling parameter includes a first sampling frequency, the electrical signal includes a voltage signal, the first sampling sequence includes a first voltage sampling sequence, the second sampling parameter includes a second sampling interval and a second sampling frequency, and the second sampling parameter is determined according to the first sampling parameter and the first sampling sequence, including: calculating the first sampling point number of each cycle in the first voltage sampling sequence; determining the voltage fundamental frequency according to the first sampling frequency and the first sampling point number; determining the second sampling interval according to the first sampling point number and a preset sampling point number; determining the second sampling frequency according to the voltage fundamental frequency and the preset sampling point number.
[0017] In this technical solution, the first sampling parameter may specifically include a first sampling frequency, and the second sampling parameter may specifically include a second sampling frequency and a second sampling interval. Further, the electrical signal may specifically include a voltage signal, and accordingly, the first sampling sequence may specifically include a first voltage sampling sequence.
[0018] On this basis, in the process of calculating the second sampling parameter according to the above-mentioned first sampling sequence and the first sampling parameter, the harmonic power determination device calculates the first sampling point number of each cycle of the voltage signal based on the first voltage sampling sequence obtained by the first sampling. Further, the harmonic power determination device calculates the voltage fundamental frequency according to the calculated first sampling point number and the above-mentioned first sampling frequency. Further, the harmonic power determination device calculates the resampling step value, i.e., the second sampling interval, according to the preset sampling point number and the calculated first sampling point number, and calculates the resampling second sampling frequency according to the preset sampling point number and the calculated voltage fundamental frequency. In this way, the number of sampling points of each cycle after resampling can be set to the preset sampling point number, which can improve the accuracy of subsequent harmonic power calculation.
[0019] In some technical solutions, optionally, the voltage fundamental frequency is a ratio of the first sampling frequency to the first sampling point number.
[0020] In this technical solution, the voltage fundamental frequency may specifically be a ratio of the first sampling frequency to the calculated first sampling point number.
[0021] In some technical solutions, optionally, the second sampling interval is a ratio of the first sampling point number to the preset sampling point number.
[0022] In this technical solution, the second sampling interval can be specifically the ratio of the calculated first sampling point number to the preset sampling point number. In this way, the number of sampling points of each cycle after resampling can be set to the preset sampling point number, which can improve the accuracy of subsequent harmonic power calculation.
[0023] In some technical solutions, optionally, the second sampling frequency is the product of the voltage fundamental frequency and a preset number of sampling points.
[0024] In this technical solution, the second sampling frequency can be specifically the product of the preset number of sampling points and the calculated voltage fundamental frequency. In this way, the number of sampling points of each cycle after resampling can be set to the preset number of sampling points, which can improve the accuracy of subsequent harmonic power calculation.
[0025] In some technical solutions, optionally, the number of sampling points is preset to an integer power of 2.
[0026] In this technical solution, the above-mentioned preset number of sampling points is specifically an integer power of 2.
[0027] In some technical schemes, optionally, the electrical signal includes a voltage signal and a current signal, and the harmonic power of the nth harmonic is determined according to the nth harmonic data, including: determining the active power of the nth harmonic according to the product of the real data of the nth harmonic of the voltage signal and the real data of the nth harmonic of the current signal, and the product of the imaginary data of the nth harmonic of the voltage signal and the imaginary data of the nth harmonic of the current signal; determining the reactive power of the nth harmonic according to the product of the imaginary data of the nth harmonic of the voltage signal and the real data of the nth harmonic of the current signal, and the product of the real data of the nth harmonic of the voltage signal and the imaginary data of the nth harmonic of the current signal.
[0028] In this technical solution, the above-mentioned electrical signal may specifically include a current signal and a voltage signal, the above-mentioned nth harmonic data may specifically include the imaginary part data and the real part data of the nth harmonic of the voltage signal, the imaginary part data and the real part data of the nth harmonic of the current signal, and the above-mentioned harmonic power may specifically include reactive power and active power.
[0029] On this basis, in the process of calculating the harmonic power of the nth harmonic of the electric signal according to the nth harmonic data obtained after the fast Fourier transform, the harmonic power determination device calculates the active power of the nth harmonic of the electric signal according to the product of the real data of the nth harmonic of the current signal and the real data of the nth harmonic of the voltage signal, and the product of the imaginary data of the nth harmonic of the current signal and the imaginary data of the nth harmonic of the voltage signal. Further, the harmonic power determination device calculates the reactive power of the nth harmonic of the electric signal according to the product of the real data of the nth harmonic of the current signal and the imaginary data of the nth harmonic of the voltage signal, and the product of the imaginary data of the nth harmonic of the current signal and the real data of the nth harmonic of the voltage signal. In this way, the harmonic power of the electrical signal is directly calculated based on the operation result of the fast Fourier transform, which reduces the operation steps, reduces the time consumption of harmonic power calculation, improves the calculation efficiency of harmonic power, eliminates the fitting error caused by trigonometric function interpolation in the traditional calculation method, and improves the accuracy of harmonic power calculation.
[0030] In some technical solutions, optionally, the active power and reactive power are calculated according to the following formula: n =U nre I nre +U nim I nim ;Q n =U nim I nre -U nre I nim ; Among them, P n is the active power of the nth harmonic, Q n is the reactive power of the nth harmonic, U nre is the real part data of the nth harmonic of the voltage signal, I nre is the real part data of the nth harmonic of the current signal, U nim is the imaginary part data of the nth harmonic of the voltage signal, I nim It is the imaginary part data of the nth harmonic of the current signal.
[0031] In this technical solution, the active power of the nth harmonic of the electrical signal can be calculated according to the following formula: n =U nre I nre +U nim I nim Where n represents the harmonic order, P n Indicates the active power of the nth harmonic of the electrical signal, U nre Represents the real part data of the nth harmonic of the voltage signal, U nim Represents the imaginary data of the nth harmonic of the voltage signal, I nreRepresents the real part data of the nth harmonic of the current signal, I nim Indicates the imaginary part data of the nth harmonic of the current signal.
[0032] Furthermore, the reactive power of the nth harmonic of the electrical signal can be calculated according to the following formula: Q n =U nim I nre -U nre I nim Among them, Q n Indicates the active power of the nth harmonic of the electrical signal.
[0033] In this way, based on the above formula, the harmonic power of the electrical signal is calculated directly according to the imaginary and real data of each harmonic of the current signal and the voltage signal obtained after the fast Fourier transform, which reduces the calculation steps, reduces the time consumption of harmonic power calculation, and improves the calculation efficiency of harmonic power. It does not involve trigonometric function operations in traditional calculation methods, eliminates the fitting error caused by trigonometric function operation interpolation, and improves the accuracy of harmonic power calculation.
[0034] According to a second aspect of the present invention, a device for determining harmonic power is proposed, which includes: a sampling unit, used to sample an electrical signal according to a first sampling parameter to obtain a first sampling sequence; a processing unit, used to determine a second sampling parameter according to the first sampling parameter and the first sampling sequence; the sampling unit is also used to resample the first sampling sequence according to the second sampling parameter to obtain a second sampling sequence; the processing unit is also used to perform a fast Fourier transform on the second sampling sequence to obtain nth harmonic data of the electrical signal, where n is a positive integer; the processing unit is also used to determine the harmonic power of the nth harmonic based on the nth harmonic data.
[0035] The harmonic power determination device provided by the present invention includes a sampling unit and a processing unit. In the process of calculating the harmonic power of each order of an electrical signal, the sampling unit performs a first sampling on the electrical signal according to a set first sampling parameter to obtain a first sampling sequence. Further, the processing unit calculates a second sampling parameter according to the above-mentioned first sampling sequence and the first sampling parameter, and the sampling unit then resamples the first sampling sequence obtained by the first sampling according to the calculated second sampling parameter to obtain a second sampling sequence. Further, the processing unit performs a fast Fourier transform on the second sampling sequence obtained after resampling to obtain the nth harmonic data of the electrical signal, where n is a positive integer, that is, to obtain the harmonic data of each order of the electrical signal. Further, the processing unit calculates the harmonic power of the nth harmonic of the electrical signal based on the nth harmonic data obtained after the fast Fourier transform. In this way, after sampling and resampling the electrical signal, the harmonic power is directly calculated based on the result after fast Fourier transform, which reduces the calculation steps, reduces the time consumption of harmonic power calculation, improves the calculation efficiency of harmonic power, eliminates the fitting error caused by trigonometric function interpolation in traditional calculation methods, and improves the accuracy of harmonic power calculation.
[0036] According to a third aspect of the present invention, an electric meter is proposed, comprising: an electric signal detection device for detecting electric signals; a control device connected to the electric signal detection device, the control device comprising a floating-point operator, and the control device is used to implement the steps of a method for determining harmonic power as in any of the above technical solutions.
[0037] The electric meter proposed in the third aspect of the present invention includes a control device, which is used to implement the steps of the method for determining harmonic power in any of the above technical solutions. Therefore, the electric meter proposed in the third aspect of the present invention has all the beneficial effects of the method for determining harmonic power in the technical solution of the first aspect, which will not be repeated here.
[0038] The control device includes a FPU (Floating Point Unit) to ensure the calculation accuracy of the first number of sampling points in the process of calculating the harmonic power.
[0039] According to a fourth aspect of the present invention, a readable storage medium is provided, on which a program or instruction is stored, and when the program or instruction is executed by a processor, a method for determining harmonic power in any of the above technical solutions is implemented. Therefore, the readable storage medium provided in the fourth aspect of the present invention has all the beneficial effects of the method for determining harmonic power in any of the technical solutions in the first aspect, which will not be repeated here.
[0040] Additional aspects and advantages of the present invention will become apparent from the following description or may be learned by practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0042] Figure 1 A schematic diagram of a flow chart of a method for determining harmonic power according to an embodiment of the present invention is shown;
[0043] Figure 2 A second flow chart of a method for determining harmonic power according to an embodiment of the present invention is shown;
[0044] Figure 3 A schematic diagram showing a method for determining harmonic power according to an embodiment of the present invention is shown;
[0045] Figure 4 An example diagram showing the effect of the first sampling sequence according to an embodiment of the present invention is shown;
[0046] Figure 5 An example diagram showing the effect of the second sampling sequence according to an embodiment of the present invention is shown;
[0047] Figure 6 A structural block diagram of a device for determining harmonic power according to an embodiment of the present invention is shown;
[0048] Figure 7 The structure block diagram of the electric meter according to the embodiment of the present invention is shown. DETAILED DESCRIPTION
[0049] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present invention and the features in the embodiments can be combined with each other without conflict.
[0050] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited to the specific embodiments disclosed below.
[0051] Combine the following Figures 1 to 7 , the method and device for determining harmonic power, the electric meter and the readable storage medium provided in the embodiments of the present application are described in detail through specific embodiments and their application scenarios.
[0052] In one embodiment of the present invention, Figure 1 As shown, the method for determining harmonic power may specifically include the following steps 102 to 110:
[0053] Step 102, sampling the electrical signal according to a first sampling parameter to obtain a first sampling sequence;
[0054] Step 104, determining a second sampling parameter according to the first sampling parameter and the first sampling sequence;
[0055] Step 106, resampling the first sampling sequence according to the second sampling parameter to obtain a second sampling sequence;
[0056] Step 108, performing fast Fourier transform on the second sampling sequence to obtain nth harmonic data of the electrical signal;
[0057] Step 110, determining the harmonic power of the nth harmonic according to the nth harmonic data;
[0058] Wherein, n is a positive integer.
[0059] The execution subject of the technical solution of the method for determining harmonic power provided by the present invention may be an electric meter, or a device for determining harmonic power, or may be determined according to actual use requirements, which is not specifically limited here. In order to more clearly describe the method for determining harmonic power provided by the present invention, the execution subject of the method for determining harmonic power is a device for determining harmonic power for explanation below.
[0060] Specifically, in the method for determining harmonic power provided by the present invention, in the process of calculating the power of each harmonic of an electrical signal, the device for determining harmonic power samples the electrical signal for the first time according to the set first sampling parameter to obtain a first sampling sequence. Further, the device for determining harmonic power calculates the second sampling parameter according to the above-mentioned first sampling sequence and the first sampling parameter, and then resamples the first sampling sequence obtained by the first sampling according to the calculated second sampling parameter to obtain a second sampling sequence. Further, the device for determining harmonic power performs a fast Fourier transform on the second sampling sequence obtained after resampling to obtain the nth harmonic data of the electrical signal, where n is a positive integer, that is, to obtain the harmonic data of each order of the electrical signal. Further, the device for determining harmonic power calculates the harmonic power of the nth harmonic of the electrical signal according to the nth harmonic data obtained after the fast Fourier transform. In this way, after sampling and resampling the electrical signal, the harmonic power is directly calculated based on the result after fast Fourier transform, which reduces the calculation steps, reduces the time consumption of harmonic power calculation, improves the calculation efficiency of harmonic power, eliminates the fitting error caused by trigonometric function interpolation in traditional calculation methods, and improves the accuracy of harmonic power calculation.
[0061] The electrical signal includes a current signal and a voltage signal, the first sampling parameter may include a first sampling interval and a first sampling frequency, and the first sampling sequence includes a first current sampling sequence and a first voltage sampling sequence. Figure 3As shown, when the electric signal is sampled for the first time, the current signal and the voltage signal are sampled at equal intervals according to the preset first sampling frequency and the first sampling interval, and a first current sampling sequence I is obtained. n And the first voltage sampling sequence U n .
[0062] Among them, the first sampling frequency is recorded as f s , according to the Nyquist theorem, the first sampling frequency f s The following relationship should be satisfied: s ≥2f max .
[0063] Among them, f max It is the highest frequency value that needs to be detected in the measured signal.
[0064] In the actual application process, in order to ensure the sampling effect, the first sampling frequency f s The maximum frequency value can be f max 2.56 to 4 times.
[0065] For example, when the mains frequency is 50 Hz and the parameters of the highest harmonics to the 64th order need to be analyzed, f max That is: 50×64=3200Hz. At this time, if the first sampling frequency f s is the highest frequency value f max 4 times, the first sampling frequency f s It can be: 3200×4=12800 Hz. Wherein, at a sampling rate of 12800 Hz, when the fundamental frequency of the measured signal is 50 Hz, the number of sampling points per cycle is 256 points.
[0066] Furthermore, the Fast Fourier Transform, or FFT, is an efficient algorithm for discrete Fourier transform, which can transform a discrete sequence in the time domain into the frequency domain in order to analyze the amplitude and phase parameters of each harmonic frequency point contained in the original signal.
[0067] In some embodiments of the present invention, optionally, the first sampling parameter may specifically include a first sampling frequency, and the second sampling parameter may specifically include a second sampling frequency and a second sampling interval. Further, the electrical signal may specifically include a voltage signal, and accordingly, the first sampling sequence may specifically include a first voltage sampling sequence. On this basis, step 104 may specifically include the following steps 104a to 104d:
[0068] Step 104a, calculating the number of first sampling points of each cycle in the first voltage sampling sequence;
[0069] Step 104b, determining the voltage fundamental frequency according to the first sampling point number and the first sampling frequency;
[0070] Step 104c, determining a second sampling interval according to the preset number of sampling points and the first number of sampling points;
[0071] Step 104d: determining a second sampling frequency according to a preset number of sampling points and a voltage fundamental frequency.
[0072] In this embodiment, the first sampling parameter may specifically include a first sampling frequency, and the second sampling parameter may specifically include a second sampling frequency and a second sampling interval. Further, the electrical signal may specifically include a voltage signal, and accordingly, the first sampling sequence may specifically include a first voltage sampling sequence.
[0073] On this basis, in the process of calculating the second sampling parameter according to the above-mentioned first sampling sequence and the first sampling parameter, the harmonic power determination device calculates the first sampling point number of each cycle of the voltage signal based on the first voltage sampling sequence obtained by the first sampling. Further, the harmonic power determination device calculates the voltage fundamental frequency according to the calculated first sampling point number and the above-mentioned first sampling frequency. Further, the harmonic power determination device calculates the resampling step value, i.e., the second sampling interval, according to the preset sampling point number and the calculated first sampling point number, and calculates the resampling second sampling frequency according to the preset sampling point number and the calculated voltage fundamental frequency. In this way, the number of sampling points of each cycle after resampling can be set to the preset sampling point number, which can improve the accuracy of subsequent harmonic power calculation.
[0074] The first sampling point number is the exact number of sampling points contained in each cycle of the electrical signal after the first sampling, and the first sampling point number can be an integer or a decimal. For example, if the first sampling point number is a decimal, the first sampling sequence can be specifically as follows: Figure 4 shown.
[0075] Furthermore, the preset number of sampling points is an integer, that is, each cycle after resampling contains an integer number of sampling points. Figure 5 shown.
[0076] Furthermore, the electrical signal may specifically include a current signal, and accordingly, the first sampling sequence may specifically include a first current sampling sequence. It is understandable that, in actual application, the frequency of the current signal depends on the frequency of the voltage signal, and therefore, the number of sampling points per cycle of the current signal is also considered to be the first number of sampling points, and the second sampling interval and the second sampling frequency are also used to resample the current signal.
[0077] Specifically, in the method for determining harmonic power provided by the present invention, if Figure 3As shown, the current signal and the voltage signal are sampled at equal intervals to obtain a first current sampling sequence I n And the first voltage sampling sequence U n Afterwards, the first voltage sampling sequence U is obtained by sampling the voltage signal at equal intervals. n , calculate the number of accurate first sampling points in each cycle of the voltage signal, recorded as N u The frequency of the current signal depends on the frequency of the voltage signal, and the number of accurate first sampling points in each cycle of the current signal is also N. u . Further, based on the first number of sampling points N u Calculate the second sampling frequency and the second sampling interval of the resampled current, and then obtain the first current sampling sequence I after sampling at equal intervals. n The first voltage sampling sequence U is interpolated and resampled respectively, so as to resample the current signal and the voltage signal after equal interval sampling respectively, and obtain the second current sampling sequence I with the number of sampling points in each cycle being the preset number of sampling points n ' and the second voltage sampling sequence U n For example, the preset number of sampling points is 256. After resampling, a second current sampling sequence I with exactly 256 sampling points per cycle is obtained. n ' and the second voltage sampling sequence U n ′.
[0078] On this basis, in the process of fast Fourier transforming the second sampling sequence, as Figure 3 As shown, based on the sampling point data of the continuous whole cycle in the same period in the second current sampling sequence and the second voltage sampling sequence obtained after resampling, a fast Fourier transform operation, i.e., an FFT operation, is performed to obtain the real data and the imaginary data of each harmonic of the electric signal, that is, the real data of the nth harmonic and the imaginary data of the nth harmonic of the voltage signal are obtained, and the real data of the nth harmonic and the imaginary data of the nth harmonic of the current signal are obtained, where n is an integer.
[0079] On this basis, based on the above-mentioned fast Fourier transform calculation results, the harmonic signals of the voltage signal and the current signal can be expressed by the following formula (3) and formula (4) respectively:
[0080]
[0081] Where n represents the harmonic order, i is the imaginary unit, Indicates the nth harmonic signal of the voltage signal, U nre Represents the real part data of the nth harmonic of the voltage signal, U nim Represents the imaginary data of the nth harmonic of the voltage signal, Represents the nth harmonic signal of the current signal, Inre Represents the real part data of the nth harmonic of the current signal, I nim Indicates the imaginary part data of the nth harmonic of the current signal.
[0082] In some embodiments of the present invention, optionally, the voltage fundamental frequency is a ratio of the first sampling frequency to the first sampling point number.
[0083] In this embodiment, the voltage fundamental frequency may specifically be a ratio of the first sampling frequency to the calculated first sampling point number.
[0084] That is, for the above voltage fundamental frequency, it can be calculated by the following formula (5):
[0085]
[0086] Among them, f u Indicates the voltage fundamental frequency, f s Represents the first sampling frequency, N u Indicates the first sampling point number.
[0087] In some embodiments of the present invention, optionally, the second sampling interval is a ratio of the first sampling point number to the preset sampling point number.
[0088] In this embodiment, the second sampling interval may be specifically the ratio of the calculated first sampling point number to the preset sampling point number. In this way, the number of sampling points of each cycle after resampling can be set to the preset sampling point number, which can improve the accuracy of subsequent harmonic power calculation.
[0089] That is, for the second sampling interval, it can be calculated specifically by the following formula (6):
[0090]
[0091] Wherein, Δ represents the second sampling interval, M represents the preset number of sampling points, and N u Indicates the first sampling point number.
[0092] For example, taking the preset number of sampling points as 256, So that the number of sampling points per cycle after resampling is 256.
[0093] In some embodiments of the present invention, optionally, the second sampling frequency is the product of the voltage fundamental frequency and a preset number of sampling points.
[0094] In this embodiment, the second sampling frequency may be specifically the product of the preset number of sampling points and the calculated voltage fundamental frequency. In this way, the number of sampling points of each cycle after resampling can be set to the preset number of sampling points, which can improve the accuracy of subsequent harmonic power calculation.
[0095] That is, the second sampling frequency can be calculated by the following formula (7):
[0096] f s ′=Mf u , (7)
[0097] Among them, f s ′ represents the second sampling frequency of interpolation resampling, M represents the preset number of sampling points, f u Indicates the voltage fundamental frequency.
[0098] For example, taking the preset number of sampling points as 256, f s ′=256f u , so that the number of sampling points per cycle after resampling is 256.
[0099] In some embodiments of the present invention, optionally, the number of sampling points is preset to be an integer power of 2.
[0100] In this embodiment, the preset number of sampling points is specifically an integer power of 2.
[0101] In actual application, the above-mentioned preset number of sampling points may be specifically 128, 256 or other values. For the specific value of the preset number of sampling points, those skilled in the art may set it according to actual conditions, and no specific limitation is made here.
[0102] In actual application, after the second sampling sequence is subjected to a fast Fourier transform operation, it can be known from the characteristics of the fast Fourier transform algorithm that the frequency resolution of each harmonic can be expressed as shown in the following formula (8):
[0103]
[0104] Where n represents the harmonic order, f n Indicates the frequency resolution of the nth harmonic, f s ′ represents the second sampling frequency of interpolation resampling, N represents the number of sampling points for fast Fourier transform operation, k represents the frequency of fast Fourier transform operation, M represents the preset number of sampling points, f u Indicates the voltage fundamental frequency.
[0105] For example, taking the preset number of sampling points as 256,
[0106] When k is 1, f n Equal to f u, that is, the frequency resolution is equal to the voltage fundamental frequency. At this time, when n is equal to 0, it represents the data of the DC component, when n is equal to 1, it represents the data of the fundamental wave, when n is equal to 2, it represents the data of the second harmonic, and so on. According to the parameters in the above example, the highest harmonic data that can be obtained is n equal to 127, but in fact, only the harmonic data from 1 to 64 are used.
[0107] In some embodiments of the present invention, optionally, the electrical signal may specifically include a current signal and a voltage signal, the nth harmonic data may specifically include imaginary data and real data of the nth harmonic of the voltage signal, and imaginary data and real data of the nth harmonic of the current signal, and the harmonic power may specifically include reactive power and active power. On this basis, Figure 2 As shown, the above step 110 may specifically include the following steps 110a and 108b:
[0108] Step 110a, determining the active power of the nth harmonic according to the product of the real data of the nth harmonic of the voltage signal and the real data of the nth harmonic of the current signal, and the product of the imaginary data of the nth harmonic of the voltage signal and the imaginary data of the nth harmonic of the current signal;
[0109] Step 110b, determining the reactive power of the nth harmonic according to the product of the imaginary data of the nth harmonic of the voltage signal and the real data of the nth harmonic of the current signal, and the product of the real data of the nth harmonic of the voltage signal and the imaginary data of the nth harmonic of the current signal.
[0110] In this embodiment, the above-mentioned electrical signal may specifically include a current signal and a voltage signal, the above-mentioned nth harmonic data may specifically include the imaginary part data and the real part data of the nth harmonic of the voltage signal, the imaginary part data and the real part data of the nth harmonic of the current signal, and the above-mentioned harmonic power may specifically include reactive power and active power.
[0111] On this basis, in the process of calculating the harmonic power of the nth harmonic of the electric signal according to the nth harmonic data obtained after the fast Fourier transform, the harmonic power determination device calculates the active power of the nth harmonic of the electric signal according to the product of the real data of the nth harmonic of the current signal and the real data of the nth harmonic of the voltage signal, and the product of the imaginary data of the nth harmonic of the current signal and the imaginary data of the nth harmonic of the voltage signal. Further, the harmonic power determination device calculates the reactive power of the nth harmonic of the electric signal according to the product of the real data of the nth harmonic of the current signal and the imaginary data of the nth harmonic of the voltage signal, and the product of the imaginary data of the nth harmonic of the current signal and the real data of the nth harmonic of the voltage signal. In this way, the harmonic power of the electrical signal is directly calculated based on the operation result of the fast Fourier transform, which reduces the operation steps, reduces the time consumption of harmonic power calculation, improves the calculation efficiency of harmonic power, eliminates the fitting error caused by trigonometric function interpolation in the traditional calculation method, and improves the accuracy of harmonic power calculation.
[0112] That is, in the method for determining harmonic power provided by the present invention, if Figure 3 As shown, after obtaining the real data of the nth harmonic of the voltage signal and the imaginary data of the nth harmonic of the current signal through FFT operation, the reactive power of the nth harmonic of the electrical signal and the active power of the nth harmonic are calculated respectively based on the real data of the nth harmonic of the voltage signal and the imaginary data of the nth harmonic of the current signal.
[0113] In some embodiments of the present invention, optionally, the active power of the nth harmonic of the electrical signal may be calculated according to the following formula (9):
[0114] P n =U nre I nre +U nim I nim , (9)
[0115] Where n represents the harmonic order, P n Indicates the active power of the nth harmonic of the electrical signal, U nre Represents the real part data of the nth harmonic of the voltage signal, U nim Represents the imaginary data of the nth harmonic of the voltage signal, I nre Represents the real part data of the nth harmonic of the current signal, I nim Indicates the imaginary part data of the nth harmonic of the current signal.
[0116] Furthermore, the reactive power of the nth harmonic of the electrical signal can be calculated according to the following formula (10):
[0117] Q n =U nim I nre -U nre I nim , (10)
[0118] Among them, Q n Indicates the active power of the nth harmonic of the electrical signal.
[0119] In this way, based on the above formula, the harmonic power of the electrical signal is calculated directly according to the imaginary and real data of each harmonic of the current signal and the voltage signal obtained after the fast Fourier transform, which reduces the calculation steps, reduces the time consumption of harmonic power calculation, and improves the calculation efficiency of harmonic power. It does not involve trigonometric function operations in traditional calculation methods, eliminates the fitting error caused by trigonometric function operation interpolation, and improves the accuracy of harmonic power calculation.
[0120] The derivation steps of the above formula (9) and formula (10) can be specifically shown as follows: formula (11) to formula (21).
[0121] In the above formulas (1) and (2), U nRMS is the effective value of the voltage of the nth harmonic, I nRMS is the effective value of the current of the nth harmonic, that is, U nRMS is the nth harmonic signal of the voltage signal in the above formula (3) The modulus value, I nRMS is the nth harmonic signal of the current signal in the above formula (4) Based on this, U nRMS and I nRMS Can be expressed as:
[0122]
[0123]
[0124] in, Represents the nth harmonic signal of the voltage signal The modulus value, Represents the nth harmonic signal of the current signal The modulus value of .
[0125] Furthermore, the nth harmonic signal of the voltage signal The phase of The nth harmonic signal of the current signal The phase of Then, for the angle between the voltage and current of the nth harmonic in formula (1) and formula (2), it can be specifically expressed as:
[0126]
[0127] in, Represents the angle between the voltage and current of the nth harmonic.
[0128] Furthermore, combined with the above formula (13), with the help of the two-angle difference formula in trigonometric function, the formulas (1) and (2) are and Can be converted into:
[0129]
[0130] in, Represents the nth harmonic signal of the current signal The phase of Represents the nth harmonic signal of the voltage signal phase.
[0131] Furthermore, combining formula (3), formula (4), formula (11) and formula (12), for the nth harmonic signal of the current signal Phase And the nth harmonic signal of the voltage signal Phase Its sine and cosine values can be expressed as:
[0132]
[0133] Among them, U nRMS is the effective value of the voltage of the nth harmonic, I nRMS is the effective value of the current of the nth harmonic, U nre Represents the real part data of the nth harmonic of the voltage signal, U nim Represents the imaginary data of the nth harmonic of the voltage signal, I nre Represents the real part data of the nth harmonic of the current signal, I nim Indicates the imaginary part data of the nth harmonic of the current signal.
[0134] On this basis, by substituting formula (14) to formula (19) into the above formula (1) and formula (2), we can obtain:
[0135]
[0136] Among them, P n Indicates the active power of the nth harmonic of the electrical signal, Q nIndicates the active power of the nth harmonic of the electrical signal.
[0137] In summary, in the method for determining harmonic power provided by the present invention, after sampling the voltage signal and the current signal at equal intervals, the first voltage sampling sequence obtained after the voltage signal sampling is used to calculate the precise first sampling point number in each cycle after the first sampling of the electrical signal, and based on the first sampling point number, the electrical signal is interpolated and resampled, and then the whole cycle data after the interpolation and resampling is FFT processed to obtain the real and imaginary data of each harmonic of the voltage signal and the current signal, and the active power and reactive power of each harmonic are directly calculated based on the real and imaginary data of each harmonic. In this way, on the one hand, the active power and reactive power of each harmonic are directly calculated based on the result after the FFT operation, the operation steps are few, and the efficiency of harmonic power calculation is high. On the other hand, the data after FFT is directly used for calculation, and no trigonometric function operation is involved, which eliminates the fitting error caused by the table lookup interpolation in the trigonometric function operation, and improves the accuracy of harmonic power calculation.
[0138] In one embodiment of the present invention, a device for determining harmonic power is also provided. Figure 6 As shown, Figure 6 The structure block diagram of the harmonic power determination device 200 according to the embodiment of the present invention is shown. The harmonic power determination device 200 may specifically include the following sampling unit 202 and processing unit 204:
[0139] The sampling unit 202 is used to sample the electrical signal according to the first sampling parameter to obtain a first sampling sequence;
[0140] The processing unit 204 is configured to determine a second sampling parameter according to the first sampling parameter and the first sampling sequence;
[0141] The sampling unit 202 is further configured to resample the first sampling sequence according to a second sampling parameter to obtain a second sampling sequence;
[0142] The processing unit 204 is further used to perform a fast Fourier transform on the second sampling sequence to obtain nth harmonic data of the electrical signal, where n is a positive integer;
[0143] The processing unit 204 is further configured to determine the harmonic power of the nth harmonic according to the nth harmonic data.
[0144] The harmonic power determination device 200 provided in the embodiment of the present invention includes a sampling unit 202 and a processing unit 204. In the process of calculating the harmonic power of each order of the electrical signal, the sampling unit 202 performs a first sampling on the electrical signal according to the set first sampling parameter to obtain a first sampling sequence. Further, the processing unit 204 calculates a second sampling parameter according to the above-mentioned first sampling sequence and the first sampling parameter, and the sampling unit 202 then resamples the first sampling sequence obtained by the first sampling according to the calculated second sampling parameter to obtain a second sampling sequence. Further, the processing unit 204 performs a fast Fourier transform on the second sampling sequence obtained after resampling to obtain the nth harmonic data of the electrical signal, where n is a positive integer, that is, to obtain the harmonic data of each order of the electrical signal. Further, the processing unit 204 calculates the harmonic power of the nth harmonic of the electrical signal according to the nth harmonic data obtained after the fast Fourier transform. In this way, after sampling and resampling the electrical signal, the harmonic power is directly calculated based on the result after fast Fourier transform, which reduces the calculation steps, reduces the time consumption of harmonic power calculation, improves the calculation efficiency of harmonic power, eliminates the fitting error caused by trigonometric function interpolation in traditional calculation methods, and improves the accuracy of harmonic power calculation.
[0145] The electrical signal includes a current signal and a voltage signal, the first sampling parameter may include a first sampling interval and a first sampling frequency, and the first sampling sequence includes a first current sampling sequence and a first voltage sampling sequence. Specifically, when the electrical signal is sampled for the first time, the current signal and the voltage signal are sampled at equal intervals according to the preset first sampling frequency and the first sampling interval, and the first current sampling sequence I is obtained. n And the first voltage sampling sequence U n .
[0146] Among them, the first sampling frequency is recorded as f s , according to the Nyquist theorem, the first sampling frequency f s The following relationship should be satisfied: s ≥2f max .
[0147] Among them, f max It is the highest frequency value that needs to be detected in the measured signal.
[0148] In the actual application process, in order to ensure the sampling effect, the first sampling frequency f s The maximum frequency value can be f max 2.56 to 4 times.
[0149] For example, when the mains frequency is 50 Hz and the parameters of the highest harmonics to the 64th order need to be analyzed, f maxThat is: 50×64=3200Hz. At this time, if the first sampling frequency f s is the highest frequency value f max 4 times, the first sampling frequency f s It can be: 3200×4=12800 Hz. Wherein, at a sampling rate of 12800 Hz, when the fundamental frequency of the measured signal is 50 Hz, the number of sampling points per cycle is 256 points.
[0150] Furthermore, the Fast Fourier Transform, or FFT, is an efficient algorithm for discrete Fourier transform, which can transform a discrete sequence in the time domain into the frequency domain in order to analyze the amplitude and phase parameters of each harmonic frequency point contained in the original signal.
[0151] In some embodiments of the present invention, optionally, the first sampling parameter includes a first sampling frequency, the electrical signal includes a voltage signal, the first sampling sequence includes a first voltage sampling sequence, the second sampling parameter includes a second sampling frequency and a second sampling interval, and the processing unit 204 is specifically used to: calculate the first sampling point number of each cycle in the first voltage sampling sequence; determine the voltage fundamental frequency according to the first sampling point number and the first sampling frequency; determine the second sampling interval according to the preset sampling point number and the first sampling point number; determine the second sampling frequency according to the preset sampling point number and the voltage fundamental frequency.
[0152] In some embodiments of the present invention, optionally, the voltage fundamental frequency is a ratio of the first sampling frequency to the first sampling point number.
[0153] In some embodiments of the present invention, optionally, the second sampling interval is a ratio of the first sampling point number to the preset sampling point number.
[0154] In some embodiments of the present invention, optionally, the second sampling frequency is the product of the voltage fundamental frequency and a preset number of sampling points.
[0155] In some embodiments of the present invention, optionally, the number of sampling points is preset to be an integer power of 2.
[0156] In some embodiments of the present invention, optionally, the electrical signal includes a voltage signal and a current signal, and the harmonic power of the nth harmonic is determined according to the nth harmonic data, including: determining the active power of the nth harmonic according to the product of the real data of the nth harmonic of the current signal and the real data of the nth harmonic of the voltage signal, and the product of the imaginary data of the nth harmonic of the current signal and the imaginary data of the nth harmonic of the voltage signal; determining the reactive power of the nth harmonic according to the product of the real data of the nth harmonic of the current signal and the imaginary data of the nth harmonic of the voltage signal, and the product of the imaginary data of the nth harmonic of the current signal and the real data of the nth harmonic of the voltage signal.
[0157] In some embodiments of the present invention, the reactive power and the active power are optionally calculated according to the following formula: n =U nre I nre +U nim I nim ;Q n =U nim I nre -U nre I nim ; Among them, Q n is the reactive power of the nth harmonic, P n is the active power of the nth harmonic, I nre is the real part data of the nth harmonic of the current signal, U nre is the real part data of the nth harmonic of the voltage signal, I nim is the imaginary part data of the nth harmonic of the current signal, U nim It is the imaginary part data of the nth harmonic of the voltage signal.
[0158] In one embodiment of the present invention, an electric meter is also provided. Figure 7 As shown, Figure 7 The structure block diagram of the electric meter 300 provided by the embodiment of the present invention is shown. The electric meter 300 includes an electric signal detection device 302 and a control device 304.
[0159] The electrical signal detection device 302 is used to detect electrical signals.
[0160] Furthermore, the control device 304 is connected to the electrical signal detection device 302 .
[0161] Furthermore, the control device 304 is used to implement the steps of the method for determining harmonic power in any of the above embodiments. Therefore, the electric meter 300 has all the technical effects of the method for determining harmonic power in any of the above embodiments, which will not be described in detail here.
[0162] The control device 304 includes a floating point operator 306 to ensure the calculation accuracy of the first number of sampling points in the process of calculating the harmonic power.
[0163] In actual application, the control device 304 may be a device such as an MCU, which is not specifically limited here.
[0164] Furthermore, in actual application, the electric meter 300 may specifically include a single-phase electric meter and a three-phase electric meter, wherein each phase includes one voltage and one current, and when calculating the harmonic power of each phase, the corresponding voltage data and current data are required.
[0165] In one embodiment of the present invention, a readable storage medium is also provided, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method for determining harmonic power in any of the above embodiments are implemented.
[0166] The readable storage medium provided by the embodiment of the present invention, when the program or instruction stored therein is executed by the processor, can implement the steps of the method for determining harmonic power in any of the above embodiments. Therefore, the readable storage medium has all the beneficial effects of the method for determining harmonic power in any of the above embodiments, which will not be repeated here.
[0167] Specifically, the above-mentioned readable storage medium may include any medium capable of storing or transmitting information. Examples of readable storage media include electronic circuits, semiconductor memory devices, read-only memory (ROM), random access memory (RAM), compact disc read-only memory (CD-ROM), flash memory, erasable ROM (EROM), magnetic tape, floppy disk, optical disk, hard disk, optical fiber medium, radio frequency (RF) link, optical data storage device, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0168] In the description of this specification, the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance unless otherwise clearly specified and limited; the terms "connection", "installation", "fixation" and the like should be understood in a broad sense, for example, "connection" can be a fixed connection, a detachable connection, or an integral connection; it can be directly connected or indirectly connected through an intermediate medium. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0169] In the description of this specification, the description of the terms "one embodiment", "some embodiments", "specific embodiments", 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 invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0170] In addition, the technical solutions between the various embodiments of the present invention can be combined with each other, but it must be based on the fact that ordinary technicians in the field can implement it. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by the present invention.
[0171] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for determining harmonic power, characterized in that: include: Sampling the electrical signal according to a first sampling parameter to obtain a first sampling sequence; Determine a second sampling parameter according to the first sampling parameter and the first sampling sequence; Resample the first sampling sequence according to the second sampling parameter to obtain a second sampling sequence; Performing a fast Fourier transform on the second sampling sequence to obtain nth harmonic data of the electrical signal, where n is a positive integer; The harmonic power of the nth harmonic is determined according to the nth harmonic data.
2. The method for determining harmonic power according to claim 1, characterized in that: The first sampling parameter includes a first sampling frequency, the electrical signal includes a voltage signal, the first sampling sequence includes a first voltage sampling sequence, the second sampling parameter includes a second sampling interval and a second sampling frequency, and determining the second sampling parameter according to the first sampling parameter and the first sampling sequence includes: Calculating the number of first sampling points of each cycle in the first voltage sampling sequence; Determine a voltage fundamental frequency according to the first sampling frequency and the first number of sampling points; Determine the second sampling interval according to the first number of sampling points and a preset number of sampling points; The second sampling frequency is determined according to the voltage fundamental frequency and the preset number of sampling points.
3. The method for determining harmonic power according to claim 2, characterized in that: The voltage fundamental frequency is a ratio of the first sampling frequency to the first sampling point number.
4. The method for determining harmonic power according to claim 2, characterized in that: The second sampling interval is a ratio of the first number of sampling points to the preset number of sampling points.
5. The method for determining harmonic power according to claim 2, characterized in that: The second sampling frequency is the product of the voltage fundamental frequency and the preset number of sampling points.
6. The method for determining harmonic power according to claim 2, characterized in that: The preset number of sampling points is an integer power of 2.
7. The method for determining harmonic power according to any one of claims 1 to 6, characterized in that: The electrical signal includes a voltage signal and a current signal, and determining the harmonic power of the nth harmonic according to the nth harmonic data includes: Determine the active power of the nth harmonic according to the product of the real data of the nth harmonic of the voltage signal and the real data of the nth harmonic of the current signal, and the product of the imaginary data of the nth harmonic of the voltage signal and the imaginary data of the nth harmonic of the current signal; The reactive power of the nth harmonic is determined according to the product of the imaginary data of the nth harmonic of the voltage signal and the real data of the nth harmonic of the current signal and the product of the real data of the nth harmonic of the voltage signal and the imaginary data of the nth harmonic of the current signal.
8. The method for determining harmonic power according to claim 7, characterized in that: The active power and the reactive power are calculated according to the following formula: P n =U nre AND nre +U nim AND nim ; Q n =U nim I nre -U nre I nim ; Among them, P n is the active power of the nth harmonic, Q n is the reactive power of the nth harmonic, U nre is the real part data of the nth harmonic of the voltage signal, I nre is the real part data of the nth harmonic of the current signal, U nim is the imaginary part data of the nth harmonic of the voltage signal, I nim It is the imaginary part data of the nth harmonic of the current signal.
9. A device for determining harmonic power, characterized in that: include: A sampling unit, used for sampling the electrical signal according to a first sampling parameter to obtain a first sampling sequence; a processing unit, configured to determine a second sampling parameter according to the first sampling parameter and the first sampling sequence; The sampling unit is further configured to resample the first sampling sequence according to the second sampling parameter to obtain a second sampling sequence; The processing unit is further used to perform a fast Fourier transform on the second sampling sequence to obtain nth harmonic data of the electrical signal, where n is a positive integer; The processing unit is further used to determine the harmonic power of the nth harmonic according to the nth harmonic data.
10. An electric meter, characterized in that: include: An electrical signal detection device, used for detecting electrical signals; A control device is connected to the electrical signal detection device, the control device includes a floating-point operator, and the control device is used to implement the steps of the method for determining harmonic power as described in any one of claims 1 to 8.
11. A readable storage medium, characterized in that: The readable storage medium stores a program or an instruction, and when the program or the instruction is executed by a processor, the steps of the method for determining harmonic power according to any one of claims 1 to 8 are implemented.
Citation Information
Cited By
Electric parameter calculation method of electricity meter, control device and computer readable storage medium
CN120577591A