Improved Voltage Unbalance and Harmonics Compensation Control Strategy for an Isolated Microgrid

This paper suggests an enhanced control scheme for a four-leg battery energy storage systems (BESS) under unbalanced and nonlinear load conditions operating in the isolated microgrid. Simplicity, tiny steady-state error, fast transient response, and low total harmonic distortion (THD) are the main advantages of the method. Firstly, a new decoupled per-phase model for the three-phase four-leg inverter is presented. It can eliminate the effect of power stage coupling on control design; thus, the three-phase four-leg power inverter can be viewed as three single input single output (SISO) control systems. Then, using an improved orthogonal signal generation method, the per-phase model of the four-leg inverter in the stationary and synchronous frame is derived. As the second step, a per-phase multi-loop control scheme for the four-leg inverter under unbalanced load conditions is suggested. The proposed control strategy has the ability to provide balanced output voltages under unbalanced load conditions by avoiding the need to deal with the symmetrical components. Finally, a multi-resonant harmonic compensator is used to actively prevent low-order harmonic currents to distort the output voltages of the three-phase four-leg grid-forming power converter. Simulations results are also presented to verify the performance of the suggested control strategy.


Introduction
The isolated microgrids can be defined as a group of dispersed generators, communication systems, protection devices, sensitive loads, distributed energy storage systems (DESSs) and power electronic interfaces connected through a relatively small grid and isolated from the main grid [1][2][3][4].The distributed generations (DGs) and DESSs such as batteries and wind turbines must be equipped with power electronic interfaces to provide the required flexibility for isolated microgrids [5][6][7].Depending on the characteristics of the primary energy source and the role assigned to the DGs/DESSs, the inverter-based distributed energy resource (DER) can be operated either as grid-forming or grid-feeding units.
voltages under unbalanced load conditions with a fast transient response, zero steady-state error without any sensitivity to frequency variations and low THD under nonlinear load conditions.
An enhanced control strategy for a four-leg battery energy storage systems (BESS) operating in 4-wire isolated microgrid is suggested in this study.The average large signal model of the four-leg inverter in the abc reference frame is derived at first.Next, in order to independently control each phase of the four-leg grid-forming unit, a new decoupled per-phase model is presented.The proposed model can eliminate the effect of power stage coupling on control design.The next part focuses on proposing a multi-loop control scheme for grid-forming BESS operating in an isolated microgrid under unbalanced load conditions.This control strategy is proposed using the per-phase modeling of the four-leg VSC in the stationary and rotating reference frames.A multi-resonant harmonic controller is also used to actively prevent low-order harmonic currents to distort the output voltages.The paper is organized as follows: describes the modeling of a four-leg inverter.Per-phase voltage control strategy is presented in Section 3. The harmonic compensator is presented in Section 4. The results and discussion are presented in Section 5. Section 6 provides the conclusions.

Modeling of the Four-Leg Inverter
The four-leg inverter can be obtained by adding an additional fourth leg to the conventional three-legged switching network.The power stage of a three-phase four-leg VSC with a neutral inductor (L n ) is shown in Figure 1.The LC filter parameter design and related calculations are given in [30].The modeling of the four-leg inverter has been discussed widely in the literature [31].However, most studies in this field have modeled the four-leg inverter by neglecting the coupling of the power stage on control design, which results in an unsatisfactory dynamic response.In this study, the average large signal model of a four-leg inverter in the abc reference frame is derived at first, and then the state-space model of the system is realized.Subsequently, a new decoupled per-phase model for the four-leg inverter is presented.It can be eliminated by the effect of power stage coupling on control design; consequently, the four-leg power inverter can be viewed as three single input single output (SISO) control systems.
Energies 2018, 11, 2688 3 of 26 control scheme for a grid-forming power converter operating in an isolated microgrids to provide balanced output voltages under unbalanced load conditions with a fast transient response, zero steady-state error without any sensitivity to frequency variations and low THD under nonlinear load conditions.An enhanced control strategy for a four-leg battery energy storage systems (BESS) operating in 4-wire isolated microgrid is suggested in this study.The average large signal model of the four-leg inverter in the abc reference frame is derived at first.Next, in order to independently control each phase of the four-leg grid-forming unit, a new decoupled per-phase model is presented.The proposed model can eliminate the effect of power stage coupling on control design.The next part focuses on proposing a multi-loop control scheme for grid-forming BESS operating in an isolated microgrid under unbalanced load conditions.This control strategy is proposed using the per-phase modeling of the four-leg VSC in the stationary and rotating reference frames.A multi-resonant harmonic controller is also used to actively prevent low-order harmonic currents to distort the output voltages.The paper is organized as follows: Section 2 describes the modeling of a four-leg inverter.Per-phase voltage control strategy is presented in Section 3. The harmonic compensator is presented in Section 4. The results and discussion are presented in Section 5. Section 6 provides the conclusions.

Modeling of the Four-Leg Inverter
The four-leg inverter can be obtained by adding an additional fourth leg to the conventional three-legged switching network.The power stage of a three-phase four-leg VSC with a neutral inductor (  ) is shown in Figure 1.The LC filter parameter design and related calculations are given in [30].The modeling of the four-leg inverter has been discussed widely in the literature [31].However, most studies in this field have modeled the four-leg inverter by neglecting the coupling of the power stage on control design, which results in an unsatisfactory dynamic response.In this study, the average large signal model of a four-leg inverter in the abc reference frame is derived at first, and then the state-space model of the system is realized.Subsequently, a new decoupled per-phase model for the four-leg inverter is presented.It can be eliminated by the effect of power stage coupling on control design; consequently, the four-leg power inverter can be viewed as three single input single output (SISO) control systems.

Average Large Signal Model of the Four-Leg Inverter
The need for long-time simulation and several switches can result in the non-linear behavior of the four-leg inverter.Since the switching study is out of the scope of this research, the average large signal model of the four-leg inverter is derived as depicted in Figure 2. To describe the operation of the four-leg inverter, a switching function can be defined as:

