# Random Harmonic Detection and Compensation Based on Synchronous Reference Frame

Authors: Yanbo Che; Zhaojing Yin; Shuyan Yu; Qiang Sun
Journal: Journal of Electrical and Computer Engineering
 (2017)

---

## Abstract

Algorithms for harmonic detection and compensation are important guarantees for an active power filter (APF) to achieve the harmonic control function and directly determine the overall performance. Existing algorithms usually need a large amount of computation, and the compensation effect of specified order harmonic is also limited. DC side capacitor voltage at sudden change of load is affected by the algorithm as well. This paper proposes a new algorithm for harmonic detection and compensation based on synchronous reference frame (SRF), in which a band-pass filter with center frequency of6kth harmonic is designed in fundamental frequency SRF to extract random harmonic current with two different frequencies of (6k±1)th harmonic in stationary reference frame. This new algorithm can rapidly detect any specified harmonic, and it can adjust the power factor to compensate reactive power. Meanwhile, it has few impacts on DC side capacitor voltage under complicated operating conditions such as sudden change of load. The correctness and effectiveness of this new algorithm are verified by simulation and experiment.


---

## Body

## 1. Introduction

With the large-scale application of power electronics devices in recent years, the amount of various nonlinear loads has been increased rapidly. Current waveform distortion and harmonic problem is becoming more and more serious; hence the research and application of harmonic control devices have become a hot research topic at home and abroad [1–3]. At present, there are two main types of filter, passive power filter (PPF) and active power filter (APF). PPF removes harmonic or prevents harmonic spreading by adding extra impedance branches to a system. PPF is easy to be resonant with the power grid, and its compensation characteristic is easy to be affected by the impedance of the power network. The compensation accuracy is low and the flexibility of its application is poor. These drawbacks limit its application in some occasions with high requirements [4]. Adopting high-performance main circuit of power electronic converter and control system, APF can quickly detect changes in harmonic currents, then compensate harmonic, and adjust power quality according to different compensation targets. Being better than PPF in both compensation precision and flexibility of harmonic current detection, APF has gradually got more attention and research [5–8].The detection and compensation performance of an APF is mainly related to the extraction algorithm of the system compensation current and the control strategy of the main power inverter. The performance of a compensation current extraction algorithm largely depends on the accuracy, fastness, and real-time of the current extraction. The key to controlling a main power inverter is to ensure a fast tracking of instruction current by APF output current and keep their consistency. Therefore, it is an important issue improving the accuracy of APF harmonic compensation to catch the instantaneous harmonic and reactive components from the power grid currents quickly and accurately. Meanwhile, with the rapid development of large-scale integrated circuit, especially digital signal processor technology, the technology of extracting harmonic and reactive current in APF system has gradually developed from analog to digital form, which greatly improves the speed of current extraction and the accuracy of compensation [9]. However, the traditional harmonic detection and compensation methods which detect and compensate the content of harmonic cannot meet the functional requirements on variety to APF [10–12]. It is urgent to search a method that could detect the random harmonic current or voltage in load and then compensate them according to actual demands.At present, the main methods for harmonic detection and compensation are classified as Filter method [13], Wavelet Transform method [14], Neural Network method [15, 16], FFT method [17, 18], PQ method [19], and SRF method [20]. The authors have deeply studied these methods by reading a large number of literatures [21–27] and evaluated them from computation, response speed, reliability, and compensation precision. As shown in Table 1, A to E stand for the grades from highest to lowest, and their abilities of random harmonic detection and compensation are also compared. This table indicates that the Filter method, Wavelet Transform method, Neural Network method, and FFT method only are suitable for some special occasions due to their shortcomings. Although the PQ method and the traditional SRF method, which are based on Instantaneous Reactive Power Theory [28], show good performance in all aspects and are widely used, they lack the function of detecting and compensating for random harmonics.Table 1
Comparison of different methods.
Filter
Wavelet Transform
Neural Network
FFT
PQ
SRF
Computation
A
D
C
E
B
B
Response speed
E
D
B
C
B
A
Reliability
E
D
C
D
B
A
Compensation precision
E
D
C
A
B
A
Ability of random harmonic detection and compensation
No
No
No
Yes
No
NoDifferent from traditional harmonic detection algorithm, random harmonic detection algorithm can detect and compensate specified order harmonic, improve processing speed, reduce work load, and thus get attention by scholars. Taking a three-phase three-wire parallel APF as research representative, this paper proposes a new SRF-based algorithm for random harmonic current detection and compensation. It can detect and compensate the specified harmonic, reduce the computation amounts, and have few impacts on DC side capacitor voltage when the loads mutate. Finally, simulation and experiment show the effectiveness and feasibility of this algorithm.


