ip− iq Harmonic Detection Method Based on Time- Varying Integral Duration

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. .is method introduces a series connection scheme composed of Low-Pass Filter (LPF) and a current average module firstly..en, 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.


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. e existing harmonic detection methods mainly include Fourier analysis [3], Neural network [4][5][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. is detection method is divided into p-q detection method [11,12], i p − i q detection method [13][14][15][16][17], etc. A single-phase harmonic current detection method without phase-locked loop is proposed [14]. is 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.

i p − i q Harmonic Detection Algorithms
e i p − i q algorithm uses instantaneous reactive power theory to obtain instantaneous active current i p and instantaneous reactive current i q firstly. en, uses structure described in Figure 1 to detect harmonic of power grids.
Firstly, three-phase currents i a , i b , i c are converted the i α , i β by transform matrix C 32 , and then multiplied matrix C which is constructed by a sine and cosine signal generation circuit to obtain instantaneous active current i p and instantaneous reactive current i q . (1) is filtered by a low-pass filter LPF to obtain its DC component i pq . So, the fundamental current i f can be calculated from i pq according to formula (2).
where i f � i af i bf i cf T , i pq � i p i q T . e first element and the second element of subscript related to I 11 and ϕ 11 indicate the positive sequence and order of the harmonic, respectively. I 11 and ϕ 11 are the effective value and phase angle of the positive sequence component corresponding to current fundamental wave, respectively. en the threephase load harmonic current is obtained by subtracting the three-phase load current from its fundamental current: where i h � i ah i bh i ch T .

Principle of i p − i q 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 C into C 0 when angular frequency ω of power grids is a fixed value ω 0 : 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. erefore, for the angular frequency ω 0 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. e value of ω 0 will not affect the harmonic detection result and accuracy. Moreover, the detection accuracy of i f is positive correlation detection accuracy of i pq ; meanwhile, the detection accuracy of i pq is determined by difference of ω 0 − ω. So, we can conclude that the detection accuracy of i f is determined by difference of ω 0 − ω with respect to detected voltage and current. Generally, we take ω 0 � 2πf � 100π as the angular velocity in the preset transformation matrix C 0 . Details of transformation matrix C 0 is described as

LPF with Time-Varying Integral Duration.
In the i p − i q detection method, in order to improve the detection accuracy and response speed of the harmonic current, we describe i pq as harmonic form: where n is the harmonic order and n ∈ N * . e role of LPF here is to filter out harmonic components of i pq to get the fundamental wave positive sequence DC component or to obtain slip frequency component i pq between power grid and C 0 . According to equation (7), in the phase-locked loop detection stage, the obtained i pq is described as In non-phase-locked loop detection stage, the obtained i pq is described as e harmonic components of i pq is described as 2 Mathematical Problems in Engineering where i pq � i p i q T . 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. e details of method are shown in Figure 2. It is clearly found that LPF and average module are filter high-order harmonic components and loworder harmonic components of i pq , 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 i pq denotes low-frequency AC component of ω 0 − ω with respect to phase-locked loop detection stage and lowfrequency 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 ω 0 of C 0 set by 2πf (100 π), we find that the frequency range of i pq is from 0 Hz to 0.5 Hz. To guarantee i pq 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 i pq , so that we can get the DC component of the i pq (in phase-locked loop scene) or the slip periodic component of i pq (in non-phase-locked loop scene). Suppose harmonic order of power grid is known as α 1 , α 2 , . . . , α n , α i ∈ N * and so on, we can set integer time T I � lcm(T/α 1 , tT/α 2 n, q . . . h, T x/α n ), where T I � lcm (•, •, . . . , •) denotes least common multiple of element, T is the power frequency period. Integer equation (7) in the [t − T I , t] section, it can be denoted as It clearly that AC component of i pq is completely eliminated if integer time T I is known. Now, we discuss the obtain method of integer time T I . We firstly define the similarity degree of between i pq (t) and i pq (t − T I ) which can be described as where i pq (t − T I ) to be periodic signal, we obtain S Moreover, we find that S T I pq (t) increases with difference between i pq (t) and i pq (t − T I ). S T I pq (t) could get maximum value 1 1 T when i pq (t) and i pq (t − T I ) has a completely opposite waveform. It inspires us to use S T I pq (t) to describe the coherence between i pq (t) and i pq (t − T I ). From the above discussion, we can determine integer time T I using match filtering scheme as follow: (1) Sampling output of the LPF relate to i pq (t) (2) Initializing threshold parameter F pq � F p F q T and integer time parameter Mathematical Problems in Engineering 3 T and getting integer time T pq (n + 1) by equation (13), go to stage 3.
In the above scheme, step factor of integer time λ pq (n) is a key problem that should to be considered. We defined a function listed as equation (14) to describe the relation between λ pq (n) and S T I pq (t). It is clear that λ p (n) is monotone increasing function with respect to S T I pq (t). Moreover, to guarantee robust and convergence of algorithm, we constraint λ pq (n) to satisfy the inequality (15) and (16)

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 realtime track the actual fundamental wave active current in time, resulting in the detected value being smaller than the actual. erefore, 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. e principle block diagram of the i p − i q 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. e larger the gain K, the faster the response speed, but the detection accuracy will also decrease. erefore, 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 G f (s), the PD controller transfer function is as follows: en 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. e 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. erefore, this method makes up for the lack of detection accuracy and low response speed. e principle block diagram of the improved i p − i q harmonic detection method based on the instantaneous reactive power theory is shown in Figure 4.

Simulation Model and Parameters.
In order to verify the effectiveness of the time-varying integration time improvement i p − i q 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. us, 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 i pq of the instantaneous active and reactive current i pq of the time-varying integral duration detection method with the improved i p − i q detection method at different cut-off frequencies.
(2) To verify the effectiveness of the improved i p − i q harmonic detection method, we compare the proposed method with the method presented in [16,17] in some aspects including fundamental wave current i f , harmonic current i h , and fundamental wave current total distortion rate THD. e results are shown in Figure 4. (3) To verify the general applicability of the improved i p − i q 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 i f and obtain the total distortion current THD of the fundamental current finally. e parameters involved in the simulation experiment are shown in Table 1.

Simulations Analysis Related to DC Component of Instantaneous Current.
e keypoint of i p − i q detection method is to compute the DC component i p related to instantaneous active current i p and the DC component i q related to instantaneous reactive current i q . As it is known, harmonic detection accuracy and response time of system are mainly determined by detection accuracy and response time of i p and i q . To verify effectiveness of proposed method, we firstly compare proposed method with methods which presented in the paper [16,17] in the aspects of i p and i q detection. e 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 i p and i q small and detection accuracy of i p and i q 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 i p and i q related to method of paper [17] is slightly great since low-order harmonic of i p − i q 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 i p and i q , high detection accuracy of i p and i q , small dynamic delay and fast response speed of systems (delay period less than T/4) and so on. us, effectiveness of proposed detection method based on timevarying integral LPF is verified.
In non-phase-locked loop scene, we apply the timevarying integral methods to the i p − i q harmonic detection to obtain the i p component of the instantaneous active current i p and the i q component of the instantaneous reactive current i q , and the result is shown in Figure 6. We can find that at this time, i p and i q are AC, and their amplitudes are equal i p and i q in the scene of a phase-locked loop. e frequency of i p and i q is the difference value between the  Mathematical Problems in Engineering system frequency f and the slip frequency f 0 related to initial transformation matrix C 0 , namely f 0 − f � 0.2 Hz, which verifies the previous analysis. e curve of i p and i q 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 i p − i q harmonic detection method non-phase-locked loop.

Simulation Experiment Analysis with Respect to Similarity
ree-phase uncontrolled rectifier is used as harmonic generator, and the curve of the similarity degree S T pq (t) versus the integration duration T is shown in Figure 7. e 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 6k ± 1, k ∈ N * harmonics, and these harmonics become 6k, k ∈ N * harmonics after 3/2

Simulation Analysis of Improved Harmonic Detection
Method. e 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. e 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 threephase including uncontrollable rectification and three-phase voltage inverter to discussion performance of proposed i p − i q harmonic detection method in different cut-off frequency conditions. e 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  Reference [16] Reference [17] 0.14 0.16 0.18 0.2 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]. is 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 Reference [16] Reference [17] 0.14 0.  Rectifier proposed method Inverter proposed method Rectifier reference [16] 25Hz Inverter reference [16] 25Hz  Mathematical Problems in Engineering method is 2/3 of traditional method. is shows that, for different harmonic sources, our method has more applicable than that of traditional method, which verifies the universality of the our method.

Conclusion
Aiming at the shortcomings of the traditional i p − i q harmonic detection method, using instantaneous reactive power theory, we propose an improved i p − i q 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
e 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
e authors declare that they have no conflicts of interest.