Average Large Signal Model of the Four-Leg Inverter
The need for long-time simulation and several switches can result in the non-linear behavior of the four-leg inverter.Since the switching study is out of the scope of this research, the average large signal model of the four-leg inverter is derived as depicted in Figure 2. To describe the operation of the four-leg inverter, a switching function can be defined as: Using the AC voltage terminals and by neglecting the inherent resistance of the capacitors, the voltage and current equations of the average model in the abc reference frame can be written as: where   ,   and   are the output currents,  − ,  − and  − are the load currents,   ,   and   are the output voltages, and   is the neutral current.The four-leg system is a six-order multi-input-multi-output (MIMO) system, including a total of six state variables (inductor currents and capacitor voltages of the LC filter), three line-to-duty ratios as inputs and three output AC voltages.Thus, it is difficult to control such complex six-order system.To cope with this problem, three channels in four-leg power converter should be completely decoupled to be viewed as three SISO control systems.The power stage of the four-leg inverter can be modelled according to the principles of the per-phase basis so that only a single-phase representation of the inverter is used for the analysis and design.However, due to the presence of an unlike coupling among three channels, the control of this type of inverter is very complicated.In the following, a new decoupled per-phase model for the four-leg power converter using an output voltage feedback path in each phase is presented.

Decoupled Per-Phase Model of the Four-Leg Inverter
In this subsection, a new decoupled per-phase model for the four-leg inverter is presented.The four-leg system has six state variables, including three inductor currents and three output voltage capacitors.It also contains three line-to-duty ratios as inputs and three output voltages.By considering the load currents as disturbances, the state-space equation of the system can be obtained as follows: where   Using the AC voltage terminals and by neglecting the inherent resistance of the capacitors, the voltage and current equations of the average model in the abc reference frame can be written as: where i la , i lb and i lc are the output currents, i load−a , i load−b and i load−c are the load currents, v AG , v BG and v CG are the output voltages, and i n is the neutral current.
The four-leg system is a six-order multi-input-multi-output (MIMO) system, including a total of six state variables (inductor currents and capacitor voltages of the LC filter), three line-to-duty ratios as inputs and three output AC voltages.Thus, it is difficult to control such complex six-order system.To cope with this problem, three channels in four-leg power converter should be completely decoupled to be viewed as three SISO control systems.The power stage of the four-leg inverter can be modelled according to the principles of the per-phase basis so that only a single-phase representation of the inverter is used for the analysis and design.However, due to the presence of an unlike coupling among three channels, the control of this type of inverter is very complicated.In the following, a new decoupled per-phase model for the four-leg power converter using an output voltage feedback path in each phase is presented.

Decoupled Per-Phase Model of the Four-Leg Inverter
In this subsection, a new decoupled per-phase model for the four-leg inverter is presented.The four-leg system has six state variables, including three inductor currents and three output voltage capacitors.It also contains three line-to-duty ratios as inputs and three output voltages.By considering the load currents as disturbances, the state-space equation of the system can be obtained as follows: . where T is load currents as the disturbance, and Y = [V AG V BG V CG ] T is the output of the system.Assume that L n = L /2 and r n = r C = r L = R, other matrixes in the state-space equations can be written as: The state-space equation for phase 'a' can be rewritten as: Energies 2018, 11, 2688 6 of 26 As can be seen, in order to decouple the phase 'a' from the other channels, the coefficients of V CB and V CC must be zero.Assuming the input variables are: where V CA , V CB and V CC are the output voltage feedback paths, which can be added to the control scheme.K i (i = 1, 2, 3, . . .6) is an unknown variable, which must be determined for decoupling purpose.V * a f , V * b f and V * c f are also the control input variables.By rewriting the state-space equations for the other phases and substituting (5) into the state-space equations for three subsystems, six equations with six unknown components can be obtained as: This equation has a unique solution as follow: By considering the input variables as: , the matrixes in the state-space equation can be rewritten as: As can be observed, the four-leg inverter is partitioned into three single-phase subsystems.By neglecting the inherent resistance of capacitors, the state-space equation of each subsystem can be described as: where i l and V C are the inductance current and capacitor voltage in each phase, respectively.V i and i load are the input voltage and load current of each phase, respectively.The state-space equation of each subsystem describes the model of a single-phase inverter with the filter parameters as depicted in Figure 3. Therefore, the four-leg power inverter can be viewed as three SISO control systems.The voltage decoupling feedback path can be added to the control strategy in each phase to simplify the system modeling and design.The decoupled model of the four-leg inverter using the voltage decoupling feedback paths is depicted in Figure 4.It can be seen, each subsystem can be controlled independently using various controllers in different reference frames.In the following subsection, the per-phase control of the four-leg inverter in the rotating frame is presented.strategy in each phase to simplify the system modeling and design.The decoupled model of the four-leg inverter using the voltage decoupling feedback paths is depicted in Figure 4.It can be seen, each subsystem can be controlled independently using various controllers in different reference frames.In the following subsection, the per-phase control of the four-leg inverter in the rotating frame is presented.

Suggested Per-Phase Voltage Control Strategy in the Rotating Frame
In the current research progress for the area of electrical power engineering, the control of four-leg power converters using symmetrical components in the rotating frame under unbalanced  strategy in each phase to simplify the system modeling and design.The decoupled model of the four-leg inverter using the voltage decoupling feedback paths is depicted in Figure 4.It can be seen, each subsystem can be controlled independently using various controllers in different reference frames.In the following subsection, the per-phase control of the four-leg inverter in the rotating frame is presented.

Suggested Per-Phase Voltage Control Strategy in the Rotating Frame
In the current research progress for the area of electrical power engineering, the control of four-leg power converters using symmetrical components in the rotating frame under unbalanced

