Harmonic current detection method based on PSO improved fixed step length

By introducing the PSO algorithm and the variable step size mechanism of hyperbolic tangent function in the fixed step size LMS algorithm, the harmonic current detection method is improved, and the problems of high computational complexity, poor real-time performance and susceptible to noise interference in the prior art are solved, and high-precision, stability and wide-band harmonic detection capabilities are achieved.

CN119861218AInactive Publication Date: 2025-04-22ELECTRIC POWER SCI & RES INST OF STATE GRID TIANJIN ELECTRIC POWER CO +4
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202510354237.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-25
Publication Date
2025-04-22
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

When detecting high-order harmonic currents in complex harmonic environments, the prior art has high computational complexity, poor real-time performance, is susceptible to noise interference, and lacks wide-band harmonic detection capabilities.

Method used

The minimum mean square (LMS) algorithm based on particle swarm optimization (PSO) algorithm is used to improve the fixed step size minimum mean square (LMS) algorithm, combined with the variable step size mechanism of the hyperbolic tangent function, and a low-pass filter is embedded for adaptive harmonic current detection.

Benefits of technology

It significantly improves the sensitivity and adaptability of the algorithm in high-frequency bands and complex scenarios, improves detection accuracy and stability, and enhances anti-interference ability and broadband detection ability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119861218A_ABST
    Figure CN119861218A_ABST
Patent Text Reader

Abstract

The invention discloses a harmonic current detection method based on a PSO improved fixed step length. The harmonic current detection method comprises the following steps: S1, firstly, constructing an active power filter (APF) circuit model; s2, embedding a variable step size LMS algorithm based on a hyperbolic tangent function into the low-pass filter model established in the S1, and carrying out adaptive harmonic current detection; and S3, a PSO algorithm is adopted to optimize filtering parameters of the LMS algorithm in the S2. The harmonic current detection method not only solves challenges faced by higher harmonic detection in a novel power system, such as the problems of high calculation complexity, poor real-time performance, easy noise interference and the like, but also realizes rapid and accurate detection of the harmonic current by introducing an advanced adaptive filtering technology and an intelligent optimization algorithm, so that the detection accuracy of the harmonic current is improved. The method is of great significance in improving electric energy quality and guaranteeing stable operation of an electric power system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of power quality detection, and in particular to a harmonic current detection method based on PSO with improved fixed step length. Background Art

[0002] With the rapid development of modern power electronics technology, the application of power electronic devices in new power systems is becoming more and more extensive, such as wind power generation, solar power generation, electric vehicle charging stations, and various converters in smart grids. While these power electronic devices bring efficient and flexible power conversion, they also introduce a large amount of high-order harmonic currents due to their nonlinear characteristics. High-order harmonics not only cause grid voltage waveform distortion and affect power quality, but also may cause problems such as overheating of equipment in the power system, insulation aging, and protection malfunction. In severe cases, they even threaten the stable operation of the entire power system. The extensive use of new energy power generation equipment, especially power electronic devices such as inverters, has brought complex harmonic problems to the power grid. These power electronic devices will generate a large amount of harmonic currents during operation, and due to the intermittent and uncertain nature of new energy power generation, the harmonic components are more complex and changeable, containing harmonic components in various frequency bands from low frequency to high frequency. Most of the existing harmonic detection methods are designed for harmonics in specific frequency bands and lack the ability to detect broadband harmonics. The harmonic problem after a high proportion of new energy is connected, and its harmonic components cover a wide frequency range, so a method that can be applied to broadband harmonic detection is needed.

[0003] Traditionally, the detection of harmonic currents mainly relies on analog filters or methods based on Fourier transform. However, analog filters are complex to design and sensitive to frequency changes, making them difficult to adapt to rapidly changing harmonic environments. Although the Fourier transform-based method has high accuracy, it has a large amount of calculation and poor real-time performance, making it unsuitable for online real-time detection. For example, the fixed-step least mean square (LMS) algorithm, although it can detect harmonic currents to a certain extent, its detection capability and accuracy are not good when faced with a complex harmonic environment after a high proportion of new energy is connected. The fixed-step LMS algorithm is often difficult to converge to the true harmonic current value quickly and accurately when the harmonic components are complex and changeable, and is easily affected by noise interference, resulting in a decrease in detection accuracy.

