A Wavelet-Based Unified Power Quality Conditioner to Eliminate Wind Turbine Non-Ideality Consequences on Grid-Connected Photovoltaic Systems

Abstract: The integration of renewable power sources with power grids presents many challenges, such as synchronization with the grid, power quality problems and so on. The shunt active power filter (SAPF) can be a solution to address the issue while suppressing the grid-end current harmonics and distortions. Nonetheless, available SAPFs work somewhat unpredictably in practice. This is attributed to the dependency of the SAPF controller on nonlinear complicated equations and two distorted variables, such as load current and voltage, to produce the current reference. This condition will worsen when the plant includes wind turbines which inherently produce 3rd, 5th, 7th and 11th voltage harmonics. Moreover, the inability of the typical phase locked loop (PLL) used to synchronize the SAPF reference with the power grid also disrupts SAPF operation. This paper proposes an improved synchronous reference frame (SRF) which is equipped with a wavelet-based PLL to control the SAPF, using one variable such as load current. Firstly the fundamental positive sequence of the source voltage, obtained using a wavelet, is used as the input signal of the PLL through an orthogonal signal generator process. Then, the generated orthogonal signals are applied through the SRF-based compensation algorithm to synchronize the SAPF’s reference with power grid. To further force the remained uncompensated grid current harmonics to pass through the SAPF, an improved series filter (SF) equipped with a current harmonic suppression loop is proposed. Concurrent operation of the improved SAPF and SF is coordinated through a unified power quality conditioner (UPQC). The DC-link capacitor of the proposed UPQC, used to interconnect a photovoltaic (PV) system to the power grid, is regulated by an adaptive controller. Matlab/Simulink results confirm that the proposed wavelet-based UPQC results in purely sinusoidal grid-end currents with total harmonic distortion (THD) = 1.29%, which leads to high electrical efficiency of a grid-connected PV system.


Introduction
With the increasingly energy crisis and environmental pollution, the use of renewable green energy sources, such as wind and solar, has been becoming popular worldwide.However, how to integrate these renewable sources into a power system, a challenging issue, has been attracting considerable attention [1][2][3][4][5].
On one hand, rapid growth of non-linear loads such as power electronic inverters, used to integrate the renewable power sources into the grid, raises drastic power quality issues throughout supply networks.This results in many technical issues such as overheating of transformers, false operation of circuit breakers and relays, reduction in transmission system efficiency, and so on [6,7].To address such issues, active power filters (APFs) are introduced into the power systems, and accordingly many compensation algorithms have been proposed to direct the control of the APFs.The generalized theory of instantaneous power (GTIP), for instance, was introduced in [8], and this compensation theory was then suggested for an interfaced photovoltaic system in [9].However, under non-ideal waveforms, the GTIP theory results in highly source-end zero current components [10].Many other prominent power theories, such as current's physical component [11], conservative power theory [12], the Fryze, Buchholz and Depenbrock method [13], and the p-q-r theory [14][15][16] were also proposed.However, these algorithms still result in unacceptable outcomes, particularly under unbalanced and nonlinear load conditions [10].Therefore, the available active filters which are used in [17][18][19][20][21] to interface DGs with power grids cannot greatly suppress harmonics and disturbances under non-linear unbalanced conditions, worsening the power quality issues.In [10], a compensation algorithm based on the advanced generalized theory of instantaneous power (A-GTIP) is proposed to control the shunt active power filter (SAPF) particularly in presence of non-linear loads.Further, the SAPF controlled by that A-GTIP method is used to integrate a photovoltaic (PV) system into the power grid [22].However, this method, like other compensation algorithms including current's physical component [11] and conservative power theory [12], depends on two variables, namely load-terminal currents and voltages, to calculate the oscillated active and inactive powers.Hence, under distorted load-terminal voltages or currents, these methods work unsatisfactorily.This condition will worsen when the plant includes wind turbines which inherently produce the 3rd, 5th, 7th and 11th voltage harmonics [23,24].
In [25], a synchronous reference frame (SRF)-based compensation algorithm is introduced to extract the SAPF's references.This method only needs the information of one variable, namely the load-terminal current.In this method, the measured load current is transferred to the synchronous rotating frames, using cosine and sinus functions which are extracted by the phase locked loop (PLL).The generated reference of the SAPF is then synchronized with the supply voltages, using PLL-based orthogonal cosine and sinus signals.This method is unable to perfectly recognize and compensate those harmonic loads which show low impedances at certain frequencies.In addition, the accuracy of this method depends on what level the employed PLL can work properly.Therefore, efforts have been made to develop a more accurate PLL.In [26], a modified PLL structure has been developed to limit the total harmonic distortion (THD) of compensated current to 2.7%.In [27], a self-tuning filter, controlled by the SRF method, has been suggested to improve the APFs' performance.That suggestion has limited the compensated current THD to 2.07%.The neural network is suggested in [28] to improve the accuracy of the SRF method under sinusoidal load terminal voltages.That suggestion leads the compensated current THD to be limited to 1.45%.To improve the SRF-based control algorithm under non-sinusoidal load-terminal voltages, a wavelet-based PLL is proposed in [29].That method has been suggested in a three-phase four-wire system, and limited the THD of the compensated current to 1.90%.But, it works inaccurately in face of unbalanced load conditions.Moreover, the employed wavelet-based PLL is highly susceptible to noise, particularly under source voltage harmonics and distortions.In addition, the employed wavelet-based low-pass filter, used to improve the transient response of the SAPF, results in a drastic 0.02 s delay of the SAPF.
On the other hand, the APFs with controllable DC/AC inverters are an excellent option to integrate renewable power sources into the power grid as shown in Figure 1, since they give flexible functions to overall interconnected renewable energy sources, so as to supply the power grid and at the same time work as energy conditioners [30].Thus, developing an accurate control algorithm for the APFs can also enhance the overall efficiency of the integrated renewable sources.through a unified power quality conditioner (UPQC).Finally, an adaptive control algorithm is developed to facilitate the integration of the PV systems into the power grid.The proposed adaptive controller manages the PV output power to regulate the dc-link voltage of the proposed UPQC.