Suggested Per-Phase Voltage Control Strategy in the Rotating Frame
In the current research progress for the area of electrical power engineering, the control of four-leg power converters using symmetrical components in the rotating frame under unbalanced load conditions is a well-developed research topic.Despite the maturity, little attention has been given to the per-phase control of the four-leg inverter under unbalanced load circumstances.The main reason lies in the fact that the per-phase control of the four-leg inverter in the dq frame needs to create a virtual two-phase system in each subsystem to deal with the transformation from the stationary to the rotating frame.
The Park transformation is a 2-2 transform that requires at least two independent phases in the stationary reference frame to convert components to the dq frame.However, the per-phase control of the four-leg inverter is not directly applicable in the dq frame due to the existence of only one phase in each subsystem.Indeed, the per-phase dq control of a four-leg power converter requires at least two independent phases in each subsystem to cope with the transformation between stationary and rotating frames.This challenge can be handled using an orthogonal imaginary component in each phase, which provides the second phase essential in each subsystem for the Park transformation.
Since there exists only one available phase in each subsystem of the four-leg power converter, the transformation from the stationary to the rotating frame cannot be used easily for per-phase dq control, unless a second orthogonal phase is created for each subsystem.Several orthogonal signal generation methods have been proposed in the literature [32].However, complexity, inaccurate dynamic performance, sensitivity to parameter changes and inability to operate with variable grid frequencies are the main drawbacks of these techniques.To cope with these disadvantages, the orthogonal signal is generated based on the reference values of voltages in the d and q-axes.It can be implemented easily and provides high dynamic response.The structure of the employed orthogonal signal generation technique is demonstrated in Figure 5.As seen, the orthogonal components can be obtained as: where V * d and V * q are the refrence values of voltages in the dq frame, q ), θ is the phase angle of the grid and ψ is the angle of the αβ/dq transformation, which is equal to θ in the steady-state.
Energies 2018, 11, 2688 8 of 26 the four-leg inverter is not directly applicable in the dq frame due to the existence of only one phase in each subsystem.Indeed, the per-phase dq control of a four-leg power converter requires at least two independent phases in each subsystem to cope with the transformation between stationary and rotating frames.This challenge can be handled using an orthogonal imaginary component in each phase, which provides the second phase essential in each subsystem for the Park transformation.
Since there exists only one available phase in each subsystem of the four-leg power converter, the transformation from the stationary to the rotating frame cannot be used easily for per-phase dq control, unless a second orthogonal phase is created for each subsystem.Several orthogonal signal generation methods have been proposed in the literature [32].However, complexity, inaccurate dynamic performance, sensitivity to parameter changes and inability to operate with variable grid frequencies are the main drawbacks of these techniques.To cope with these disadvantages, the orthogonal signal is generated based on the reference values of voltages in the d and q-axes.It can be implemented easily and provides high dynamic response.The structure of the employed orthogonal signal generation technique is demonstrated in Figure 5.As seen, the orthogonal components can be obtained as: where  The control scheme for the four-leg grid-forming unit is implemented using a double feedback loop control scheme in each phase.The structure of the suggested per-phase control scheme in three independent channels is presented in Figure 6.The control system block diagram shows:

•
The four-leg inverter is partitioned into three single-phase subsystems using the proposed decoupled per-phase model.There exists an independent cascaded current-voltage controller in each subsystem that provides relevant phase control signals.

•
The inner current control loop uses the filter capacitor current as a feedback signal.

•
The inner current control loop is implemented in the stationary reference frame using a proportional controller.

•
The outer voltage control loop uses the load voltage as a feedback signal.

•
The outer voltage loop is implemented in the rotating frame using the PI controller.The control scheme for the four-leg grid-forming unit is implemented using a double feedback loop control scheme in each phase.The structure of the suggested per-phase control scheme in three independent channels is presented in Figure 6.The control system block diagram shows:

•
The four-leg inverter is partitioned into three single-phase subsystems using the proposed decoupled per-phase model.There exists an independent cascaded current-voltage controller in each subsystem that provides relevant phase control signals.

•
The inner current control loop uses the filter capacitor current as a feedback signal.

•
The inner current control loop is implemented in the stationary reference frame using a proportional controller.

•
The outer voltage control loop uses the load voltage as a feedback signal.

•
The outer voltage loop is implemented in the rotating frame using the PI controller.As seen in Figure 6, the output voltage in each phase (, , ) is sampled and converted into the stationary reference frame using the orthogonal signal generation technique.Later, the load voltage quantities in the stationary reference frame ( ,,() ,  ,,() ) are converted into the dq rotating frame ( ,,() ,  ,,() ) using the Park transformation.The sin  and cos  terms required for the Park transformation are obtained from the output reference voltage with a second-order generalized integrator frequency-locked loop.The load voltage quantities are compared with the reference voltage values (   * ,  * ) in the synchronous reference frame to compensate using PI controllers in the rotating frame.In this regard,   * is set at the peak value of the reference phase voltage, while   * is set at 0 V.The outputs of the external voltage loop can be used as the reference signals for the current controller in each subsystem.The generated references for the inner current loops (  * ,   * ) via the outer voltage loop are then converted from the synchronous reference frame into the stationary reference frame.It should be noted here that the phase and amplitude characteristics of the PI controller in the dq frame are equivalent to the PR controller in the stationary reference frame due to the application of the Park transformation and the inverse Park transformation.
In spite of the voltage controller, which is designed in the synchronous reference frame, the inner current control loop is implemented in the stationary reference frame.As can be seen, only α-axis quantities belong to the real system in the current controller.Therefore, only the real reference current (  * ) is fed to the current controller.In this control loop, the capacitor current is sampled, and then compared with the reference currents generated by the outer voltage controller.In the  As seen in Figure 6, the output voltage in each phase (Voa, Vob, Voc) is sampled and converted into the stationary reference frame using the orthogonal signal generation technique.Later, the load voltage quantities in the stationary reference frame (V a,b,c(α) , V a,b,c(β) ) are converted into the dq rotating frame (V a,b,c(d) , V a,b,c(q) ) using the Park transformation.The sin θ and cos θ terms required for the Park transformation are obtained from the output reference voltage with a second-order generalized integrator frequency-locked loop.The load voltage quantities are compared with the reference voltage values (V * q , V * d ) in the synchronous reference frame to compensate using PI controllers in the rotating frame.In this regard, V * d is set at the peak value of the reference phase voltage, while V * q is set at 0 V.The outputs of the external voltage loop can be used as the reference signals for the current controller in each subsystem.The generated references for the inner current loops (i * cq , i * cd ) via the outer voltage loop are then converted from the synchronous reference frame into the stationary reference frame.It should be noted here that the phase and amplitude characteristics of the PI controller in the dq frame are equivalent to the PR controller in the stationary reference frame due to the application of the Park transformation and the inverse Park transformation.
In spite of the voltage controller, which is designed in the synchronous reference frame, the inner current control loop is implemented in the stationary reference frame.As can be seen, only α-axis quantities belong to the real system in the current controller.Therefore, only the real reference current (i * cα ) is fed to the current controller.In this control loop, the capacitor current is sampled, and then compared with the reference currents generated by the outer voltage controller.In the stationary reference frame, the reference signals are sinusoidal; hence, a simple proportional controller can be used to ensure the excellent reference tracking and to achieve a zero steady-state error.
In addition, a voltage feedforward path is added to the multi-loop controller in each phase to enhance the system robustness.Moreover, it has the ability to simplify the system modeling and controller design.The decoupling voltage feedback path is also added to the control scheme in each phase to eliminate the effect of power stage coupling on control design.Lastly, the output of the inner current loop is transformed into the natural reference frame and then divided by DC-link voltage.Note that the feedforward loop is included to consider the DC-link voltage value for the generation of the gate signals.Furthermore, the carrier-based pulse width modulator (PWM) method is used in this thesis to generate the inverter output voltage owing to its proper performance and ease of implementation.In this modulation method, the concept of offset voltage is implemented using a single carrier.The method has a strong performance and can be implemented easily.Therefore, it is used in this study to generate the inverter output voltage.
In the proposed per-phase control strategy, the PI controller regulates the instantaneous output voltages in the rotating frame, whereas the simple proportional controller regulates the currents in the stationary reference frame.According to the basic principles of the control theory of cascaded control, the inner current and the outer voltage controllers can be designed separately as long as the dynamics of the voltage loop are designed to be slower than the current loop.

