An improved ip-iq harmonic detection method

The ip-iq harmonic detection method based on instantaneous reactive power has been widely used in active power filter (APF). However, the traditional ip-iq detection method has errors when the grid voltage is unbalanced and distorted. This paper proposes an improved ip-iq harmonic detection method, which uses adaptive notch filter (ANF) to extract the fundamental positive-sequence voltage signal, so that the phase locked loop (PLL) can still accurately obtain the phase information under bad grid conditions. At the same time, moving average filter (MAF) is used to replace low-pass filtering to reduce the detection delay. The simulation results show that the improved ip-iq detection method can accurately detect harmonic current under non-ideal grid voltage conditions, and has good dynamic characteristics.


Introduction
In recent years, with the wide application of power electronic technology and the large-scale grid connection of renewable energy generation, the problem of harmonic pollution in power system has become increasingly prominent, which not only affects the power quality supply for users, but also poses a threat to the safe operation of power system. Therefore, some scholars have proposed the APF [1] . By collecting the load current, APF separates the harmonic component from the load current, and injects the harmonic current with equal magnitude and opposite directions into the system. In order to make the APF have good compensation performance, the harmonic parts in the load should be detected quickly and accurately.
At present, the commonly used detection methods include the method based on fourier transform theory [2] , the method based on wavelet transform theory [3] , the method based on Fryze power theory [4] and the method based on instantaneous reactive power theory [5] . The instantaneous reactive power theory was proposed by H. Akagi in 1983 [6] . The i p -i q harmonic detection method based on instantaneous reactive power has been widely used, but its detection accuracy mainly depends on the performance of the PLL and the filter. In practice, the grid voltage often appears unbalance and distortion. The PLL of synchronous rotating coordinate can not provide the fundamental positive-sequence phase accurately, which causes the detection error. In order to solve the above problems, an improved i p -i q harmonic detection method is proposed in this paper. The ANF is used to improve the traditional synchronous coordinate system PLL, and the MAF is used to replace the low-pass filter to improve the detection accuracy.
The structure of the remaining paper is as follows. The next section introduces the traditional i p -i q harmonic detection method. Sect. 3 analyzes the principle of the ANF, and the structure of the ANF-PLL is given, and the low-pass filter is replaced by MAF. In the 4 section, the rationality of the proposed method is verified by MATLAB/ Simulink. Conclusions are drawn in Sect. 5.

The principle of traditional ip-iq detection method
The principle of the traditional i p -i q harmonic detection method is shown in Fig.1. Firstly, phase lock loop (PLL) is used to extract the phase angle of the grid voltage , and collect the three-phase load current signals , and . It performs Clarke transformation and Park transformation to obtain the load current and in the rotating coordinate system. Where and as follow, According to the definition of instantaneous reactive power theory, represents instantaneous active current, represents instantaneous reactive current, and consist of two parts, the DC component and the AC component.
The currents and are respectively passed through low pass filter (LPF) to filter out the AC components, obtains the DC components of instantaneous active currenti p and instantaneous reactive currenti q . Theni p andi q through inverse Park transformation and inverse Clarke transformation , and finally subtract the DC component from the load current , and to get the harmonic current component. Where and as follow, The above analysis shows that the accuracy of i p -i q detection method mainly depends on the performance of PLL and LPF. Under non-ideal conditions, the grid voltage contains imbalance and distortion components. At this time, the traditional PLL cannot accurately obtain the phase of the fundamental positive-sequence voltage, which causes detection errors. In addition, the LPF will also cause detection delay.

ANF-PLL
Adaptive Notch Filter (ANF) can extract the required sine component by tracking the frequency change of a given signal. Its structure is shown in Fig.2 [7,8] : The notch parameter ξ determines the depth and antiinterference performance of the notch. According to the structure diagram of ANF and its dynamic equation, the Bode diagram of system output when ω=2 *50 rad/s and =0.5, 1.0, 2.0 is shown in Fig.3. As can be seen from Fig.3, at the 50Hz power frequency signal, the ANF's amplitude gain is 0, and the phase frequency gain is 0° and 90°, respectively. That is, when the ANF inputs a power frequency periodic signal, we can get an original signal and a quadrature signal leading by 90°. In addition, it can be seen from Fig.3 that ANF can attenuate the high-frequency signal, or that high harmonics in the signal can be filtered out.
Therefore, we can use ANF to extract the fundamental positive-sequence component of grid voltage, and then pass it through PLL. The improved PLL is called ANF-PLL, and the specific process is shown in Fig.4 Where a and q are the rotation factor, 120°, 90°.

MAF
Moving average filter (MAF) is a finite impulse response filter, which can be regarded as an ideal low pass filter under certain conditions [9] . MAF can be described by Eq. (7) in the continuous domain.
Where is the input signal, ̅ is the output signal, and is the window length. In practical application, MAF is usually realized in discrete form, and its expression in discrete domain is: Where N is the number of samples, the relationship between the window length and sampling time is: The structure of MAF in discrete domain is shown in Fig.5,   Fig. 5. MAF in discrete domain For i p -i q detection, the odd harmonics in the load current need to be filtered, and the harmonic current becomes even after Park transformation. When the sampling frequency of the system is 10 kHz and N is 100, the Bode diagram of MAF is shown in Fig.6.   Fig. 6. Bode diagram of MAF As can be seen from Fig.6, MAF filters out the 100Hz and its multi-frequency components.
In summary, this paper proposes an improved i p -i q harmonic detection method as shown in Fig.7, which mainly improves the PLL and LPF.

Simulation analysis
The improved i p -i q harmonic detection method was verified by MATLAB/simulink. First, verify the phaselocking ability of ANF-PLL under non-ideal grid voltage conditions. The grid voltage is shown in Fig.8, in 0~0.08s three-phase voltage balance and no distortion, at 0.08s to add 0.2p.u. of the fundamental negative-sequence voltage and 0.15p.u. of the fifth harmonic voltage. Fig.9 shows the comparison of the two PLL. The picture above is a traditional PLL, and the picture below is an improved ANF-PLL. It can be seen that before 0.08s, both PLLs can accurately track the grid phase; after 0.08s, when the grid voltage is unbalanced and distorted, the traditional PLL phase is biased, and there is a certain lag, while ANF-PLL can still accurately lock the grid phase.    Fig.11 shows the filtering effect of the two filters, it can be seen, the LPF needs about 0.03s to gradually stabilize and there is a overshoot, while the MAF only needs 0.01s to achieve stability.

Conclusion
In order to solve the detection error of traditional i p -i q harmonic detection method under non-ideal voltage conditions, an improved i p -i q detection method is proposed in this paper. This method uses ANF to extract fundamental positive-sequence voltage signal, and uses MAF instead of LPF to reduce delay. Finally, the effectiveness of the proposed method is verified by simulation.