Practical Issues and Proposed Solutions
The A-GTIP based compensation algorithm was proposed in [10].This method was further suggested to control an active filter which also integrates a PV system into the power grid [22].In this method, firstly positive component of source voltage in fundamental sequence is made at the point of common coupling (PCC).Then, using the information of two variables, namely load voltage and current, the DC component of the active power is extracted.Further, the required current reference to control the SAPF is generated using (1).However, an ideal positive sequence voltage can never be made at the PCC.This is due to the technological limitations of the SF.The limitations are raised due to modulating switching frequencies, such as the employed control, microcontroller processing speed, and modulation techniques, delays and so on.This accordingly leads the non-sinusoidal voltage components in Equation (1) (i.e., VS(t)) to act as a source of distortion.
The SRF-based compensation algorithm, on the contrary, only needs the information of one variable, namely the load-terminal current.In this method, the first step is to extract the fundamental positive sequence of the load current (IL1 + ).To this aim, the load-terminal current is transferred into the d-q coordinate, i.e., synchronous rotating frame, using park transform.In the d-q coordinate, the fundamental sequence of positive component of load-terminal current emerges as a DC value, while other harmonics appear as an AC value.This means that all frequencies are reduced by a specific amount.Subsequently, the DC component of the d-axis, extracted by a low-pass filter (LPF), will be returned to the abc coordinate via inverse park transform to yield the fundamental sequence of the positive component of load-terminal current (i.e., IL1 + ).Then, the extracted IL1 + is subtracted from the instant load-terminal current to obtain the reference current of the SAPF, i.e., IC = IL − IL1 + .As This paper initially develops a wavelet-based PLL to generate orthogonal signals required for the SRF-based compensation algorithm of the SAPF.Then, to further force the remained uncompensated source-end current harmonics and distortions to pass through the SAPF, a current harmonic suppression loop is inserted into the compensation algorithm of a series filter (SF) alongside the SAPF.This fully cancels all the source-end current harmonics and distortions in three-phase four-wire system.Furthermore, the concurrent operation of the proposed wavelet-based SAPF and the SF is proposed through a unified power quality conditioner (UPQC).Finally, an adaptive control algorithm is developed to facilitate the integration of the PV systems into the power grid.The proposed adaptive controller manages the PV output power to regulate the dc-link voltage of the proposed UPQC.

Practical Issues and Proposed Solutions
The A-GTIP based compensation algorithm was proposed in [10].This method was further suggested to control an active filter which also integrates a PV system into the power grid [22].In this method, firstly positive component of source voltage in fundamental sequence is made at the point of common coupling (PCC).Then, using the information of two variables, namely load voltage and current, the DC component of the active power is extracted.Further, the required current reference to control the SAPF is generated using (1).However, an ideal positive sequence voltage can never be made at the PCC.This is due to the technological limitations of the SF.The limitations are raised due to modulating switching frequencies, such as the employed control, microcontroller processing speed, and modulation techniques, delays and so on.This accordingly leads the non-sinusoidal voltage components in Equation (1) (i.e., V S (t)) to act as a source of distortion.