Multi-Resonant Harmonic Compensator
The simplified model of the three-phase four-leg inverter suppling nonlinear loads is depicted in Figure 7.In this Figure , Z o refers to the output impedance of the inverter, i is the output current, v o is the output voltage and v r is the reference voltage.Assuming that there are harmonics in the output current (i).Hence, the output current can be written as: where ω is the system frequency, h is the harmonic order and ∅ h is the phase angle.Moreover, the h-th harmonic voltage dropped on the output impedance is Additionally, it is assumed that the inverter injects clean current and there is no harmonic voltage generated by reference voltage.Hence, v r can be written as: Energies 2018, 11, 2688 10 of 26 controller can be used to ensure the excellent reference tracking and to achieve a zero steady-state error.
In addition, a voltage feedforward path is added to the multi-loop controller in each phase to enhance the system robustness.Moreover, it has the ability to simplify the system modeling and controller design.The decoupling voltage feedback path is also added to the control scheme in each phase to eliminate the effect of power stage coupling on control design.Lastly, the output of the inner current loop is transformed into the natural reference frame and then divided by DC-link voltage.Note that the feedforward loop is included to consider the DC-link voltage value for the generation of the gate signals.Furthermore, the carrier-based pulse width modulator (PWM) method is used in this thesis to generate the inverter output voltage owing to its proper performance and ease of implementation.In this modulation method, the concept of offset voltage is implemented using a single carrier.The method has a strong performance and can be implemented easily.Therefore, it is used in this study to generate the inverter output voltage.
In the proposed per-phase control strategy, the PI controller regulates the instantaneous output voltages in the rotating frame, whereas the simple proportional controller regulates the currents in the stationary reference frame.According to the basic principles of the control theory of cascaded control, the inner current and the outer voltage controllers can be designed separately as long as the dynamics of the voltage loop are designed to be slower than the current loop.

Multi-Resonant Harmonic Compensator
The simplified model of the three-phase four-leg inverter suppling nonlinear loads is depicted in Figure 7.In this Figure,  o refers to the output impedance of the inverter,  is the output current,  o is the output voltage and   is the reference voltage.Assuming that there are harmonics in the output current ().Hence, the output current can be written as: where  is the system frequency, ℎ is the harmonic order and ∅ ℎ is the phase angle.
Moreover, the ℎ-th harmonic voltage dropped on the output impedance is √2 ℎ |  (ℎ)|.Additionally, it is assumed that the inverter injects clean current and there is no harmonic voltage generated by reference voltage.Hence,   can be written as: Hence, the fundamental component of the output voltage can be also obtained as: where Hence, the fundamental component of the output voltage can be also obtained as: where The harmonic components in the output voltage can also be obtained using the harmonic current components and the output impedance at the harmonic frequencies as: In this regard, the THD of the output voltage of the inverter can be obtained as [33]: As seen, the THD is mainly affected by the output impedance at the harmonic frequencies.Therefore, it is feasible to optimize the design of the output impedance at high frequencies to minimize the THD of the output voltage.It can be achieved without affecting the impedance at the fundamental frequency.To obtain low THD for output voltage under highly distorted load conditions, a harmonic compensator is added to each subsystem as depicted in Figure 8.The transfer function of the harmonic compensator can be explained as: where k n is the gain of integrator for nth harmonic component and h is the highest harmonic order.The developed controller minimizes the output impedance of the inverter over the frequency range of the main harmonic current components.The suggested harmonic compensator in each phase provides notches in frequency response at the related frequency, thereby reducing the inverter output harmonic distortion.As the four-leg power converter operates in the three-phase four-wire microgrids, the number of harmonic integrator must be selected so that the controller can be handled both zero and negative sequence harmonics.Therefore, a harmonic compensator tuned at the 3rd, 5th, 7th, 9th, 11th, and 13th harmonic frequencies is used in each phase of the four-leg power converter.

