Abstract
By analyzing harmonic related to instantaneous active current and instantaneous reactive current, we propose an improved harmonic detection method to remedy long response delay and low detection accuracy corresponding to harmonic of power system. This method introduces a series connection scheme composed of Low-Pass Filter (LPF) and a current average module firstly. Then, detection accuracy of harmonic current is enhanced by adaptive tuning cut-off frequency of LPF and integration time which was obtained by proposed algorithm of the current average module. Moreover, feedback loop is introduced to compensated delay caused by LPF. Simulations including uncontrollable rectifier and three-phase voltage type inverter show proposed method has many advantages such as high detection accuracy, low response delay and good generality. Our method provides reliable harmonic current detection for later harmonic suppression and harmonic compensation.
1. Introduction
With the wide use of power electronic equipment in power system, coupled with a large number of nonlinear loads, a large number of harmonic pollution appears in the power grid, which has a serious impact on the power quality of the power grid. Active power filter (APF) is a main method to alleviate harmonic pollution [1, 2]. Accurately and quickly detecting harmonic current is one of the key technologies of active power filters. The existing harmonic detection methods mainly include Fourier analysis [3], Neural network [4–6], adaptive interference cancellation [7, 8], wavelet transform [9, 10], and instantaneous reactive power theory. It is precisely because of the characteristics of insensitivity to power grid frequency changes, high detection accuracy of harmonic detection, and low response delay that instantaneous reactive power theory has been widely used. This detection method is divided into p-q detection method [11, 12], detection method [13–17], etc. A single-phase harmonic current detection method without phase-locked loop is proposed [14]. This method avoids voltage phase shift caused by voltage fluctuations and eliminates detection errors caused by phase-locked loop. However, the LPF in this method cannot improve the delay effect and makes the detection real-time poor. Sun et al. [15] proposed a harmonic detection method using single-phase circuit structures and introduced harmonics and reactive current as feedback signals to compensate for the delay of the LPF. Although this method improves the dynamic response speed of harmonic detection, it cannot significantly enhance accuracy of harmonic detection. Li Shui-xiang series connects a current average module with LPF to effectively improve the accuracy of harmonic detection and response speed [16]. However, this method does not effectively use the harmonic components which may contain the same phase as the fundamental wave of active current. Wang Yang added a PI controller after LPF to improve detection accuracy and introduced PD controller as feedback to improve response speed [17], while harmonic detection ability of its method is weaker than that of current average module method. Using theory of instantaneous reactive power, this paper proposes a harmonic detection method which adaptively changes the integration time following detection current changing and improves detection accuracy and response speed. Finally, simulation results verify the good performance of the improved harmonic detection method.
2. ip − iq Harmonic Detection Algorithms
2.1. Traditional ip − iq Harmonic Detection Algorithm
The algorithm uses instantaneous reactive power theory to obtain instantaneous active current and instantaneous reactive current firstly. Then, uses structure described in Figure 1 to detect harmonic of power grids.