[0004] The following related documents were found after searching: A method for adaptive harmonic current detection based on a fixed-step LMS algorithm embedded in a low-pass filter, which optimizes the iteration step size through a sparrow search algorithm (SSA) to reduce the total harmonic distortion rate. The difference between this application and the above documents is:

[0005] The present invention innovatively introduces the particle swarm optimization (PSO) algorithm into the improvement of the fixed-step LMS algorithm, and combines it with a variable step-size mechanism based on the hyperbolic tangent function, which significantly improves the sensitivity and adaptability of the algorithm in high-frequency bands and complex scenarios. In contrast, the prior art only uses a fixed-step LMS algorithm combined with a low-pass filter, and optimizes the iterative step size through SSA to reduce the total harmonic distortion rate, and does not involve the optimization of the variable step-size mechanism or other complex scenarios. Its technical route is relatively single and its adaptability is limited. In terms of application scenarios, the present invention deeply optimizes special scenarios such as high-frequency harmonic detection, DC power supply inversion in high-proportion new energy wind power scenarios, and low-frequency component interference, and has stronger scenario targeting. However, the prior art does not explicitly mention the optimization of specific scenarios (such as high-frequency harmonics or DC power supply inversion), and its method is more inclined to generality and lacks special adaptation to complex scenarios. In addition, the present invention significantly improves the detection accuracy and stability of the algorithm by combining the PSO algorithm with a variable step-size mechanism, especially showing stronger anti-interference ability and adaptability in complex power systems. The existing technology mainly relies on iterative optimization of error feedback signals, and does not perform modeling analysis for special scenarios. Its detection accuracy and robustness may be limited in complex environments. Finally, the present invention achieves high-precision harmonic detection within a wide frequency range, which can effectively cope with various scenario requirements such as high-frequency harmonics and low-frequency component interference. However, the existing technology does not explicitly mention the improvement of broadband detection capabilities, and its frequency application range may be relatively limited.

[0006] In summary, how to develop an efficient, accurate and adaptable harmonic current detection technology has become a technical problem that needs to be solved urgently by people in this field. Summary of the invention

[0007] The present invention aims to solve at least one of the technical problems existing in the prior art. To this end, the present invention provides a harmonic current detection method based on a PSO improved fixed step size. The harmonic current detection method of the present invention not only solves the challenges faced by high-order harmonic detection in new power systems, such as high computational complexity, poor real-time performance, and susceptibility to noise interference, but also realizes rapid and accurate detection of harmonic currents by introducing advanced adaptive filtering technology and intelligent optimization algorithms, which is of great significance for improving power quality and ensuring stable operation of power systems.

[0008] In order to solve the above problems, the present invention provides a harmonic current detection method based on PSO improved fixed step size, comprising the following steps:

[0009] S1. First, construct an active filter APF circuit model;

[0010] S2. Embed the variable step size LMS algorithm based on the hyperbolic tangent function into the low-pass filter for adaptive harmonic current detection;

[0011] S3. Use PSO algorithm to optimize the filtering parameters to improve the current detection accuracy.

[0012] Preferably, in S1, an active filter APF circuit model is constructed by the following steps:

[0013] S101: Build an active filter APF circuit model consisting of a detection circuit, a control circuit and a PWM inverter circuit;

[0014] S102: By detecting the harmonic current components flowing through the load, the active filter APF responds through the inverter circuit to generate corresponding compensation components:

[0015] ; (1)

[0016] In the above formula, i L (t) represents the current flowing through the load, t is the time; I k is the reactive current, in A; k is the harmonic coefficient; I1 represents the amplitude of the fundamental current, i1(t) represents the fundamental current component; i h (t) represents the harmonic current component; i 1p (t) and i 1q (t) represents the active and reactive components of the fundamental current, w is the angular velocity; θ1 is the active compensation angle; θ k is the reactive power compensation angle.

[0017] Preferably, in step S2, a variable step-size LMS algorithm based on a hyperbolic tangent function needs to be embedded in a low-pass filter for adaptive harmonic current detection, including the following steps:

[0018] S201: The sine and cosine voltage signals of the voltage phase-locked loop PLL are measured and named as x1(n) and x2(n) respectively, and are used as inputs. The LMS algorithm is calculated according to the following formula to obtain the tracking calibration signal y(n) as output:

[0019] ; (2)

[0020] In the above formula, the error signal e(n) represents the harmonic signal, e n is the harmonic signal amplitude, e n =e(n); by continuously responding to the value of e(n), the filter weight coefficients w1(n) and w2(n) are adjusted so that the output signal y(n) closely follows the load current signal i L The change of (n), including its amplitude and phase, gradually approaches i L (n); when from i L When the adjusted output tracking signal y(n) is subtracted from (n), the result is the harmonic signal; μ represents the iterative step size;

[0021] S202, determining the step size of the LMS filter, and extending the time interval between two harmonic currents by finely adjusting the number of sampling intervals, thereby accelerating the process of the high-order harmonic autocorrelation approaching zero; the updated algorithm adopts the improved hyperbolic tangent function expressions (3)-(5) for calculation;

[0022] ; (3)

[0023] ; (4)

[0024] ; (5)

[0025] In the above formula, μ(n) is the error signal; a(n) is the dynamic adjustment step size; δ is the assignment factor; e(n) is the harmonic signal; p(n) is the update weight; C is a constant, D is the exponential window coefficient, γ is the forgetting factor, m is the error compensation coefficient, and b is the compensation time;

[0026] S203, implement variable step size calculation of LMS algorithm through formula (3)-(5), and update weight coefficients w1(n) and w2(n) of the filter according to formula (6)-(7):

[0027] ; (6)

[0028] ; (7)

[0029] In the above formula, J(n) represents the instantaneous gradient.

[0030] Preferably, in step S3, in order to reduce the influence of the traditional exponential window coefficient D and the forgetting factor γ on the final current measurement result, a particle swarm algorithm is used to optimize these two parameters:

[0031] S301: randomly generate a certain number of particles, each particle represents a potential solution, that is, a set of specific exponential window coefficients D and forgetting factor values;

[0032] S302: Initialize the position and velocity of each particle, which will be used to search for the optimal solution in the solution space;

[0033] S303: defining a fitness function according to formula (8) to evaluate the quality of each particle, that is, the performance of the combination of the exponential window coefficient D and the forgetting factor represented by it in harmonic current detection;

[0034] ; (8)

[0035] In the above formula, I sand I ref They represent the current flowing into the grid and the current value monitored by the proposed algorithm respectively;

[0036] S304: Update the speed and position of each particle according to the speed update formula and position update formula of the particle swarm algorithm; calculate the fitness value of each particle, and update the individual optimal position and global optimal position of the particle according to the fitness value; in this process:

[0037] If the fitness value of any particle is better than the fitness value of its individual optimal position, its individual optimal position is updated to the current position of the particle;

[0038] If the fitness value of any particle is better than the fitness value of the global optimal position, the global optimal position is updated to the current position of the particle;

[0039] S305: Determine whether the maximum number of iterations has been reached. If so, stop the iteration; if not, repeat steps S301-S304.

[0040] The advantages of the present invention compared with the prior art are:

[0041] The present invention discloses a harmonic current detection method based on PSO with improved fixed step size, which can quickly and accurately realize fault current measurement. By optimizing the filter parameters in combination with the PSO algorithm, the filter parameters can be automatically adjusted to achieve the best performance, thereby improving the accuracy of harmonic current detection. This optimization process can take into account the dynamic changes of the system to ensure that high-precision detection can be maintained under different working conditions. The variable step size LMS algorithm based on the hyperbolic tangent function is introduced, so that the low-pass filter can adaptively adjust the step size according to the characteristics of the input signal, thereby more effectively tracking and filtering out the harmonic components. This adaptive mechanism improves the response speed and accuracy of the system to different types of harmonic currents. The improved LMS algorithm can better suppress the influence of noise on the detection results while maintaining the convergence speed through the variable step size strategy. This is particularly important for the complex electromagnetic environment that often exists in practical applications, and helps to improve the stability and reliability of the detection results. In summary, the harmonic current detection method proposed by this method can improve the detection accuracy while enhancing the adaptability and robustness of the system, reducing noise interference, improving algorithm efficiency, and is easy to implement and integrate. It is of great significance for improving power quality, protecting power equipment and promoting the development of smart grids. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0043] Figure 1 is a flow chart of the method of the present invention;