Simulation Results
To confirm the performance of the suggested per-phase multi-loop control strategy, the four-leg power converter operating in isolated mode is simulated using the DIgSILENT PowerFactory software.It is equipped with the proposed per-phase multi-loop control strategy.The desired voltage is 155.56V line-to-neutral peak at 60 Hz.All the electrical and controller parameters are given in Table 1.The performance of the suggested per-phase scheme is compared with the conventional SCC-based control strategy [27][28][29].The developed controller minimizes the output impedance of the inverter over the frequency range of the main harmonic current components.The suggested harmonic compensator in each phase provides notches in frequency response at the related frequency, thereby reducing the inverter output harmonic distortion.As the four-leg power converter operates in the three-phase four-wire microgrids, the number of harmonic integrator must be selected so that the controller can be handled both zero and negative sequence harmonics.Therefore, a harmonic compensator tuned at the 3rd, 5th, 7th, 9th, 11th, and 13th harmonic frequencies is used in each phase of the four-leg power converter.

Simulation Results
To confirm the performance of the suggested per-phase multi-loop control strategy, the four-leg power converter operating in isolated mode is simulated using the DIgSILENT PowerFactory software.It is equipped with the proposed per-phase multi-loop control strategy.The desired voltage is 155.56V line-to-neutral peak at 60 Hz.All the electrical and controller parameters are given in Table 1.The performance of the suggested per-phase scheme is compared with the conventional SCC-based control strategy [27][28][29].

Transient Performance
In this simulation, while the four-leg unit is initially supplying a three-phase resistive load (8 Ω/ph), a single-phase inductive-resistive load (R = 20 Ω and L = 2 mH) is added between phase 'a' and 'c' at 0.3 s.After 0.2 s, the connected load between phase 'c' and the neutral line is changed from 8 to 5.7 Ω. Lastly, the nominal load between phase and the neutral line is disconnected at 0.7 s.
The three-phase output voltages and currents of the four-leg inverter under varying unbalanced load changes, with the conventional control strategy, is depicted in Figure 9.This figure also shows the transient load voltages as zoomed figures.As can be observed from this figure, the load voltages and currents are initially balanced.Then, the load currents in phase 'a' and 'c' are increased by at least 3 line cycles transient due to the inclusion of the line-to-line load between phase 'a' and 'c' at 0.3 s.A large voltage sag is observed in the output voltages with this control strategy; however, it is restored with a slow transient response.Afterward, the connected load between phase 'c' and the neutral line is changed from 8 to 5.7 Ω at 0.5 s.Consequently, the currents in phase 'c' and the neutral current are gradually increased.Similarly, a large voltage sag emerges in the load voltages, and is restored slowly because of the sudden load change.
Finally, the nominal load between phase 'a' and the neutral line is disconnected at 0.7 s; hence, the load current in phase 'a' and the neutral current are increased again with a slow transient response.As can be seen from the zoomed figure, the load disconnection leads to unequal voltage values on three-phases.Nevertheless, the output voltage values are restored with a slow transient response.It is apparent that the conventional control scheme can keep the load voltages balanced in the steady-state at all load unbalances considered in this simulation.However, at least 3 line cycles transient responses exist with this control scheme.This is because of the fact that the conventional SCC-based control scheme is implemented using multiple dq control loops.Moreover, the symmetrical components are calculated based on all-pass filters, thereby introducing significant delays, and slowing down the dynamic response of the multiple dq control loops.
The three-phase output voltages and currents of the four-leg inverter under the situation of sudden load changes with the proposed per-phase multi-loop control strategy is depicted in Figure 10.For performance comparison, the transient load voltages are shown as zoomed figures.As seen in this figure, the load currents in phase 'a' and 'c' are sharply increased with 1 line cycle transient response after the connection of the line-to-line load between phases 'a' and 'c' at 0.3 s.Nevertheless, the neutral current does not exist for this unbalance condition.It is interesting to point out in this figure that the output voltages remain balanced without any voltage dip after the sudden load change.Subsequently, the currents in phase 'c' and the neutral current are sharply increased due to the connection of the load between phase 'c' and the neutral line at 0.5 s.Similarly, the output voltages remain balanced under this load changes.Lastly, the nominal load between phase 'a' and the neutral line is disconnected at 0.7 s.As can be observed, the load current in phase 'a' and the neutral current rapidly increases, while the load voltages can remain balanced.
The results in demonstrate that the suggested per-phase multi-loop control strategy has the ability to balance the load voltages without any voltage variations under various combinations of unbalanced loads and the situation of sudden load changes.As shown from Figures 11-13, actual voltages (V d , V q ) are capable of tracking the reference voltages (V dre f , V qre f ) precisely in three phases ("a", "b" and "c"), when the current reference signal rapidly reacts to the voltage variations in the proposed control strategy.As can be observed from Figure 10, the suggested per-phase multi-loop control scheme shows an improved dynamic performance in comparison with the conventional control strategy.This is because it is implemented independently in each phase to compensate for the symmetrical components.As seen in Figure 10, the dynamic response of the suggested control scheme is very fast with 1 line cycle transient.
The proposed per-phase multi-loop control strategy does not require computations for the symmetrical components of currents and voltages for unbalanced voltage compensation.Indeed, it is implemented without using low-pass or all-pass filters; thus, it is able to achieve a rapid transient response.Moreover, the current controller is implemented using the capacitor current feedback signal instead of the higher ampere inductor current.The inner current control loop in each phase uses the filter capacitor current as the direct feedback signal.Therefore, variations in the inner current loop for unbalanced compensation and sudden load changes occur faster.
Table 2 compares the results obtained from this simulation, between the conventional control strategy, and the suggested multi-loop control strategy under unbalanced load conditions.As can be seen, there exist 3 line cycles transient with the conventional control scheme, while the dynamic response of the suggested control scheme is very fast, with only 1 line cycle transient.As shown in this table, the superiority of the suggested control scheme over the conventional SCC-based is confirmed by the 2 line cycles decrease in the transient response.In summary, these simulation results show that quick dynamic responses and fast regulation time with no overshoot are the main advantages of the proposed multi-loop control strategy.Table 2. Transient performance of two control strategies.