Firstly, three-phase currents , , are converted the , by transform matrix , and then multiplied matrix which is constructed by a sine and cosine signal generation circuit to obtain instantaneous active current and instantaneous reactive current .where , . Meanwhile, obtained by formula (1) is filtered by a low-pass filter LPF to obtain its DC component . So, the fundamental current can be calculated from according to formula (2).where , . The first element and the second element of subscript related to and indicate the positive sequence and order of the harmonic, respectively. and are the effective value and phase angle of the positive sequence component corresponding to current fundamental wave, respectively. Then the three-phase load harmonic current is obtained by subtracting the three-phase load current from its fundamental current:where .
2.2. Principle of ip − iq Harmonic Detection Algorithm Non-Phase-Locked Loop
In the traditional detection algorithm, we use PLL to detect the phase-A voltage and generate a synchronous signal corresponding to sine and cosine. However, when the load voltage is distorted, the PLL is interfered by the distortion voltage signal, which affects the detection effect and lead to signal asynchrony. To tackle this problem, we change into when angular frequency of power grids is a fixed value :
So, the three-phase load current fundamental wave component is described as
We find that the three-phase current fundamental wave components calculated by formulas (2) and (5) are exactly the same. Therefore, for the angular frequency in the transformation matrix, in the entire process, it only plays a transition role and does not affect the acquisition of the final fundamental wave component. The value of will not affect the harmonic detection result and accuracy. Moreover, the detection accuracy of is positive correlation detection accuracy of ; meanwhile, the detection accuracy of is determined by difference of . So, we can conclude that the detection accuracy of is determined by difference of with respect to detected voltage and current. Generally, we take as the angular velocity in the preset transformation matrix . Details of transformation matrix is described as
3. Time-Varying Integral Duration (TVID) Improved ip − iq Detection Method
3.1. LPF with Time-Varying Integral Duration
In the detection method, in order to improve the detection accuracy and response speed of the harmonic current, we describe as harmonic form:where n is the harmonic order and . The role of LPF here is to filter out harmonic components of to get the fundamental wave positive sequence DC component or to obtain slip frequency component between power grid and . According to equation (7), in the phase-locked loop detection stage, the obtained is described as
In non-phase-locked loop detection stage, the obtained is described as
The harmonic components of is described aswhere . Due to the negative relation of respond speed and accuracy filter, LPF cannot meet the dual requirements of response speed and detection accuracy. To tackle this problem, we propose a new structure to contact an average module whose integration time can adaptively change according to load current at the back of LPF. In addition, we properly set the cutoff frequency of the LPF to further enhance its performance. The details of method are shown in Figure 2. It is clearly found that LPF and average module are filter high-order harmonic components and low-order harmonic components of , respectively. In this way, we can simultaneously enhance the accuracy and response speed corresponding to harmonic detection.

Now, we discuss the problem of cutoff frequency setting with respect to LPF. Analyzing equations (8) and (9), we find that denotes low-frequency AC component of with respect to phase-locked loop detection stage and low-frequency AC components phase with respect to nonlocked loop detection stage, respectively. As we know, frequency tolerance and maximum deviation of power system are generally set to 50 ± 0.2 Hz and 50 ± 0.5 Hz [18], respectively. Suppose angular frequency of set by (100 ), we find that the frequency range of is from 0 Hz to 0.5 Hz. To guarantee no distortion, we set the cut-off frequency of LPF equal to 150 Hz.
Next, we use average value module to eliminate AC component of , so that we can get the DC component of the (in phase-locked loop scene) or the slip periodic component of (in non-phase-locked loop scene). Suppose harmonic order of power grid is known as and so on, we can set integer time , where denotes least common multiple of element, T is the power frequency period. Integer equation (7) in the section, it can be denoted as
It clearly that AC component of is completely eliminated if integer time is known. Now, we discuss the obtain method of integer time . We firstly define the similarity degree of between and which can be described aswhere . Supposing and to be periodic signal, we obtain when are , . Moreover, we find that increases with difference between and . could get maximum value when and has a completely opposite waveform. It inspires us to use to describe the coherence between and . From the above discussion, we can determine integer time using match filtering scheme as follow:(1)Sampling output of the LPF relate to (2)Initializing threshold parameter and integer time parameter (3)Calculating by (12)(4)if , updating step factor of integer time and getting integer time by equation (13), go to stage 3.(5)If and , end.
In the above scheme, step factor of integer time is a key problem that should to be considered. We defined a function listed as equation (14) to describe the relation between and . It is clear that is monotone increasing function with respect to . Moreover, to guarantee robust and convergence of algorithm, we constraint to satisfy the inequality (15) and (16)
3.2. Introduce Feedback Link
In order to improve the response speed of harmonic detection, we introduce harmonic and reactive current feedback at the input of harmonic detection. When the fundamental wave active current increases, the delayed effect of LPF on the detection makes the detected fundamental wave active current unable to real-time track the actual fundamental wave active current in time, resulting in the detected value being smaller than the actual. Therefore, the harmonics and reactive current at the output will inevitably contain the same phase components as the fundamental wave active current. We feed these components back to the input and compensate for the effects of errors due to LPF delay. Similarly, when the fundamental wave active current decreases, the harmonics and reactive currents at the output have phase components opposite to the fundamental wave active current, so that the detected fundamental wave active current rapidly decays to compensate for the delay of the LPF. The principle block diagram of the harmonic detection algorithm with feedback link is shown in Figure 3.

