Enhanced Control Scheme for a Three-Phase Grid-Connected PV Inverter under Unbalanced Fault Conditions

This paper presents an improved control strategy to cancel the double grid frequency oscillations in the active power, reactive power, and DC-link voltage of a three-phase grid-connected photovoltaic (PV) system under unbalanced grid condition. To achieve these goals, an enhanced positive–negative-sequence control (PNSC) to remove oscillations of active power and an instantaneous active–reactive control (IARC) to mitigate the fluctuations of active and reactive power, simultaneously, are suggested. These methods are also effective to reduce the oscillations of the DC-link voltage. To track the desired unbalanced or harmonic reference currents, improved proportional resonant (PR) current controllers have been designed using the Bode frequency analysis. Simulation studies are carried out via Matlab/Simulink® software to verify the effectiveness of the suggested control strategies.


Introduction
Despite numerous benefits provided by large power plants, economic, technical, and environmental advantages have led to the gradual development of small-scale renewable energy resources (RERs) into the power system [1][2][3][4][5]. Among different types of RERs, solar photovoltaic (PV) is a suitable choice owing to the possibility of direct conversion of sunlight into electricity using power electronic devices [6,7]. This system can operate in two main operation modes, including grid-connected and stand-alone [8]. However, to achieve a reliable operation during normal and grid fault conditions, some regulatory and technical problems such as constraints set by power generation systems have to be resolved before PV systems can become commonplace.
In recent years, there has been increasing interest in power quality in grid-connected PV inverters under grid faults, as the non-sinusoidal current is injected into the power system under such conditions, and the active/reactive power includes double frequency contents [9]. These oscillations in the active/reactive power can lead to undesired variation in the DC-link voltage. Fundamentally, oscillations occur due to the poor performance of both current control strategies of the PV system and the grid synchronization system.
Based on the recently revised grid codes, PV inverters are preferred to stay connected to the power system during grid voltage faults and contribute to the grid stability and power quality by All required properties for the PV system are presented in the following: (1) maximum utilization of PV panels in working hours; this is mainly attributed under any environmental conditions; (2) regulating the DC-link voltage to guarantee the proper performance of the inverter, applying via changes in duty cycle; (3) injecting smooth power by the inverter to ensure the power quality requirement of the utility grid; and (4) providing precise phase information of the grid positive-sequence voltage for the control unit by a fast and precise synchronization system.
In the DC-DC converter, the required control signal (duty cycle) is determined by the MPPT algorithm. In addition, there are two control loops in the power control of a VSC: (1) an outer control loop is responsible for generating the reference current to regulate the DC-link voltage and injecting the desired power to the network and (2) an inner control loop with the task of tracking the reference current generated by the outer control loop. In this system, a frequency-locked loop (FLL) control block synchronizes the PV inverter with the power grid and provides a specific phase angle.

FLL Synchronization System
Under normal conditions, the synchronous reference frame PLL (SRF-PLL) is an effective synchronization method. However, under unbalanced voltage conditions, the system provides distorted phase information due to operating based on a fixed phase difference. To solve this problem, an FLL synchronization system is suggested in [18,25,26]. FLLs operate based on the grid frequency, which its change is much slower than the grid voltage phase-angle. It estimates the grid angle from positive-and negative-sequence components of the voltage signal at the fundamental frequency. FLL is able to achieve frequency adaptability by a simple control loop, without using either phase-angles or trigonometric functions. Hence, it acts as an adaptive filter to frequency changes that may occur in the grid system [25,27,28]. In this paper, a double second-order generalized integrator FLL (DSOGI-FLL) is used for phase detection, and it is adapted to the DC-DC/VSC control structure. The structure of the DSOGI-FLL is shown in Figure 2, which is composed of two active filters second-order generalized integrator-quadrature signal generator (SOGI-QSG) blocks, positive-negative-sequence calculation (PNSC) block and the FLL [27,29,30]. The SOGI-QSG blocks are active filters and can convert input sinusoidal signal to square output signal. These blocks are also effective in eliminating high-order harmonics. The calculator block of the PNSC operates with the method of sequence components in the αβ reference frame.