#
I L1 ptq " The SRF-based compensation algorithm, on the contrary, only needs the information of one variable, namely the load-terminal current.In this method, the first step is to extract the fundamental positive sequence of the load current (I L1 + ).To this aim, the load-terminal current is transferred into the d-q coordinate, i.e., synchronous rotating frame, using park transform.In the d-q coordinate, the fundamental sequence of positive component of load-terminal current emerges as a DC value, while other harmonics appear as an AC value.This means that all frequencies are reduced by a specific amount.Subsequently, the DC component of the d-axis, extracted by a low-pass filter (LPF), will be returned to the abc coordinate via inverse park transform to yield the fundamental sequence of the positive component of load-terminal current (i.e., I L1 + ).Then, the extracted I L1 + is subtracted from the instant load-terminal current to obtain the reference current of the SAPF, i.e., I C = I L ´IL1 + .
As mentioned, this method involves two drawbacks.The first is the disability to compensate for the load currents under the distorted load-terminal voltages, due to the inaccuracy of the PLLs used in this method to extract and synchronize the SAPF reference [29,31].The second is the SRF-based compensation algorithm performs unexpectedly when a non-linear load shows a very low impedance in some frequency components (see load impedance (Z L ) in Figure 2).As a result, the injected current by the SAPF cannot perfectly compensate for the load harmonics.Therefore, the source-end currents become non-sinusoidal.
Energies 2016, 9, 390 4 of 16 mentioned, this method involves two drawbacks.The first is the disability to compensate for the load currents under the distorted load-terminal voltages, due to the inaccuracy of the PLLs used in this method to extract and synchronize the SAPF reference [29,31].The second is the SRF-based compensation algorithm performs unexpectedly when a non-linear load shows a very low impedance in some frequency components (see load impedance (ZL) in Figure 2).As a result, the injected current by the SAPF cannot perfectly compensate for the load harmonics.Therefore, the source-end currents become non-sinusoidal.Hence, arranging a Kirchhoff's voltage law (KVL) within the available loop as well as a Kirchhoff's current law (KCL) at the load terminal point will yield: where G(jω) is the transfer function relating ISAPF to IL.Both the source-end current IS(t) and the load current IL(t) are obtained for a given ù below: According to Equation (3), when a non-linear load shows a very low impedance in some frequency components, the source-end current in the given harmonics (ω = ωh) cannot be fully compensated by the SAPF, as can be seen in Figure 16a in the simulation section, where the THD of the source-end current becomes 1.34% for K = 0.
Two solutions are presented here to overcome the mentioned drawbacks and to accurately control the SAPF, particularly in terms of wind plant non-ideal voltages.Firstly, wavelet theory is applied to take one step forward addressing the inaccuracy of the typical PLLs required for an orthogonal signal generator process within the SRF-based control algorithm.Secondly, to further force the remained uncompensated load current harmonics to pass through the SAPF, this paper proposes a current suppression loop, inserted in the control algorithm of the SF.

Wavelet Transform
By translating/dilating a few basic shapes, the Fourier series-based wavelet transform (WT) maps the time-frequency localization of a signal below [32][33][34]: Hence, arranging a Kirchhoff's voltage law (KVL) within the available loop as well as a Kirchhoff's current law (KCL) at the load terminal point will yield: where G(jω) is the transfer function relating I SAPF to I L .Both the source-end current I S (t) and the load current I L (t) are obtained for a given ù below: According to Equation (3), when a non-linear load shows a very low impedance in some frequency components, the source-end current in the given harmonics (ω = ω h ) cannot be fully compensated by the SAPF, as can be seen in Figure 16a in the simulation section, where the THD of the source-end current becomes 1.34% for K = 0.
Two solutions are presented here to overcome the mentioned drawbacks and to accurately control the SAPF, particularly in terms of wind plant non-ideal voltages.Firstly, wavelet theory is applied to take one step forward addressing the inaccuracy of the typical PLLs required for an orthogonal signal generator process within the SRF-based control algorithm.Secondly, to further force the remained uncompensated load current harmonics to pass through the SAPF, this paper proposes a current suppression loop, inserted in the control algorithm of the SF.

