Electric energy metering chip and harmonic power factor calculation method and device thereof
The harmonic voltage and current angle are calculated by discrete Fourier transform and CORDIC algorithm, which solves the problems of large resource occupation and high power consumption caused by high-digit division operations in the prior art, and realizes high-precision and efficient harmonic power factor measurement.
Patent Information
- Application Number
- CN202111180880.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-11
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2041-10-11
AI Technical Summary
The existing harmonic power factor calculation technology requires higher digit division operations, resulting in large resource occupation and increased power consumption, making it difficult to meet high requirements for calculation accuracy and accuracy.
Discrete Fourier transform and CORDIC algorithm are used to calculate the harmonic voltage angle and harmonic current angle, and the harmonic power factor is calculated through the angle difference, which avoids division operations and achieves real-time and efficient measurement.
The calculation accuracy and accuracy of harmonic power factor are improved, the chip area and power consumption are reduced, and real-time and efficient harmonic power factor measurement is achieved.
Smart Images

Figure CN114089031B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electric energy metering, and in particular to a harmonic power factor calculation method of an electric energy metering chip, a harmonic power factor calculation device of an electric energy metering chip, a computer-readable storage medium and an electric energy metering chip. Background Art
[0002] With the advancement of digital signal processing and chip design and manufacturing technology, energy metering chips have been widely used in smart energy meters. As the core component of smart energy meters, the calculation accuracy and accuracy of energy metering chips directly determine the accuracy and accuracy of the energy meter's measurement. In the power system, the size of the power factor is related to the load nature of the power system and is an important indicator to measure the efficiency of the power system. When the power factor is low, it means that the reactive power in the power system is large, the efficiency of the power system is low, and the loss in the line power supply is large. When the power factor is high, the reactive power in the power system is small, the efficiency of the power system is high, and the loss in the line power supply is small.
[0003] The application of a large number of power electronic power consumption and power generation equipment in the current power system has led to increasingly serious harmonic pollution in the current power system. Harmonics have already had an impact on power equipment that cannot be ignored. At present, the development of chips with harmonic metering functions is not yet mature, and it is imperative to develop metering chips with harmonic metering functions. The harmonic power factor calculation function is an essential function of the metering chip. It is of great practical significance to study high-precision harmonic power factor calculation methods suitable for harmonic power metering chips. The existing harmonic power factor calculation technology solutions generally calculate the power factor of the fundamental wave and each harmonic by calculating the active power P of the fundamental wave and each harmonic. n And the apparent power S of the fundamental wave and each harmonic n Then, use the formula: The power factor is calculated. The calculation process of the fundamental wave and each harmonic power factor requires a high-digit division operation, and the high-digit division operation will occupy more resources of the harmonic metering chip, resulting in increased power consumption. Summary of the invention
[0004] The present invention aims to solve one of the technical problems in the related art at least to a certain extent. To this end, the first purpose of the present invention is to propose a harmonic power factor calculation method for an electric energy metering chip, which realizes real-time and efficient measurement of harmonic power factors and effectively improves the calculation precision and accuracy of each harmonic power factor.
[0005] The second objective of the present invention is to provide a harmonic power factor calculation device for an electric energy metering chip.
[0006] A third object of the present invention is to provide a computer-readable storage medium.
[0007] A fourth objective of the present invention is to provide an electric energy metering chip.
[0008] To achieve the above-mentioned purpose, the first aspect of the embodiment of the present invention proposes a harmonic power factor calculation method for an electric energy metering chip, comprising: obtaining a current voltage value and a current current value; performing a discrete Fourier transform on the current voltage value and the current current value to obtain a discrete Fourier transform result; calculating a harmonic voltage angle and a harmonic current angle according to the discrete Fourier transform result; and calculating a harmonic power factor according to the angle difference between the harmonic voltage angle and the harmonic current angle.
[0009] According to the harmonic power factor calculation method of the electric energy metering chip of the embodiment of the present invention, first, the current voltage value and the current current value are obtained, then the current voltage value and the current current value are subjected to discrete Fourier transform to obtain the discrete Fourier transform result, then the harmonic voltage angle and the harmonic current angle are calculated according to the discrete Fourier transform result, and finally, the harmonic power factor is calculated according to the angle difference between the harmonic voltage angle and the harmonic current angle. Thus, the method realizes the real-time and efficient measurement of the harmonic power factor, and effectively improves the calculation precision and accuracy of each harmonic power factor.
[0010] In addition, the harmonic power factor calculation method of the electric energy metering chip according to the above embodiment of the present invention may also have the following additional technical features:
[0011] According to one embodiment of the present invention, a discrete Fourier transform is performed on the current voltage value and the current current value using the following formula:
[0012]
[0013] Wherein, F(k) represents the discrete Fourier transform result, f(n) represents the current voltage value or the current current value, represents the rotation factor of the fundamental wave or harmonic, and N represents the multiple of the fundamental wave.
[0014] According to one embodiment of the present invention, the harmonic voltage angle and the harmonic current angle are calculated based on the discrete Fourier transform result, including: obtaining the real part and the imaginary part corresponding to the current voltage value and the real part and the imaginary part corresponding to the current current value respectively according to the discrete Fourier transform result; and using the CORDIC algorithm to calculate the real part and the imaginary part corresponding to the current voltage value and the current current value respectively, so as to obtain the harmonic voltage angle and the harmonic current angle.
[0015] According to one embodiment of the present invention, a CORDIC algorithm is used to calculate the real part and the imaginary part corresponding to the current voltage value and the current current value, respectively, to obtain the harmonic voltage angle and the harmonic current angle, including: taking the real part and the imaginary part corresponding to the current voltage value or the current current value as the first iteration initial value; determining the rotation angle of each iteration according to the imaginary part corresponding to the current voltage value or the current current value; performing iterative calculation according to the first iteration initial value and the rotation angle of each iteration; when the imaginary part corresponding to the current voltage value or the current current value after iterative calculation approaches 0, determining the harmonic voltage angle or the harmonic current angle.
[0016] According to one embodiment of the present invention, the following formula is used for iterative calculation:
[0017] x n+1 =x n -s yn ×(2 -n ×y n )
[0018] y n+1 =y n +s yn ×(2 -n × n )
[0019]
[0020] Among them, x n+1 represents the real part of the current voltage value or the current current value after n iterations, x n represents the real part of the current voltage value or the current current value after n-1 iterations, n represents the number of iterations, y n+1 represents the imaginary part of the current voltage value or the current current value after n iterations, y n represents the imaginary part of the current voltage value or the current current value after iteration n-1 times, z n+1 represents the harmonic voltage angle or the harmonic current angle after n iterations, z n represents the harmonic voltage angle or the harmonic current angle after iteration n-1 times, represents the rotation angle of each iteration, s yn is the decision operator, where when y n >0, s yn =1, when y n When <0, s yn =-1.
[0021] According to one embodiment of the present invention, the harmonic power factor is calculated based on the angle difference between the harmonic voltage angle and the harmonic current angle, including: using a CORDIC algorithm to calculate the angle difference between the harmonic voltage angle and the harmonic current angle to obtain the harmonic power factor.
[0022] According to one embodiment of the present invention, the CORDIC algorithm is used to calculate the angle difference between the harmonic voltage angle and the harmonic current angle, including: obtaining the scaling factor of each iteration; using the inverse of the scaling factor of each iteration, the first set value and the angle difference between the harmonic voltage angle and the harmonic current angle as the second iteration initial value; determining the rotation angle of each iteration according to the angle difference between the harmonic voltage angle and the harmonic current angle; performing iterative calculation according to the second iteration initial value and the rotation angle of each iteration; when the angle difference between the harmonic voltage angle and the harmonic current angle after iterative calculation approaches 0, determining the harmonic power factor.
[0023] According to one embodiment of the present invention, the scaling factor k for each iteration is obtained by the following formula: m :
[0024]
[0025] Among them, cosβ i represents the rotation angle of the i-th iteration, m represents the number of iterations, i = 1, 2, …, m.
[0026] According to one embodiment of the present invention, the following formula is used for iterative calculation:
[0027] x′ m+1 = x′ m -s zm ×(2 -m ×y′ m )
[0028] y′ m+1 =y′ m +s zm ×(2 -m ×x′ m )
[0029] z′ m+1 = z′ m -s zm ×β m
[0030] Among them, x′ m+1 or y′ m+1 represents the harmonic power factor after m iterations, x′ m or y′ mrepresents the harmonic power factor after iteration m-1 times, z′ m+1 represents the angle difference between the harmonic voltage angle and the harmonic current angle after m iterations, z′ m represents the angle difference between the harmonic voltage angle and the harmonic current angle after iteration m-1 times, β m represents the rotation angle of each iteration, s zm represents the decision operator, where z′ m >0, s zm =1, when z′ m When <0, s zm =-1.
[0031] According to an embodiment of the present invention, the harmonic power factor calculation method of the electric energy metering chip further includes: determining the harmonic power factor according to the quadrant where the angle difference between the harmonic voltage angle and the harmonic current angle is located.
[0032] According to an embodiment of the present invention, before performing discrete Fourier transform on the current voltage value and the current current value, the method further includes: performing phase compensation and gain adjustment processing on the current voltage value and the current current value.
[0033] To achieve the above-mentioned purpose, the second aspect of the embodiment of the present invention proposes a harmonic power factor calculation device for an electric energy metering chip, including: an acquisition module, used to obtain a current voltage value and a current current value; a transformation module, used to perform a discrete Fourier transform on the current voltage value and the current current value to obtain a discrete Fourier transform result; a first calculation module, used to calculate the harmonic voltage angle and the harmonic current angle according to the discrete Fourier transform result; a second calculation module, used to calculate the harmonic power factor according to the angle difference between the harmonic voltage angle and the harmonic current angle.
[0034] According to the harmonic power factor calculation device of the electric energy metering chip of the embodiment of the present invention, the current voltage value and the current current value are obtained by the acquisition module, the current voltage value and the current current value are subjected to discrete Fourier transformation by the transformation module to obtain the discrete Fourier transformation result, and the harmonic voltage angle and the harmonic current angle are calculated by the first calculation module according to the discrete Fourier transformation result, and the second calculation module calculates the harmonic power factor according to the angle difference between the harmonic voltage angle and the harmonic current angle. Thus, the device realizes real-time and efficient measurement of the harmonic power factor, and effectively improves the calculation precision and accuracy of each harmonic power factor.
[0035] In addition, the harmonic power factor calculation device of the electric energy metering chip according to the above embodiment of the present invention may also have the following additional technical features:
[0036] According to one embodiment of the present invention, the transformation module performs discrete Fourier transform on the current voltage value and the current current value by using the following formula:
[0037]
[0038] Wherein, F(k) represents the discrete Fourier transform result, f(n) represents the current voltage value or the current current value, represents the rotation factor of the fundamental wave or harmonic, and N represents the multiple of the fundamental wave.
[0039] According to one embodiment of the present invention, the first calculation module calculates the harmonic voltage angle and the harmonic current angle according to the discrete Fourier transform result, and is specifically used to: obtain the real part and imaginary part corresponding to the current voltage value and the real part and imaginary part corresponding to the current current value according to the discrete Fourier transform result; use the CORDIC algorithm to calculate the real part and imaginary part corresponding to the current voltage value and the current current value, respectively, to obtain the harmonic voltage angle and the harmonic current angle.
[0040] According to one embodiment of the present invention, the first calculation module adopts the CORDIC algorithm to respectively calculate the real part and the imaginary part corresponding to the current voltage value and the current current value to obtain the harmonic voltage angle and the harmonic current angle, and is specifically used to: use the real part and the imaginary part corresponding to the current voltage value or the current current value as the first iteration initial value; determine the rotation angle of each iteration according to the imaginary part corresponding to the current voltage value or the current current value; perform iterative calculation according to the first iteration initial value and the rotation angle of each iteration; when the imaginary part corresponding to the current voltage value or the current current value after iterative calculation approaches 0, determine the harmonic voltage angle or the harmonic current angle.
[0041] According to one embodiment of the present invention, the first calculation module uses the following formula to perform iterative calculation:
[0042] x n+1 =x n -s yn ×(2 -n ×y n )
[0043] y n+1 =y n +s yn ×(2 -n × n )
[0044]
[0045] Among them, x n+1represents the real part of the current voltage value or the current current value after n iterations, x n represents the real part of the current voltage value or the current current value after n-1 iterations, n represents the number of iterations, y n+1 represents the imaginary part of the current voltage value or the current current value after n iterations, y n represents the imaginary part of the current voltage value or the current current value after iteration n-1 times, z n+1 represents the harmonic voltage angle or the harmonic current angle after n iterations, z n represents the harmonic voltage angle or the harmonic current angle after iteration n-1 times, represents the rotation angle of each iteration, s yn is the decision operator, where when y n >0, s yn =1, when y n <0, s yn =-1.
[0046] According to one embodiment of the present invention, the second calculation module calculates the harmonic power factor based on the angle difference between the harmonic voltage angle and the harmonic current angle, and is specifically used to: use the CORDIC algorithm to calculate the angle difference between the harmonic voltage angle and the harmonic current angle to obtain the harmonic power factor.
[0047] According to one embodiment of the present invention, the second calculation module uses the CORDIC algorithm to calculate the angle difference between the harmonic voltage angle and the harmonic current angle, and is specifically used to: obtain the expansion factor of each iteration; use the inverse of the expansion factor of each iteration, the first set value and the angle difference between the harmonic voltage angle and the harmonic current angle as the second iteration initial value; determine the rotation angle of each iteration according to the angle difference between the harmonic voltage angle and the harmonic current angle; perform iterative calculation according to the second iteration initial value and the rotation angle of each iteration; when the angle difference between the harmonic voltage angle and the harmonic current angle after iterative calculation approaches 0, determine the harmonic power factor.
[0048] According to an embodiment of the present invention, the second calculation module obtains the scaling factor k of each iteration by the following formula: m :
[0049]
[0050] Among them, cosβ i represents the rotation angle of the i-th iteration, m represents the number of iterations, i = 1, 2, …, m.
[0051] According to one embodiment of the present invention, the second calculation module uses the following formula to perform iterative calculation:
[0052] x′ m+1 = x′ m -s zm ×(2 -m ×y′ m )
[0053] y′ m+1 =y′ m +s zm ×(2 -m ×x′ m )
[0054] z′ m+1 = z′ m -s zm ×β m
[0055] Among them, x′ m+1 or y′ m+1 represents the harmonic power factor after m iterations, x′ m or y′ m represents the harmonic power factor after iteration m-1 times, z′ m+1 represents the angle difference between the harmonic voltage angle and the harmonic current angle after m iterations, z′ m represents the angle difference between the harmonic voltage angle and the harmonic current angle after iteration m-1 times, β m represents the rotation angle of each iteration, s zm represents the decision operator, where z′ m >0, s zm =1, when z′ m <0, s zm =-1.
[0056] According to an embodiment of the present invention, the second calculation module is further used to determine the harmonic power factor according to the quadrant in which the angle difference between the harmonic voltage angle and the harmonic current angle is located.
[0057] According to an embodiment of the present invention, the harmonic power factor calculation device of the electric energy metering chip further includes: a processing module, which is used to perform phase compensation and gain adjustment processing on the current voltage value and the current current value.
[0058] To achieve the above-mentioned purpose, the third aspect of the present invention proposes a computer-readable storage medium, on which a harmonic power factor calculation program of an electric energy metering chip is stored. When the harmonic power factor calculation program of the electric energy metering chip is executed by a processor, the harmonic power factor calculation method of the electric energy metering chip mentioned above is implemented.
[0059] According to the computer-readable storage medium of an embodiment of the present invention, the harmonic power factor calculation method of the above-mentioned electric energy metering chip is implemented by executing the harmonic power factor calculation program of the electric energy metering chip, thereby realizing real-time and efficient measurement of the harmonic power factor, and effectively improving the calculation precision and accuracy of each harmonic power factor.
[0060] To achieve the above-mentioned purpose, an embodiment of the fourth aspect of the present invention proposes an electric energy metering chip, including a memory, a processor, and a harmonic power factor calculation program of the electric energy metering chip stored in the memory and executable on the processor. When the processor executes the harmonic power factor calculation program of the electric energy metering chip, the above-mentioned harmonic power factor calculation method of the electric energy metering chip is implemented.
[0061] According to the electric energy metering chip of the embodiment of the present invention, when the processor executes the harmonic power factor calculation program of the electric energy metering chip, the harmonic power factor calculation method of the above-mentioned electric energy metering chip realizes real-time and efficient measurement of the harmonic power factor, and effectively improves the calculation precision and accuracy of each harmonic power factor.
[0062] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] Figure 1 A flowchart of a method for calculating harmonic power factor of an electric energy metering chip according to an embodiment of the present invention;
[0064] Figure 2 A block diagram of a harmonic power factor calculation device of an electric energy metering chip according to an embodiment of the present invention;
[0065] Figure 3 FIG. 4 is a block diagram of an electric energy metering chip according to an embodiment of the present invention. DETAILED DESCRIPTION
[0066] Embodiments of the present invention are described in detail below, examples of which 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 invention, and should not be construed as limiting the present invention.
[0067] The following describes a harmonic power factor calculation method for an electric energy metering chip, a harmonic power factor calculation device for an electric energy metering chip, a computer-readable storage medium, and an electric energy metering chip according to embodiments of the present invention with reference to the accompanying drawings.
[0068] Figure 1The figure is a flow chart of a harmonic power factor calculation method of an electric energy metering chip according to an embodiment of the present invention.
[0069] like Figure 1 As shown, the harmonic power factor calculation method of the electric energy metering chip may include:
[0070] S1, obtaining the current voltage value and the current current value. In one embodiment of the invention, the voltage and current data of the power system can be collected by an ADC (Analog-to-Digital Converter) sampling unit of an electric energy metering chip.
[0071] S2, performing discrete Fourier transform on the current voltage value and the current current value to obtain a discrete Fourier transform result.
[0072] According to an embodiment of the present invention, before performing discrete Fourier transform on the current voltage value and the current current value, the method further includes: performing phase compensation and gain adjustment processing on the current voltage value and the current current value.
[0073] Specifically, the ADC sampling unit is connected to a front-end phase compensation and gain adjustment unit. When the ADC input sampling unit obtains the current voltage value and the current current value, the front-end phase compensation and gain adjustment unit compensates and adjusts the gain of the current voltage value and the current current value output by the ADC input sampling unit, and outputs the current voltage value and the current current value after compensation and gain adjustment. The front-end phase compensation and gain adjustment unit may be connected to an ADC input data cache unit, so as to cache the adjusted current voltage value and current current value.
[0074] In one embodiment of the present invention, phase compensation may include leading phase compensation and lagging phase compensation. The leading and lagging ranges of the phase compensation error constant are used to determine which sampling point is used as the standard point for calculation and the total number of sampling points required for calculation. The leading and lagging interpolation order units are automatically adjusted according to the position of the standard point, the phase compensation error constant and the sampling period. The corresponding coefficients and sub-item data units of Newton interpolation are calculated in real time according to the position of the standard point, the interpolation order and the sampling value, and the Newton interpolation polynomial is synthesized to calculate the sampling value required after phase compensation.
[0075] According to one embodiment of the present invention, a discrete Fourier transform is performed on the current voltage value and the current current value using the following formula:
[0076]
[0077] Among them, F(k) represents the discrete Fourier transform result, f(n) represents the current voltage value or the current current value, It indicates the rotation factor of the fundamental wave or harmonic, which is preset according to the actual situation. N indicates the multiple of the fundamental wave.
[0078] Specifically, the current voltage value and current current value obtained by the front-end phase compensation and gain adjustment unit are Fourier transformed by the discrete Fourier transform unit. Assuming that the voltage data is Fourier transformed, the current voltage value is substituted into formula (1) to obtain the Fourier transform result F(k) in the form of a complex vector corresponding to the voltage data, and the corresponding real and imaginary values are obtained. If the current data is Fourier transformed, the current current value is substituted into formula (1) to obtain the Fourier transform result in the form of a complex vector corresponding to the current data and the values of the real and imaginary parts. It should be noted that when the current fundamental wave is determined, the corresponding harmonic is also determined.
[0079] S3, calculating and obtaining the harmonic voltage angle and the harmonic current angle according to the discrete Fourier transform result.
[0080] According to one embodiment of the present invention, calculating the harmonic voltage angle and the harmonic current angle based on the discrete Fourier transform result may include: obtaining the real part and imaginary part corresponding to the current voltage value and the real part and imaginary part corresponding to the current current value respectively according to the discrete Fourier transform result; using the CORDIC (Coordinate Rotation Digital Computer) algorithm to calculate the real part and imaginary part corresponding to the current voltage value and the current current value respectively, so as to obtain the harmonic voltage angle and the harmonic current angle.
[0081] Specifically, the real part and imaginary part corresponding to the current voltage value can be obtained according to the Fourier transform result calculated by the current voltage value input formula (1), and then the real part and imaginary part corresponding to the current voltage value are calculated by the CORDIC algorithm to obtain the harmonic voltage angle. The CORDIC algorithm only requires shift and addition and subtraction operations, and does not require division operations, which can greatly reduce the chip area and power consumption, and can also greatly improve the calculation accuracy and precision of the harmonic voltage angle and the harmonic current angle. If you want to obtain the harmonic current angle, the real part and imaginary part corresponding to the current current value obtained by the Fourier transform result are calculated by the CORDIC algorithm.
[0082] According to one embodiment of the present invention, the CORDIC algorithm is used to calculate the real part and the imaginary part corresponding to the current voltage value and the current current value respectively to obtain the harmonic voltage angle and the harmonic current angle, which may include: taking the real part and the imaginary part corresponding to the current voltage value or the current current value as the first iteration initial value; determining the rotation angle of each iteration according to the imaginary part corresponding to the current voltage value or the current current value; performing iterative calculation according to the first iteration initial value and the rotation angle of each iteration; when the imaginary part corresponding to the current voltage value or the current current value after iterative calculation approaches 0, determining the harmonic voltage angle or the harmonic current angle.
[0083] According to one embodiment of the present invention, the following formula is used for iterative calculation:
[0084]
[0085] Among them, x n+1 Represents the real part of the current voltage value or current value after n iterations, x n Represents the real part of the current voltage value or current value after n-1 iterations, n represents the number of iterations, y n+1 Represents the imaginary part of the current voltage value or current value after n iterations, y n Represents the imaginary part of the current voltage value or current value after iteration n-1 times, z n+1 It represents the harmonic voltage angle or harmonic current angle after n iterations, z n It represents the harmonic voltage angle or harmonic current angle after iteration n-1 times. represents the rotation angle of each iteration, s yn is the decision operator, where when y n >0, s yn =1, when y n <0, s yn =-1.
[0086] Specifically, the calculation of harmonic voltage angles and harmonic current angles requires the CORDIC algorithm to work in vector mode in a circular coordinate system. The pseudo-rotation equation of the CORDIC algorithm in this mode is formula (2). First, the CORDIC algorithm is specifically described by taking the harmonic voltage angle as an example. In the calculation process of the harmonic voltage angle, the current iteration initial value of the CORDIC algorithm is the real part and imaginary part of the current voltage value obtained through the Fourier transform result. Among them, the rotation angle of each iteration is related to the number of iterations, and the angle of each iteration can be the same or different. When performing iterative calculations, the corresponding rotation angle is extracted according to the number of iterations and substituted into formula (2) for calculation. For example, when performing the first iterative calculation, the real part x1 corresponding to the current voltage value is x0-s y0 ×(2 -0×y0), the imaginary part y1 corresponding to the current voltage value = y0 + s y0 ×(2 -0 ×x0), the harmonic voltage angle corresponding to the current voltage value Among them, x1 represents the real part corresponding to the current voltage value after 1 iteration, x0 represents the real part corresponding to the current voltage value (the initial value of the first iteration), y1 represents the imaginary part corresponding to the current voltage value after 1 iteration, y0 represents the imaginary part corresponding to the current voltage value (the initial value of the first iteration), z1 represents the harmonic voltage angle after 1 iteration, and z0=0 is the initial value of the harmonic voltage angle. The rotation angle for the initial iteration can be extracted from the preset value, s y0 is the decision operator. When y0>0, s y0 =1, when y0<0, s y0 =-1. At this time, it is determined whether y1 approaches 0. If y1 approaches 0, the iterative calculation is stopped. At this time, z1 is the harmonic voltage angle. Otherwise, the iterative calculation is continued until the calculated y1 is equal to 0. n+1 When it approaches 0, the iterative calculation stops. At this time, z n+1 is the harmonic voltage angle.
[0087] The steps for obtaining the harmonic current angle are the same as the above-mentioned calculation method of the harmonic voltage angle, and will not be repeated here.
[0088] S4, calculating the harmonic power factor according to the angle difference between the harmonic voltage angle and the harmonic current angle.
[0089] According to one embodiment of the present invention, calculating the harmonic power factor based on the angle difference between the harmonic voltage angle and the harmonic current angle may include: using a CORDIC algorithm to calculate the angle difference between the harmonic voltage angle and the harmonic current angle to obtain the harmonic power factor.
[0090] Specifically, the harmonic voltage angle and the harmonic current angle are obtained respectively through the above step 3, and their values are subtracted to obtain the angle difference between the harmonic voltage angle and the harmonic current angle. The power factor unit for calculating the harmonics using the CORDIC algorithm is connected to the unit for calculating the angle difference between the harmonic voltage and harmonic current angles. The power factor unit calculates the cosine value of the angle difference output by the angle difference unit using the CORDIC algorithm. The calculated cosine value of the angle difference between the harmonic voltage angle and the harmonic current angle is the corresponding harmonic power factor.
[0091] According to one embodiment of the present invention, the CORDIC algorithm is used to calculate the angle difference between the harmonic voltage angle and the harmonic current angle, which may include: obtaining the expansion factor of each iteration; using the inverse of the expansion factor of each iteration, the first set value and the angle difference between the harmonic voltage angle and the harmonic current angle as the second iteration initial value; determining the rotation angle of each iteration according to the angle difference between the harmonic voltage angle and the harmonic current angle; performing iterative calculation according to the second iteration initial value and the rotation angle of each iteration; when the angle difference between the harmonic voltage angle and the harmonic current angle after iterative calculation approaches 0, determining the harmonic power factor.
[0092] According to one embodiment of the present invention, the scaling factor k for each iteration is obtained by the following formula: m :
[0093]
[0094] Among them, cosβ i represents the rotation angle of the i-th iteration, m represents the number of iterations, i = 1, 2, ..., m. Rotation angle cosβ i It is pre-set and stored according to the actual situation. When calculating the scaling factor, the corresponding rotation angle is extracted and applied according to the number of iterations.
[0095] According to one embodiment of the present invention, the following formula is used for iterative calculation:
[0096]
[0097] Among them, x′ m+1 or y′ m+1 represents the harmonic power factor after m iterations, x′ m or y′ m represents the harmonic power factor after iteration m-1 times, z′ m+1 It represents the angle difference between the harmonic voltage angle and the harmonic current angle after m iterations, z′ m It represents the angle difference between the harmonic voltage angle and the harmonic current angle after iteration m-1 times, β m represents the rotation angle of each iteration, s zm represents the decision operator, where z′ m >0, s zm =1, when z′ m When <0, s zm =-1.
[0098] Specifically, the CORDIC algorithm generates a scaling factor to simplify the calculation. Since each iteration of the pseudo-rotation equation will produce a proportional change, the corresponding scaling factor for each iteration is calculated using the product formula of formula (3). For example, when performing the first iteration, the scaling factor k n In the calculation formula (3), m = 1, and the scaling factor of the first iteration is k1 = 1 / cosβ i The second iteration initial value includes the inverse of the first iteration expansion factor 1 / k1, the first set value y0 and the angle difference z′0 between the harmonic voltage and the harmonic current angle. Then, the second iteration initial value and the preset iteration rotation angle β0 are substituted into formula (4) for iterative calculation. At this time, after one iteration, x′1=x′0-s z0 ×(2 -0 ×y′0),y′1=y′0-s z0 ×(2 -0 ×x′0),z′1=z′0-s z0 ×(2 -0 ×β0), where x0=1 / k1, y0=0 is the first setting value, z′0=the angle difference between the harmonic voltage angle and the harmonic current angle, s y0 is the decision operator. If z′0>0, s y0 =1, when z′0<0, s y0 =-1. Determine whether z′1 approaches 0. If z′1 approaches 0, stop iterative calculation and determine the harmonic power factor. Otherwise, continue iterative calculation until the angle difference z′ between the harmonic voltage and harmonic current angles is m+1 When it approaches 0, the iterative calculation is stopped and the harmonic power factor is determined.
[0099] According to one embodiment of the present invention, the harmonic power factor calculation method of the electric energy metering chip further includes: determining the harmonic power factor according to the quadrant where the angle difference between the harmonic voltage angle and the harmonic current angle is located. The corresponding relationship between the quadrant where the angle difference between the harmonic voltage angle and the harmonic current angle is located and the value of the harmonic power factor is preset according to actual application.
[0100] Specifically, the plane rectangular coordinate system is divided into four quadrants through the four areas divided by the horizontal axis and the vertical axis. The quadrant is centered on the origin, with the x and y axes as dividing lines. The upper right is the first quadrant, the upper left is the second quadrant, the lower left is the third quadrant, and the lower right is the fourth quadrant. The correspondence between the angle difference between the harmonic voltage angle and the harmonic current angle and the quadrant is preset. It is assumed that the angle difference range corresponding to the first quadrant is (0°, 90°], the angle difference range corresponding to the second quadrant is (90°, 180°], the angle difference range corresponding to the third quadrant is (180°, 270°], and the angle difference range corresponding to the fourth quadrant is (270°, 360°). When the angle difference is in the first quadrant, the harmonic power factor is x′ m+1 , when the angle difference is in the second quadrant, the harmonic power factor is x′ m+1 Negate -x′ m+1 , when the angle difference is in the third quadrant, the harmonic power factor is y′ m+1 , when the angle difference is in the fourth quadrant, the harmonic power factor is y′ m+1 Negation is -y′ m+1 At this time, the final harmonic power factor can be determined based on the quadrant of the angle difference actually calculated.
[0101] In summary, the harmonic power factor calculation method of the electric energy metering chip of the embodiment of the present invention utilizes the characteristics of discrete Fourier transform and CORDIC algorithm to realize real-time and efficient measurement of fundamental wave and harmonic power factors. The CORDIC algorithm only requires shift and addition and subtraction operations, and does not require division operations, which greatly reduces the chip area and power consumption. Moreover, the calculation method does not require division operations during the calculation of the harmonic power factor, avoiding the technical problem that the division operation is difficult to achieve high-precision calculation due to its own characteristics. In addition, the above-mentioned harmonic power factor can be output to the output data cache unit for storage for use in subsequent links.
[0102] In summary, according to the harmonic power factor calculation method of the electric energy metering chip according to the embodiment of the present invention, first, the current voltage value and the current current value are obtained, and then the current voltage value and the current current value are subjected to discrete Fourier transform to obtain the discrete Fourier transform result, and then the harmonic voltage angle and the harmonic current angle are calculated according to the discrete Fourier transform result, and finally, the harmonic power factor is calculated according to the angle difference between the harmonic voltage angle and the harmonic current angle. Thus, the method realizes real-time and efficient measurement of the harmonic power factor, and effectively improves the calculation precision and accuracy of each harmonic power factor.
[0103] Corresponding to the above-mentioned embodiment, the present invention further proposes a harmonic power factor calculation device for an electric energy metering chip.
[0104] like Figure 2As shown, the harmonic power factor calculation device of the electric energy metering chip according to the embodiment of the present invention may include: an acquisition module 10 , a conversion module 20 , a first calculation module 30 and a second calculation module 40 .
[0105] Among them, the acquisition module 10 is used to obtain the current voltage value and the current current value. The transformation module 20 is used to perform discrete Fourier transform on the current voltage value and the current current value to obtain a discrete Fourier transform result. The first calculation module 30 is used to calculate the harmonic voltage angle and the harmonic current angle according to the discrete Fourier transform result. The second calculation module 40 is used to calculate the harmonic power factor according to the angle difference between the harmonic voltage angle and the harmonic current angle.
[0106] According to one embodiment of the present invention, the transformation module 20 performs discrete Fourier transform on the current voltage value and the current current value using the following formula:
[0107]
[0108] Among them, F(k) represents the discrete Fourier transform result, f(n) represents the current voltage value or the current current value, Indicates the rotation factor of the fundamental wave or harmonic, and N indicates the multiple of the fundamental wave.
[0109] According to one embodiment of the present invention, the first calculation module 30 calculates the harmonic voltage angle and the harmonic current angle according to the discrete Fourier transform result, and is specifically used to: obtain the real part and imaginary part corresponding to the current voltage value and the real part and imaginary part corresponding to the current current value according to the discrete Fourier transform result; use the CORDIC algorithm to calculate the real part and imaginary part corresponding to the current voltage value and the current current value respectively, so as to obtain the harmonic voltage angle and the harmonic current angle.
[0110] According to one embodiment of the present invention, the first calculation module 30 uses the CORDIC algorithm to calculate the real part and the imaginary part corresponding to the current voltage value and the current current value respectively to obtain the harmonic voltage angle and the harmonic current angle, and is specifically used for: taking the real part and the imaginary part corresponding to the current voltage value or the current current value as the first iteration initial value; determining the rotation angle of each iteration according to the imaginary part corresponding to the current voltage value or the current current value; performing iterative calculation according to the first iteration initial value and the rotation angle of each iteration; when the imaginary part corresponding to the current voltage value or the current current value after iterative calculation approaches 0, determining the harmonic voltage angle or the harmonic current angle.
[0111] According to one embodiment of the present invention, the first calculation module 30 uses the following formula to perform iterative calculation:
[0112] x n+1 =x n -s yn ×(2-n ×y n )
[0113] y n+1 =y n +s yn ×(2 -n × n )
[0114]
[0115] Among them, x n+1 Represents the real part of the current voltage value or current value after n iterations, x n Represents the real part of the current voltage value or current value after n-1 iterations, n represents the number of iterations, y n+1 Represents the imaginary part of the current voltage value or current value after n iterations, y n Represents the imaginary part of the current voltage value or current value after iteration n-1 times, z n+1 It represents the harmonic voltage angle or harmonic current angle after n iterations, z n It represents the harmonic voltage angle or harmonic current angle after iteration n-1 times. represents the rotation angle of each iteration, s yn is the decision operator, where when y n >0, s yn =1, when y n When <0, s yn =-1.
[0116] According to one embodiment of the present invention, the second calculation module 40 calculates the harmonic power factor based on the angle difference between the harmonic voltage angle and the harmonic current angle, and is specifically used to: use the CORDIC algorithm to calculate the angle difference between the harmonic voltage angle and the harmonic current angle to obtain the harmonic power factor.
[0117] According to one embodiment of the present invention, the second calculation module 40 uses the CORDIC algorithm to calculate the angle difference between the harmonic voltage angle and the harmonic current angle, and is specifically used to: obtain the expansion factor of each iteration; use the inverse of the expansion factor of each iteration, the first set value and the angle difference between the harmonic voltage angle and the harmonic current angle as the second iteration initial value; determine the rotation angle of each iteration according to the angle difference between the harmonic voltage angle and the harmonic current angle; perform iterative calculation according to the second iteration initial value and the rotation angle of each iteration; when the angle difference between the harmonic voltage angle and the harmonic current angle after iterative calculation approaches 0, determine the harmonic power factor.
[0118] According to one embodiment of the present invention, the second calculation module 40 obtains the scaling factor k of each iteration by the following formula:m :
[0119]
[0120] Among them, cosβ i represents the rotation angle of the i-th iteration, m represents the number of iterations, i = 1, 2, …, m.
[0121] According to one embodiment of the present invention, the second calculation module 40 uses the following formula to perform iterative calculation:
[0122] x′ m+1 = x′ m -s zm ×(2 -m ×y′ m )
[0123] y′ m+1 =y′ m +s zm ×(2 -m ×x′ m )
[0124] z′ m+1 = z′ m -s zm ×β m
[0125] Among them, x′ m+1 or y′ m+1 represents the harmonic power factor after m iterations, x′ m or y′ m represents the harmonic power factor after iteration m-1 times, z′ m+1 It represents the angle difference between the harmonic voltage angle and the harmonic current angle after m iterations, z′ m It represents the angle difference between the harmonic voltage angle and the harmonic current angle after iteration m-1 times, β m represents the rotation angle of each iteration, s zm represents the decision operator, where z′ m >0, s zm =1, when z′ m When <0, s zm =-1.
[0126] According to an embodiment of the present invention, the second calculation module 40 is further used to determine the harmonic power factor according to the quadrant where the angle difference between the harmonic voltage angle and the harmonic current angle is located.
[0127] According to an embodiment of the present invention, the harmonic power factor calculation device of the electric energy metering chip may further include: a processing module for performing phase compensation and gain adjustment processing on the current voltage value and the current current value.
[0128] It should be noted that for details not disclosed in the harmonic power factor calculation device of the electric energy metering chip in the embodiment of the present invention, please refer to the details disclosed in the harmonic power factor calculation method of the electric energy metering chip in the above embodiment of the present invention, and the details will not be repeated here.
[0129] According to the harmonic power factor calculation device of the electric energy metering chip of the embodiment of the present invention, the current voltage value and the current current value are obtained by the acquisition module, the current voltage value and the current current value are subjected to discrete Fourier transformation by the transformation module to obtain the discrete Fourier transformation result, and the harmonic voltage angle and the harmonic current angle are calculated by the first calculation module according to the discrete Fourier transformation result, and the second calculation module calculates the harmonic power factor according to the angle difference between the harmonic voltage angle and the harmonic current angle. Thus, the device realizes real-time and efficient measurement of the harmonic power factor, and effectively improves the calculation precision and accuracy of each harmonic power factor.
[0130] Corresponding to the above embodiment, the present invention also proposes a computer-readable storage medium.
[0131] According to the computer-readable storage medium of the embodiment of the present invention, a harmonic power factor calculation program of the electric energy metering chip is stored thereon, and when the harmonic power factor calculation program of the electric energy metering chip is executed by the processor, the harmonic power factor calculation method of the electric energy metering chip described above is implemented.
[0132] According to the computer-readable storage medium of an embodiment of the present invention, the harmonic power factor calculation method of the above-mentioned electric energy metering chip is implemented by executing the harmonic power factor calculation program of the electric energy metering chip, thereby realizing real-time and efficient measurement of the harmonic power factor, and effectively improving the calculation precision and accuracy of each harmonic power factor.
[0133] Corresponding to the above embodiments, the present invention also proposes an electric energy metering chip.
[0134] like Figure 3 As shown, the electric energy metering chip 100 of the embodiment of the present invention may include a memory 110, a processor 120, and a harmonic power factor calculation program of the electric energy metering chip stored in the memory 110 and executable on the processor 120. When the processor 120 executes the harmonic power factor calculation program of the electric energy metering chip, the above-mentioned harmonic power factor calculation method of the electric energy metering chip is implemented.
[0135] According to the electric energy metering chip of the embodiment of the present invention, when the processor executes the harmonic power factor calculation program of the electric energy metering chip, the harmonic power factor calculation method of the above-mentioned electric energy metering chip realizes real-time and efficient measurement of the harmonic power factor, and effectively improves the calculation precision and accuracy of each harmonic power factor.
[0136] It should be noted that the logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be specifically implemented 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 purposes 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 portion with one or more wirings (electronic device), 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), an optical fiber 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, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.
[0137] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: 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.
[0138] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" 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 may be combined in any one or more embodiments or examples in a suitable manner.
[0139] 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 the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0140] In the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements, unless otherwise clearly defined. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0141] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.
Claims
1. A method for calculating harmonic power factor of an electric energy metering chip, characterized in that: include: Get the current voltage value and current value; Performing a discrete Fourier transform on the current voltage value and the current current value to obtain a discrete Fourier transform result; Calculate the harmonic voltage angle and the harmonic current angle according to the discrete Fourier transform result; Calculating a harmonic power factor based on an angle difference between the harmonic voltage angle and the harmonic current angle; Calculating the harmonic power factor according to the angle difference between the harmonic voltage angle and the harmonic current angle includes: The CORDIC algorithm is used to calculate the angle difference between the harmonic voltage angle and the harmonic current angle to obtain the harmonic power factor. The angle difference between the harmonic voltage angle and the harmonic current angle is calculated using a CORDIC algorithm, including: Get the scaling factor for each iteration; The reciprocal of the stretch factor of each iteration, the first set value, and the angle difference between the harmonic voltage angle and the harmonic current angle are used as the second iteration initial value; Determining a rotation angle for each iteration according to an angle difference between the harmonic voltage angle and the harmonic current angle; Performing iterative calculation according to the second iteration initial value and the rotation angle of each iteration; When the angle difference between the iteratively calculated harmonic voltage angle and the harmonic current angle approaches 0, the harmonic power factor is determined.
2. The method for calculating the harmonic power factor of the electric energy metering chip according to claim 1, characterized in that: The current voltage value and the current current value are subjected to discrete Fourier transform using the following formula: Wherein, F(k) represents the discrete Fourier transform result, f(n) represents the current voltage value or the current current value, represents the rotation factor of the fundamental wave or harmonic, and N represents the multiple of the fundamental wave.
3. The method for calculating harmonic power factor of an electric energy metering chip according to claim 1, characterized in that: The harmonic voltage angle and the harmonic current angle are calculated based on the discrete Fourier transform result, including: According to the discrete Fourier transform result, respectively obtain the real part and the imaginary part corresponding to the current voltage value and the real part and the imaginary part corresponding to the current current value; The CORDIC algorithm is used to calculate the real part and the imaginary part corresponding to the current voltage value and the current current value respectively, so as to obtain the harmonic voltage angle and the harmonic current angle.
4. The method for calculating the harmonic power factor of the electric energy metering chip according to claim 3, characterized in that: The real part and the imaginary part corresponding to the current voltage value and the current current value are calculated respectively by using the CORDIC algorithm to obtain the harmonic voltage angle and the harmonic current angle, including: Taking the real part and the imaginary part corresponding to the current voltage value or the current current value as the first iteration initial value; Determine the rotation angle of each iteration according to the imaginary part corresponding to the current voltage value or the current current value; Performing iterative calculation according to the first iteration initial value and the rotation angle of each iteration; When the imaginary part corresponding to the current voltage value or the current current value after iterative calculation approaches 0, the harmonic voltage angle or the harmonic current angle is determined.
5. The method for calculating harmonic power factor of an electric energy metering chip according to claim 4, characterized in that: The following formula is used for iterative calculation: x n+1 =x n -s yn ×(2 -n ×y n ) and n+1 =and n +s yn ×(2 -n ×x n ) Among them, x n+1 represents the real part of the current voltage value or the current current value after n iterations, x n represents the real part of the current voltage value or the current current value after n-1 iterations, n represents the number of iterations, y n+1 represents the imaginary part of the current voltage value or the current current value after n iterations, y n represents the imaginary part of the current voltage value or the current current value after iteration n-1 times, z n+1 represents the harmonic voltage angle or the harmonic current angle after n iterations, z n represents the harmonic voltage angle or the harmonic current angle after iteration n-1 times, represents the rotation angle of each iteration, s yn is the decision operator, where when y n >0, s yn =1, when y n When <0, s yn =-1.
6. The method for calculating harmonic power factor of an electric energy metering chip according to claim 1, characterized in that: The scaling factor k for each iteration is obtained by the following formula: m : Among them, cosβ i represents the rotation angle of the i-th iteration, m represents the number of iterations, i = 1, 2, …, m.
7. The method for calculating harmonic power factor of an electric energy metering chip according to claim 6, characterized in that: The following formula is used for iterative calculation: x′ m+1 =x′ m -s zm ×(2 -m ×y′ m ) and' m+1 =y′ m +s zm ×(2 -m ×x′ m ) z′ m+1 =z′ m -s zm ×β m Among them, x′ m+1 or y′ m+1 represents the harmonic power factor after m iterations, x′ m or y′ m represents the harmonic power factor after iteration m-1 times, z′ m+1 represents the angle difference between the harmonic voltage angle and the harmonic current angle after m iterations, z′ m represents the angle difference between the harmonic voltage angle and the harmonic current angle after iteration m-1 times, β m represents the rotation angle of each iteration, s zm represents the decision operator, where z′ m >0, s zm =1, when z′ m When <0, s zm =-1.
8. The method for calculating harmonic power factor of an electric energy metering chip according to claim 7, characterized in that: Also includes: The harmonic power factor is determined according to the quadrant in which the angle difference between the harmonic voltage angle and the harmonic current angle is located.
9. The method for calculating harmonic power factor of an electric energy metering chip according to claim 1, characterized in that: Before performing discrete Fourier transform on the current voltage value and the current current value, the method further includes: Phase compensation and gain adjustment processing are performed on the current voltage value and the current current value.
10. A harmonic power factor calculation device for an electric energy metering chip, characterized in that: include: An acquisition module is used to obtain the current voltage value and the current current value; A transformation module, used for performing a discrete Fourier transform on the current voltage value and the current current value to obtain a discrete Fourier transform result; A first calculation module, used for calculating and obtaining harmonic voltage angles and harmonic current angles according to the discrete Fourier transform result; A second calculation module, used for calculating the harmonic power factor according to the angle difference between the harmonic voltage angle and the harmonic current angle; The second calculation module calculates the harmonic power factor according to the angle difference between the harmonic voltage angle and the harmonic current angle, and is specifically used to: The CORDIC algorithm is used to calculate the angle difference between the harmonic voltage angle and the harmonic current angle to obtain the harmonic power factor. The second calculation module uses the CORDIC algorithm to calculate the angle difference between the harmonic voltage angle and the harmonic current angle, specifically for: Get the scaling factor for each iteration; The reciprocal of the stretch factor of each iteration, the first set value, and the angle difference between the harmonic voltage angle and the harmonic current angle are used as the second iteration initial value; Determining a rotation angle for each iteration according to an angle difference between the harmonic voltage angle and the harmonic current angle; Performing iterative calculation according to the second iteration initial value and the rotation angle of each iteration; When the angle difference between the iteratively calculated harmonic voltage angle and the harmonic current angle approaches 0, the harmonic power factor is determined.
11. The harmonic power factor calculation device of the electric energy metering chip according to claim 10, characterized in that: The transformation module performs discrete Fourier transform on the current voltage value and the current current value using the following formula: Wherein, F(k) represents the discrete Fourier transform result, f(n) represents the current voltage value or the current current value, represents the rotation factor of the fundamental wave or harmonic, and N represents the multiple of the fundamental wave.
12. The harmonic power factor calculation device of the electric energy metering chip according to claim 10, characterized in that: The first calculation module calculates the harmonic voltage angle and the harmonic current angle according to the discrete Fourier transform result, and is specifically used for: According to the discrete Fourier transform result, respectively obtain the real part and the imaginary part corresponding to the current voltage value and the real part and the imaginary part corresponding to the current current value; The CORDIC algorithm is used to calculate the real part and the imaginary part corresponding to the current voltage value and the current current value respectively, so as to obtain the harmonic voltage angle and the harmonic current angle.
13. The harmonic power factor calculation device of the electric energy metering chip according to claim 12, characterized in that: The first calculation module uses the CORDIC algorithm to calculate the real part and the imaginary part corresponding to the current voltage value and the current current value respectively to obtain the harmonic voltage angle and the harmonic current angle, which is specifically used for: Taking the real part and the imaginary part corresponding to the current voltage value or the current current value as the first iteration initial value; Determine the rotation angle of each iteration according to the imaginary part corresponding to the current voltage value or the current current value; Performing iterative calculation according to the first iteration initial value and the rotation angle of each iteration; When the imaginary part corresponding to the current voltage value or the current current value after iterative calculation approaches 0, the harmonic voltage angle or the harmonic current angle is determined.
14. The harmonic power factor calculation device of the electric energy metering chip according to claim 13, characterized in that: The first calculation module uses the following formula for iterative calculation: x n+1 =x n -s yn ×(2 -n ×y n ) and n+1 =and n +s yn ×(2 -n ×x n ) Among them, x n+1 represents the real part of the current voltage value or the current current value after n iterations, x n represents the real part of the current voltage value or the current current value after n-1 iterations, n represents the number of iterations, y n+1 represents the imaginary part of the current voltage value or the current current value after n iterations, y n represents the imaginary part of the current voltage value or the current current value after iteration n-1 times, z n+1 represents the harmonic voltage angle or the harmonic current angle after n iterations, z n represents the harmonic voltage angle or the harmonic current angle after iteration n-1 times, represents the rotation angle of each iteration, s yn is the decision operator, where when y n >0, s yn =1, when y n When <0, s yn =-1.
15. The harmonic power factor calculation device of the electric energy metering chip according to claim 10, characterized in that: The second calculation module obtains the scaling factor k for each iteration by the following formula: m : Among them, cosβ i represents the rotation angle of the i-th iteration, m represents the number of iterations, i = 1, 2, …, m.
16. The harmonic power factor calculation device of the electric energy metering chip according to claim 15, characterized in that: The second calculation module uses the following formula to perform iterative calculation: x′ m+1 =x′ m -s zm ×(2 -m ×y′ m ) and' m+1 =y′ m +s zm ×(2 -m ×x′ m ) z′ m+1 =z′ m -s zm ×β m Among them, x′ m+1 or y′ m+1 represents the harmonic power factor after m iterations, x′ m or y′ m represents the harmonic power factor after iteration m-1 times, z′ m+1 represents the angle difference between the harmonic voltage angle and the harmonic current angle after m iterations, z′ m represents the angle difference between the harmonic voltage angle and the harmonic current angle after iteration m-1 times, β m represents the rotation angle of each iteration, s zm represents the decision operator, where z′ m >0, s zm =1, when z′ m When <0, s zm =-1.
17. The harmonic power factor calculation device of the electric energy metering chip according to claim 16, characterized in that: The second calculation module is also used for: The harmonic power factor is determined according to the quadrant in which the angle difference between the harmonic voltage angle and the harmonic current angle is located.
18. The harmonic power factor calculation device of the electric energy metering chip according to claim 10, characterized in that: Also includes: The processing module is used to perform phase compensation and gain adjustment processing on the current voltage value and the current current value.
19. A computer-readable storage medium, characterized in that: A harmonic power factor calculation program of an electric energy metering chip is stored thereon, and when the harmonic power factor calculation program of the electric energy metering chip is executed by a processor, a harmonic power factor calculation method of an electric energy metering chip according to any one of claims 1-9 is implemented.
20. An electric energy metering chip, characterized in that: The invention comprises a memory, a processor and a harmonic power factor calculation program of an electric energy metering chip which is stored in the memory and can be run on the processor. When the processor executes the harmonic power factor calculation program of the electric energy metering chip, the harmonic power factor calculation method of the electric energy metering chip according to any one of claims 1 to 9 is implemented.