MPPT Method
The energy conversion efficiency in PV systems is mainly related to the output current of the converter and atmospheric conditions. To take into account all the effective factors to improve the efficiency, MPPT algorithms are proposed in [31]. In [32,33], several methods with different implementations, from primary to advanced procedures are introduced. Incremental conductance (INC) method with the PI controller is one of the best solutions. Figure 3 indicates the INC-MPPT block diagram with the PI feedback, which is used as the MPPT method in this paper. The INC method is based on the fact that the power slope of the PV is null at the MPP (dP/dV = 0), positive in the left and negative on the right side of the PV power characteristic. Thus, the MPP can be found in terms of the increment in the array conductance. This method also features a modified version and does not suffer from fast transients in environmental conditions. The PI controller improves the IC method by minimizing the error between the actual conductance and the incremental conductance because the compensator can be adjusted and updated according to the system necessity.

Current Controller
To generate appropriate pulse-width modulation (PWM) signals that are applied to inverter switches, conventional PI controllers use the difference between dq components of VSC currents Electronics 2020, 9, 1247 5 of 24 and the reference currents. In normal situations, the reference current is constant (in both the d and q axis). However, it is no longer a fixed value under unbalanced grid voltage conditions. In other words, the reference currents have a sinusoidal form by twice of fundamental grid frequency due to cross-coupling between the dq axis signals and contain positive and negative sequences, which cannot generally be tracked by a PI controller [29]. In control systems theory, to track sinusoidal signals, PR controllers are usually utilized [34]. The PR controller solves this problem by using the grid frequency, which is the same for either of the two sequences' components. A single PR control with the ability to track the sinusoidal signal is enough to compensate the positive and negative sequences, simultaneously. Three main types of PR controllers are introduced in the following section: (I) ideal PR controller, (II) non-ideal PR controller, and (III) non-ideal PR controller with harmonic compensators.

Type I: Ideal PR Controller
The transfer function of the ideal PR controller is [35]: where, ω is grid frequency in (rad/sec) and k p and k i are the proportional and integral gains. This controller has an infinite gain at the grid frequency with a slight bandwidth to obtain a zero steady-state error in the tracking of the sinusoidal signal at the grid frequency based on Equation (1) and Bode diagram of Figure 4 [16]. The block diagram of the ideal PR current controller is also shown in Figure 5. The narrow bandwidth can cause the performance of the controller so sensitive to the central frequency value; hence, the non-ideal PR controller is preferred in practice.

Current Controller
To generate appropriate pulse-width modulation (PWM) signals that are applied to inverter switches, conventional PI controllers use the difference between dq components of VSC currents and the reference currents. In normal situations, the reference current is constant (in both the d and q axis). However, it is no longer a fixed value under unbalanced grid voltage conditions. In other words, the reference currents have a sinusoidal form by twice of fundamental grid frequency due to cross-coupling between the dq axis signals and contain positive and negative sequences, which cannot generally be tracked by a PI controller [29]. In control systems theory, to track sinusoidal signals, PR controllers are usually utilized [34]. The PR controller solves this problem by using the grid frequency, which is the same for either of the two sequences' components. A single PR control with the ability to track the sinusoidal signal is enough to compensate the positive and negative sequences, simultaneously. Three main types of PR controllers are introduced in the following section: (I) ideal PR controller, (II) non-ideal PR controller, and (III) non-ideal PR controller with harmonic compensators.

Type I: Ideal PR Controller
The transfer function of the ideal PR controller is [35]: where, ω is grid frequency in (rad/sec) and kp and ki are the proportional and integral gains. This controller has an infinite gain at the grid frequency with a slight bandwidth to obtain a zero steady-state error in the tracking of the sinusoidal signal at the grid frequency based on Equation (1) and Bode diagram of Figure 4 [16]. The block diagram of the ideal PR current controller is also shown in Figure 5. The narrow bandwidth can cause the performance of the controller so sensitive to the central frequency value; hence, the non-ideal PR controller is preferred in practice.

Type II: Non-Ideal PR Controller
The transfer function of the non-ideal PR controller is: In Equation (2), the bandwidth of the controller can be adjusted by BW, which is determined by damping factor ξ. This means that by increasing ξ, the bandwidth would be wider. The Bode diagram of the non-ideal PR is shown in Figure 6. As can be seen, the bandwidth is wider when compared with the ideal PR controller. The block diagram of the non-ideal PR controller is displayed in Figure 7.
Electronics 2020, 9,  The transfer function of the non-ideal PR controller is: In Equation Error! Reference source not found., the bandwidth of the controller can be adjusted by BW, which is determined by damping factor  . This means that by increasing  , the bandwidth would be wider. The Bode diagram of the non-ideal PR is shown in Figure 6. As can be seen, the bandwidth is wider when compared with the ideal PR controller. The block diagram of the non-ideal PR controller is displayed in Figure 7.  Henceforth, under normal grid conditions, the non-ideal PR current control will be able to track sinusoidal signals. However, it is not responsible to track the reference three-phase sinusoidal signals, which present harmonics in their waveform. Tracking these signals is essential for controlling active and reactive power, simultaneously [18]. Hence, the PR controller with a harmonic compensator will be applied in this paper.