Wavelet Transform
By translating/dilating a few basic shapes, the Fourier series-based wavelet transform (WT) maps the time-frequency localization of a signal below [32][33][34]: where ψ denotes the mother wavelet and its upper star (i.e., "*") represents the complex conjugate.a and τ are scale and displacement factors of continuous signal x(t), respectively.The mother wavelet with zero average, used as a prototype for all windows, is dilated by the scale value of a, and shifted by τ.The continuous signal x(t) can be reconstructed as follows: Synthesizing the discrete wavelet transform (DWT) of a signal is implemented in real time with several methods such as: multi-resolution analysis (MRA), windowed wavelet transform (WWT) technique, and the lifting wavelet transform (LWT) method.The MRA and WWT methods, however, cannot perfectly reconstruct every signal, since their inverse transform (IDWT) includes rounding errors within the floating point operation.Moreover, the whole data are firstly being analyzed in the MRA and WWT methods, and then half of the analyzed data are removed (through down-sampling step).Therefore, implementing of these two methods (i.e., the MRA and WWT) always demands an extra memory, and a full in-place calculation is not possible.On the contrary, the LWT method does not depend on Fourier transforms or involve complex mathematical calculations [34].In this method, the useless part of the input data is firstly removed through down-sampling process; then, the WT analysis begins.Thus, the calculation time and required memory are accordingly highly reduced.Also, a fully in-place becomes feasible, with higher speed calculation.The input signals through predict/update process are decomposed into different frequency bands: where s(z) and t(z) are Laurent polynomial coefficients extracted through prime (update) and dual (predict) lifting steps.The LWT is implemented, using the extracted coefficients (i.e., t i (z) and s i (z)) as can be seen in Figure 3.The LWT method can always be applied as long as the determinant of the polynomial matrix equals one.
Energies 2016, 9, 390 5 of 16 The mother wavelet with zero average, used as a prototype for all windows, is dilated by the scale value of a, and shifted by τ.The continuous signal x(t) can be reconstructed as follows: Synthesizing the discrete wavelet transform (DWT) of a signal is implemented in real time with several methods such as: multi-resolution analysis (MRA), windowed wavelet transform (WWT) technique, and the lifting wavelet transform (LWT) method.The MRA and WWT methods, however, cannot perfectly reconstruct every signal, since their inverse transform (IDWT) includes rounding errors within the floating point operation.Moreover, the whole data are firstly being analyzed in the MRA and WWT methods, and then half of the analyzed data are removed (through down-sampling step).Therefore, implementing of these two methods (i.e., the MRA and WWT) always demands an extra memory, and a full in-place calculation is not possible.On the contrary, the LWT method does not depend on Fourier transforms or involve complex mathematical calculations [34].In this method, the useless part of the input data is firstly removed through down-sampling process; then, the WT analysis begins.Thus, the calculation time and required memory are accordingly highly reduced.Also, a fully in-place becomes feasible, with higher speed calculation.The input signals through predict/update process are decomposed into different frequency bands: where s(z) and t(z) are Laurent polynomial coefficients extracted through prime (update) and dual (predict) lifting steps.The LWT is implemented, using the extracted coefficients (i.e., ti(z) and si(z)) as can be seen in Figure 3.The LWT method can always be applied as long as the determinant of the polynomial matrix equals one.

Orthogonal Signal Generator
The orthogonal signal generator is designed as follows.First, both a discrete LWT and an inverse LWT blocks are subsequently adopted to extract the fundamental positive component of input signal.Then, the second order generalized integrator (SOGI)-based PLL [35], as shown in Figure 4, generates

Orthogonal Signal Generator
The orthogonal signal generator is designed as follows.First, both a discrete LWT and an inverse LWT blocks are subsequently adopted to extract the fundamental positive component of input signal.Then, the second order generalized integrator (SOGI)-based PLL [35], as shown in Figure 4, generates the orthogonal signals.Now, the orthogonal signals in a Cartesian coordinate frame are conversed to a polar coordinate frame.Then, the required phase correction is imposed through the final block (see Figure 4a for φ which is a constant value in radian, used for phase correction).Figure 5 shows that the proposed orthogonal signal generator equipped with WT is able to produce satisfactory outcomes even under a non-ideal distorted input signal.Furthermore, to control the SAPF's forth leg to compensate the power grid/source neutral current, the required reference as seen in Figure 6 is simply produced by adding all the measured instant load currents as:   Furthermore, to control the SAPF's forth leg to compensate the power grid/source neutral current, the required reference as seen in Figure 6 is simply produced by adding all the measured instant load currents as:  Furthermore, to control the SAPF's forth leg to compensate the power grid/source neutral current, the required reference as seen in Figure 6 is simply produced by adding all the measured instant load currents as: # i L´n ptq " i La ptq `iLb ptq `iLc ptq i ˚sh´n ptq " ´iL´n ptq (7) Furthermore, to control the SAPF's forth leg to compensate the power grid/source neutral current, the required reference as seen in Figure 6 is simply produced by adding all the measured instant load currents as:

Proposed Voltage Suppression Loop of the Series Filter
The proposed SF acts as a controlled voltage source, injecting the compensation voltage needed to mitigate voltage sags and THD into the utility.In the proposed SF's compensation algorithm, as seen in Figure 7, the SRF method equipped with the developed wavelet-based orthogonal signals generator is applied to extract the positive sequence of source voltage, i.e., V S1 + .To this end, the source voltages are firstly transferred into the d-q coordinate.Then, the DC component of the d-axis is separated from other harmonics using a LPF.Further, inverse park transform is applied to obtain the positive sequence component of the source voltages (V S1 + ) in the abc domain.Then, the obtained V S1 + is subtracted from the instant source voltage, leading to extraction of the source voltage oscillations and harmonics.However, the normal source voltage still needs to be tracked in case of a voltage sag/swell.Hence, the controller subtracts the magnitude of the V S1 + from its nominal peak (220 ˆsqrt (2)), preparing for the SF to be added to the available voltage references ((Vref) in Figure 7).

Proposed Voltage Suppression Loop of the Series Filter
The proposed SF acts as a controlled voltage source, injecting the compensation voltage needed to mitigate voltage sags and THD into the utility.In the proposed SF's compensation algorithm, as seen in Figure 7, the SRF method equipped with the developed wavelet-based orthogonal signals generator is applied to extract the positive sequence of source voltage, i.e., VS1 + .To this end, the source voltages are firstly transferred into the d-q coordinate.Then, the DC component of the d-axis is separated from other harmonics using a LPF.Further, inverse park transform is applied to obtain the positive sequence component of the source voltages (VS1 + ) in the abc domain.Then, the obtained VS1 + is subtracted from the instant source voltage, leading to extraction of the source voltage oscillations and harmonics.However, the normal source voltage still needs to be tracked in case of a voltage sag/swell.Hence, the controller subtracts the magnitude of the VS1 + from its nominal peak (220 × sqrt (2)), preparing for the SF to be added to the available voltage references ((Vref) in Figure 7).

Proposed Current Suppression Loop for the Series Filter
Here, a current suppression loop is designed as seen in Figure 8 and inserted into the SF control algorithm (Figure 9).This current suppression loop lets the SF highly impede against frequency components in order to compensate for current harmonics drawn because of non-linear loads which show low ZL in some frequencies.

Proposed Current Suppression Loop for the Series Filter
Here, a current suppression loop is designed as seen in Figure 8 and inserted into the SF control algorithm (Figure 9).This current suppression loop lets the SF highly impede against frequency Energies 2016, 9, 390 8 of 17 components in order to compensate for current harmonics drawn because of non-linear loads which show low Z L in some frequencies.
Considering G' (jω) as the SF transfer function and K as the impedance gain when KG' (jω) >> Z S (jω) + Z L (jω| ω = ωh ), it can be concluded that the source current tends toward zero at unwanted frequencies (Equation ( 8) for I S (jω)).

Proposed Current Suppression Loop for the Series Filter
Here, a current suppression loop is designed as seen in Figure 8 and inserted into the SF control algorithm (Figure 9).This current suppression loop lets the SF highly impede against frequency components in order to compensate for current harmonics drawn because of non-linear loads which show low ZL in some frequencies.
Considering G' (jω) as the SF transfer function and K as the impedance gain when KG' (jω) >> ZS (jω) + ZL (jω|ω = ωh), it can be concluded that the source current tends toward zero at unwanted frequencies (Equation (8) for IS (jω)).Figure 9 introduces the improved control algorithm for a series active filter, which is suitable for simulation and design purposes.The fundamental component of the source voltage is measured through the harmonic voltage suppression loop.Meanwhile, harmonics of the source-end current are extracted through the current harmonic suppression loop.For this purpose, both the instantaneous oscillating active and non-active power are splitting up as shown in Figure 9 using the measured source-end currents (Isource).Then, the extracted harmonics of source current are subsequently multiplied by K to yield the converter output voltage.Further, the combination of proposed shunt and series active filters lets unwanted frequency components be attenuated according to their harmonic order, leading to the source-end sinusoidal current (Equation ( 9) for IS).

Proposed Controller to Regulate the DC-Link Voltage of the Unified Power Quality Conditioner
When the DC-link capacitor of the UPQC is used to integrate a PV system into the power grid, the DC-link voltage (VDC) becomes an important variable to be regulated.Here, an adaptive controller as shown in Figure 10 is suggested to control the DC-link voltage of the UPQC.The DC-link voltage must remain higher than its minimum reference value (Vmin), so as to ensure a satisfactory operation of the UPQC. Figure 9 introduces the improved control algorithm for a series active filter, which is suitable for simulation and design purposes.The fundamental component of the source voltage is measured through the harmonic voltage suppression loop.Meanwhile, harmonics of the source-end current are extracted through the current harmonic suppression loop.For this purpose, both the instantaneous oscillating active and non-active power are splitting up as shown in Figure 9 using the measured source-end currents (I source ).Then, the extracted harmonics of source current are subsequently multiplied by K to yield the converter output voltage.
Further, the combination of proposed shunt and series active filters lets unwanted frequency components be attenuated according to their harmonic order, leading to the source-end sinusoidal current (Equation ( 9) for I S ).