## 2. Basic Principle

### 2.1. Basic Principle of APF

The concept of APF was first proposed by Japanese scientists in the early 70s. The basic principle of APF is to generate a current that has the same amplitude and opposite phase with harmonic current by controllable power semiconductor devices and inject it into the grid, intentionally to cancel the total harmonic current and compensate in real-time. According to different applications, the active power filter can be divided into two categories: DC active power filter and AC active power filter. The former is mainly applied to HVDC system, and the latter (often cited as APF will be discussed in this paper) to AC power system of different voltage levels.An APF usually consists of two functional parts, detecting harmonic signal and generating compensating component. As shown in Figure1, distorted proportion of the current and voltage in grid are detected by the detection circuit of APF. Corresponding compensation current component is then generated from the power circuit under certain control strategy and injected into the grid to achieve the purpose of harmonic elimination.Figure 1
Schematic diagram of APF.


### 2.2. Basic Idea of SRF-Based Harmonic Detection Algorithm

The SRF-based algorithm works by changing a fundamental positive sequence current into direct current by Park Transform, then filtering out the harmonic and reactive current through a low-pass filter (LPF), and finally getting the compensation current reference value [16], as shown in Figure 2.Figure 2
The basic principle of SRF.Current in nonlinear load such as common rectifier bridge consists of the fundamental and (6n±1)th harmonic components, respectively, corresponding to direct current (DC) and alternating current (AC) components in stationary reference frame when converted into fundamental frequency SRF. A LPF precisely designed in fundamental frequency SRF can greatly improve the percentage of fundamental component, and then the harmonic component can be obtained by subtracting the fundamental harmonic from the load waveform.


## 2.1. Basic Principle of APF

The concept of APF was first proposed by Japanese scientists in the early 70s. The basic principle of APF is to generate a current that has the same amplitude and opposite phase with harmonic current by controllable power semiconductor devices and inject it into the grid, intentionally to cancel the total harmonic current and compensate in real-time. According to different applications, the active power filter can be divided into two categories: DC active power filter and AC active power filter. The former is mainly applied to HVDC system, and the latter (often cited as APF will be discussed in this paper) to AC power system of different voltage levels.An APF usually consists of two functional parts, detecting harmonic signal and generating compensating component. As shown in Figure1, distorted proportion of the current and voltage in grid are detected by the detection circuit of APF. Corresponding compensation current component is then generated from the power circuit under certain control strategy and injected into the grid to achieve the purpose of harmonic elimination.Figure 1
Schematic diagram of APF.


## 2.2. Basic Idea of SRF-Based Harmonic Detection Algorithm

The SRF-based algorithm works by changing a fundamental positive sequence current into direct current by Park Transform, then filtering out the harmonic and reactive current through a low-pass filter (LPF), and finally getting the compensation current reference value [16], as shown in Figure 2.Figure 2
The basic principle of SRF.Current in nonlinear load such as common rectifier bridge consists of the fundamental and (6n±1)th harmonic components, respectively, corresponding to direct current (DC) and alternating current (AC) components in stationary reference frame when converted into fundamental frequency SRF. A LPF precisely designed in fundamental frequency SRF can greatly improve the percentage of fundamental component, and then the harmonic component can be obtained by subtracting the fundamental harmonic from the load waveform.


## 3. SRF-Based Random Harmonic Detection and Compensation

### 3.1. Stability of DC Side Capacitor Voltage

Stabling the DC side capacitor voltage is an important premise to effectively compensate the harmonic currents generated by load. The basic idea (of stabling the DC side capacitor voltage) is to absorb the fundamental active power in the grid by treating the active power filter as the current source device. The low-pass filter in the traditional harmonic detection algorithm is carried out in fundamental frequency SRF. When the load changes suddenly, the time delay during hall current detection of load side is usually neglected. There is a time delay in the harmonic compensating reference calculation process of LPF to extract the current, so the LPF is unable to trace the changes in input. If the load changes suddenly during the process of harmonics compensating, although the APF can instantly sense this change, some fundamental components will still be remained in harmonic detection algorithm. So for the time period from the beginning of mutation in load to the end of time delay in LPF, APF actually absorbs active power from the grid. These active components raise the DC side capacitor voltage, and stronger load current or change causes more obvious fluctuation in the DC side capacitor voltage.The harmonic compensating reference in the random harmonic detection algorithm does not come from the result of subtracting the LPF output from the load current, so the compensating reference, when load changes do not contain fundamental component that largely fluctuate the DC side capacitor voltage, and the voltage can be easily maintained.


