New energy primary frequency modulation acquisition method and device based on autocorrelation frequency fitting
The autocorrelation function fitting method with a nonlinear least squares approach addresses the limitations of existing methods by providing accurate, robust, and timely frequency estimation in new energy stations, overcoming noise and signal type limitations.
Patent Information
- Application Number
- CN202411755740.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-03
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2044-12-03
AI Technical Summary
Existing methods for frequency estimation in new energy stations, such as Fast Fourier Transform (FFT) and zero-crossing detection, fail to meet the accuracy and computational efficiency requirements for grid frequency estimation due to limited frequency resolution, noise sensitivity, and applicability to a wide range of signal types.
A method and device using autocorrelation function fitting with a nonlinear least squares approach, combined with the Levenberg-Marquardt algorithm, to estimate power grid frequency, which includes digital-to-analog conversion, low-pass filtering, and autocorrelation function modeling to minimize a loss function for precise frequency estimation.
The method achieves high accuracy, robustness to noise and signal distortions, and rapid frequency calculation, enabling timely frequency tracking within a half-cycle (10ms) with improved precision.
Smart Images

Figure CN119246947A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of new energy power, and in particular relates to a new energy primary frequency modulation acquisition method and device based on autocorrelation frequency fitting. Background Art
[0002] In the primary frequency modulation system of new energy stations, accurate estimation of the grid frequency is the key to ensure system stability and efficiency. The sampling frequency of the power acquisition module of the general power system is below 9600Hz, and the grid frequency is mainly in the range of 45-55Hz. The current national standard for the frequency acquisition accuracy and rate of new energy primary frequency modulation and inertia response system are: 0.001Hz, 10ms; the primary frequency modulation system of new energy stations requires the frequency of the signal to be calculated within 100ms, with an accuracy of 0.001Hz.
[0003] Currently, the commonly used methods include Fast Fourier Transform (FFT) and zero-crossing detection, but both methods have some shortcomings.
[0004] The shortcomings of the Fast Fourier Transform FFT method are: 1. Frequency resolution: The frequency resolution of FFT is limited by the sampling rate and signal length, while the autocorrelation function fitting method is not limited by this. If the frequency is solved using the fast Fourier transform, the frequency resolution is: Δf=1 / T, where T is the total time length of the signal. That is, when the frequency accuracy requirement is 0.001Hz, a 1000-second signal is required, which does not meet the 10ms requirement; 2. Computational complexity: FFT has a low computational complexity, but it does not have an advantage when high precision is required.
[0005] The disadvantages of the zero-crossing detection method are: Noise resistance: The zero-crossing detection method is sensitive to noise and it is difficult to effectively filter out the influence of noise; Applicability: The zero-crossing detection method is only applicable to pure sine waves and is not applicable to a wider range of signal types. Summary of the invention
[0006] The present invention proposes a new energy primary frequency modulation acquisition method and device based on autocorrelation frequency fitting, which uses autocorrelation function to perform frequency fitting, can quickly solve the power grid frequency, has high accuracy, good robustness and strong timeliness.
[0007] To achieve the above object, the technical solution of the present invention is achieved as follows:
[0008] A new energy primary frequency modulation acquisition method based on autocorrelation frequency fitting, comprising: In the primary frequency regulation system of the new energy station, the three-phase current / voltage signal of the secondary side loop of the power grid is converted into digital-to-analog and low-pass filtered. The autocorrelation function of the current / voltage signal after low-pass filtering is described by the fitting model, and a loss function is constructed to represent the residual sum of squares between the autocorrelation function of the current / voltage signal and the fitting model. The nonlinear least squares method is used to minimize the loss function; the frequency obtained by the fitting model is used as the estimated power grid frequency.
[0009] Furthermore, the output current / voltage signal is defined as: ; Where y(t) represents the current / voltage sine wave signal; A represents the signal amplitude; f0 represents the original grid frequency; t represents the time offset of the signal, and its total time range is T; Indicates the initial phase of the signal; The autocorrelation function fitting model is defined as: ; Where R(t) represents the fitted value of the autocorrelation function at time offset t; represents the fitted signal amplitude; f represents the frequency to be estimated; represents the initial phase of the fitted model.
[0010] Furthermore, the loss function is: ;in Represents the value of the loss function; K represents the number of valid points of the autocorrelation function, and half a cycle of data 10ms is selected, K=96; R[k] represents the k-th point fitting value of the autocorrelation function.
[0011] Furthermore, the method of minimizing the loss function using the nonlinear least squares method includes: S101. Set the loss function formula of the nonlinear least squares method to: ;in ; ; x is the independent variable, i represents the i-th point of the effective point number K, is the independent variable at the i-th point; is the parameter vector; is the observed value at the i-th point, which is the current / voltage signal after low-pass filtering; S102, initialization parameters, selection of parameter vector The initial value of S103, calculate the residual vector r, ;in ; S104. Calculate the Jacobian matrix J. The elements of the matrix J are: ;in , They are and The first partial derivative of , represents the parameter vector The three parameters one; S105. Construct the canonical equation: , used to calculate the parameter update amount ; T represents matrix transpose; S106: Update parameters : ; Indicates the parameters before updating ; Indicates the updated parameters ; S107, check convergence conditions: If the parameter update amount If it is small enough, or the loss function changes less than the set threshold, the iteration is stopped; S108, iteration: repeat steps S103-S107 until the convergence condition is met.
[0012] Preferably, in step S106, the update rule is set as: ;in is the damping factor, which is used to control the update step size; I is the identity matrix; when the loss function decreases, it decreases ; When the loss function rises, increase .
[0013] On the other hand, the present invention also provides a new energy primary frequency modulation acquisition device based on autocorrelation frequency fitting, comprising: Conversion and filtering module: In the primary frequency modulation system of the new energy station, the three-phase current / voltage signal of the secondary side circuit of the power grid is converted into digital and low-pass filtered; Fitting model module: The current / voltage signal after low-pass filtering is described by the fitting model to describe the autocorrelation function; Loss function module: constructs a loss function to represent the residual sum of squares between the current / voltage signal autocorrelation function and the fitting model; Optimization module: Use nonlinear least squares method to minimize the loss function; Frequency module: The frequency obtained by fitting the model is used as the estimated grid frequency.
[0014] Further, the fitting model module includes: the output current / voltage signal is defined as: ; Where y(t) represents the current / voltage sine wave signal; A represents the signal amplitude; f0 represents the original grid frequency; t represents the time offset of the signal, and its total time range is T; Indicates the initial phase of the signal; The autocorrelation function fitting model is defined as: ; Where R(t) represents the fitted value of the autocorrelation function at time offset t; represents the fitted signal amplitude; f represents the frequency to be estimated; represents the initial phase of the fitted model.
[0015] Furthermore, the loss function module includes: the loss function is: ;in Represents the value of the loss function; K represents the number of valid points of the autocorrelation function, and half a cycle of data 10ms is selected, K=96; R[k] represents the k-th point fitting value of the autocorrelation function.
[0016] Furthermore, the optimization module includes: Setting unit: Set the loss function formula of the nonlinear least squares method as: ;in ; ; x is the independent variable, i represents the i-th point of the effective point number K, is the independent variable at the i-th point; is the parameter vector; is the observed value at the i-th point, which is the current / voltage signal after low-pass filtering; Initialization unit: Initialize parameters, select parameter vector The initial value of Residual vector unit: calculates the residual vector r, ;in ; Jacobian matrix unit: Calculate the Jacobian matrix J. The elements of matrix J are: ;in , They are and The first partial derivative of , represents the parameter vector The three parameters one; Regularization unit: Construct regularization equation: , used to calculate the parameter update amount ; T represents matrix transpose; Update unit: Update parameters : ; Indicates the parameters before updating ; Indicates the updated parameters ; Check unit: Check convergence conditions: If the parameter update amount If it is small enough, or the loss function changes less than the set threshold, the iteration is stopped; Iteration unit: performs iterations, repeating the operations from the residual vector unit to the check unit until the convergence condition is met.
[0017] Preferably, in the updating unit, the updating rule is set as: ;in is the damping factor, which is used to control the update step size; I is the identity matrix; when the loss function decreases, it decreases ; When the loss function rises, increase .
[0018] Compared with the prior art, the present invention has the following beneficial effects: 1. The present invention has high precision: by fitting the autocorrelation function, the frequency can be accurately estimated even in the case of large noise.
[0019] 2. The present invention has good robustness: it is insensitive to changes in the phase and amplitude of the signal and is suitable for incomplete or distorted signals.
[0020] 3. The present invention is time-effective: it can use only half a cycle of the signal and accurately calculate the signal frequency through rapid calculation, and can quickly track and capture the change of signal frequency, with strong timeliness. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 It is a schematic diagram of the process of Example 1 of the present invention.
[0022] Figure 2 It is a conversion and filtering schematic diagram of embodiment 1 of the present invention. DETAILED DESCRIPTION
[0023] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other.
[0024] In order to make the purpose and features of the present invention more obvious and understandable, the specific implementation methods of the present invention are further described below in conjunction with the accompanying drawings.
[0025] The present invention uses the autocorrelation function for frequency fitting, and only needs to use half a cycle, i.e., a 10ms sinusoidal wave electrical signal, and it takes less than 1ms to quickly solve the grid frequency; the nonlinear least squares method is used to minimize the loss function of the fitting function, and the Levenberg-Marquardt algorithm is combined to further minimize the loss function, thereby improving the frequency solution accuracy.
[0026] Embodiment 1: The specific steps of this embodiment are as follows: Figure 1 As shown, including: Step 1: Digital-to-analog conversion and pre-filtering.
[0027] In the primary frequency modulation system of the new energy station, the three-phase current / voltage signal of the secondary side circuit of the power grid passing through the voltage and current transformer is first converted into a digital signal by the analog-to-digital converter in the data acquisition module. The sampling frequency of the device is set to 9600Hz to achieve accurate sampling of the power grid frequency. Then, the noise signal with a frequency above 1550Hz is filtered out through a pre-low-pass filter. Since the converter and the low-pass filter are conventional modules, they will not be described in detail in this embodiment.
[0028] The three-phase current / voltage signal output after filtering is defined as follows (in the power system, the DC signal of the sine wave is ignored): ; y(t): current / voltage sine wave signal; A: signal amplitude, indicating the maximum value of the signal; : Grid frequency, generally around 50 Hz, refers to the original frequency in autocorrelation; t: the time offset of the signal, whose total time range is T; : Phase, indicating the initial phase of the signal.
[0029] Step 2: Define the autocorrelation function fitting model.
[0030] Define a fitting model to describe the autocorrelation function: ; R(t): The fitted value of the autocorrelation function at time offset t.
[0031] : The fitted signal amplitude, which indicates the maximum signal value of the fitted model. When the voltage is used to solve the frequency, it is set to the phase voltage rated value.
[0032] f: frequency to be estimated, the initial value is set to 50Hz.
[0033] : Fitted phase, indicating the initial phase of the fitted model.
[0034] Step 3: Define the loss function.
[0035] Define the loss function L, which represents the residual sum of squares between the autocorrelation function and the fitted model. The loss function can be expressed as: ; in: : The value of the loss function, which represents the residual sum of squares between the autocorrelation function and the fitted model.
[0036] K: the number of effective points of the autocorrelation function. The present invention selects half-cycle data, i.e., 10 ms, i.e., K=96.
[0037] : The k-th point fitting value of the autocorrelation function.
[0038] Step 4: Use nonlinear least squares to minimize the loss function.
[0039] In this optimization process, the model parameters need to be adjusted , in order to better fit the autocorrelation function. The present invention uses the nonlinear least squares method to fit the model parameters to minimize the residual sum of squares. Its goal is to find a set of parameters that minimizes the difference between the model prediction value and the actual observation value. The following are the specific steps of nonlinear least squares optimization: (1) Given a model , where x is the independent variable, is the parameter vector, and the observation value is y. The goal is to minimize the loss function , that is, the residual sum of squares: ; in: ; ; is the i-th observation value, i.e., the filtered current / voltage signal of step 1.
[0040] The model is The predicted value at .
[0041] K is the number of observations, that is, the number of effective points of the autocorrelation function. The present invention uses half a cycle of data, i.e., 10 ms, i.e., 96 effective points.
[0042] (2) Initialization parameters: Select the initial parameter vector =[current / voltage signal rated value,50,0].
[0043] (3) Calculate the residual: Calculate the residual vector r, ;in .
[0044] (4) Calculate the Jacobian matrix: Calculate the Jacobian matrix J. The elements of the matrix J are: , , They are and The first-order partial derivative of . , represents the parameter vector The three parameters One of them; J is a 96*3 matrix.
[0045] (5) Construct the canonical equation: , used to calculate the parameter update amount ; Where T represents the matrix transpose.
[0046] (6) Update parameters .
[0047] In the optimization process, the Levenberg-Marquardt algorithm is introduced to further minimize the loss function. This algorithm combines the advantages of the gradient descent method and the Newton method by dynamically adjusting the damping factor. To control the update step size. The update rules are as follows: ; in: is the damping factor, which is used to control the update step size. The initial value can be set to 0.01.
[0048] I is the identity matrix.
[0049] J is the Jacobian matrix, which represents the partial derivatives of the model output with respect to the parameters.
[0050] When the loss function decreases, ; When the loss function rises, increase By dynamically adjusting ,The algorithm balances between gradient descent and Newton’s method to improve convergence speed and stability.
[0051] (7) Check convergence conditions: If the parameter update If the value is small enough or the loss function changes less than the set threshold, the iteration is stopped; the threshold can be set to 0.0001.
[0052] Otherwise, return to step (3).
[0053] (8) Iteration: Repeat (3)-(7) until the convergence condition is met.
[0054] Through these steps and formulas, the nonlinear least squares method can effectively fit the model parameters and minimize the loss function, thereby improving the prediction accuracy of the model.
[0055] Step 5: Extract frequencies.
[0056] Finally, the estimated frequency f is extracted from the optimization result. In this way, the accuracy of solving the frequency of a half-cycle sine wave signal can be effectively improved.
[0057] Through the above steps, the frequency of the current sine wave signal can be accurately estimated by using the autocorrelation function and nonlinear least squares method combined with the Levenberg-Marquardt algorithm. This method has broad application prospects in power systems, signal processing and other related fields. By introducing the optimization algorithm, we can still obtain reliable frequency estimation in the face of noise and incomplete signals.
[0058] Embodiment 2: In this embodiment 2, a new energy primary frequency modulation acquisition device based on autocorrelation frequency fitting is proposed, comprising: Conversion and filtering module: In the primary frequency modulation system of the new energy station, the three-phase current / voltage signal of the secondary side circuit of the power grid is converted into digital and low-pass filtered; Fitting model module: The current / voltage signal after low-pass filtering is described by the fitting model to describe the autocorrelation function; Loss function module: constructs a loss function to represent the residual sum of squares between the current / voltage signal autocorrelation function and the fitting model; Optimization module: Use nonlinear least squares method to minimize the loss function; Frequency module: The frequency obtained by fitting the model is used as the estimated grid frequency.
[0059] Wherein, the fitting model module includes: the output current / voltage signal is defined as: ; Where y(t) represents the current / voltage sine wave signal; A represents the signal amplitude; f0 represents the original grid frequency; t represents the time offset of the signal, and its total time range is T; Indicates the initial phase of the signal; The autocorrelation function fitting model is defined as: ; Where R(t) represents the fitted value of the autocorrelation function at time offset t; represents the fitted signal amplitude; f represents the frequency to be estimated; represents the initial phase of the fitted model.
[0060] The loss function module includes: the loss function is: ;in Represents the value of the loss function; K represents the number of valid points of the autocorrelation function, and half a cycle of data 10ms is selected, K=96; R[k] represents the k-th point fitting value of the autocorrelation function.
[0061] The optimization module includes: Setting unit: Set the loss function formula of the nonlinear least squares method as: ;in ; ; x is the independent variable, i represents the i-th point of the effective point number K, is the independent variable at the i-th point; is the parameter vector; is the observed value at the i-th point, which is the current / voltage signal after low-pass filtering; Initialization unit: Initialize parameters, select parameter vector The initial value of Residual vector unit: calculates the residual vector r, ;in ; Jacobian matrix unit: Calculate the Jacobian matrix J. The elements of matrix J are: ;in , They are and The first partial derivative of , represents the parameter vector The three parameters one; Regularization unit: Construct regularization equation: , used to calculate the parameter update amount ; T represents matrix transpose; Update unit: Update parameters : ; Indicates the parameters before updating ; Indicates the updated parameters ; Check unit: Check convergence conditions: If the parameter update amount If it is small enough, or the loss function changes less than the set threshold, the iteration is stopped; Iteration unit: performs iterations, repeating the operations from the residual vector unit to the check unit until the convergence condition is met.
[0062] In the update unit, the update rule is set as: ;in is the damping factor, which is used to control the update step size; I is the identity matrix; when the loss function decreases, it decreases ; When the loss function rises, increase .
[0063] The new energy primary frequency modulation acquisition device based on autocorrelation frequency fitting proposed in this embodiment 2 can realize the new energy primary frequency modulation acquisition method based on autocorrelation frequency fitting described in embodiment 1, and has the same technical effect as embodiment 1.
[0064] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A new energy primary frequency modulation acquisition method based on autocorrelation frequency fitting, characterized in that: include: In the primary frequency regulation system of the new energy station, the three-phase current / voltage signal of the secondary side loop of the power grid is converted into digital-to-analog and low-pass filtered. The autocorrelation function of the current / voltage signal output after low-pass filtering is described by the fitting model. A loss function is constructed to represent the residual sum of squares between the autocorrelation function of the current / voltage signal and the fitting model. The nonlinear least squares method is used to minimize the loss function. The frequency obtained by the fitting model is used as the estimated power grid frequency.
2. The new energy primary frequency modulation acquisition method based on autocorrelation frequency fitting according to claim 1 is characterized in that: The output current / voltage signal is defined as: ; Where y(t) represents the current / voltage sine wave signal; A represents the signal amplitude; f0 represents the original grid frequency; t represents the time offset of the signal, and its total time range is T; Indicates the initial phase of the signal; The autocorrelation function fitting model is defined as: ; Where R(t) represents the fitted value of the autocorrelation function at time offset t; represents the fitted signal amplitude; f represents the frequency to be estimated; represents the initial phase of the fitted model.
3. The new energy primary frequency modulation acquisition method based on autocorrelation frequency fitting according to claim 2 is characterized in that: The loss function is: ;in Represents the value of the loss function; K represents the number of valid points of the autocorrelation function, and half a cycle of data 10ms is selected, K=96; R[k] represents the k-th point fitting value of the autocorrelation function.
4. The new energy primary frequency modulation acquisition method based on autocorrelation frequency fitting according to claim 3 is characterized in that: The method of minimizing the loss function using the nonlinear least squares method includes: S101. Set the loss function formula of the nonlinear least squares method to: ;in ; ; x is the independent variable, i represents the i-th point of the effective point number K, is the independent variable at the i-th point; is the parameter vector; is the observed value at the i-th point, which is the current / voltage signal after low-pass filtering; S102, initialization parameters, selection of parameter vector The initial value of S103, calculate the residual vector r, ;in ; S104. Calculate the Jacobian matrix J. The elements of the matrix J are: ;in , They are and The first partial derivative of , represents the parameter vector The three parameters one; S105. Construct the canonical equation: , used to calculate the parameter update amount ; T represents matrix transpose; S106: Update parameters : ; Indicates the parameters before updating ; Indicates the updated parameters ; S107, check convergence conditions: If the parameter update amount If it is small enough, or the loss function changes less than the set threshold, the iteration is stopped; S108, iteration: repeat steps S103-S107 until the convergence condition is met.
5. The new energy primary frequency modulation acquisition method based on autocorrelation frequency fitting according to claim 4 is characterized in that: In step S106, the update rule is set as: ;in is the damping factor, which is used to control the update step size; I is the identity matrix; when the loss function decreases, it decreases ; When the loss function rises, increase .
6. A new energy primary frequency modulation acquisition device based on autocorrelation frequency fitting, characterized in that: include: Conversion and filtering module: In the primary frequency modulation system of the new energy station, the three-phase current / voltage signal of the secondary side circuit of the power grid is converted into digital and low-pass filtered; Fitting model module: The current / voltage signal output after low-pass filtering is described by the fitting model to describe the autocorrelation function; Loss function module: constructs a loss function to represent the residual sum of squares between the current / voltage signal autocorrelation function and the fitting model; Optimization module: Use nonlinear least squares method to minimize the loss function; Frequency module: The frequency obtained by fitting the model is used as the estimated grid frequency.
7. The new energy primary frequency modulation acquisition device based on autocorrelation frequency fitting according to claim 6 is characterized in that: The fitting model module includes: the output current / voltage signal is defined as: ; Where y(t) represents the current / voltage sine wave signal; A represents the signal amplitude; f0 represents the original grid frequency; t represents the time offset of the signal, and its total time range is T; Indicates the initial phase of the signal; The autocorrelation function fitting model is defined as: ; Where R(t) represents the fitted value of the autocorrelation function at time offset t; represents the fitted signal amplitude; f represents the frequency to be estimated; represents the initial phase of the fitted model.
8. The new energy primary frequency modulation acquisition device based on autocorrelation frequency fitting according to claim 7 is characterized in that: The loss function module includes: the loss function is: ;in Represents the value of the loss function; K represents the number of valid points of the autocorrelation function, and half a cycle of data 10ms is selected, K=96; R[k] represents the k-th point fitting value of the autocorrelation function.
9. The new energy primary frequency modulation acquisition device based on autocorrelation frequency fitting according to claim 8 is characterized in that: The optimization module includes: Setting unit: Set the loss function formula of the nonlinear least squares method as: ;in ; ; x is the independent variable, i represents the i-th point of the effective point number K, is the independent variable at the i-th point; is the parameter vector; is the observed value at the i-th point, which is the current / voltage signal after low-pass filtering; Initialization unit: Initialize parameters, select parameter vector The initial value of Residual vector unit: calculates the residual vector r, ;in ; Jacobian matrix unit: Calculate the Jacobian matrix J. The elements of matrix J are: ;in , They are and The first partial derivative of , represents the parameter vector The three parameters one; Regularization unit: Construct regularization equation: , used to calculate the parameter update amount ; T represents matrix transpose; Update unit: Update parameters : ; Indicates the parameters before updating ; Indicates the updated parameters ; Check unit: Check convergence conditions: If the parameter update amount If it is small enough, or the loss function changes less than the set threshold, the iteration is stopped; Iteration unit: performs iterations, repeating the operations from the residual vector unit to the check unit until the convergence condition is met.
10. The new energy primary frequency modulation acquisition device based on autocorrelation frequency fitting according to claim 9, characterized in that: In the update unit, the update rule is set as: ;in is the damping factor, which is used to control the update step size; I is the identity matrix; when the loss function decreases, it decreases ; When the loss function rises, increase .
Citation Information
Patent Citations
Single ADC acquisition channel dynamic characteristic test method
CN107102255A
Least square fitting dynamic frequency measurement method
CN107271768A
Nonlinear fitting-based synchronous phasor measuring method
CN109283391A
Frequency estimation method for harmonic waves and inter-harmonic waves in power system
CN115015633A
Inertia level estimation method for high-proportion new energy novel power system
CN116484322A
Cited By
New energy primary frequency modulation frequency rapid calculation method and device based on HERMITE interpolation
CN119944739A
Semiconductor nonlinear output junction capacitance measurement method based on fitting iteration
CN120064915A
Flow calculation method for high-precision intelligent measurement and control valve under multi-parameter coordinated regulation and control
CN120740958A