[0044] Figure 2 APF circuit model structure diagram constructed in the present invention;

[0045] Figure 3 It is the LMS principle diagram of the present invention;

[0046] Figure 4 This is a comparison chart of the detection accuracy of the present invention and the prior art method;

[0047] Figure 5 It is a logic flow chart of harmonic current detection in the present invention. DETAILED DESCRIPTION

[0048] The embodiments of the present application are described in detail below, and examples of the embodiments 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 only used to explain the present application, and cannot be understood as limiting the present application.

[0049] In the description of this application, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" 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. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to specific circumstances.

[0050] The present invention is further described in detail below in conjunction with the accompanying drawings.

[0051] The present invention discloses a harmonic current detection method based on PSO with improved fixed step size. Figure 1 As shown, including:

[0052] S1. First, construct an active filter APF circuit model;

[0053] S2. In order to make up for the shortcomings of traditional filters, the variable step size LMS algorithm based on the hyperbolic tangent function is embedded in the low-pass filter for adaptive harmonic current detection;

[0054] S3. Use PSO algorithm to optimize the filtering parameters and improve the current detection accuracy.

[0055] The present invention firstly constructs an active filter APF circuit model; then, in order to make up for the shortcomings of traditional filters, a variable step-size LMS algorithm based on a hyperbolic tangent function is embedded in a low-pass filter for adaptive harmonic current detection; finally, a PSO algorithm is used to optimize the filtering parameters to improve the current detection accuracy.

[0056] The specific implementation process is carried out through the following steps:

[0057] S101: Build detection circuit, control circuit and PWM inverter circuit, and construct active filter APF circuit model;

[0058] S102: By detecting the harmonic current components flowing through the load, the active filter APF responds through the inverter circuit to generate corresponding compensation components

[0059] ; (1)

[0060] In the above formula, i L (t) represents the current flowing through the load, I1 represents the amplitude of the fundamental current, and i1(t) represents the fundamental current component; i h (t) represents the harmonic current component; i 1p (t) and i 1q (t) represents the active and reactive components of the fundamental current, w is the angular velocity; θ1 is the active compensation angle; θ k is the reactive power compensation angle.

[0061] S201: The sine and cosine voltage signals of the voltage phase-locked loop PLL are measured and named as x1(n) and x2(n) respectively, and are used as inputs. The LMS algorithm is calculated according to the following formula to obtain the tracking calibration signal y(n) as output:

[0062] ; (2)

[0063] In the above formula, the error signal e(n) represents the harmonic signal; by continuously responding to the value of e(n) and adjusting the filter weight coefficients w1 and w2, we can make the output signal y(n) closely follow the load current signal i L The change of (n), including its amplitude and phase, gradually approaches i L (n); when from i LWhen the adjusted output tracking signal y(n) is subtracted from (n), the result is the harmonic signal; μ represents the iterative step size;

[0064] S202, determine the step size of the LMS filter. This step is extremely critical. The choice of step size has a significant impact on system performance: a smaller step size can reduce the measurement error, but it will greatly reduce the extraction rate of harmonic components; on the contrary, a larger step size can speed up the extraction of harmonic components, but it will increase the measurement error. Therefore, in order to ensure the steady-state error rate while improving the extraction speed, choosing a suitable step size becomes an important factor affecting the efficiency of the entire system. High-order harmonics show the characteristic that the autocorrelation increases linearly with the sampling time. By reasonably shortening the sampling time, the degree of autocorrelation between high-order harmonics can be effectively reduced. Based on this characteristic, the optimized algorithm extends the time interval between two harmonic currents by finely controlling the number of sampling intervals, thereby accelerating the process of the high-order harmonic autocorrelation approaching zero. The updated algorithm adopts the improved hyperbolic tangent function expression (3)-(5) for calculation.

[0065] ; (3)

[0066] ; (4)

[0067] ; (5)

[0068] In the above formula, μ(n) is the error signal; a(n) is the dynamic adjustment step size; δ is the assignment factor; e(n) is the calculation error; p(n) is the update weight; C is a constant, D is the exponential window coefficient, and γ is the forgetting factor;

[0069] S203, implement variable step size calculation of LMS algorithm through formula (3)-(5), and update weight coefficients w1 and w2 of the filter according to formula (6)-(7)