Type III: Non-Ideal PR Controller with a Harmonic Compensators
The standard PR controller is made by using the PR controller for each phase. In the last implementation, several resonant compensators tuned at the fundamental and other harmonic frequencies are connected in parallel. In this case, the reference sinusoidal signal, which contains  Henceforth, under normal grid conditions, the non-ideal PR current control will be able to track sinusoidal signals. However, it is not responsible to track the reference three-phase sinusoidal signals, which present harmonics in their waveform. Tracking these signals is essential for controlling active and reactive power, simultaneously [18]. Hence, the PR controller with a harmonic compensator will be applied in this paper.

Type III: Non-Ideal PR Controller with a Harmonic Compensators
The standard PR controller is made by using the PR controller for each phase. In the last implementation, several resonant compensators tuned at the fundamental and other harmonic frequencies are connected in parallel. In this case, the reference sinusoidal signal, which contains Electronics 2020, 9, 1247 7 of 24 harmonics can be correctly tracked. The transfer function of the non-ideal PR controller with harmonic compensators is written as follows: The open-loop gain Bode diagram of the non-ideal PR controller, with and without the third, fifth, and seventh harmonic compensators, is presented in Figure 8. The open-loop crossover frequency of the controller must be higher than the highest harmonic frequency to ensure the tracking performance of the closed-loop system. The crossover frequency is adjusted by k p and will be limited by the stability of the gain margin [36]. Added harmonic compensators have no significant impact on the desired property of the primary PR controller; enabling the tracking of the main frequency [18]. Furthermore, this controller is capable of compensating both positive and negative sequences. The block diagram of this controller is shown in Figure 9.
Electronics 2020, 9, The open-loop gain Bode diagram of the non-ideal PR controller, with and without the third, fifth, and seventh harmonic compensators, is presented in Figure 8. The open-loop crossover frequency of the controller must be higher than the highest harmonic frequency to ensure the tracking performance of the closed-loop system. The crossover frequency is adjusted by and will be limited by the stability of the gain margin [36]. Added harmonic compensators have no significant impact on the desired property of the primary PR controller; enabling the tracking of the main frequency [18]. Furthermore, this controller is capable of compensating both positive and negative sequences. The block diagram of this controller is shown in Figure 9.      In designing the PR current controller, the elements of two sequences of grid voltage in the frequency domain can be expressed as follows: Based on Equation (5) v(s) αβ contains both sequence components of grid voltage. Additionally, Equation (6) shows the relationship between voltage and current elements. The diagonal matrix form in Equation (6) indicates no cross-coupling between phases. Thus, based on Equations (5) and (6), a PR controller with the ability of tracking the sinusoidal signal on the stationary reference frame is able to cancel out the error on the positive and negative sequence components in an unbalanced situation.

Proposed Power Control Method
Under abnormal conditions, the instantaneous control of active and reactive power exchanged with the utility grid is highly important. Due to the interaction between voltages and currents with different sequences at the point of common coupling (PCC), the exchanged power will be oscillating. In this regard, the first step is the calculation of instantaneous active and reactive powers.
Basically, the orthogonal voltage (v ⊥ ) in Equation (7) is 90 • leaded of the original grid voltage vector (v). Considering Equation (7), the instantaneous active and reactive power would be calculated in the time domain as Equations (7) and (8), respectively. More details about transformation into the stationary frame and dq reference frame are given in [18].
where, p, q are constant terms of exchanged power and p, q are the oscillating terms. Under abnormal conditions, two issues are important for PV systems; power oscillation terms and current harmonics [25]. In the following, the PNSC and the instantaneous active-reactive control (IARC) are proposed. The PNSC method has the capability to cancel out the active power oscillations without injecting the current harmonics. This method can be implemented on active load systems that no need to inject reactive power. For instance, if the injection of active power into the network is considered, while the reactive power set-point is equal to zero, the active power oscillations are mitigated. Thus it can be more beneficial economically than the IARC method. On the other hand, the IARC method has the ability to remove both active and reactive power oscillations simultaneously along with the current harmonics.