### 3.2. Random Harmonic Detection and Compensation

As stated above, when the load suddenly changes, the influence from random harmonic detection and compensation device on the DC side capacitor voltage is much smaller than that from a full compensation shown in Figure2. The random harmonic detection method with preset compensatory angle is commonly used and given in Figure 3.Figure 3
The basic principle of SRF with compensatory angle.The application of the random harmonic detection algorithm in Figure3, however, is limited by large computation. This algorithm will be updated in this paper to reduce computation load and realize quick random detection and compensation of harmonics. The updated algorithm can also ensure the stability of DC side capacitor voltage.In two-phase stationary reference frame, the vector of the load current is composed of the vectors of fundamental and harmonic currents. The (6n+1)th harmonic current vectors are in the same direction with the fundamental current vector and are defined as positive sequence components; correspondingly, the (6n-1)th harmonic current vectors are in the opposite direction to the fundamental current vector and are defined as negative sequence components. The rotational angular velocity of a pair of adjacent harmonic current of positive and negative sequences relative to the fundamental vector is 6nω in two-phase stationary reference frame; therefore, the fundamental, positive, and negative sequences of the load currents under a stationary reference frame can be, respectively, described as follows: (1)iLα1=32I1sin⁡ωt,iLβ=-32I1cos⁡ωt,iLαh+=32Insinnωt,n=6k+1,k=1,2,…,iLβh+=-32Incos⁡nωt,n=6k+1,k=1,2,…,iLαh-=32Insin⁡nωt,n=6k-1,k=1,2,…,iLβh-=32Incos⁡nωt,n=6k-1,k=1,2,….Transfer them with the expression in (2), and then fundamental and harmonic components in fundamental frequency SRF can be obtained, as shown in (3):(2)iLdiLq=CdqαβiLαiLβ=cos⁡θsin⁡θ-sin⁡θcos⁡θiLαiLβ,(3)iLd=32I1+∑k=1,2,…-I6k-1+I6k+1cos⁡6kωt,iLq=32I1+∑k=1,2,…I6k-1+I6k+1sin⁡6kωt,where I1 is the amplitude value of the fundamental current and In of the nth harmonic current. The physical meaning of (3) is that (6k±1)th harmonics in stationary reference frame turn into 6kth harmonic in fundamental frequency SRF.The sum of adjacent positive and negative sequence harmonic current vectors in stationary reference frame is transferred into that of harmonic current vectors with the same rotational speed in fundamental frequency SRF. On the basis of SRF, two different harmonics (6k±1) in stationary reference frame can be abstracted through a pair of band-pass filter (BPF) (6k) in fundamental frequency SRF. For example, the schematic diagram detecting 5th harmonic negative and 7th harmonic positive sequence components of a rectifier load is shown in Figure 4, in which the center frequency of second-order BPF is 300 Hz.Figure 4
The schematic diagram of new SRF-based algorithm for harmonic detection.Extended from the SRF algorithm to detect harmonic, this new algorithm is able to control the power factor as well, so the reactive power compensation can be achieved. Meanwhile, the number of second-order BPFs and the computation of CPU are also reduced.


## 3.1. Stability of DC Side Capacitor Voltage

Stabling the DC side capacitor voltage is an important premise to effectively compensate the harmonic currents generated by load. The basic idea (of stabling the DC side capacitor voltage) is to absorb the fundamental active power in the grid by treating the active power filter as the current source device. The low-pass filter in the traditional harmonic detection algorithm is carried out in fundamental frequency SRF. When the load changes suddenly, the time delay during hall current detection of load side is usually neglected. There is a time delay in the harmonic compensating reference calculation process of LPF to extract the current, so the LPF is unable to trace the changes in input. If the load changes suddenly during the process of harmonics compensating, although the APF can instantly sense this change, some fundamental components will still be remained in harmonic detection algorithm. So for the time period from the beginning of mutation in load to the end of time delay in LPF, APF actually absorbs active power from the grid. These active components raise the DC side capacitor voltage, and stronger load current or change causes more obvious fluctuation in the DC side capacitor voltage.The harmonic compensating reference in the random harmonic detection algorithm does not come from the result of subtracting the LPF output from the load current, so the compensating reference, when load changes do not contain fundamental component that largely fluctuate the DC side capacitor voltage, and the voltage can be easily maintained.


## 3.2. Random Harmonic Detection and Compensation