[0070] ; (6)

[0071] ; (7)

[0072] In the above formula, J(n) represents the instantaneous gradient.

[0073] S301: A certain number of particles are randomly generated, each particle represents a potential solution, that is, a set of specific exponential window coefficients D and forgetting factor values.

[0074] S302: Initialize the position and velocity of each particle, which will be used to search for the optimal solution in the solution space.

[0075] S303: defining a fitness function according to formula (8) to evaluate the quality of each particle, that is, the performance of the combination of the exponential window coefficient D and the forgetting factor represented by it in harmonic current detection;

[0076] ; (8)

[0077] In the above formula, I s and I ref They represent the current flowing into the grid and the current value monitored by the proposed algorithm respectively;

[0078] S304: Update the speed and position of each particle according to the speed update formula and position update formula of the particle swarm algorithm. Calculate the fitness value of each particle, and update the individual optimal position and global optimal position of the particle according to the fitness value. If the fitness value of a particle is better than the fitness value of its individual optimal position, update its individual optimal position to the current position of the particle. If the fitness value of a particle is better than the fitness value of the global optimal position, update the global optimal position to the current position of the particle.

[0079] S305: Determine whether the maximum number of iterations has been reached. If so, stop the iteration. If not, repeat steps S301-S304.

[0080] In order to further illustrate the effectiveness and feasibility of the algorithm proposed in this paper, the proposed method is compared with the traditional LMS detection method and pq harmonic current detection method. Figure 4 shown.

[0081] Depend on Figure 4As shown in the figure, under different noise disturbances, the diagnostic accuracy of this method can be maintained at the highest level. Even under strong noise interference, it still maintains a high diagnostic accuracy, and the accuracy can be maintained above 95%. This patented method embeds a variable step-size LMS algorithm based on a hyperbolic tangent function into a low-pass filter for adaptive harmonic current detection. This variable step-size method can dynamically adjust the step size according to the size of the error signal, thereby accelerating the convergence speed when the error is large, and reducing the adjustment amplitude when the error is small, avoiding overshoot, thereby improving the detection accuracy. In contrast, the traditional LMS algorithm uses a fixed step size, which may cause the convergence speed to be too slow or the adjustment amplitude to be too large in some cases, affecting the detection accuracy. This patented method uses a PSO algorithm to optimize the parameters of the filter. The PSO algorithm is an optimization algorithm based on swarm intelligence, which has a strong global search capability and a fast convergence speed. It can find a better combination of filter parameters, thereby improving the current detection accuracy. However, traditional parameter adjustment methods may rely on experience or trial and error, and it is difficult to find the global optimal solution. In a noise-disturbed environment, this patented method can more effectively suppress noise interference and improve detection accuracy through improved LMS algorithm and PSO algorithm optimization. Traditional LMS method and pq harmonic current detection method may be greatly affected in a noise environment, resulting in reduced detection accuracy.

[0082] In addition, in order to verify the computational efficiency of the method proposed in this method, the second, third and higher harmonics (fourth and above) are superimposed on the standard sine wave, and this type of harmonic current is detected and compared with the traditional LMS algorithm and pq harmonic current detection method. In order to more intuitively show the difference in detection time, the detection time required by the method proposed in this method is set to the benchmark value 1. The relevant detection results are shown in Table 1 below:

[0083] Table 1 Comparison of calculation time of different detection methods

[0084]

[0085] From the above table, it can be found that the method proposed in this method has the shortest calculation time required in multi-type harmonic current detection. The patented method adopts a variable step-size LMS algorithm based on the hyperbolic tangent function. This algorithm can dynamically adjust the step size according to the size of the error signal, so as to converge to the optimal solution faster in the iteration process. Compared with the traditional fixed-step-size LMS algorithm, the variable-step-size LMS algorithm achieves a better balance between convergence speed and steady-state error, thereby improving the real-time performance of harmonic current detection. The patented method optimizes the parameters of the filter through the PSO algorithm. As an intelligent optimization algorithm, the PSO algorithm has the characteristics of strong global search capability and fast convergence speed. Through the optimization of the PSO algorithm, the optimal filter parameter combination can be found, further improving the accuracy and speed of harmonic current detection. The patented method constructs an active filter APF circuit model. The APF can detect the load current in real time and extract the harmonic components of the load current through internal DSP calculation. The APF has the characteristics of fast response speed and good filtering effect. It can efficiently filter out the harmonics in the load current, thereby providing an accurate input signal for harmonic current detection. There is a contradiction between the convergence speed and steady-state error of the fixed-step LMS algorithm. Improper step size selection may lead to slow convergence or large steady-state error. When dealing with complex harmonic currents, the convergence speed of the traditional LMS algorithm may be limited, thus affecting the detection time. The pq harmonic current detection method is based on the instantaneous reactive power theory and calculates the harmonic current by extracting the DC component through a low-pass filter. However, the design and parameter selection of the low-pass filter have a great influence on the detection results, and in some cases may not meet the requirements of high real-time performance.