PNSC
As the proposed controller is for a three-leg inverter operating in a three-phase three-wire system, the control of the quantities of the zero-sequence is not included in the design of the control system. To determine the expressions for the reference currents generated by the PNSC strategy, it is initially assumed that only active power is delivered to the grid. In order to calculate the considered reference currents, injected currents and power terms are as follows: Electronics 2020, 9, 1247 9 of 24 In regards to Equation (12): By substituting Equation (13) in Equation (11): Hence, by mixing Equations (10), (13), and (14): Now with previous assumptions on the reactive power, i * q can be written as: where |v| 2 is the norm of the grid voltage vector signal that is proposed for different reference frames as follows: Equation (17) represents that the proposed method can be implemented in different reference frames with different controllers. Thus, reference current can be given as: Therefore, the active and reactive powers can be given as: The third and fourth terms are mitigated in both the above equations, as the dot product between two components with the same sequence and 90 • shifted is equal to zero. On the other hand, the fifth and the sixth terms are zero due to the conditions stated in Equation (12), and the first assumption, where both oscillating terms forced to be zero when calculating the reference for the active and reactive currents.
In the PSNC method, fluctuations in the active power can be mitigated completely, and the injected current would be sinusoidal without any harmonics. Therefore, the non-ideal PR compensator is proper to track the reference currents in the PSNC technique. The inner and outer loop of the current controller using the PNSC method, along with the DSOGI-FLL is shown in Figure 10.

IARC
Under unbalanced grid voltage conditions, the voltage vector oscillates at twice the fundamental grid frequency, as Equation (21) [18].
To provide smooth active and reactive powers, simultaneously, reference currents are calculated as follows: In Equations (22) and (23) the active and reactive reference power can be calculated as Equations (8) and (9), which oscillating terms have been set to zero, and constant terms are obtained based on the output power. Where g and b represent instantaneous conductance and susceptance, from the inverter output, respectively. i * p and i * q are proper reference currents as follows: Thus, the reference currents are determined as: These currents are the most efficient reference currents that determine the exact reference currents to exchange constant power with the main grid, under generic voltage conditions. Hence, these currents have the highest degree of control. Although the generated reference currents lead to smooth output active and reactive power, they include harmonic terms. This is because when the expression of Equation (21) is processed in the denominator, the resulting reference currents are not sinusoidal, but contain harmonics. Therefore, a non-ideal PR controller with harmonic compensation property has to be utilized here to achieve the proper tracking performance. In addition, the instantaneous control of the active and reactive power means the instantaneous tracking of the sinusoidal waveform of an unbalanced harmonic current in the controller. The current control loop to implement this method is shown in Figure 11.

Controller Design Using Bode Frequency Analysis
The PR controller contains the term of proportional k p and integral k i gains. In order to fulfill a damping factor of 0.7 and overshoot less than 5%, the modulus criterions can be calculated as [25,37]: where L is the summation of series inductance and R is the summation of series resistance of interfaced LCL filter and T 1 = 1.5T s + 0.5T sw and T s = 1 f s and T sw = 1 f sw . The closed-loop control system must be considered to attain the proper value of parameters. The block diagram of the PR current control loop is shown in Figure 12. This loop would be the same for each of α and β components. In this loop, each block is estimated with a transfer function as follows: In order to obtain the optimum PR gain values, a discrete pole placement analysis has been utilized by using criteria values in the current control loop (k p crt = 0.34, k icrt = 3.44). Two requirements have been imposed on the control loop (1) the current loop should be stable, with a phase margin larger than 45 • and a gain margin larger than 6 dB and (2) the bandwidth of the system should be a minimum of 500 Hz [37].
Considering the transfer function of the PR controller, the k p term is used to adjust the stability of the overall control system. In order to select the k p , the root locus method was performed in the discrete-time domain with the Matlab toolbox, Sisotool. As can be seen in Figure 13, the dominant poles had a damping factor of 0.7. Furthermore, it is illustrated that the current control loop with a k p value of 0.3 had a phase margin of 62.8 • and a gain margin of 19.1 dB and the damping of the resonant poles reached the value of 0.7. Furthermore, it is shown that a stable loop was obtained. An integral gain k i1 of 20 was chosen as a tradeoff between a good noise rejection and good dynamics. In the same way, for cascading PR compensators the integral gains k i3 , k i5 , and k i7 of 10, 7, and 5 were chosen, respectively. Considering the DC voltage loop in Figure 14, the PI controller values are tuned using the optimum symmetrical criterion [38]. The block of the current control loop is represented as closed loop transfer function, which can be written as: By utilizing the optimum symmetrical method and imposing the phase margin of 45 • , the PI parameters can be calculated as: where S d is the d-component of continuous switching vector via park transformation. Similar to the previous procedure, the k p and k i terms were tuned via the root locus method in the discrete time domain with the Matlab toolbox, Sisotool. Hence, as it is shown in Figure 15 with k p = 7 and k i = 800 a stable loop a phase margin of 55 • and a gain margin of 25.5 dB was achieved. Finally, all the controller parameters are displayed in Table 1.

