Harmonic impedance measuring method based on capacitor switching
The problem of background harmonic impedance measurement of capacitor cut-off is solved by using a robust LOWESS algorithm and smooth spline fitting method to process data, and the measurement accuracy is significantly improved.
Patent Information
- Application Number
- CN202510268771.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-07
- Publication Date
- 2025-06-27
AI Technical Summary
In actual power grids, background harmonics and noise will interfere with the measurement of harmonic impedance of capacitor cutout, seriously affecting the measurement accuracy.
The data processing method based on the robust LOWESS algorithm and smooth spline fitting method is adopted to reduce the voltage and current data before and after capacitor switching, notch processing and abnormal data correction, so as to improve the accuracy of harmonic impedance measurement.
Through the improved data processing method, the impact of background harmonic and noise on harmonic impedance measurement can be effectively reduced, the measurement accuracy can be improved, and the accuracy of the calculation of harmonic impedance characteristics can be ensured.
Smart Images

Figure CN120214416A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of harmonic impedance measurement, and particularly to a harmonic impedance measurement method based on capacitor switching. Background Art
[0002] With the popularization of power electronic devices and the large-scale access of nonlinear loads, the problem of harmonic pollution has become increasingly serious, posing challenges to the safe and stable operation of the entire power grid. To effectively control and manage harmonic pollution, the "harmonic reward and punishment mechanism" has been proposed internationally, which uses economic means to reward harmonic suppression parties and impose corresponding penalties on harmonic sources; China's "Electricity Law" also puts forward relevant regulations of "the polluter shall be responsible for treatment", and both power supply and power consumption parties only need to be responsible for the harmonic part they generate. The primary goal of quantifying and differentiating harmonic responsibilities is to evaluate the harmonic emission levels on the system side and the user side, and harmonic impedance is an important evaluation indicator. Therefore, accurately estimating harmonic impedance is of great significance.
[0003] Existing harmonic impedance estimation methods can be divided into two categories: "interventional methods" and "non-interventional methods". The main "non-interventional" methods include the fluctuation method, regression analysis method, independent random vector covariance method, etc., which use their own harmonic sources and measurable parameters to calculate the system harmonic impedance. Their measurement does not require changing the normal operation of the system, but has the disadvantage of low measurement accuracy. "Interventional" methods include harmonic current injection method, thyristor branch switching method, capacitor switching method, etc., which provide harmonic impedance measurement conditions by artificially generating disturbances in the system. Compared with the "non-interventional method", they are more reliable.
[0004] Capacitor switching is an important means and commonly used equipment for reactive power compensation in the power grid. The capacitor switching method for measuring harmonic impedance has received wide attention because of its small impact on the power grid and convenient operation. Some scholars use notch filters to preprocess waveforms to reduce the influence of spectral leakage, and then use wavelet analysis to reconstruct signals to remove noise interference. Other scholars use the Prony algorithm and TLS-ESPRIT algorithm respectively to extract transient harmonic components to calculate harmonic impedance, eliminating the influence of spectral leakage on measurement accuracy. There are also considerations of the influence of system noise on measurement accuracy, and the voltage and current signals are decomposed and reconstructed by db4 wavelet packets to calculate the harmonic impedance frequency characteristics. Or a Hamming window is used for time-domain windowing of the current and voltage signals after removing the 50Hz fundamental wave component, effectively suppressing the spectral leakage problem of the discrete Fourier transform; in the actual power grid, background harmonics and noise will interfere with the harmonic impedance measurement of capacitor switching, seriously affecting the measurement accuracy.
[0005] In summary, with the massive access of power electronic devices, the harmonic problem has become increasingly serious. Harmonic impedance estimation is the primary condition for harmonic assessment and harmonic control. The harmonic impedance measurement method based on capacitor switching has received attention because of its small impact on the power grid. However, in the actual power grid, the fundamental wave, background harmonics, and noise will cause interference to varying degrees, resulting in abnormal measurement data and seriously affecting the calculation accuracy. Summary of the Invention
[0006] The present invention provides a harmonic impedance measurement method based on capacitor switching. The present invention solves the problem that background harmonics and noise in the actual power grid will interfere with the harmonic impedance measurement of capacitor switching and seriously affect the measurement accuracy, and proposes a data processing method based on the robust LOWESS algorithm and the smoothing spline fitting method to improve the measurement data.
[0007] To achieve the above object, the technical solution adopted by the present invention is: a harmonic impedance measurement method based on capacitor switching, comprising the following steps:
[0008] Step 1: Obtain the voltage and current data at the common connection point before and after capacitor switching;
[0009] Step 2: Denoise the voltage and current data according to the Kalman filter principle;
[0010] Step 3: Use a notch filter to remove the fundamental wave and background harmonics of the voltage and current, perform a fast FFT decomposition, and calculate the harmonic impedance characteristics;
[0011] Step 4: Use the robust LOWESS algorithm to correct the abnormal data in the harmonic impedance measurement value;
[0012] Step 5: Use the smoothing spline fitting method to fit the global data.
[0013] As a further improvement of the present invention, the specific content of the above Step 1 is as follows:
[0014] Use PSCAD to build a simulation model, add 3rd, 5th, and 7th harmonic waves to simulate background harmonics, collect the voltage and current data at the common connection point before and after capacitor switching; and import the voltage and current data into MATLAB, and superimpose Gaussian white noise respectively.
[0015] As a further improvement of the present invention, the specific content of the above Step 2 includes the following steps:
[0016] Step 2.1: Construct a prediction equation for the system at time K with respect to time K-1:
[0017]
[0018] where, A is the state transformation matrix; B is the control matrix; is the prior estimate value at time K; U is the control variable; P is the error covariance matrix; Q is the system noise covariance matrix;
[0019] Step 2.2: Correct using the observed value at time K:
[0020]
[0021] Where, is the posterior estimate value at time K; H is the observation matrix; R is the noise covariance matrix; I is the identity matrix; K k is the Kalman gain.
[0022] As a further improvement of the present invention, step 3 specifically includes the following steps:
[0023] Step 3.1: Use a notch filter to eliminate the fundamental wave and background harmonics of the current and voltage, and its transfer function is:
[0024]
[0025] Step 3.2: Perform Fourier decomposition on the voltage and current data to calculate the harmonic impedance characteristics at the common coupling point; the Laplace equation after the capacitor is put into operation is:
[0026] U sd (s) = Z sd (s)I sd (s) + V(s)
[0027] Where, U sd is the equivalent power supply on the system side; Z sd is the equivalent impedance on the system side; I sd is the current flowing through the impedance on the system side; V is the voltage across the capacitor;
[0028] At other frequencies, short-circuit the equivalent voltage source on the system side, and the equivalent impedance at this time is:
[0029]
[0030] Where, I is the current generated by the capacitor.
[0031] As a further improvement of the present invention, step 4 specifically includes the following steps:
[0032] Step 4.1: For the data set {x n , y n}, n = 1, 2,..., η, set the window length to h and the robust iteration number to t;
[0033] Step 4.2: Use a cubic function to calculate the weight of each data point within the window: where x is the center point, x k is the sampling point within the window, d(x) is the farthest distance between the sampling point and the center point, and w k (x) is the weight of the sampling point relative to the center point;
[0034] Step 4.3: Use the weighted value w k (x) to perform a fitting estimation by the least squares method to obtain the fitting value at the center point n thus obtaining the initial fitting curve;
[0035] Step 4.4: Define the fitting residual as:
[0036] Step 4.5: Let s be the median of |e k |, and define another set of weights θ k as:
[0037] Step 4.6: Loop through Steps 4.3 - 4.5, use θ k to replace w k , and iterate t times to obtain the final fitting curve.
[0038] As a further improvement of the present invention, in Step 5, the smoothing spline adopts a cubic spline and is obtained through the following formula:
[0039]
[0040] where α is the penalty coefficient and g is the cubic spline function.
[0041] The beneficial effects of the present invention are:
[0042] The present invention takes into account the influence of background harmonics and noise in the actual power grid, and aims at the abnormal data in the harmonic impedance measurement value and the problem of large error from the theoretical value. A data processing method based on the robust LOWESS algorithm and the smoothing spline fitting method is introduced to further process the measurement data; by comparing the average relative errors of the harmonic impedance measurement values before and after improvement with the theoretical values, it can be seen that the calculation accuracy of the improved harmonic impedance characteristics is higher. Description of the Drawings
[0043] Figure 1 is the flowchart of the embodiment of the present invention;
[0044] Figure 2 is the simulation system model diagram in the embodiment of the present invention;
[0045] Figure 3 is the amplitude-frequency diagram of the system harmonic impedance before improvement under the simulation system model in the embodiment of the present invention;
[0046] Figure 4It is the system harmonic impedance phase-frequency diagram before improvement under the simulation system model in the embodiment of the present invention;
[0047] Figure 5 It is the flowchart of the data processing method in the embodiment of the present invention;
[0048] Figure 6 It is the system harmonic impedance amplitude-frequency diagram after improvement under the simulation system model in the embodiment of the present invention;
[0049] Figure 7 It is the system harmonic impedance phase-frequency diagram after improvement under the simulation system model in the embodiment of the present invention. Specific embodiments
[0050] The embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0051] Embodiment
[0052] As Figure 1 shown, a harmonic impedance measurement method based on capacitor switching includes the following steps:
[0053] S1: Obtain voltage and current data before and after capacitor switching;
[0054] S1 specifically includes the following steps:
[0055] S11: Use PSCAD to build a simulation model, add 3rd, 5th, and 7th harmonic to simulate background harmonics, and refer to Figure 2 , and collect the voltage and current data of the common connection point before and after capacitor switching;
[0056] S12: Import the voltage and current data into MATLAB and superimpose Gaussian white noise respectively.
[0057] S2: Denoise the voltage and current according to the Kalman filtering principle;
[0058] S2 specifically includes the following steps:
[0059] S21: Construct the prediction equation of the system at time K-1 for time K:
[0060]
[0061] where A is the state transformation matrix; B is the control matrix; is the prior estimate value at time K; U is the control variable; P is the error covariance matrix; Q is the system noise covariance matrix;
[0062] S22: Use the observed value at time K for correction:
[0063]
[0064] Among them, is the posterior estimate value at time K; H is the observation matrix; R is the noise covariance matrix; I is the identity matrix; K k is the Kalman gain.
[0065] S3: Use a notch filter to remove the fundamental voltage and current and background harmonics, perform a fast FFT decomposition, and calculate the harmonic impedance characteristics;
[0066] S3 specifically includes the following steps:
[0067] S31: Use a notch filter to remove the fundamental and background harmonics of the current and voltage, and its transfer function is:
[0068]
[0069] S32: Perform Fourier decomposition on the voltage and current data, and the harmonic impedance characteristics at the point of common coupling can be calculated. The Laplace equation after the capacitor is connected is:
[0070] U sd (s) = Z sd (s)I sd (s) + V(s)
[0071] Among them, U sd is the equivalent power supply on the system side; Z sd is the equivalent impedance on the system side; I sd is the current flowing through the impedance on the system side; V is the voltage across the capacitor.
[0072] It is usually considered that U sd only contains components at 50 Hz. Therefore, at other frequencies, the equivalent voltage source on the system side is short-circuited, and the equivalent impedance at this time is:
[0073]
[0074] Among them, I is the current generated by the capacitor.
[0075] S4: Use the robust LOWESS algorithm to correct the abnormal data in the harmonic impedance measurement value;
[0076] S4 specifically includes the following steps:
[0077] S41: For the data set {x n , y n}, n = 1, 2,..., η, set the window length to h and the robust iteration times to t;
[0078] S42: Use a cubic function to calculate the weight of each data point within the window: Among them, x is the center point, xk is the sampling point within the window, d(x) is the farthest distance between the sampling point and the center point, and w k (x) is the weight of the sampling point relative to the center point.
[0079] In addition, the weight function should satisfy that the weights of the data points outside the window are 0, which has no impact on the fitting;
[0080] S43: Use the weighted value w k (x) to perform fitting estimation through the least squares method to obtain the fitting value at the center point n thus obtaining the initial fitting curve;
[0081] S44: Define the fitting residual as:
[0082] S45: Let s be the median of |e k |, and define another set of weights θ k as:
[0083] S46: Repeatedly perform S43 - S45, using θ k to replace w k , and iterating t times is the final fitting curve.
[0084] S5: Use the smoothing spline fitting method to fit the global data;
[0085] S5 specifically includes the following steps:
[0086] The smoothing spline uses a cubic spline and is obtained through the following formula:
[0087]
[0088] where α is the penalty coefficient and g is the cubic spline function.
[0089] Based on Figure 2 the system model in, perform simulations to verify the effectiveness of the proposed method. In the simulation experiment, the background harmonic contents of the 3rd, 5th, and 7th times are 0.320%, 0.316%, and 0.774% respectively. By controlling the switching of capacitors through the circuit breaker, it is put into operation at 0.1 s, and the voltage and current at the PCC are recorded at a sampling frequency of 2 MHz and imported into MATLAB to superimpose 40 dB Gaussian white noise respectively.
[0090] Figures 3-4These are the amplitude-frequency and phase-frequency diagrams of the harmonic impedance before improvement measured under the simulation system model of the present invention, that is, only noise reduction, fundamental wave and background harmonic removal, and fast FFT calculation of harmonic impedance characteristics are performed, without performing S3-S4. It can be seen from the figure that the background harmonics and noise have a great interference on the harmonic impedance measurement: the notch filter has high requirements for the accuracy of the notch center frequency, and the 7th background harmonic is not removed, so the measured values of the amplitude and phase at 350 Hz are abnormal; in addition, there is still an obvious error between the measured value of the harmonic impedance after Kalman filtering noise reduction and the theoretical value.
[0091] Figure 5 This is the flow chart for processing abnormal data in the measured values of harmonic impedance;
[0092] Figures 6-7 These are the amplitude-frequency and phase-frequency diagrams of the improved harmonic impedance measured under the simulation system model of the present invention. It can be seen from the figure that the data processing method proposed by the present invention can effectively process abnormal values and reduce the influence of background harmonics and noise on harmonic impedance measurement in the actual power grid.
[0093] To more directly evaluate the effect of this improved method in harmonic impedance measurement, it is characterized by the average relative error between the measured values before and after improvement and the theoretical value. Since the theoretical phase value at 0 Hz under the simulation system model of the present invention is 0°, there is no relative error. Therefore, the average relative error of the amplitude from 0 Hz to 5000 Hz and the average phase error from 1 Hz to 5000 Hz are calculated and compared. A lower average relative error indicates higher measurement accuracy, as shown in Table 1.
[0094] Table 1 Comparison of measurement accuracies
[0095]
[0096] Table 1 further verifies that after the improvement by using the data processing method based on the robust LOWESS algorithm and the smoothing spline fitting method, the measurement accuracy of the system harmonic impedance is greatly improved.
[0097] The above-described embodiments only represent the specific implementation manners of the present invention. The description is relatively specific and detailed, but it should not be construed as a limitation on the scope of the patent of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present invention, several deformations and improvements can still be made, and these all belong to the protection scope of the present invention.
Claims
1. A method for measuring harmonic impedance based on capacitor switching, characterized in that: The following steps are involved: Step 1, obtaining voltage and current data at the common connection point before and after the capacitor is switched on; Step 2: De-noise the voltage and current data according to the Kalman filter principle; Step 3: Use a notch filter to trap the voltage and current fundamental wave and background harmonics, perform fast FFT decomposition, and calculate the harmonic impedance characteristics; Step 4: Use the robust LOWESS algorithm to correct abnormal data in the harmonic impedance measurement value; Step 5: Use smoothing spline fitting method to fit the global data.
2. The method for measuring harmonic impedance based on capacitor switching according to claim 1, characterized in that: The step 1 is specifically as follows: A simulation model was built using PSCAD, and the 3rd, 5th, and 7th harmonics were added to simulate background harmonics. The voltage and current data at the common connection point before and after the capacitor was switched on were collected. The voltage and current data were imported into MATLAB, and Gaussian white noise was superimposed on them respectively.
3. The method for measuring harmonic impedance based on capacitor switching according to claim 1, characterized in that: The step 2 specifically includes the following steps: Step 2.1, construct the prediction equation of the system at time K-1 to time K: P k - =AP k-l From T +Q Among them, A is the state transformation matrix; B is the control matrix; is the prior estimate at time K; U is the control variable; P is the error covariance matrix; Q is the system noise covariance matrix; Step 2.2: Use the observed value at time K for correction: K k =P k - H T (HP k - H T +R) -1 P k =(I-K k H)P k - in, is the posterior estimate at time K; H is the observation matrix; R is the noise covariance matrix; I is the identity matrix; K k is the Kalman gain.
4. The method for measuring harmonic impedance based on capacitor switching according to claim 3, characterized in that: The step 3 specifically comprises the following steps: Step 3.1: Use a notch filter to remove the fundamental wave and background harmonics of current and voltage. The transfer function is: Step 3.2: Perform Fourier decomposition on the voltage and current data to calculate the harmonic impedance characteristics at the common coupling point; the Laplace equation after the capacitor is added is: U sd (s)=Z sd (s)I sd (s)+V(s) Among them, U sd is the equivalent power supply on the system side; Z sd is the equivalent impedance on the system side; I sd is the current flowing through the system side impedance; V is the voltage across the capacitor; At other frequencies, the system equivalent voltage source is short-circuited, and the equivalent impedance is: Where I is the current generated by the capacitor.
5. The method for measuring harmonic impedance based on capacitor switching according to claim 4, characterized in that: The step 4 specifically comprises the following steps: Step 4.1: For the data set {x n ,y n }, n = 1, 2, ..., η, set the window length to h, and the number of robust iterations to t; Step 4.2: Use the cubic function to calculate the weight of each data point in the window: Where x is the center point, x k is the sampling point in the window, d(x) is the farthest distance between the sampling point and the center point, and w k (x) is the weight of the sampling point relative to the center point; Step 4.3: Using weighted value w k (x) The fitting value at the center point n is obtained by fitting estimation using the least squares method. Thus, the initial fitting curve is obtained; Step 4.4, define the fitting residual as: Step 4.5: Let s be |e k | median, define another set of weights θ k for: Step 4.6: Loop through steps 4.3 to 4.5, using θ k Instead of w k , and the final fitting curve is obtained after t iterations.
6. The method for measuring harmonic impedance based on capacitor switching according to claim 5, characterized in that: In step 5, the smoothing spline adopts a cubic spline, which is obtained by the following formula: Among them, α is the penalty coefficient and g is the cubic spline function.