[0086] In order to verify the broadband harmonic detection capability of the present invention, the detection accuracy of the present method under the connection of a DC inverter power supply is shown in the following table:

[0087] Table 2 Detection accuracy of different methods for high-low-DC harmonic combinations

[0088]

[0089] It can be concluded from Table 2 that the present invention discloses a harmonic current detection method based on PSO (particle swarm optimization)-improved fixed step size least mean square (LMS) algorithm. This method not only has the ability to detect harmonic currents quickly and accurately, but also can effectively reduce the impact of noise interference on detection accuracy. On this basis, the present invention further optimizes special scenarios, especially in high-frequency harmonic detection, DC power supply inversion in high-proportion new energy wind power scenarios, and processing of low-frequency component interference, to achieve broadband detection capability. In terms of high-frequency harmonic detection, the present invention improves the LMS algorithm and introduces a variable step size mechanism based on the hyperbolic tangent function, so that the algorithm has higher sensitivity and adaptability in the high frequency band. At the same time, the filter parameters are optimized in combination with the PSO algorithm, and the frequency response of the filter can be accurately adjusted, thereby realizing accurate detection of high-frequency harmonic components. This optimization strategy not only improves the detection accuracy, but also enhances the robustness of the algorithm, so that it can operate stably in complex and changeable power systems. In the high-proportion new energy wind power scenario, the present invention considers the impact of DC power supply inversion on harmonic detection. Since a large number of DC power inverters are usually included in wind power systems, these devices will generate harmonic currents during the inversion process. In order to accurately detect these harmonic currents, the present invention adds a DC power inverter module to the APF circuit model, and models and analyzes it. By adjusting the parameters of the LMS algorithm and the PSO optimization strategy, the present invention can achieve accurate detection of the harmonic currents generated by the DC power inverter, thereby improving the stability and reliability of the entire wind power system. In the harmonic detection process, low-frequency component interference is a problem that cannot be ignored. In order to solve this problem, the present invention introduces a low-pass filter into the algorithm, and combines the variable step size LMS algorithm based on the hyperbolic tangent function to perform adaptive harmonic current detection. This combination strategy can effectively filter out low-frequency component interference and improve the accuracy of harmonic detection. At the same time, by optimizing the filter parameters through the PSO algorithm, the influence of low-frequency components on the detection results can be further reduced. In order to achieve broadband detection capability, the present invention improves the LMS algorithm and introduces the PSO algorithm for parameter optimization. This combination strategy enables the algorithm to maintain high detection accuracy and stability in a wider frequency range. Whether it is high-frequency harmonics or low-frequency component interference, the present invention can effectively detect and suppress it. This wide-band detection capability enables the present invention to have a wider application prospect in the field of harmonic detection in power systems.

[0090] The present invention and its embodiments are described above, and such description is not restrictive. The drawings show only one embodiment of the present invention, and the actual structure is not limited thereto. In short, if ordinary technicians in the field are inspired by it, without departing from the purpose of the invention, they can design a structure and embodiment similar to the technical solution without creativity, which should belong to the protection scope of the present invention.

Claims

1. A harmonic current detection method based on PSO with improved fixed step size, characterized in that: The following steps are involved: S1. First, construct an active filter APF circuit model; S2. Embed the variable step size LMS algorithm based on the hyperbolic tangent function into the low-pass filter model built in S1 to perform adaptive harmonic current detection; S3. Use the PSO algorithm to optimize the filtering parameters of the LMS algorithm in S2.