Simulation Results
The simulation results include a comparison between three tests under two types of voltage sag: (1) the conventional current control strategy, (2) the PNSC method performance using the type II PR controller, and (3) the IARC method performance using the type III PR controller. The system is a 100 kW PV inverter connected to the utility grid by a three-phase three-leg VSC. In addition, the Y∆ transformer with a three-phase local load after the PV system is interfaced to the grid by a 14-km three-wire transmission line. The PV system parameters are shown in Table 2. The reference for the active and reactive power was assumed to be 100 (kW) and zero (kVAr), in all simulations, respectively. Additionally, the LCL filter with a passive damper was designed based on [39]. To ensure the stable operation of the PV system, the minimum value of the DC capacitors was calculated based on [22]. Figures 16 and 17 show the waveform of the grid voltage at PCC. As seen, in t = 0.6 s, a single-phase-to-ground fault ('type B' voltage sag) and a phase-to-phase fault ('type C' voltage sag) occurred [25].   In the following sections, two grid cycles are given to the FLL synchronize with the grid voltage. After a transient period of t = 0.1 s, the first dynamic response of the proposed method in comparison with the conventional method is shown. In t = 0.25 s, the MPPT algorithm is triggered that makes the active power to be increased to 5 kW, without any impact on the reactive power.

Conventional Current Control Method
To clarify the quality of reference currents, three generating methods were used in this paper. First, the conventional method was simulated [23]. Figure 18 shows the performance of the conventional method, which produced intensive oscillations in the active and reactive power. The DC-link voltage with the conventional current control method is also presented in Figure 19. As can be observed, the DC-link voltage was not constant and oscillations with considerable amplitude appeared during the voltage sag.

PNSC Method Performance Using the Type II PR Controller
The output power under 'type B' and 'type C' voltage sag by using the PNSC method is depicted in Figures 20 and 21, which shows the effective performance of the proposed method in canceling out active power oscillations completely. Moreover, the comparison of the performance between the PNSC method and the conventional method indicates the higher quality of the PNSC power adjustment. The DC-link capacitors' voltage under 'type B' and 'type C' faults are shown in Figures 22 and 23. It shows the response of implementing the PNSC, which indicates 55.5% and 45% reduction in the amplitude of voltage oscillations when compared with the conventional method, respectively.    The proper three-phase unbalanced reference currents generated by the PNSC method before and after fault occurrence is shown in Figure 24, which indicate the appropriate performance of the PNSC method and accurate current tracking by the controller.    implemented. The IARC method shows around a 50% reduction in the amplitude of voltage oscillations. The three-phase reference currents generated by the IARC method and injected currents via the non-ideal PR controller with harmonic compensators are shown in Figure 29. It indicates that, after the fault period, the harmonic reference currents generated were tracked properly.  Moreover, the Fast Fourier Transform (FFT) analysis for one phase of injected currents via the IARC method is shown in Figure 30. It is contained with high total harmonic distortion (THD) as 21.11% of the fundamental frequency. The harmonic orders as a percentage of the fundamental frequency are shown in Table 3.

Conclusions
This paper suggested an improved control scheme for a three-phase two-stage PV converter by the combination of the FLL and PR current reference generator to improve the power quality under abnormal conditions. The proposed method has the ability to mitigate the double grid frequency oscillations in the DC-link voltage and the active and reactive powers under unbalanced faults. Ananalytical method was used to obtain the optimum value of controllers' parameters. To generate the appropriate reference current, two methods, including PNSC with type II of the PR controller and IARC with type III of the PR controller were applied. The simulation results illustrated that the IARC method along with type III of PR controller effectively mitigates the double grid frequency oscillations in the DC-link voltage, active power, and active power under unbalanced grid faults.
Author Contributions: All authors participated equally in conceptualization, methodology, implementation, and writing-review and editing the paper. Additionally, all authors have read and agreed to the published version of the manuscript.
Funding: This research received no external funding.

Conflicts of Interest:
The authors declare no conflict of interest.