Decreasing Harmonics via Three Phase Parallel Active Power Filter Using Online Adaptive Harmonic Injection Algorithm

Three-Phase Parallel Active Power Filter (PAPF) control mechanism via a novel Adaptive Harmonic Injection (AHI) algorithm is proposed in order to filter out harmonics generated by non-linear loads and carry out reactive power compensation. The presented PAPF mechanism is composed of two stages. Before is the extraction of reference current to determine currents with harmonics. Once the reference current is determined, according to the reference current, appropriate current harmonics are injected by triggering of the inverter switches. The proper amplitude and phase values of the harmonics that will be injected are estimated online at any instant by the AHI algorithm. In this study, the sine and the cosine of the phase angle for any harmonic order is weighted by the values estimated via the AHI algorithm, thus obtaining harmonic orders at the desired amplitude and phase. Simulations are performed using various non-linear loads in order to validate the proposed method.


INTRODUCTION
Although grid voltage varies sinusoidally, loads that contain thyristor or diode rectifiers draw significant amounts of harmonic currents from the grid.These harmonic currents cause harmonic voltage drops in system impedance, leading to voltage distortions at the point of common coupling.This distortion in voltage affects other receivers at the same distribution level.Hence, the harmonic suppression is very important in today's distribution power systems [1,2].
Acceptable limits for voltage and current harmonics in the grid are recommended by IEEE-519-1992 standards where Total Harmonic Distortion (THD %) value is determined as 5% for the current and 3% for the voltage [3].In order to meet these requirements and maintain electrical power quality at an acceptable range, active power filters are widely used.Parallel active power filters are the most widely used type of active power filters in the industry [4,5].The most important objective for the use of parallel active power filters is to overcome load current harmonics.In addition, reactive power compensation and three-phase current balancing are also carried out [6].The general structure of voltage source PAPF is shown in Fig. 1.The basic principle of PAPF is to inject currents in reverse phase and equal magnitude to the grid in order to eliminate the harmonics of load current and to perform reactive power compensation.Thus, harmonics are eliminated and the source current oscillates sinusoidally.

AC Grid
Hence, the harmonic components drawn by the load currents should be determined.It is important to extract the correct value of the reference current for successful application of PAPF.Different reference current extraction methods in the literature are summarized in Fig. 2.Among these methods, time domain and frequency domain based approaches are the most commonly used ones [7].Although different reference current extraction methods have their own limitations, most of them operate stable under constant loads.However, their performance is affected significantly under varying load conditions.Different approaches are proposed in the literature, in order to mitigate their performance under varying load conditions.
For instance, in artificial neural networks based reference current extraction methods, a lot of data is required to train the network [8].Similarly, calculations are cumbersome and take too much time in Fourier transformation based methods [4].Some authors have suggested algorithms based on least mean square (LMS).Badoni et al., propose a least squares based PAPF for harmonic compensation, power factor correction, load balancing and voltage regulation [9].In [10], least squares method is compared with the Wiener filter approach in terms of their reactive power resolution and other power quality measures.In [11], a parallel PAPF structure composed of different filter types is utilized instead of a single PAPF, so that, a more reliable and a flexible filtering is achieved.The method proposed in [12] makes use of inverter DC link voltage where the DC link voltage is decreased without sacrificing from the compensation ability of the active filter.Technical Gazette 25, Suppl.1(2018), 157-164 In this study, a normalized least mean square method based AHI algorithm is used as the reference current extraction method.The proposed AHI algorithm rapidly and accurately estimates proper amplitude and phase values of to-be-injected harmonic orders in an online manner.Estimated current harmonics values are reinjected to the grid with an opposite phase and amplitude, thus minimizing the current harmonics.The AHI algorithm keeps track of the changes in load operating characteristics and adapts itself accordingly.This method was previously applied successfully on a controller board.It was shown that, the method may be used as a computationally efficient torque ripple reduction mechanism in permanent magnet synchronous motor [13].Different control methods are used to generate the switching signals according to the acquired reference current.The PWM, hysteresis, sliding mode or fuzzy based methods are widely used [4].Hysteresis band current controller (HBCC) is used in this study.HBCC is a popular controlling method due to its simplicity and fast implementation.HBCC is a non-linear current controlling method which ensures that the output current of the inverter stays inside a certain band interval thus directly controlling the current [14,15].Reference current is compared with the actual current, in the proposed method, and inverter switching signals are generated according to the acquired current error.

ADAPTIVE HARMONIC INJECTION (AHI) ALGORITHM
An overview of current harmonic analysis and limitations along with the Adaptive Harmonic Injection (AHI) Algorithm are presented in the sequel.