As stated above, when the load suddenly changes, the influence from random harmonic detection and compensation device on the DC side capacitor voltage is much smaller than that from a full compensation shown in Figure2. The random harmonic detection method with preset compensatory angle is commonly used and given in Figure 3.Figure 3
The basic principle of SRF with compensatory angle.The application of the random harmonic detection algorithm in Figure3, however, is limited by large computation. This algorithm will be updated in this paper to reduce computation load and realize quick random detection and compensation of harmonics. The updated algorithm can also ensure the stability of DC side capacitor voltage.In two-phase stationary reference frame, the vector of the load current is composed of the vectors of fundamental and harmonic currents. The (6n+1)th harmonic current vectors are in the same direction with the fundamental current vector and are defined as positive sequence components; correspondingly, the (6n-1)th harmonic current vectors are in the opposite direction to the fundamental current vector and are defined as negative sequence components. The rotational angular velocity of a pair of adjacent harmonic current of positive and negative sequences relative to the fundamental vector is 6nω in two-phase stationary reference frame; therefore, the fundamental, positive, and negative sequences of the load currents under a stationary reference frame can be, respectively, described as follows: (1)iLα1=32I1sin⁡ωt,iLβ=-32I1cos⁡ωt,iLαh+=32Insinnωt,n=6k+1,k=1,2,…,iLβh+=-32Incos⁡nωt,n=6k+1,k=1,2,…,iLαh-=32Insin⁡nωt,n=6k-1,k=1,2,…,iLβh-=32Incos⁡nωt,n=6k-1,k=1,2,….Transfer them with the expression in (2), and then fundamental and harmonic components in fundamental frequency SRF can be obtained, as shown in (3):(2)iLdiLq=CdqαβiLαiLβ=cos⁡θsin⁡θ-sin⁡θcos⁡θiLαiLβ,(3)iLd=32I1+∑k=1,2,…-I6k-1+I6k+1cos⁡6kωt,iLq=32I1+∑k=1,2,…I6k-1+I6k+1sin⁡6kωt,where I1 is the amplitude value of the fundamental current and In of the nth harmonic current. The physical meaning of (3) is that (6k±1)th harmonics in stationary reference frame turn into 6kth harmonic in fundamental frequency SRF.The sum of adjacent positive and negative sequence harmonic current vectors in stationary reference frame is transferred into that of harmonic current vectors with the same rotational speed in fundamental frequency SRF. On the basis of SRF, two different harmonics (6k±1) in stationary reference frame can be abstracted through a pair of band-pass filter (BPF) (6k) in fundamental frequency SRF. For example, the schematic diagram detecting 5th harmonic negative and 7th harmonic positive sequence components of a rectifier load is shown in Figure 4, in which the center frequency of second-order BPF is 300 Hz.Figure 4
The schematic diagram of new SRF-based algorithm for harmonic detection.Extended from the SRF algorithm to detect harmonic, this new algorithm is able to control the power factor as well, so the reactive power compensation can be achieved. Meanwhile, the number of second-order BPFs and the computation of CPU are also reduced.


## 4. Simulation Analysis

### 4.1. Random Harmonic Detection and Compensation

From the above analysis, it is possible to detect harmonics by designing multigroup of BPFs with center frequencies of6k, k=1,2,3,… in the fundamental frequency SRF. Each group of BPF can extract positive and negative harmonic sequence harmonics with different frequency at the same time.To verify the correctness of the proposed algorithm, a model of harmonic suppression is built in MATLAB (Simulink), of which simulation parameters are shown in Table2. Current waveform of the rectifier bridge with pure resistive load is shown in Figure 5.Table 2
Simulation parameters of all digital harmonic devices.
Parameters
Value
Grid voltage
0.4 KV
DC side voltage
0.9 KV
DC side capacitor voltage
6800μF
Output impedance
0.6 mH, 0.01 Ω
Load resistance
5 ΩFigure 5
Current waveform of the rectifier bridge with pure resistive load.Thed, q components of harmonic current with the order less than 31 are shown in Figures 6 and 7, respectively. The compensated current and its spectrum are given in Figure 8.Figure 6
Thed component of harmonic current.Figure 7
Theq component of harmonic current.Figure 8
Compensated current waveform and spectral waveform.According to the current waveform and harmonic distortion rate after compensation, harmonics of all frequency are well compensated by the APF with the proposed method.


### 4.2. Waveform Comparison under Sudden Change of Load