2. The harmonic current detection method based on PSO improved fixed step size as claimed in claim 1, characterized in that: In S1, an active filter APF circuit model is constructed by the following steps: S101: Build an active filter APF circuit model consisting of a detection circuit, a control circuit and a PWM inverter circuit; S102: By detecting the harmonic current components flowing through the load, the active filter APF responds through the inverter circuit to generate corresponding compensation components: ; (1) In the above formula, i L (t) represents the current flowing through the load, t is the time; I k is the reactive current, in A; k is the harmonic coefficient; I1 represents the amplitude of the fundamental current, and i1(t) represents the fundamental current component; i h (t) represents the harmonic current component; i 1p (t) and i 1q (t) represents the active and reactive components of the fundamental current, w is the angular velocity; θ1 is the active compensation angle; θ k is the reactive power compensation angle.

3. The harmonic current detection method based on PSO improved fixed step size as claimed in claim 1, characterized in that: In step S2, a variable step-size LMS algorithm based on a hyperbolic tangent function needs to be embedded in a low-pass filter for adaptive harmonic current detection, which includes the following steps: S201: The sine and cosine voltage signals of the voltage phase-locked loop PLL are measured and named as x1(n) and x2(n) respectively, and are used as inputs. The LMS algorithm is calculated according to the following formula to obtain the tracking calibration signal y(n) as output: ; (2) In the above formula, the error signal e(n) represents the harmonic signal, e n is the harmonic signal amplitude, e n =e(n); by continuously responding to the value of e(n), the weight coefficients w1(n) and w2(n) of the filter are adjusted. In this process, the output signal y(n) needs to be adjusted along with the load current signal i L (n) changes, including adjusting the amplitude and phase of the output signal y(n) so that the output signal y(n) gradually approaches i L (n) is the adjustment qualification standard; μ represents the step size of iteration; S202, determining the step size of the LMS filter, the updated algorithm adopts the improved hyperbolic tangent function expressions (3)-(5) for calculation; ; (3) ; (4) ; (5) In the above formula, μ(n) is the error signal; a(n) is the dynamic adjustment step size; δ is the assignment factor; e(n) is the harmonic signal; p(n) is the update weight; C is a constant, D is the exponential window coefficient, γ is the forgetting factor, m is the error compensation coefficient, and b is the compensation time; S203, implement variable step size calculation of LMS algorithm through formula (3)-(5), and update weight coefficients w1(n) and w2(n) of the filter according to formula (6)-(7): ; (6) ; (7) In the above formula, J(n) represents the instantaneous gradient.

4. The harmonic current detection method based on PSO improved fixed step size as claimed in claim 1, characterized in that: In step S3, a particle swarm algorithm is used to optimize parameters: S301: randomly generate a certain number of particles, each particle represents a potential solution consisting of a set of specific exponential window coefficients D and forgetting factor γ values; S302: Initialize the position and velocity of each particle and search for the optimal solution in the solution space; S303: Define the fitness function according to formula (8), that is, the performance of the combination of the exponential window coefficient D and the forgetting factor γ in harmonic current detection represented by it: ; (8) In the above formula, I s and I ref They represent the current flowing into the grid and the current value monitored by the proposed algorithm respectively; S304: Update the speed and position of each particle according to the speed update formula and position update formula of the particle swarm algorithm; calculate the fitness value of each particle, and update the individual optimal position and global optimal position of the particle according to the fitness value; in this process: If the fitness value of any particle is better than the fitness value of its individual optimal position, its individual optimal position is updated to the current position of the particle; If the fitness value of any particle is better than the fitness value of the global optimal position, the global optimal position is updated to the current position of the particle; S305: Determine whether the maximum number of iterations has been reached. If so, stop the iteration; if not, repeat steps S301-S304.

Citation Information

Patent Citations

  • Appointed subharmonic compensation APF (active power filter) and harmonic detection and control method thereof

    CN103401243A

  • Parameter self-adaptive adjustment harmonic compensation method and device

    CN108258692A

  • Variable step harmonic current detection method based on arc tangent function

    CN114441851A

  • Adaptive variable step length LMS filter based on hyperbolic tangent function, filtering method thereof and computer equipment

    CN115360999A

  • Permanent magnet synchronous motor harmonic suppression method based on particle swarm adaptive filter

    CN118399817A