Current Harmonic Analysis and Limitations
Harmonics are defined as sine components of a periodic wave with frequencies at multiples of the fundamental frequency [16].The total harmonic distortion (THD) of a signal is defined as the ratio of sum of powers of all harmonic components to the power of the fundamental frequency [4].Harmonic Distortion can be viewed as the difference of a signal from an ideal sine wave.THD for current can be expressed as: where, I sh are the current harmonics.Non-linear loads (rectifiers, inverters, AC regulators etc.) draw non-linear current from the grid in electrical systems.Power electronic based equipment such as motor drivers, switched power sources, alternative current (AC)/direct current (DC) converters are frequently used in recent years, due to technological advancements.This equipment are loads with non-linear properties.The controlled or uncontrolled switching operations required for them yield a non-linear operating characteristic.These loads have negative impacts on the voltage and current signals of the grid they feed on and decrease the energy quality by drawing non-linear currents.These non-linear currents generate voltage harmonics in the power systems and the generated voltage harmonics spread out over the entire power system, thus affecting all elements of the system.In addition, current and voltage harmonics result in overheating of the transformers, increase in losses, decrease in the power factor and efficiency of the system.In addition to the aforementioned power quality issues, reactive power is also drawn from the grid and harmonics start to be generated as the signal form of the current drawn from the grid diverts from the sinusoidal nature.Whereas 3 and multiples of 3 rd harmonics are observed to be dominant in single-phased loads; 5 th , 7 th and 11 th order harmonics are observed in three-phased loads [19].Various limitations are recommended in order to protect the power systems and devices against harmonics.These limitations declared by IEEE and IEC are accepted as harmonic standards in many countries around the world.
The IEEE Std 519 brings limitations to the current and voltage harmonics at the Point of Common Connection (PCC).Tab. 1 shows the current harmonic limits recommended by IEEE Std 519-1992.The aim of these standards is to keep the harmonic currents that have negative impacts on the receivers of the power system within certain limits.Tight limitations are imposed on low Short Circuit Ratio (SCR).SCR is defined as the ratio of effective value of maximum short-circuit current (I SC ) to effective value of the average demanded maximum load current (I L ) per month.TDD can be defined Total Demand Distortion of the current [20].The harmonics in electrical grid is generally periodic.That is why, injecting proper current harmonics to the grid is one of the most effective methods for suppressing the harmonics caused by non-linear loads.These harmonic components can be suppressed by injecting to the grid the 3 rd , 5 th , 7 th and the 11 th harmonics generated by non-linear loads connected to the electrical grid with the proper phase and amplitude.The amplitude and phase of the harmonic order that will be injected can be expressed as: sin( ) where, h is the order of harmonic, i m is the amplitude of the current with harmonics, ω is the angular frequency and φ represents the phase of the harmonic.For example, for the 1 st harmonic: If i mh sin(φ) = w 1 and i mh sin(φ) = w 2 are replaced for the amplitude and phase of the current with constant harmonic, it can be expressed for the h th harmonic as: As can be seen, a harmonic with the desired amplitude and phase can be obtained if the sine and cosine of the phase angle for any given harmonics are scaled by proper values.These proper values are called as weights and denoted by w, and the Adaptive Harmonic Injection (AHI) algorithm is used to determine the weights [12].

AHI Algorithm
AHI algorithm is a novel technique comprised of more than one sub-value and depending on the combination of data from the input which operates linearly.This is an algorithm which was applied successfully in various image processings and computer vision problems, and wireless communication applications [19][20][21].This algorithm was also successfully applied in reducing the moment fluctuations in motors.Sub-values or inputs are combined linearly using updated weights with an Adaptive Data/Decision Fusion (ADF) method that is based on making projections on convex sets that define sub-values in an online manner [12].
This method is based on the principle of injecting a harmonic with the desired magnitude to the system in order to decrease harmonics.The proper amplitude and phase values of the harmonics to be injected are estimated in an online fashion at each instant of time.Adaptive Harmonic Injection (AHI) algorithm is used to determine weight values of each harmonic for injecting harmonics at the proper amplitude and phase.The harmonic orders to be injected are determined in advance using the proposed AHI method.Sine and cosine values of each harmonic phase angle are scaled by corresponding weights and linearly combined [12].
As can be seen in Fig. 3, the difference between load current and filter current is estimated to determine the error term.This difference is not used directly as the error term.The error term is obtained by subtracting the current value from the previous value.The weight values are updated in an online manner depending on the increase and decrease in error values.