For sudden changes in load, simulate and compare the effects of full compensation and random compensation. The nonlinear load consists of a bridge rectifier and a pure resistance, and the load current is suddenly doubled at 0.6 s and then halved at 0.75 s, as shown in Figure9.Figure 9
The load current waveform.Figures10 and 11 show the corresponded grid currents for full compensation and random compensation, respectively. Figures 12 and 13 are waveforms for DC side capacitor voltages under these two kinds of compensations.Figure 10
The grid current waveform under full compensation.Figure 11
The grid current waveform under random compensation.Figure 12
The capacitor voltage waveform under full compensation.Figure 13
The capacitor voltage waveform under random compensation.These simulation results indicate that the SRF-based algorithm for harmonic detection and compensation proposed in this paper has good filtering effect to the harmonic current generated by simulation. When the load current changes suddenly, the random harmonic compensation algorithm does not import fundamental components, so it will not affect the DC side capacitor voltage.


## 4.1. Random Harmonic Detection and Compensation

From the above analysis, it is possible to detect harmonics by designing multigroup of BPFs with center frequencies of6k, k=1,2,3,… in the fundamental frequency SRF. Each group of BPF can extract positive and negative harmonic sequence harmonics with different frequency at the same time.To verify the correctness of the proposed algorithm, a model of harmonic suppression is built in MATLAB (Simulink), of which simulation parameters are shown in Table2. Current waveform of the rectifier bridge with pure resistive load is shown in Figure 5.Table 2
Simulation parameters of all digital harmonic devices.
Parameters
Value
Grid voltage
0.4 KV
DC side voltage
0.9 KV
DC side capacitor voltage
6800μF
Output impedance
0.6 mH, 0.01 Ω
Load resistance
5 ΩFigure 5
Current waveform of the rectifier bridge with pure resistive load.Thed, q components of harmonic current with the order less than 31 are shown in Figures 6 and 7, respectively. The compensated current and its spectrum are given in Figure 8.Figure 6
Thed component of harmonic current.Figure 7
Theq component of harmonic current.Figure 8
Compensated current waveform and spectral waveform.According to the current waveform and harmonic distortion rate after compensation, harmonics of all frequency are well compensated by the APF with the proposed method.


## 4.2. Waveform Comparison under Sudden Change of Load

For sudden changes in load, simulate and compare the effects of full compensation and random compensation. The nonlinear load consists of a bridge rectifier and a pure resistance, and the load current is suddenly doubled at 0.6 s and then halved at 0.75 s, as shown in Figure9.Figure 9
The load current waveform.Figures10 and 11 show the corresponded grid currents for full compensation and random compensation, respectively. Figures 12 and 13 are waveforms for DC side capacitor voltages under these two kinds of compensations.Figure 10
The grid current waveform under full compensation.Figure 11
The grid current waveform under random compensation.Figure 12
The capacitor voltage waveform under full compensation.Figure 13
The capacitor voltage waveform under random compensation.These simulation results indicate that the SRF-based algorithm for harmonic detection and compensation proposed in this paper has good filtering effect to the harmonic current generated by simulation. When the load current changes suddenly, the random harmonic compensation algorithm does not import fundamental components, so it will not affect the DC side capacitor voltage.


## 5. Experimental Verification

The algorithm of random harmonic detection and compensation proposed in this paper is employed in a full digital controller for APF to verify its effect. The load is composed of a three-phase control rectifier and a pure resistance set to 3 Ω. A power quality analyzer of model FLUKE 434 was selected as measurement instrument. The current waveforms of three-phase grid before and after compensation are shown in Figures14 and 15, respectively, and their harmonic contents are shown in Figures 16 and 17.Figure 14
Current fluctuation curve before compensation.Figure 15
Current fluctuation curve after compensation.Figure 16
Current harmonic contents before compensation.Figure 17
Current harmonic contents after compensation.The heavily distorted current is restored to normal waveform after harmonic detection and compensation, and the effect of active power filter with our algorithm is significant. The experimental results show that the SRF-based method for harmonic detection and compensation can be well used to detect and compensate harmonics of specified order, and the DC side capacitor voltage can also be stable even when the load changes suddenly. This is the key why the APF can filter efficiently.


## 6. Conclusion

The paper proposes a new SRF-based algorithm for random harmonic detection and compensation, and its mathematical principle is also deduced. Simulation and experiment show that the method is correct and practical. The conclusion can be drawn as follows.Compared with traditional SRF harmonic detection algorithms, the computation is significantly reduced. When this new algorithm is applied to APF system, the operation burden of the digital controller can be reduced effectively and the control speed of the overall system is improved.Avoiding obtaining the harmonic command from the subtraction of load current and output of the low-pass filter, this new algorithm does not affect the fluctuation of DC side capacitor voltage.



---

*Source: 7239267-2017-06-06.xml*