ATSE three-phase power supply phase calculation method based on Goertzel algorithm
By adopting a three-phase power supply phase calculation method based on Gozel algorithm in the dual power supply automatic conversion switch, the problem of frequency inaccurate in the existing technology in high harmonic environment is solved, and the accurate calculation of the three-phase power supply phase and the reliability of power switching is realized.
Patent Information
- Application Number
- CN202411720160.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-03-07
AI Technical Summary
The three-phase power phase calculation method on dual power automatic conversion switch products that are widely used in the market is difficult to ensure the accuracy of frequency in applications with large harmonic content.
The three-phase power supply phase calculation method based on the Gozel algorithm is adopted, and the AD data of the three-phase voltage is collected by the controller, the common variables of the Gozel algorithm are calculated, and the phase information is calculated, and the phase information of the three-phase power supply is obtained.
Accurate calculation of the three-phase power supply phase is achieved, accuracy and reliability in operations such as power switching, and the problem of inaccurate frequency in high harmonic environments of existing methods is solved.
Smart Images

Figure CN119577321A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of three-phase power supply phase calculation methods, and in particular to an ATSE three-phase power supply phase calculation method based on a Goertzel algorithm. Background Art
[0002] In the field of power systems, the phase calculation of three-phase power plays a vital role, especially for dual-power automatic transfer switches (ATSE), whose normal operation and performance improvement are closely related to it. Accurate calculation of the phase of three-phase power is one of the key factors to ensure that ATSE can achieve efficient and reliable power switching.
[0003] With the rapid development of modern industry towards automation and intelligence, as well as the continuous growth of society's demand for electricity and the increasing diversification of electrical equipment, the operating environment of the power system has become increasingly complex. Among them, the increase in harmonic content has become a prominent problem. The widespread application of various nonlinear loads in industrial production and daily life, such as variable frequency speed regulation equipment, rectifiers, arc furnaces, etc., continuously injects harmonic currents into the power system, resulting in increasingly complex harmonic content in the power grid.
[0004] The three-phase power phase calculation method currently widely used in dual power automatic transfer switch products on the market mostly adopts the zero-crossing method. This method is difficult to ensure frequency accuracy in applications with large harmonic content. Summary of the invention
[0005] In view of the shortcomings of the prior art, the present invention provides an ATSE three-phase power supply phase calculation method based on the Goertzel algorithm, which solves the problem that the three-phase power supply phase calculation method currently widely used in dual-power automatic transfer switch products on the market mostly adopts the zero-crossing method, which is difficult to ensure the frequency accuracy in applications with large harmonic content.
[0006] To achieve the above objectives, the present invention is implemented by the following technical solutions: an ATSE three-phase power supply phase calculation method based on the Goertzel algorithm comprises the following steps:
[0007] S1, collecting AD data of the three-phase voltage of the power supply at a fixed sampling rate through the sampling circuit of the controller;
[0008] S2, setting the initial frequency of frequency detection, the number of cycles k=1 and the number of samples per cycle N;
[0009] S3, calculate the common variables of Goertzel algorithm;
[0010] S4, resampling the AD data according to the set frequency;
[0011] S5, performing convolution operations on the resampled AD data in sequence;
[0012] S6. After calculating N sampling points of a period of data, the second step is performed to obtain Y containing the amplitude-frequency information at the target frequency. n ;
[0013] S7, according to Y n The real and imaginary parts of Y are calculated n Phase information of
[0014] S8. Calculate the phase information of the three phases in sequence, obtain the phase information of the three-phase power supply, and assist in control logic analysis.
[0015] Preferably, the commonly used variables for calculating the Goertzel algorithm in step S3 include Twiddle Factor
[0016] Preferably, the resampling operation in step S4 includes converting AD data with a fixed sampling rate according to a set frequency.
[0017] Preferably, the convolution operation formula in step S5 is:
[0018] Preferably, the second step calculation formula in step S6 is:
[0019] Preferably, the real part in step S7 is Y n_real , the imaginary part is Y n_imag , the calculation yields Y n The phase information formula is Y n_phase =tanh -1 (Y n_imag / Y n_real ).
[0020] Preferably, the Q kn is the value at time n, and is used to k(n-1) and Q k(n-2) The value of .
[0021] The present invention provides a method for calculating the phase of an ATSE three-phase power supply based on the Goertzel algorithm.
[0022] Beneficial effects:
[0023] 1. The present invention collects AD data of the three-phase voltage of the power supply, calculates the phase information of each phase in turn, obtains the phase information of the three-phase power supply, and then obtains the phase information of the three-phase power supply through data integration, thereby realizing a comprehensive grasp of the overall phase state of the three-phase power supply, providing accurate phase information for the control logic of ATSE, ensuring its accuracy and reliability in operations such as power switching, and solving the problem that the three-phase power supply phase calculation method currently widely used in dual-power automatic transfer switch products on the market mostly adopts the zero-crossing method, and this method is difficult to ensure the accuracy of the frequency in applications with large harmonic content.
[0024] 2. The present invention can be implemented by only collecting the AD value of the three-phase power supply, which greatly saves the cost and complexity of the hardware circuit, helps the automatic transfer switch calculate the frequency of the current power supply, further enriches the comprehensiveness of dual power supply detection, and improves the safety and reliability of the dual power supply automatic transfer switch. In addition, this method can be used for product upgrades at no cost, and only the software method needs to be updated.
[0025] 3. The present invention discards high-order harmonic information during the calculation process, which greatly simplifies the calculation process, ensures the rapidity of the algorithm, and only calculates the fundamental wave information, thereby reducing harmonic interference and improving the accuracy of frequency calculation. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 is a flow chart of the method of the present invention;
[0027] Figure 2 It is a circuit connection diagram of the present invention. DETAILED DESCRIPTION
[0028] The technical solution of the present invention will be described clearly and completely below in conjunction with the accompanying drawings of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0029] Example:
[0030] Please see attached Figure 1 , Attachment Figure 2 The embodiment of the present invention provides a method for calculating the phase of an ATSE three-phase power supply based on a Goertzel algorithm, comprising the following steps:
[0031] S1, collecting AD data of the three-phase voltage of the power supply at a fixed sampling rate through the sampling circuit of the controller;
[0032] S2, setting the initial frequency of frequency detection, the number of cycles k=1 and the number of samples per cycle N;
[0033] S3, calculate the common variables of Goertzel algorithm;
[0034] S4, resampling the AD data according to the set frequency;
[0035] S5, performing convolution operations on the resampled AD data in sequence;
[0036] S6. After calculating N sampling points of a period of data, the second step is performed to obtain Y containing the amplitude-frequency information at the target frequency. n ;
[0037] S7, according to Y n The real and imaginary parts of Y are calculated n Phase information of
[0038] S8. Calculate the phase information of the three phases in sequence, obtain the phase information of the three-phase power supply, and assist in control logic analysis.
[0039] Common variables used to calculate the Goertzel algorithm in step S3 include Twiddle Factor
[0040] The resampling operation in step S4 includes converting the AD data with a fixed sampling rate according to a set frequency.
[0041] The convolution operation formula in step S5 is:
[0042] The second operation formula in step S6 is:
[0043] The real part in step S7 is Y n_real , the imaginary part is Y n_imag , calculate Y n The phase information formula is Y n_phase =tanh -1 (Y n_imag / Y n_real ).
[0044] Q kn is the value at time n, and is used to k(n-1) and Q k(n-2) The value of .
[0045] Specifically, the sampling circuit of the controller collects AD data of the three-phase voltage of the power supply at a fixed sampling rate (e.g., 8KHz), thereby obtaining discrete sample values of the three-phase voltage of the power supply in the time domain. These sample values constitute the basic data for subsequent calculations, thereby realizing the digital collection of the three-phase voltage signal of the power supply, thereby providing raw data support for accurate phase calculation;
[0046] By setting the initial frequency of the frequency detection (such as 50Hz), the number of cycles (set to k = 1) and the number of samples per cycle (such as N = 64), these parameters can be reasonably set to ensure that the sampling data will not be missing within a certain frequency range (such as 70Hz), because there is a specific relationship between the sampling rate and the frequency and the number of samples (such as ), so as to effectively utilize sampling resources and avoid data redundancy or insufficiency while meeting the calculation accuracy requirements, thus laying the foundation for the subsequent accurate calculation of frequency and phase;
[0047] By calculating the common variables of Goertzel's algorithm, including Twiddle Factor By using trigonometric operations to calculate these variables, key parameters are provided for the convolution operation and frequency calculation in the Goertzel algorithm. These parameters reflect the mathematical relationship of the fundamental frequency in the algorithm, thereby converting complex frequency domain calculations into linear filtering operations based on these variables, thereby improving calculation efficiency and accuracy, and helping to reduce the impact of harmonic interference on phase calculations from the algorithm level;
[0048] The resampling operation includes converting the AD data of the fixed sampling rate (8KHz) according to the set frequency (such as 50Hz), and adopting a specific resampling algorithm (such as interpolation-based methods) to ensure that the number of sampling points in one cycle remains unchanged (such as setting the number of samples per cycle to 64), thereby re-adjusting the sampled data in the frequency domain to match the set frequency, thereby solving the calculation deviation problem caused by the possible mismatch between the fixed sampling rate and the actual power supply frequency, and ensuring that subsequent calculations are based on the accurate sampling data frequency;
[0049] By performing convolution operations on the resampled AD data in sequence, the convolution operation formula is: By performing weighted summation calculation on the adjacent sampling point data according to this formula, the Q at each moment can be gradually calculated. kn The value contains the information of the power signal at the fundamental frequency, so as to realize the extraction and calculation of the fundamental signal by utilizing the characteristics of the Goertzel algorithm, thereby improving the pertinence of the phase calculation to the fundamental information and reducing harmonic interference;
[0050] After calculating one cycle of data (N sampling points), the second step is performed. The formula is: By using the Q obtained by the first step of convolution operation kn The value is multiplied by the rotation factor and the corresponding operation is performed to obtain Y containing the amplitude-frequency information at the target frequency. n, which reflects the amplitude characteristics of the power signal at the target frequency (such as 50Hz), thus realizing the conversion from time domain data to frequency domain amplitude and frequency information, and providing the necessary intermediate data for the subsequent calculation of the phase;
[0051] By following Y n The real part Y n_real and the imaginary part Y n_imag (The real and imaginary parts are obtained by n The calculated phase information formula is Y n_phase =tanh -1 (Y n_imag / Y n_real ). By using the inverse tangent function to calculate the ratio of the real part to the imaginary part, we get Y n The phase angle on the complex plane further converts the amplitude-frequency information in the frequency domain into phase information, providing key data for ultimately determining the phase of the three-phase power supply;
[0052] By calculating the phase information of each of the three phases in sequence, the phase information of the three-phase power supply is obtained to assist in the control logic analysis. By repeating the above steps S1-S7 to independently calculate each phase of the three-phase power supply, accurate phase data of each of the three phases is obtained, and then the phase information of the three-phase power supply is obtained through data integration, thereby achieving a comprehensive grasp of the overall phase state of the three-phase power supply, providing accurate phase information for the control logic of the ATSE, ensuring its accuracy and reliability in operations such as power switching, and solving the problem that the three-phase power supply phase calculation method currently widely used in dual power automatic transfer switch products on the market mostly uses the zero-crossing method, which is difficult to ensure the accuracy of the frequency in applications with large harmonic content.
[0053] The following is further introduced in conjunction with specific embodiments:
[0054] Embodiment 1:
[0055] The Goertzel algorithm is an algorithm for calculating the discrete Fourier transform (DFT). The algorithm regards the discrete Fourier transform as a set of filters, performs convolution operations on the input signal and the impulse response in the filter, and obtains the output of the filter to obtain the frequency of a certain point in the frequency domain. The algorithm uses the periodicity of the rotation factor to convert the discrete Fourier transform into a linear filtering operation. The Goertzel algorithm only calculates the amplitude of individual known frequency points. The concept of "frequency point" is essentially the same as the frequency point in the Fourier transform, and the resolution and corresponding relationship of frequency recognition are also the same.
[0056] The detailed calculation process of the algorithm is as follows:
[0057] Define Q knis the value at time n, but Q is needed k(n-1) and Q k(n-2) It can be seen that this algorithm is continuously iteratively calculated.
[0058] At n = 0, Q k(n-1) Q k(-1) and Q k(-2) The initial value of both is 0.
[0059] Then use the second formula to calculate the value range of n, which is 0 to N.
[0060] Get Q kn After that, add a step of sequence position exchange. Specifically: Q k(n-2) =Q k(n-1) , Q k(n-1) =Q kn , then we can proceed to the next step of calculation, which is the calculation at time n+1.
[0061] After the Goertzel algorithm, the three-phase power supply can be obtained at the target frequency F last The frequency domain information is obtained, and then the phase deviation Δφ is calculated based on the frequency domain calculation result information of the two cycles. Based on the phase deviation Δφ, ΔF can be further obtained, thereby calculating the latest frequency information F=F last +ΔF.
[0062] The method flow chart is as follows Figure 1 The detailed description is as follows:
[0063] S1. First, the AD data of the three-phase voltage of the power supply is collected through the sampling circuit of the controller at a fixed sampling rate (e.g., 8KHz);
[0064] S2. Next, set the initial frequency of the frequency detection (e.g. 50 Hz), the number of cycles k = 1, and the number of samples per cycle N (e.g. 64). This ensures that the sampled data will not be missing within the 70 Hz frequency range.
[0065] S3. Calculate the common variables of Goertzel algorithm, such as Twiddle Factor
[0066] S4, resampling each sampling point, that is, converting the AD data with a fixed sampling rate according to the set frequency to ensure that the number of sampling points remains unchanged within one cycle;
[0067] S5. Perform convolution operations on the resampled AD data in sequence
[0068] S6. After calculating one cycle of data, i.e. N sampling points, the second step of operation is performed At this time Y n Contains amplitude-frequency information of the power signal at the target frequency;
[0069] S7, according to Y n The real part Y n_real and the imaginary part Y n_imag These two data can be further calculated to get Y n Phase information Y n_phase =tanh -1 (Y n_imag / Y n_real );
[0070] S8. Similarly, the phase information of the three phases can be obtained, and finally the data is sorted to obtain the phase information of the three-phase power supply to assist in control logic analysis.
[0071] This method is applied to Schneider Wango H-Plus controllers, which can meet the reliable detection of power supply frequency without adding additional hardware circuits, improve product comprehensiveness, safety, reliability, and shorten product development cycle.
[0072] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. The ATSE three-phase power supply phase calculation method based on the Goertzel algorithm is characterized in that: The following steps are involved: S1, collecting AD data of the three-phase voltage of the power supply at a fixed sampling rate through the sampling circuit of the controller; S2, setting the initial frequency of frequency detection, the number of cycles k=1 and the number of samples per cycle N; S3, calculate the common variables of Goertzel algorithm; S4, resampling the AD data according to the set frequency; S5, performing convolution operations on the resampled AD data in sequence; S6. After calculating N sampling points of a period of data, the second step is performed to obtain Y containing the amplitude-frequency information at the target frequency. n ; S7, according to Y n The real and imaginary parts of Y are calculated n Phase information of S8. Calculate the phase information of the three phases in sequence, obtain the phase information of the three-phase power supply, and assist in control logic analysis.
2. The ATSE three-phase power supply phase calculation method based on the Goertzel algorithm according to claim 1 is characterized in that: Common variables used to calculate the Goertzel algorithm in step S3 include Twiddle Factor 3. The ATSE three-phase power supply phase calculation method based on the Goertzel algorithm according to claim 1 is characterized in that: The resampling operation in step S4 includes converting the AD data with a fixed sampling rate according to a set frequency.
4. The ATSE three-phase power supply phase calculation method based on the Goertzel algorithm according to claim 1 is characterized in that: The convolution operation formula in step S5 is:
5. The ATSE three-phase power supply phase calculation method based on the Goertzel algorithm according to claim 1 is characterized in that: The second step calculation formula in step S6 is:
6. The ATSE three-phase power supply phase calculation method based on the Goertzel algorithm according to claim 1 is characterized in that: The real part in step S7 is Y n_real , the imaginary part is Y n_imag , the calculation yields Y n The phase information formula is Y n_phase =tanh -1 (Y n_imag / Y n_real ).
7. The ATSE three-phase power supply phase calculation method based on the Goertzel algorithm according to claim 4 is characterized in that: The Q kn is the value at time n, and is used to k(n-1) and Q k(n-2) The value of .