Control Method
Transient Response to Load Changes Conventional control scheme 3 line cycles The proposed multi-loop control scheme 1 line cycle
The steady-state behavior of the four-leg power converter, equipped with the suggested multi-loop control strategy for the balanced load, is depicted in Figure 14.As seen, the output voltages and currents are balanced in the steady-state for this case because of the equal value of loading on each phase.Moreover, the neutral current does not exist for this balanced load.Figure 15 also demonstrates the load current and voltage waveforms for the three-phase Unb.#1 in the steady-state.It is observed that the load currents have unequal values.Moreover, the neutral current is not zero because of the connection to the three-phase unbalanced load.However, the proposed per-phase multi-loop control strategy has the ability to provide balanced output voltages in the steady-state under the unbalanced load.
In case of an event in one of the phases in this three-phase 4-wire system, the other two phases can be used independently, after clearing the fault.Figure 16 illustrates the steady-state load current and voltage waveforms for the Unb.#2, in which only two phases are loaded.As seen in this figure, the output voltages remain balanced irrespective of the load in one of the phases that is different from the others.It is observed that the load currents are unbalanced, and there is a significant neutral current in the 4-wire system.Figure 17 depicts the load current and voltage waveforms for the Unb.#3.It is the worst case, in which only phase 'b' is loaded.As seen here, the load currents of phase 'a' and 'b' are zero, as only phase 'b' is loaded.It can be seen from the voltage waveform that

Control Method Transient Response to Load Changes
Conventional control scheme 3 line cycles The proposed multi-loop control scheme 1 line cycle

Steady-State Performance
The evaluation of the steady-state behavior of the suggested multi-loop control strategy is made for a balanced load (R A = R B = R c = 8 Ω), and three various unbalanced load cases, which include Unb.# The steady-state behavior of the four-leg power converter, equipped with the suggested multi-loop control strategy for the balanced load, is depicted in Figure 14.As seen, the output voltages and currents are balanced in the steady-state for this case because of the equal value of loading on each phase.Moreover, the neutral current does not exist for this balanced load.Figure 15 also demonstrates the load current and voltage waveforms for the three-phase Unb.#1 in the steady-state.It is observed that the load currents have unequal values.Moreover, the neutral current is not zero because of the connection to the three-phase unbalanced load.However, the proposed per-phase multi-loop control strategy has the ability to provide balanced output voltages in the steady-state under the unbalanced load.
In case of an event in one of the phases in this three-phase 4-wire system, the other two phases can be used independently, after clearing the fault.Figure 16 illustrates the steady-state load current and voltage waveforms for the Unb.#2, in which only two phases are loaded.As seen in this figure, the output voltages remain balanced irrespective of the load in one of the phases that is different from the others.It is observed that the load currents are unbalanced, and there is a significant neutral current in the 4-wire system.Figure 17 depicts the load current and voltage waveforms for the Unb.#3.It is the worst case, in which only phase 'b' is loaded.As seen here, the load currents of phase 'a' and 'b' are zero, as only phase 'b' is loaded.It can be seen from the voltage waveform that the proposed per-phase multi-loop control strategy is capable of providing balanced output voltages under unbalanced load conditions, even when a single-phase load is connected to the microgrid.the proposed per-phase multi-loop control strategy is capable of providing balanced output voltages under unbalanced load conditions, even when a single-phase load is connected to the microgrid.It is interesting to note that the load voltages can be remained balanced in three various unbalanced load cases.For performance comparisons, the magnitudes of the fundamental components, and the PVUR of all various loads, for the conventional control strategy and the suggested control scheme are presented in Table 3.According to the IEEE standards, the PVUR the proposed per-phase multi-loop control strategy is capable of providing balanced output voltages under unbalanced load conditions, even when a single-phase load is connected to the microgrid.It is interesting to note that the load voltages can be remained balanced in three various unbalanced load cases.For performance comparisons, the magnitudes of the fundamental components, and the PVUR of all various loads, for the conventional control strategy and the suggested control scheme are presented in Table 3.According to the IEEE standards, the PVUR It is interesting to note that the load voltages can be remained balanced in three various unbalanced load cases.For performance comparisons, the magnitudes of the fundamental components, and the PVUR of all various loads, for the conventional control strategy and the suggested control scheme are presented in Table 3.According to the IEEE standards, the PVUR needs to be maintained at lower than 2% for sensitive loads [17].According to IEEE, PVUR is defined as: %PVUR = maximum voltage deviation f rom the average phase voltage average phase voltage × 100 (15) As can be observed from Table 3, the load voltages remain balanced in the steady-state for both the conventional and the proposed per-phase control schemes at all tested conditions.Additionally, the value of the PVUR is maintained below 2% at all tested conditions for both control schemes.However, the value of the PVUR is reduced with the proposed control scheme for the various load unbalance cases considered in this study.It can be seen from the table that the value of PVUR is reduced from 0.128 to 0.062% for the Unb.#1 with the proposed control strategy.This value is also reduced from 0.184 to 0.173% for the Unb.#2, with the proposed control strategy.Similarly, it is also reduced from 0.192 to 0.188% for the worst case, where the three-phase four-leg grid-forming unit has to supply a single-phase load.
According to Table 3, the superiority of the proposed control strategy over the conventional control scheme is confirmed by the significant decreases in the value of PVUR for the various load unbalance cases considered in this study.As mentioned in the literature review, the tiny steady-state error can be ensured using a PI controller in the rotating frame.However, it is difficult to achieve zero steady-state error with the conventional SCC-based control strategy because of the presence of the line frequency and the double line frequency components at the output of the PI controller.The presence of the double line and line frequency components, which are the result of the negative and zero sequence components at the output of the PI controllers, can lead to non-zero steady-state error.In contrast, the proposed per-phase multi-loop control strategy is able to compensate voltage unbalance in each phase independently, thus avoiding the need to deal with the double line and line frequency components at the output of the PI controllers.Moreover, the stationary reference frame equivalent of the PI voltage controllers in the rotating frame can ensure a tiny steady-state error for the proposed multi-loop control strategy.As can be observed from Table 3, the load voltages remain balanced in the steady-state for both the conventional and the proposed per-phase control schemes at all tested conditions.Additionally, the value of the PVUR is maintained below 2% at all tested conditions for both control schemes.However, the value of the PVUR is reduced with the proposed control scheme for the various load unbalance cases considered in this study.It can be seen from the table that the value of PVUR is reduced from 0.128 to 0.062% for the Unb.#1 with the proposed control strategy.This value is also reduced from 0.184 to 0.173% for the Unb.#2, with the proposed control strategy.Similarly, it is also reduced from 0.192 to 0.188% for the worst case, where the three-phase four-leg grid-forming unit has to supply a single-phase load.
According to Table 3, the superiority of the proposed control strategy over the conventional control scheme is confirmed by the significant decreases in the value of PVUR for the various load unbalance cases considered in this study.As mentioned in the literature review, the tiny steady-state error can be ensured using a PI controller in the rotating frame.However, it is difficult to achieve zero steady-state error with the conventional SCC-based control strategy because of the presence of the line frequency and the double line frequency components at the output of the PI controller.The presence of the double line and line frequency components, which are the result of the negative and zero sequence components at the output of the PI controllers, can lead to non-zero steady-state error.In contrast, the proposed per-phase multi-loop control strategy is able to compensate voltage unbalance in each phase independently, thus avoiding the need to deal with the double line and line frequency components at the output of the PI controllers.Moreover, the stationary reference frame equivalent of the PI voltage controllers in the rotating frame can ensure a tiny steady-state error for the proposed multi-loop control strategy.