Proposed Controller to Regulate the DC-Link Voltage of the Unified Power Quality Conditioner
When the DC-link capacitor of the UPQC is used to integrate a PV system into the power grid, the DC-link voltage (V DC ) becomes an important variable to be regulated.Here, an adaptive controller as shown in Figure 10 is suggested to control the DC-link voltage of the UPQC.The DC-link voltage must remain higher than its minimum reference value (V min ), so as to ensure a satisfactory operation of the UPQC.
components be attenuated according to their harmonic order, leading to the source-end sinusoidal current (Equation ( 9) for IS).

Proposed Controller to Regulate the DC-Link Voltage of the Unified Power Quality Conditioner
When the DC-link capacitor of the UPQC is used to integrate a PV system into the power grid, the DC-link voltage (VDC) becomes an important variable to be regulated.Here, an adaptive controller as shown in Figure 10 is suggested to control the DC-link voltage of the UPQC.The DC-link voltage must remain higher than its minimum reference value (Vmin), so as to ensure a satisfactory operation of the UPQC.When the DC-link voltage has fallen below its maximum reference value (V DC < V max ) due to the UPQC filtering operation, the adaptive controller linearly decreases the PV current injection into the grid as Equation (10), so as to provide more active current needed to charge the DC-link capacitor of the UPQC: However, if the DC-link voltage still falls toward its minimum reference value (for V DC = V min ), no portion of the produced PV current would be injected into the grid, i.e., both α and I inj equal zero.In this case, all the PV output current will be dedicated to charging the DC-link capacitor accordingly.On the contrary, when V DC becomes greater than its maximum reference value (i.e., V DC > V max ), the generated PV current is then injected fully into the power grid (Figure 10 for α equals one).