When the feedback link is tracking the harmonic current, the feedback signal shortens the response time by adjusting the value of the gain K. The larger the gain K, the faster the response speed, but the detection accuracy will also decrease. Therefore, in this paper, a proportional derivative (PD) control link is added before the feedback gain. Suppose the fundamental wave instantaneous active current detection link transfer function is , the PD controller transfer function is as follows:
Then the transfer function of the improved harmonic detection is as follows:
We substitute equation (17) into equation (18) to get the following formula:
It can be known from formula (19) that the PD controller is a lead correction device. The differential link can reflect the trend of load current changes, provide advanced correction signals, and compensate for the poor dynamic performance of harmonic detection at transient moments. Therefore, this method makes up for the lack of detection accuracy and low response speed. The principle block diagram of the improved harmonic detection method based on the instantaneous reactive power theory is shown in Figure 4.

4. Simulation Experiment Analysis
4.1. Simulation Model and Parameters
In order to verify the effectiveness of the time-varying integration time improvement detection method, we use Matlab Simulink software to set up a simulation experiment model based on the principle shown in Figure 4. Since the methods in the paper [14] and paper [15] are harmonic detection methods of single-phase circuit, they are unsuitable to be compared with proposed method. Thus, we use harmonic detection method of three-phase circuit phase which were presented in the paper [16] and paper [17] to compare to proposed method. We carry out simulation experiment research from three aspects. (1) To verify the performance of LPF using time-varying integral duration, we use a three-phase uncontrollable rectifier as the harmonic source and compare the DC component of the instantaneous active and reactive current of the time-varying integral duration detection method with the improved detection method at different cut-off frequencies. (2) To verify the effectiveness of the improved harmonic detection method, we compare the proposed method with the method presented in [16, 17] in some aspects including fundamental wave current , harmonic current , and fundamental wave current total distortion rate THD. The results are shown in Figure 4. (3) To verify the general applicability of the improved harmonic detection method, we change the harmonic source to a three-phase voltage inverter firstly and then use Fourier transform to analyse the fundamental wave current and obtain the total distortion current THD of the fundamental current finally. The parameters involved in the simulation experiment are shown in Table 1.
4.2. Simulations Analysis Related to DC Component of Instantaneous Current
The keypoint of detection method is to compute the DC component related to instantaneous active current and the DC component related to instantaneous reactive current . As it is known, harmonic detection accuracy and response time of system are mainly determined by detection accuracy and response time of and . To verify effectiveness of proposed method, we firstly compare proposed method with methods which presented in the paper [16, 17] in the aspects of and detection. The results are shown in Figure 5. It is not difficult to find that when average module is introduced behind the LPF, the method in paper [16] has some good characteristic including ripples of and small and detection accuracy of and high. However, respond delay time of this method is long, leading to slow respond speed. Although PI controller is series connected behind the LPF, ripple of and related to method of paper [17] is slightly great since low-order harmonic of can not to be entirely filtered in this scene, leading to low detection accuracy of harmonic. However, since PD feedback is introduced in harmonic detection system to effectively employ in phase components of fundamental active current which may contain the harmonic, response speed related to method of paper [17] is fast. Now, observing the proposed harmonic detection method, we find that the proposed method has good characteristic such as small ripple of and , high detection accuracy of and , small dynamic delay and fast response speed of systems (delay period less than ) and so on. Thus, effectiveness of proposed detection method based on time-varying integral LPF is verified.

(a)

(b)
In non-phase-locked loop scene, we apply the time-varying integral methods to the harmonic detection to obtain the component of the instantaneous active current and the component of the instantaneous reactive current , and the result is shown in Figure 6. We can find that at this time, and are AC, and their amplitudes are equal and in the scene of a phase-locked loop. The frequency of and is the difference value between the system frequency and the slip frequency related to initial transformation matrix , namely , which verifies the previous analysis. The curve of and in the figure are very smooth, indicating that the filtering effect is better. It is clear that the time-varying integral method also can be applied in the harmonic detection method non-phase-locked loop.

4.3. Simulation Experiment Analysis with Respect to Similarity Degree
Three-phase uncontrolled rectifier is used as harmonic generator, and the curve of the similarity degree versus the integration duration is shown in Figure 7. The load changes abruptly at 0.1 seconds, and the similarity degree of active current or reactive current suddenly increases. It needs the conductive integration time to be updated. Our algorithm adaptively changes the integration time to follow the change of the load current. When the detection is stable, the active current integration time is stabilized at 0.0033 (T/6) seconds, and the reactive current integration time is stabilized at 0.01 (T/2) seconds. For a three-phase uncontrollable rectifier circuit, the load current mainly contains harmonics, and these harmonics become harmonics after 3/2 transformation. For , is consistent with the simulation results. We can verify the previous analysis. For , because the component value of is small, the amplitude of the harmonic component is large. We can see that there are obvious low-order harmonics, so the average module integration time is stable at T/2.