Under Nonlinear Load Conditions
To confirm the performance of the control strategy under nonlinear load conditions, the four-leg power converter is simulated using the DIgSILENT PowerFactory software.To validate the effectiveness of the suggested primary control strategy under nonlinear load conditions, a single-phase nonlinear load that consists of a diode rectifier bridge that feeds a 500 μF capacitor in parallel with a 30 Ω resistor, is connected between phase 'a' and the neutral line at the PCC.The four-leg power converter is equipped with the proposed multi-resonant harmonic voltage compensator.Figure 18 illustrates the nonlinear load current waveform and the associated harmonic spectra.The waveforms of the three-phase output currents and the neutral currents of the four-leg power converter under nonlinear load conditions are depicted in Figure 19.As can be observed, the output currents of the four-leg power converter is highly distorted with sharp spikes.
The output voltages of phase 'a' in the four-leg power converter and their harmonic spectra, before compensation, is depicted in Figure 20.As seen, the output voltage of phase 'a' in four-leg power converter is distorted due to the connection of the single-phase nonlinear load.As observed, both negative and zero sequence harmonics can cause power quality difficulties in the output of the inverter.
The output voltage of phase 'a' in the four-leg power converter and their harmonic spectra, with the suggested harmonic controller, are shown in Figure 21.When comparing the output voltage waveforms in phase 'a', it is remarkable to see that by employing the multi-resonant harmonic compensator, the harmonics for voltages in the 3rd, 5th, 7th, 9th, 11th, and 13th harmonics are obviously suppressed.

Under Nonlinear Load Conditions
To confirm the performance of the control strategy under nonlinear load conditions, the four-leg power converter is simulated using the DIgSILENT PowerFactory software.To validate the effectiveness of the suggested primary control strategy under nonlinear load conditions, a single-phase nonlinear load that consists of a diode rectifier bridge that feeds a 500 µF capacitor in parallel with a 30 Ω resistor, is connected between phase 'a' and the neutral line at the PCC.The four-leg power converter is equipped with the proposed multi-resonant harmonic voltage compensator.Figure 18 illustrates the nonlinear load current waveform and the associated harmonic spectra.The waveforms of the three-phase output currents and the neutral currents of the four-leg power converter under nonlinear load conditions are depicted in Figure 19.As can be observed, the output currents of the four-leg power converter is highly distorted with sharp spikes.
The output voltages of phase 'a' in the four-leg power converter and their harmonic spectra, before compensation, is depicted in Figure 20.As seen, the output voltage of phase 'a' in four-leg power converter is distorted due to the connection of the single-phase nonlinear load.As observed, both negative and zero sequence harmonics can cause power quality difficulties in the output of the inverter.
The output voltage of phase 'a' in the four-leg power converter and their harmonic spectra, with the suggested harmonic controller, are shown in Figure 21.When comparing the output voltage waveforms in phase 'a', it is remarkable to see that by employing the multi-resonant harmonic compensator, the harmonics for voltages in the 3rd, 5th, 7th, 9th, 11th, and 13th harmonics are obviously suppressed.The quality of the sinusoidal voltage waveforms in terms of THD is compared in Table 4.As can be observed in this table, the output voltage of the four-leg power converter remains sinusoidal after compensation, and the THD is reduced from 5.9 to 2.68%.Overall, the results of this part show that the per-phase multi-loop control strategy that consists of the cascaded voltage-current controller,  The quality of the sinusoidal voltage waveforms in terms of THD is compared in Table 4.As can be observed in this table, the output voltage of the four-leg power converter remains sinusoidal after compensation, and the THD is reduced from 5.9 to 2.68%.Overall, the results of this part show that the per-phase multi-loop control strategy that consists of the cascaded voltage-current controller, The quality of the sinusoidal voltage waveforms in terms of THD is compared in Table 4.As can be observed in this table, the output voltage of the four-leg power converter remains sinusoidal after compensation, and the THD is reduced from 5.9 to 2.68%.Overall, the results of this part show that the per-phase multi-loop control strategy that consists of the cascaded voltage-current controller, and the multi-resonant harmonic compensator, has the ability to keep the output voltages of the DG balanced with low THD under the situation of unbalanced and nonlinear load.Table 4. Comparison of the output voltage THDs, with and without using the harmonic controller.

Test Case
Voltage THD (%) Without harmonic control 5.9 With the proposed harmonic control 2.68