Simulations and Discussion
To validate the accuracy of the improved UPQC, the power grid depicted in Figure 1 is simulated in Matlab/Simulink (MathWorks, Miami, FL, USA).The power grid supplies a diode rectifier and a hypothetical unbalanced load.The hypothetical unbalanced load is connected to the network at 0.2 s and disconnected at 0.4 s.Tables 1 and 2 present the parameters of the employed loads.Moreover, a PV system is integrated to the power grid via the DC-link capacitor of the UPQC.The simulated photovoltaic system consists of series and parallel solar panels, a DC-DC converter to control and also to higher up (or lower down) the PV's current, and a maximum power point tracking (MPPT) controller.Table 3 presents the employed solar parameters.The optimum operation of the photovoltaic system happens at one maximum power point (Figure 11a).To reach this maximum power point, a dummy load which equals to the optimal load is created at the PV's terminal by a DC-DC converter, using variable duty cycles.Figure 11b depicts the tracking of the maximum power point of the employed PV system.The PV system is able to regulate the DC-link voltage; meanwhile, the excess PV power, if it remains, can be injected into the power grid.To analyze the effects of non-ideal waveforms of wind turbines on the accuracy of the proposed UPQC, a wind power plant is simulated and connected to a 20 kV distribution system as shown in Figure 12.To analyze the effects of non-ideal waveforms of wind turbines on the accuracy of the proposed UPQC, a wind power plant is simulated and connected to a 20 kV distribution system as shown in Figure 12.To analyze the effects of non-ideal waveforms of wind turbines on the accuracy of the proposed UPQC, a wind power plant is simulated and connected to a 20 kV distribution system as shown in Figure 12.The wind generation supplies a 120 kV power grid through one 10 km line and a 20 kV feeder.The simulated wind power plant has six doubly fed induction generators (DFIG) which include a The wind generation supplies a 120 kV power grid through one 10 km line and a 20 kV feeder.The simulated wind power plant has six doubly fed induction generators (DFIG) which include a wind turbine, a wound rotor induction generator, and two back-to-back power electronic converters.The DFIG's stator windings are connected to the power grid directly; but, the rotor windings are jointed to the power grid using the two back-to-back converters which have a DC-link capacitor.The grid-side converter regulates the DC-link voltage to meet a constant value.However, the generator-side converter is controlled to adjust the torque, the active and reactive power at the stator terminal.By optimizing the wind turbine speed and minimizing the mechanical stresses on the wind turbine during gusts of wind, the DFIG structure allows the extraction of the maximum energy from the wind.Other various simulating methods are commonly used for wind turbines such as detailed model, average model and phasor model.The detailed model of the wind turbine used in this paper is well suited for observing harmonics over relatively short periods.The simulated wind plant generates 9 MW through six 1.5 MW wind turbines.By operating in bi-directional mode, the back-to-back power converters make the DFIG able to work either in sub-synchronous speed mode or super-synchronous speed mode.Under the stated speed modes, the DFIG's stator injects active power to the grid.The rotor, on the contrary, supplies the grid through the back to back converters only in super-synchronous speed mode, whereas in sub-synchronous speed mode, the active power flows in the opposite direction.
In this way, the operating speed of the DFIG becomes about ˘30% of the synchronous speed.The developed controller of the DFIG adjusts the torque in order to maintain the speed at 1.2/unit.Moreover, the produced reactive power is regulated at zero Var.The detailed parameters of the wind turbine and induction generator are listed in Table 4.The wavelet theory is employed to extract the positive component of the source voltage which is used as the input signal of a SOGI-based PLL through generating the orthogonal (cosine/sinus) signals.
The orthogonal signals generator is needed for the SRF-based compensation algorithm.The required wavelet levels to reach the lowest frequency band (i.e., 50 Hz) that only contains the positive sequence of the source voltage are determined by Equation (11): where f s represents the sampling frequency of original signal, f u indicates the lowest frequency range, and n represents the required wavelet levels.In this study, the sampling rate of 1600 Hz is selected for the orthogonal signal generator process; hence, three wavelet levels are needed to extract the fundamental sequence of positive component (50 Hz) of the source voltage.This makes a low-pass filter with a cut-off frequency of 100 Hz.Further, the inverse wavelet process is required to reconstruct the fundamental positive component of original signal.This study applies five inverse LWT levels to accurately extract the positive component of source voltage in a fundamental sequence, as shown in Figure 13.The distorted non-linear grid-end voltages and unbalanced load-terminal currents are shown in Figure 14.The Haar mother wavelet with a flat band pass characteristic is selected to decompose the source voltage into different frequency bands.Subsequently, to reconstruct the fundamental positive component of source voltage in orthogonal signals generator process, the db8 mother wavelet is employed, since the db8, as can be seen in Figure 13, is better than other mother wavelets to reconstruct the fundamental positive component of the source voltage.
The distorted non-linear grid-end voltages and unbalanced load-terminal currents are shown in Figure 14.The distorted non-linear grid-end voltages and unbalanced load-terminal currents are shown in Figure 14.The SAPF that is controlled by the proposed wavelet-based SRF method equipped with the SF and the current harmonic suppression loop (K = 0.5) eliminates all the source-end current harmonics and distortions as can be seen in Figure 14c.Figure 15a compares the power grid voltages before and after compensation by the SF. Figure 15c compares the grid-end currents compensated for by the proposed wavelet-based SRF method and another compensation method suggested in [29].Figure 15b,c also show that the grid-end current is in the reverse phase with the instant load current.This means that the power is injected into the power grid.Thus, the integrated power system with PV enjoys a fully sinusoidal current with THD = 1.29%.
Table 5 compares the accuracy of the proposed wavelet-based SRF method, equipped with the current harmonic suppression loop, with other compensation methods.The SAPF that is controlled by the proposed wavelet-based SRF method equipped with the SF and the current harmonic suppression loop (K = 0.5) eliminates all the source-end current harmonics and distortions as can be seen in Figure 14c.Figure 15a compares the power grid voltages before and after compensation by the SF. Figure 15c compares the grid-end currents compensated for by the proposed wavelet-based SRF method and another compensation method suggested in [29].Figure 15b,c also show that the grid-end current is in the reverse phase with the instant load current.This means that the power is injected into the power grid.Thus, the integrated power system with PV enjoys a fully sinusoidal current with THD = 1.29%.
Table 5 compares the accuracy of the proposed wavelet-based SRF method, equipped with the current harmonic suppression loop, with other compensation methods.Figure 16 summarizes the THD of the simulated grid-end currents and load-terminal voltages compensated for by the proposed method under different gains for K, i.e., gain of the current harmonic suppression loop.Figure 16a demonstrates that there is always one optimum value/Impedance for K which fully forces the current harmonics to pass through SAPF. Figure 17 depicts the power grid's neutral current before and after compensation by the proposed UPQC.