Weight Update Mechanism
Let us assume that the combined algorithm is comprised of N sub-inputs (harmonics); H1, H 2 ,…, H N .Each sub-input at the time step -n generates an input value with an average of zero (H(x,n) ∈ R) for a sample x input.
Let us define the expression ( ) ( ) ( ) as the vector of the value of the sub-inputs at the n th time step for the input x and ( ) ( ) ( )  as the weight vector at that instant.We define the estimated y(x,n) value as follows: The difference between the desired y(x,n) and estimated value ( ) ( where, E denotes the expectation operator.If the expression is derived with respect to weight: , And if the expression is equated to zero; N -many equations are obtained.The solution of these equations is called the Wiener Solution.However, the solution to the following equation is obtained by using the gradient in Eq. ( 7) inside an optimization algorithm, known as the steepest descent algorithm, for obtaining a repeating solution for the minimization problem (6); where, λ is the step size.Instead of the expectation values, instantaneous values are used in ( 9): The following can be written instead of the step size λ, in Eq. ( 10): Weights of the harmonics are updated according to Eq. (12).Here, μ is the update parameter and the NLMS algorithm converges to the Wiener solution for 0<μ<2 [19].

ADAPTIVE HARMONIC INJECTION (AHI) ALGORITHM 3.1 Harmonic Power and Current (Power and Current with Harmonic)
If the grid is assumed that the pure, in other words doesn't have harmonics, the grid voltage is in the ideal form and can be expressed by the Eq. ( 13).

( )
If it is assumed that this grid feeds a non-linear load, the general expression of the current drawn from the grid is given by Eq. ( 14).This current equation includes both the fundamental current component and infinite number of harmonics.This current can be expressed as: In the equation the fundamental component is the maximum value of first order harmonic I m is also the maximum value of the load current.The sign of the phase angle φ 1 of the load is written as a general expression independent of the inductive or capacitive load condition.The instantaneous power drawn from the grid can be expressed as: If the Eq. ( 13) and Eq. ( 14) are placed in Eq. ( 15), the following power components are obtained: As can be seen from Eq. ( 16), active power in addition reactive power and infinite number of harmonics are drawn from the grid.If it is separated active power in Eq. ( 16) If it is withdrawn from the active power the instantaneous power value expressed by Eq. ( 16) the reactive and harmonic power components are acquired.Similarly, in Eq. ( 14), if the real current is subtracted from the total current the harmonic and reactive current components are obtained.Fig. 4 shows the block diagram of PAPF comprised AHI algorithm.

Reactive Power Compensation
Reactive power is used some electrical equipment that uses a magnetic field, such as motors, generators and transformers.The reactive power demand causes unnecessary current circulation in the grid.Generating reactive power at a point closer to the load has many advantages in power generation, transmission and distribution system.These advantages can be summarized as the increase of the power capacity of the grid, decrease in heat losses with decreasing current as well as decrease in harmonics.
PAPF is generally used to decrease the currents harmonics and for reactive power compensation [22].Proposed PAPF method provides fast and dynamic reactive power compensation even under varying load conditions.Both current harmonics and reactive current are estimated online via AHI algorithm as shown in Figure 4.

Hysteresis Band Current Controller (HBBC)
In this study switching signals are obtained by using Hysteresis Band Current Controller (HBCC) as a control method.Hysteresis Band Current Controller (HBCC) is proven that it is an effective method for generating gate signals in all applications of active power filters with voltage source inverters.In addition, this is a consistent and fast method with a high accuracy rate [13].It is a control method in which reference compensation current and actual compensation current are combined on a hysteresis band to generate switching signals.HBCC is a non-linear current controlling method which ensures that the output current of the inverter keeps tracking within a certain band.Output currents and reference currents are compared in order to control the current at the inverter output.The acquired error signals are applied to the hysteresis controllers to generate switching signals.As can be seen in Fig. 5, S2 switch starts conducting when the error signal reaches the upper limit of the hysteresis band thus decreasing the current, whereas S1 switch starts conducting when the error signal reaches the lower limit of the hysteresis band thus increasing the current.
In this study, reference currents are compared with the inverter output currents and the obtained error signals are applied to the HBCC as input signals.The required gate signals are generated via HBCC which are required to track the reference values of the inverter currents.Since twolevel inverter is used in the simulation study, totally 6 gate signals are needed.

SIMULATION RESULTS FOR PAPF WITH AHI ALGORITHM
In this study, the block diagram of the 3-phase, 3-wired two-level voltage source inverter based PAPF is given in Fig. 6.As can be seen from the figure, PAPF is comprised of a three-phased grid, an inverter, a connection inductance to connect the inverter to the grid, non-linear loads, AHI algorithm for detecting the current harmonics and a controlling unit for controlling the inverter current.To obtain the non-linear loads, 6 pulse bridge diode rectifier that feeds the R-L load is used to generate the harmonic currents as shown in Fig. 7.  Wave form for the three phases of the current drawn by non-linear loads and FFT analysis are shown in Fig. 8.As can be seen from Fig. 8, the current wave form drawn from the grid as a result of the non-linear characteristics of the loads is not sinusoidal when PAPF is disabled and that the THD% is 20,61.As can be seen in Fig. 8a THD% is much higher than the 5% value recommended in the IEEE-519 standards.Whereas the currents drawn by non-linear loads have transformed into pure sinusoidal when PAPF is enabled, THD% decreased to 1,92%.This THD% value is observed to be much less than the 5% value recommended in the IEEE-519 standards.Waveform and FFT analysis of the currents drawn by non-linear loads when loaded with Load-2 is shown in Fig. 9.As can be seen from Fig. 9, the current waveform drawn from the grid by loads as a result of their non-linear characteristics is not sinusoidal and that THD% is 17,71%.This value is much higher than 5% value recommended in IEEE-519 standards.Whereas the currents drawn by nonlinear loads transformed into pure sinusoidal when PAPF with AHI algorithm enabled, THD% decreased to 1,53%.This THD% value is observed to be much less than 5% value recommended in the IEEE-519 standards.Wave forms for the three phases of the current drawn by non-linear loads with capacitance are shown in Fig. 10.As can be seen from Fig. 10, the current wave form drawn from the grid as a result of the non-linear characteristics of the loads is not sinusoidal when PAPF is disabled.As can be seen from Fig. 11, whereas the currents drawn by non-linear loads transformed into pure sinusoidal when PAPF with AHI algorithm enabled.The gate signals generated by HBCC switch the inverter thus generating the filter current.It is aimed that the generated filter current will follow the reference current harmonics calculated via AHI algorithm.Fig. 12 shows the success of PAPF in following the reference current.The reactive power drawn by the non-linear loads in Fig. 13 is drawn to zero when PAPF with AHI algorithm kicked in thus resulting in successful reactive power compensation.

CONCLUSION
The objective of this study is to apply the Adaptive Harmonic Injection algorithm which is a new control algorithm to the Parallel Active Power Filter (PAPF) thus suppressing current harmonics and providing reactive power compensation.Performance of an APF using the AHI algorithm has been studied.In summary reviewed in section 2, AHI algorithm consists of the error term and the harmonic weight values.The difference between load current and filter current is estimated to determine the error term.The harmonic weight values are updated in an online manner depending on the increase and decrease in error values.
The estimated harmonic components are injected to the grid in the opposite phase via PAPF with the aim of suppressing the harmonics generated by non-linear loads.Since the current harmonics are periodic in grid, it is possible to suppress these harmonics with the injection of calculated current harmonics.Harmonics resulting from non-linear loads have different amplitude and phase values for each harmonic component under different load conditions.That is why, the major advantage of this a new adaptive method, it yields successful results in determining harmonic values under different and sudden load conditions.This situation is shown via simulation results that PAPF with AHI algorithm successful suppresses current harmonics under different load conditions.The acquired results show that the applied method keeps the total harmonic distortion much below the 5% value that is recommended in the IEEE-519 standards.

Figure 2
Figure 2 Reference Current/Voltage extraction methods

Figure 3
Figure 3 Block Diagram of Adaptive Harmonic Injection Algorithm , y x n is defined as the error of the system: ( ) ( ) ( ) by minimizing the mean square error (MSE).

Figure 4
Figure 4 PAPF Block Diagram with AHI Algorithm

Figure 5
Figure 5 PAPF Block Diagram with AHI Algorithm

Figure 6
Figure 6 Block Diagram for PAPF with AHI Algorithm

Figure 7 R
Figure 7 R-L Load with Diode Rectifier Load parameters are shown in Tab. 2.

Figure 8
Load-1 simulation results: a -Currents drawn by non-linear loads from the grid (PAPF disabled), b -FFT of the currents drawn by non-linear loads (PAPF disabled), c -Currents drawn by non-linear loads from the grid (PAPF enabled) and d -FFT of the currents drawn by non-linear loads (PAPF enabled)

Figure 9
Load-2 simulation results: a -Currents drawn by non-linear loads from the grid (PAPF disabled), b -FFT of the currents drawn by non-linear loads (PAPF disabled), c -Currents drawn by non-linear loads from the grid (PAPF enabled) and d -FFT of the currents drawn by non-linear loads (PAPF enabled)

Figure 10
Figure 10 Currents drawn by non-linear loads from the grid (PAPF disabled)

Figure 11
Figure 11 Currents drawn by non-linear loads from the grid (PAPF enabled)

Figure 12
Figure 12 Performance of PAPF with AHI algorithm in Following the Reference Current

Figure 13
Figure13 Active, reactive and apparent power signals

Table 2
Load Parameters