Conclusions
In this paper, an enhanced controller for a four-leg power converter under unbalanced and nonlinear load conditions has been presented.It is proposed using the per-phase average modeling of the four-leg inverter in the stationary and rotating reference frames.Initially, a novel decoupled model for the four-leg inverter is presented.Next, using an improved orthogonal signal generation method, the per-phase model of the four-leg inverter in the stationary and synchronous frame is derived.Then, a per-phase multi-loop control scheme for the four-leg inverter under unbalanced load conditions is suggested.Lastly, a multi-resonant harmonic compensator is used to actively prevent low-order harmonic currents.The proposed per-phase multi-loop control strategy has the ability to provide balanced output voltages under unbalanced load conditions by avoiding the need to deal with the symmetrical components.The proposed control strategy has presented outstanding voltage control performance, such as fast transient response, and short regulation time with no overshot under sudden load changes as well as tiny steady-state error under unbalanced load conditions.The superiority of the suggested control strategy over the conventional SCC-based control scheme is confirmed by the two line cycles decrease in the transient response, and the significant reduction in the value of the PVUR in the steady-state under various types of operation conditions.The multi-resonant harmonic compensator has also the ability to actively prevent low-order harmonic currents to distort the output voltages of the three-phase four-leg power converter.The compensation of both negative and zero sequence harmonics, simple control structure and insensitivity to frequency variations have given this control algorithm an edge over the conventional control strategies.The voltage THD of the grid-forming power converters were reduced from above 5.9% to lower than 2.68% with the proposed control strategy under nonlinear load conditions.

Figure 1 .
Figure 1.Power stage of a three-phase four-leg voltage source inverter.

Figure 1 .
Figure 1.Power stage of a three-phase four-leg voltage source inverter.

Figure 2 .
Figure 2. Average large-signal model of the four-leg inverter.

Figure 3 .
Figure 3. Per-phase representation of the four-leg inverter.

Figure 4 .
Figure 4. Decoupled model of the four-leg pulse width modulation inverter.

Figure 3 .
Figure 3. Per-phase representation of the four-leg inverter.

Figure 3 .
Figure 3. Per-phase representation of the four-leg inverter.

Figure 4 .
Figure 4. Decoupled model of the four-leg pulse width modulation inverter.

Figure 4 .
Figure 4. Decoupled model of the four-leg pulse width modulation inverter.
* and   * are the refrence values of voltages in the dq frame,  = √  * 2 +   * 2 ,  = tan −1 (   *   * ),  is the phase angle of the grid and  is the angle of the / transformation, which is equal to  in the steady-state.

Figure 5 .
Figure 5. Structure of the employed orthogonal signal generator.

Figure 5 .
Figure 5. Structure of the employed orthogonal signal generator.

Figure 6 .
Figure 6.Proposed multi-loop voltage and current control strategy.

Figure 7 .
Figure 7. Simplified model of the three-phase four-leg inverter.

Figure 7 .
Figure 7. Simplified model of the three-phase four-leg inverter.

Figure 9 .
Figure 9. Output voltages and currents with the conventional control strategy under suddenly load changes.

Figure 9 . 26 Figure 10 .
Figure 9. Output voltages and currents with the conventional strategy under suddenly load changes.

Figure 10 .
Figure 10.Output voltages and currents with the proposed control strategy under suddenly load changes.

Figure 11 .
Figure 11.Reference and actual voltages of the four-leg grid-forming unit in phase 'a' in the rotating frame with the proposed control strategy.

Figure 12 .
Figure 12.Reference and actual voltages of the four-leg grid-forming unit in phase 'b' in the rotating frame with the proposed control strategy.

Figure 11 . 26 Figure 11 .
Figure 11.Reference and actual voltages of the four-leg grid-forming unit in phase 'a' in the rotating frame with the proposed control strategy.

Figure 12 .
Figure 12.Reference and actual voltages of the four-leg grid-forming unit in phase 'b' in the rotating frame with the proposed control strategy.

Figure 12 .
Figure 12.Reference and actual voltages of the four-leg grid-forming unit in phase 'b' in the rotating frame with the proposed control strategy.

Figure 13 .
Figure 13.Reference and actual voltages of the four-leg grid-forming unit in phase 'c' in the rotating frame with the proposed control strategy.

Figure 13 .
Figure 13.Reference and actual voltages of the four-leg grid-forming unit in phase 'c' in the rotating frame with the proposed control strategy.

Figure 14 .
Figure 14.Output three-phase voltages and currents for the balanced load.

Figure 14 .
Figure 14.Output three-phase voltages and currents for the balanced load.

Figure 14 .
Figure 14.Output three-phase voltages and currents for the balanced load.

Energies 2018, 11 , 2688 22 of 26 Figure 18 .
Figure 18.The waveform of load current and the associated current harmonic spectrum.THD: total harmonic distortion.

Figure 19 .
Figure 19.Three-phase output currents and the neutral current of the four-leg inverter.

Figure 18 . 26 Figure 18 .
Figure 18.The waveform of load current and the associated current harmonic spectrum.THD: total harmonic distortion.

Figure 19 .
Figure 19.Three-phase output currents and the neutral current of the four-leg inverter.Figure 19.Three-phase output currents and the neutral current of the four-leg inverter.

Figure 19 .
Figure 19.Three-phase output currents and the neutral current of the four-leg inverter.Figure 19.Three-phase output currents and the neutral current of the four-leg inverter.

Figure 20 .
Figure 20.Output voltage of phase 'a' and the associated voltage harmonic spectrum, without using the harmonic compensation loop.

Figure 21 .
Figure 21.The output voltage of phase 'a' with the proposed harmonic compensation loop.

Figure 20 . 26 Figure 20 .
Figure 20.Output voltage of phase 'a' and the associated voltage harmonic spectrum, without using the harmonic compensation loop.

Figure 21 .
Figure 21.The output voltage of phase 'a' with the proposed harmonic compensation loop.

Figure 21 .
Figure 21.The output voltage of phase 'a' with the proposed harmonic compensation loop.

Table 1 .
Electrical and controller parameters of three-phase four-leg inverter.

Table 2 .
Transient performance of two control strategies.

Table 3 .
Comparison between two control strategies in the steady-state.

Table 3 .
Comparison between two control strategies in the steady-state.