Conclusions
This paper validates the available solutions to eliminate the consequences of non-ideal distorted waveforms on the SAPF accuracy that is generated due to either wind turbine operation or unbalanced non-linear loads.Depending on only one variable, namely the load current, to generate the current reference of the SAPF, a wavelet-based SRF theory is suggested to direct the control of the SAPF.Considering the new compensation algorithm based on the SRF theory, this paper proposes the UPQC for three-phase four-wire systems.Moreover, by improving the SF algorithm of the UPQC, the remained current harmonics showing low impedances at certain frequencies are attenuated considerably, forcing them to be supplied by the shunt filter of the UPQC.Hence, a full cancellation of the sourceend zero sequence current as well as harmonic suppression can be achieved in three-phase four-wire systems.Therefore, purely sinusoidal grid-end currents with THD = 1.29% lead to high electrical efficiency for a grid-connected PV system.The effectiveness of the proposed UPQC is verified by simulations.

Figure 1 .
Figure 1.The proposed wavelet-based unified power quality conditioner (UPQC) used to integrate photovoltaic units into the power system.

Figure 1 .
Figure 1.The proposed wavelet-based unified power quality conditioner (UPQC) used to integrate photovoltaic units into the power system.

Figure 2 .
Figure 2. Compensation issues related to the shunt active power filter (SAPF).

Figure 2 .
Figure 2. Compensation issues related to the shunt active power filter (SAPF).

Figure 5 .
Figure 5.The orthogonal signals generator: (a) comparison between ideal signal and produced sine signal using wavelet-based PLL; (b) comparison of produced sine signals using the proposed PLL and a typical PLL.

Figure 5 .
Figure 5.The orthogonal signals generator: (a) comparison between ideal signal and produced sine signal using wavelet-based PLL; (b) comparison of produced sine signals using the proposed PLL and a typical PLL.

Figure 5 .
Figure 5.The orthogonal signals generator: (a) comparison between ideal signal and produced sine signal using wavelet-based PLL; (b) comparison of produced sine signals using the proposed PLL and a typical PLL.

Figure 5 .
Figure 5.The orthogonal signals generator: (a) comparison between ideal signal and produced sine signal using wavelet-based PLL; (b) comparison of produced sine signals using the proposed PLL and a typical PLL.

Figure 6 .
Figure 6.Voltage source inverter (VSI) forth leg controller to suppress the source-end zero current.Figure 6. Voltage source inverter (V SI ) forth leg controller to suppress the source-end zero current.

Figure 6 .
Figure 6.Voltage source inverter (VSI) forth leg controller to suppress the source-end zero current.Figure 6. Voltage source inverter (V SI ) forth leg controller to suppress the source-end zero current.

Figure 8 .
Figure 8.The SF provides an impedance to affect load impedance (ZL).Figure 8.The SF provides an impedance to affect load impedance (Z L ).

Figure 8 .
Figure 8.The SF provides an impedance to affect load impedance (ZL).Figure 8.The SF provides an impedance to affect load impedance (Z L ).

Figure 9 .
Figure 9.The proposed control algorithm for the SF.

Figure 9 .
Figure 9.The proposed control algorithm for the SF.

Figure 10 .
Figure 10.Proposed controller to regulate the DC-link voltage.Figure 10.Proposed controller to regulate the DC-link voltage.

Figure 10 .
Figure 10.Proposed controller to regulate the DC-link voltage.Figure 10.Proposed controller to regulate the DC-link voltage.

Figure 11 .
Figure 11.(a) Generated power and voltage vs. current under standard condition; and (b) optimum current point tracking.

Figure 11 .Table 3 .
Figure 11.(a) Generated power and voltage vs. current under standard condition; and (b) optimum current point tracking.

Figure 11 .
Figure 11.(a) Generated power and voltage vs. current under standard condition; and (b) optimum current point tracking.

Figure 12 .
Figure 12.Simulation of interfaced photovoltaic (PV)-based DC micro-grid with power system, including a wind generator, by proposed UPQC.

Figure 12 .
Figure 12.Simulation of interfaced photovoltaic (PV)-based DC micro-grid with power system, including a wind generator, by proposed UPQC.

Figure 13 .
Figure 13.Fundamental positive component of source voltage reconstructed by different mother wavelets.

Figure 13 .
Figure 13.Fundamental positive component of source voltage reconstructed by different mother wavelets.

Figure 16 .
Figure 16.The THD (in percent) when the proposed SRF method equipped with the improved SF is under an unbalanced inductive load: (a) Grid-end currents; and (b) load-terminal voltages.

Figure 16 .
Figure 16.The THD (in percent) when the proposed SRF method equipped with the improved SF is under an unbalanced inductive load: (a) Grid-end currents; and (b) load-terminal voltages.

Figure 17 .
Figure 17.The power grid-end neutral current before and after compensation.

Table 1 .
Parameters of the rectified load.

Table 2 .
Parameters of the hypothetical unbalanced load.

Table 4 .
The parameters of the wind power plant.