(a)

(b)
4.4. Simulation Analysis of Improved Harmonic Detection Method
The simulation model is built according to Figure 4. In Figure 8, we compare the A-phase fundamental current obtained by the method presented in paper [16] and paper [17] with that of proposed methods. In Figure 9, we compare the A-phase harmonic current obtained by the method presented in paper [16] and paper [17] with that of proposed methods.


It can be seen from Figure 8 that method presented in paper [16] has one period (T) delay before the detection of the fundamental instantaneous current, so it conducts the harmonic current detection that also has a delay time of T, which can also be confirmed by Figure 9. As we know, dynamic response speed affects the real-time action of system. If the method presented in paper [16] is used for harmonic compensation equipment, it will also affect the response speed of compensation and lead to some twists in its output waveform, which proves that there is a certain deficiency in detection accuracy. We also find that detection delay related to the fundamental instantaneous current of method presented in paper [17] is apparently small, it is reveal that this method has good characteristic such as fast dynamic response and good real-time detection. While the error between the detection value and true value of this method is slightly great, it is revealed that the accuracy of method presented in paper [17] is low. The fundamental current obtained by the proposed method has a delay of less than T/2, it indicates that our method has fast dynamic response, good real-time detection and smooth waveform. Moreover, it can be seen from the partial enlarged image of the simulation, compared with that of method presented in paper [16, 17], fundamental current and the harmonic current with respect to our method are closer to the theoretical value, which proves that the detection accuracy has also significantly improved.
In order to compare detection accuracy of difference methods more intuitively, we use harmonic sources of three-phase including uncontrollable rectification and three-phase voltage inverter to discussion performance of proposed harmonic detection method in different cut-off frequency conditions. The fundamental current Fourier analysis (FFT) is shown in Figure 10 (considering accuracy of method presented in paper [16] greater than that of method presented in paper [17], we only compare accuracy of our method with hat of method presented in paper [16]).

It can be seen from Figure 10 that when the three-phase uncontrollable rectification is used as the harmonic source, the total distortion rate (THD) of the phase A fundamental wave current obtained by the traditional detection method and method presented in paper [16] are 0.38% and 0.27%, respectively. Our methods reduce 0.11% THD of the fundamental wave. When a three-phase voltage inverter is used as the harmonic source, THD of the fundamental wave current obtained by traditional detection method and method presented in paper [16] is 0.89%(cut-off frequency 25 Hz) and 0.68%, respectively. Our methods reduce 0.21% THD of the fundamental wave. Table 2 also shows that under different cut-off frequency conditions, THD of the fundamental wave current corresponding to proposed method is significantly lower than that of method presented in paper [16]. This means the proposed detection method has faster dynamic response and higher detection accuracy than that of method presented in paper [16] in acquiring fundamental current and harmonic detection. It can also be seen from Figure 10, in different harmonic sources condition, THD of the fundamental wave current corresponding to proposed method is 2/3 of traditional method. This shows that, for different harmonic sources, our method has more applicable than that of traditional method, which verifies the universality of the our method.
5. Conclusion
Aiming at the shortcomings of the traditional harmonic detection method, using instantaneous reactive power theory, we propose an improved harmonic detection method including time-varying integral module. We connect a current averaging module in series after LPF firstly, and then analyze harmonic components filtered by this current average module. On this basis, we reasonably set the cut-off frequency of LPF reasonably and change the integration time of current average module to adaptive change of load current. Moreover, feedback loop is introduced to compensate the delay caused by LPF. Abundant simulations are used to demonstrate our method not only has higher detection accuracy and lower response delay than that of traditional method but also has good universality.
Data Availability
The figures and tables data used to support the findings of this study are included within the article. And the other data used to support the findings of this study are available from the corresponding author upon request.
Conflicts of Interest
The authors declare that they have no conflicts of interest.
Acknowledgments
The project was supported by the National Natural Science Foundation of China (U1804149).