Random Harmonic Detection and Compensation Based on Synchronous Reference Frame

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 of 6kth 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.


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][2][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][6][7][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][11][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][22][23][24][25][26][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.
Different 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.

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 Figure 1, 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.

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.
Current in nonlinear load such as common rectifier bridge consists of the fundamental and (6 ± 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.

SRF-Based Random Harmonic
Detection and Compensation

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 lowpass 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.

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 Figure 2. The random harmonic detection method with preset compensatory angle is commonly used and given in Figure 3.
The application of the random harmonic detection algorithm in Figure 3, 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 (6 + 1)th harmonic current vectors are in the same direction with the fundamental current vector and are defined as positive sequence components; correspondingly, the (6 − 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 6 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: Transfer them with the expression in (2), and then fundamental and harmonic components in fundamental frequency SRF can be obtained, as shown in ( 3): where  1 is the amplitude value of the fundamental current and   of the th harmonic current.The physical meaning of (3) is that (6 ± 1)th harmonics in stationary reference frame turn into 6th 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 (6 ± 1) in stationary reference frame can be abstracted through a pair of band-pass filter (BPF) (6) 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.
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.

Random Harmonic Detection and Compensation.
From the above analysis, it is possible to detect harmonics by designing multigroup of BPFs with center frequencies of 6,  = 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 Table 2. Current waveform of the rectifier bridge with pure resistive load is shown in Figure 5.
The ,  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.
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.

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 Figure 9.
Figures 10 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.
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.

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 Figures 14 and 15, respectively, and their harmonic contents are shown in Figures 16 and 17.
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.

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.

Figure 3 :
Figure 3: The basic principle of SRF with compensatory angle.

Figure 4 :
Figure 4: The schematic diagram of new SRF-based algorithm for harmonic detection.

Figure 5 :Figure 6 :Figure 7 :
Figure 5: Current waveform of the rectifier bridge with pure resistive load.

Table 1 :
Comparison of different methods.

Table 2 :
Simulation parameters of all digital harmonic devices.