A Unified Current Loop Tuning Approach for Grid-Connected Photovoltaic Inverters

Weiyi Zhang 1,*, Daniel Remon 1, Antoni M. Cantarellas 1,2 and Pedro Rodriguez 1,2 1 Department of Electrical Engineering, Technical University of Catalonia, Rambla Sant Nebridi 22, Terrassa, Barcelona 08222, Spain; daniel.remon@estudiant.upc.edu (D.R.); antoni.mir@abengoa.com (A.M.C.); pedro.rodriguez@abengoa.com (P.R.) 2 Abengoa Research, Abengoa, Energia Solar 1, Palmas Altas, Seville 41014, Spain * Correspondence: weiyi.zhang@estudiant.upc.edu; Tel.: +34-93-739-8291


Introduction
Renewable power generation plants are commonly connected to grids through power electronic converters.Along with the increase of these plants, some new demands for grid-connected converters have been proposed, like higher power ratings and better grid-interactive performance, which are the trends of both the photovoltaic (PV) and wind power industry.
Oriented toward improving the performance of the grid-connected converters, different topics regarding converter control have been discussed, and the control strategies have become various in order to comply with the updated grid codes and to realize better functionality.Grid-connected converters are controlled by multi-loop controllers in many cases, in which a current controller is used in the inner control loop, as seen in [1][2][3][4][5][6].Among the requirements of the grid codes [7,8], those requiring the grid-connected converters to perform fast power tracking, as well as low voltage ride through (LVRT) are the critical ones that have conditioned the structure of the current controller most, since a good tradeoff between the dynamics and stability is needed.Moreover, the current loop plays an important role since it intrinsically determines the stability of the system, and the dynamics of the outer loops has to be analyzed assuming the current loop performing a fast response.Therefore, the design of the inner current loop is critical for the overall performance of the multi-loop controller.
Regarding current regulators, the proportional resonant (PR) controller on a stationary frame has been used in different applications showing effectiveness [9][10][11][12][13][14].Compared with the proportional integral (PI) controller on a synchronous frame [15,16], the advantages of the PR controller include the reference frame transformation with reduced computational burden in digital implementation [12], the simplicity in positive/negative sequence and harmonics control [10], the simplicity in stability analysis [17] and zero steady-state error in single-phase systems.Moreover, the grid synchronization algorithm applied in the stationary frame control paradigm is dependent on the grid frequency, which is stiffer than the grid voltage phase [18].
The influence of the PR controller gains on the characteristics of the system have been well analyzed in [10,17,19].The tuning of the controller gains is deemed to be critical for the stability and dynamics of the system.The root-locus-based method is an option to determine the controller gains by fixing the closed-loop poles [19][20][21].However, the criteria to determine the location or boundaries of the poles are not thoroughly reported.
Determining the controller gains based on crossover frequency and the phase margin is another common approach [9,22].Nevertheless, the selection of the phase margin and crossover frequency is not justified in detail.It is suggested to keep the crossover frequency below a decade of the switching frequency in [23].In [9], the crossover frequency is fixed at the mathematical higher bound under a fixed phase margin, and a phase margin of 40 • is suggested.While in [24], a phase margin between 30 • and 60 • with a gain margin above 6 dB is seen to be proper.In general, different criteria have been applied for specifying the phase margin and crossover frequency, and further analysis is needed.
This paper proposes a unified current loop tuning approach for grid-connected converters.The calculating algorithm based on crossover frequency and the phase margin is used.Additionally, different from the existing studies, the selection of the crossover frequency and phase margin is analyzed in detail to optimize the tuning.Instead of applying the phase margin and crossover frequency by classical experience, the controller gains can be tuned with more consideration of the actual system in each application.The relations among controller gains, phase margin and crossover frequency are given in the discrete-time domain for easy digital implementation and simple calculation.Besides, for an accurate estimation of the characteristics of the system, the open-loop transfer function is fully considered without the approximation of the transfer function of the controller or grid filter.
The rest of the paper is organized as follows.The adopted multi-loop control framework is described, and the modeling of the current control loop is given in Section 2. Section 3 elaborates the optimized current loop tuning procedure.Simulation and experimental results are respectively presented in Sections 4 and 5 to demonstrate the effectiveness of the proposed method, and the conclusions are drawn in Section 6.

Proportional Resonant Controller for Grid-Connected Photovoltaic Inverters
Figure 1 shows the configuration of a PV generation plant that is connected to a 33-kV grid.It is comprised of 10 buses, and each one is supplied by two PV arrays through two paralleled grid-connected inverters.
The overall multi-loop control structure for each grid-connected converter of this plant is shown in Figure 2, which evolves from the general control framework of the synchronous power controller (SPC) that is proposed in [25].The SPC stems from the concept of specifying the grid-connected converters with the electromechanical characteristics of synchronous machines and, hence, improves the interaction dynamics between the generation units and the grid.The reference of the current controller is provided by the virtual admittance block, which emulates the output impedance of synchronous machines.Inertia and damping characteristic can be given by configuring the mechanical block.Different strategies can be used for the control design of the mechanical block [26], and in this paper, a lead-lag structure is used [27].The virtual synchronous frequency ω is integrated with a phase angle θ, and combining the voltage magnitude E generated by the reactive power controller, virtual electromotive force e is generated.As found from Figure 2, a fast and stable current controller is essential to achieve the designed functionalities that are specified by the SPC.In this paper, the stationary frame control paradigm is employed.The current regulating loop is modeled as Figure 3, where the current flowing through the grid-side inductor is adopted as the feedback variable.The resonant part of the PR controller includes a second-order generalized integrator (SOGI) and a resonant gain K r , and K p is the proportional gain.T sw denotes the switching period, and due to the actual digital implementation that the duty signals are updated twice in each switching period, the computational delay is modeled to be half of the switching period.The gain of the PWM block is 1/c PK , where c PK is the peak-to-peak value of the PWM triangular waveforms [22].The LCL-trap filter [28,29] is employed as the grid connection filter, and G 2 (s) is the transfer function between the converter output voltage and grid-side current, which is expressed by Equation (1) in the continuous-time domain: where L o and L g are the converter-side inductance and grid-side inductance, respectively, R o and R g are the parasite equivalent resistance of the inductors L o and L g , C o is the filter capacitance, R co is the passive damping resistance, and C t and L t are the capacitance and inductance of the trap branch, and the different coefficients in the denominator can be written as a function of the filter parameters shown as: As an alternative, if the converter-side current flowing through the inductor L o is used as the controlled variable, the current control loop will have the same model, except that G 2 (s) should be substituted by G 1 (s) shown in Equation ( 8): It has to be mentioned that the tuning procedure introduced in this paper is applicable to power converters with other types of filters, as long as the transfer function between the controlled current and converter output voltage can be extracted.Moreover, if the synchronous frame current control is adopted, the procedure will still be effective only by replacing the PR controller block in Figure 3 with the PI controller.

Unified Tuning Approach
A generalized current loop tuning procedure is proposed based on the modeling in the last section, and the stability and dynamic performance are analyzed based on numerical models.

Direct Discrete-Time Domain Design
Continuous-time derivations tend to work properly in digital implementations once the sampling rate is well above the controller bandwidth [30].To overcome the limitations of the digital implementation in the case of lower switching frequency (thus, lower sampling frequency), in this paper, the control loop is modeled and tuned in the discrete-time domain.The transfer function of the PR controller in continuous-time domain G PR (s) is shown in Equation ( 9): The methods for discretizing the SOGI structure have been discussed in [31][32][33], and a thorough study is given in [31].In this paper, the method proposed in [33] is used, where two integrators of the SOGI can be discretized separately.Employing the backward Euler method to discretize the integrator in the direct channel and the forward Euler method for the integrator in the feedback channel [33], the transfer function of the SOGI is discretized in the sampling period T s and shown in Equation (10): The transfer function of the plant G 2 (s) is discretized by the zero-order hold (ZOH) method.Since all of the values of the filter components are known, the discretization can be done using a computing language application.The open-loop transfer function in discrete-time domain G OL (z) is then expressed in Equation ( 11): In Equation ( 11), G 2 (z) is the transfer function of the filter in the discrete-time domain.Since the ZOH transformation intrinsically introduces a delay corresponding to the PWM computational delay [9], the PWM delay has hence been included in the open-loop transfer function.

Calculation of the Controller Gains
The calculating algorithm based on the phase margin and crossover frequency is employed.According to the definitions, at crossover frequency ω c , the module of the open-loop transfer function is equal to one, and the phase angle is −(180 • − φ m ), where φ m is the phase margin.In the continuous-time domain, this relation is shown in Equations ( 12) and ( 13): Examples on calculating the controller gains in the continuous-time domain with the crossover frequency and phase margin can be found in [9,22].In this paper, based on the expressions in Section 3.1, the calculating is done in the discrete-time domain for easy digital implementation.In the discrete-time domain, the definitions of the phase margin and crossover frequency are shown in Equation ( 14): Combining Equations ( 11) and ( 14) and assuming c PK = 1, the below relation is obtained as shown in Equation ( 15): As shown in Equation ( 15), the controller gains can be calculated once ω c and φ m are fixed.In practice, the complex number in Equation (15) needs to be transformed into two real number equations by extracting the real part and imaginary part, respectively, as shown in Equations ( 16) and ( 17): If z c is defined to be the value of z when ω is fixed to ω c , then Equations ( 16) and ( 17) can be transformed into Equation ( 18): where the constant a is expressed in Equation ( 19): It is worth noting that by using a typical computing language application, Equation ( 18) can be easily expressed and processed.

Optimized Tuning
The controller gains K p and K r can be calculated by solving Equation (18), which acts as a calculator; however, giving appropriate inputs for ω c and φ m needs further analysis.
For a second-order closed-loop system, the gains can be determined by specifying the damping coefficient and the step response settling time, as shown in [33].However, for a high order system, a straightforward relation between the dynamics and the controller gains is hard to find.A usual approach is to make a reasonable approximation for the open-loop transfer function [9,22], or particularly, approximating the model of grid-connection filter [11,34,35].However, justifications of the approximation have to be given, as well as the boundaries of application.In order to provide a general tuning procedure instead of an application-specific one, the closed-loop systems defined by different sets of controller gains are evaluated and compared with each other analytically in the proposed approach in terms of stability and dynamics.The procedures of the tuning are summarized in Figure 4.
In the first step, ω c and φ m are specified with numerous values within the initial tuning range, respectively, and for each set of ω c and φ m , a set of K p and K r will be obtained through Equation (18).Commonly, the phase margin reflects the stability, and the crossover frequency reflects the bandwidth.Therefore, it is easy to designate an initial tuning range in advance.Then, different sets of controller gains will be obtained, and each set will lead to an open-loop and a closed-loop system.By the assessment of the open-loop stability margin, the closed-loop unitary step response and closed-loop bandwidth, each solution is evaluated, and an updated tuning range is determined for progressive tuning.In the tuning procedure, even though the phase margin has been specified for calculating the controller gains, it has to be checked again after the controller gains are calculated.As mentioned in [11], in some scenarios when the PR controller is assigned to track harmonics, additional open-loop resonant poles will occur, resulting in the practical phase margin being lower than the specification.
When the tuning range is updated in the first step, another round of tuning is activated with a smaller interval for the inputs.In this manner, progressive tuning is executed until an optimized solution is found.
A 100-kW three-phase two-level grid-connected converter with the LCL-trap filter is used to elaborate the tuning method.The associated parameters of the plant are shown in Table 1.Then, the transfer function of the plant in the discrete time domain is obtained as Equation (20).
Table 1.Parameters of the 100-kW converter.

Parameter Value Parameter Value
The tuning boundaries in this case are shown in Table 2, where settling time and overshoot are the ones calculated based on the closed-loop unitary step response.These requirements are used as the criteria to eliminate the ineligible solutions in the tuning.In Figure 5a, the influence of the crossover frequency on the settling time t ss and the gain margin are both shown.Both relations have a visible trend.When ω c increases from 500 rad to 800 rad, t ss has a general trend of reducing, while the gain margin has a general trend of reducing in the full range of ω c . Figure 5a also visualizes the tradeoff between the system stability and dynamics and shows that ω c with a value either too big or too small shall not be adopted.When ω c is above 1600 rad, the gain margin is smaller than 5 dB.In order to ensure the stability of the system, solutions with a gain margin smaller than 5 dB are not accepted in the tuning.Therefore, the upper bound of ω c is selected to be 1600 rad.Additionally, when ω c is below 600 rad, t ss is greater than 25 ms.In order to ensure the speed of response, solutions with t ss greater than 25 ms are not accepted in the tuning.Therefore, the lower bound ω c is selected to be 600 rad.Therefore, the updated input range of ω c is obtained and shown in Equation (21), where dω is the interval of the inputs, which is selected to be 10 rad.
Figure 5b shows the relation between overshoot and φ m .When φ m increases, the overshoot generally reduces.When φ m is smaller than 35 • , there is not a solution with an overshoot lower than 15%.Since responses with a large overshoot could render the converters to be oversized, the lower bound of φ m is selected to be 35 • .Additionally, the upper bound is selected to be 70 • .The updated tuning range of φ m is obtained and shown in Equation ( 22): Even though some solutions that do not meet the tuning requirements have been eliminated once the tuning range shown in Equations ( 21) and ( 22) is obtained, the tuning limits shown in Table 2 are still necessary in the further tuning process to eliminate all of the undesired solutions.With the inputs shown in Equations ( 21) and ( 22), different sets of K p and K r are obtained.All of the solutions that lead to a performance within the limits will be seen as eligible and stored, and one optimal solution can further be selected.
Figure 6 shows the bandwidth of the closed-loop systems in relation with ω c and φ m based on the eligible solutions.The solution with the largest bandwidth is selected as the optimal one, which is shown in Table 3.It is shown in Figure 6 that the eligible solutions mostly gather in the range of ω c = [900 rad, 1100 rad] and φ m = [55 • , 70 • ].It is worth mentioning that the number of eligible solutions can be increased simply by reducing the input interval dω.Based on the selected optimal solution, the Bode plot of the open-loop system is shown in Figure 7, where the stability is validated.By applying the above tuning procedure, the phase margin and crossover frequency can be determined in a reasonable manner according to the specified stability and dynamics limits.

Simulation Results
The current loop tuning method is validated in simulations in this section.Simulated plants of 10-kW and 100-kW power ratings are used respectively in two cases, and the response of the current loop in the presence of reference changes is evaluated.For simplicity in the primary validation, a simple outer loop control strategy is used, as shown in Figure 8, instead of using the multi-loop control structure, shown in Figure 2.With the aid of the stationary-frame phase-locked loop (PLL) [36], the frequency of the grid ω grid is estimated based on the measurement of three-phase grid voltage.The references of the current controller i * α and i * β are provided according to the instantaneous active reactive controller (IARC) [37] shown in Equations ( 23) and (24).
A simple multi-loop control structure for the primary validation of the current loop.
where P * and Q * are the reference of active and reactive power and v + α and v + β the positive sequence components of grid voltage in the stationary frame filtered by a double SOGI.
The parameters of the 10-kW converter and the controller are shown in Table 4.The simulation results of the 10-kW system are shown in Figure 9, where the steady-state and dynamic performances are shown.A power reference of 5 kW and 0 kVar is given initially, and it changes to 10 kW and 0 kVar at 0.01 s.  Figure 9a shows the waveforms of three-phase current, and it is regulated properly in both steady-state and transient without oscillations.Figure 9b shows the profiles of instantaneous power injected by the converter.The settling time of the experimental transient response is calculated by Equation (25), where I(s) is the experimental data vector (that will be the active power response or current control error response in the following cases), I ss is the value of the last element in the data vector and ε ss is the specified steady-state band: If 5% of the nominal power is defined as the steady-state band, then the active power regulation settling time is calculated to be 1.8 ms. Figure 9c shows the tracking performance of the current controller on the α and β axis.If 10% of the magnitude of the nominal current is defined as the steady-state band, then the settling times of the current controller on the α and β axis are, respectively, 0.9 ms and 0.6 ms.A fast response of the current loop is demonstrated.
The parameters of the 100-kW setups and the controller are shown in Tables 1 and 3. Additionally, the simulation results of the 100-kW system are shown in Figure 10, where a step change of the active power reference from 50 kW to 100 kW is given at 0.01 s.
Figure 10a shows the waveforms of three-phase current.In addition to the case of 10-kW system, the grid injected current is regulated properly in the steady-state and presents a fast transient response.
Figure 10b shows the instantaneous power injection.If 5% of the nominal power is defined as the steady-state band, the active power regulation settling time is calculated to be 3.0 ms. Figure 10c shows the tracking performance of the current controller on the α and β axis.If 10% of the magnitude of the nominal current is defined as the steady-state band, the settling times of the current controller on the α and β axis are 3.2 ms and 1.7 ms, respectively.

Experimental Results
Experimental tests are conducted on 10-kW and 100-kW laboratory test beds in order to further validate the proposed tuning method.The parameters of the setups are the ones shown in Tables 1 and 4. The setups of the 10-kW system are shown in Figure 11a, and the setups of the 100-kW system are shown in Figure 11b.

Steady-State and Dynamic Performance
Firstly, the performance of the current loop in the presence of reference changes is evaluated with the simple outer loop control strategy that is used in the simulations.The current loop steady-state and dynamic performance based on the 10-kW system are shown in Figure 12. Figure 12a shows the grid voltage and injected current, where the current is regulated with a fast response as in the simulation.Figure 12b shows the instantaneous active and reactive power injected into the grid.With the same definition of the steady-state band as the simulation (5%), the settling time of the active power is calculated to be 2.0 ms.Additionally, the current regulating errors on the α and β axis (recorded data in dSPACE) are shown in Figure 12c.The above experimental results have demonstrated the fast dynamics of the current loop, like the ones in the simulation results.The current loop steady-state and dynamic performances based on the 100-kW system are shown in Figure 13. Figure 13a   Further, the proposed tuning method is compared with a classical tuning method that is proposed in [9].According to the proposed optimal tuning, numerous inputs of the crossover frequency and phase margin are given to calculate the controller gains.The tuning limits are the same as Table 2, except that the overshoot is limited to 5%.Among all of the eligible solutions, the one that has the greatest bandwidth is selected.In comparison, according to the method in [9], the phase margin is fixed to 40 • , and the crossover frequency is fixed using Equation ( 26), where T d is the modeling of the delay in the loop: The tests are conducted in the 10-kW platform.It is shown in Figure 14 that the transient response of the current control based on optimal tuning has a similar speed compared to the classical tuning, but has a smaller overshoot thanks to the tuning limit of the overshoot.

Performance under Grid Voltage and Frequency Changes
Further, the current controller is implemented in the overall SPC control scheme shown in Figure 2 to evaluate its performance in the presence of voltage and frequency changes in the grid.The 10-kW setups are used to implement the controller.
In the first scenario, grid frequency variations are given by configuring a regenerative AC power source, California Instruments MX-45 (Ametek, San Diego, CA, USA).Because of the low output impedance of the regenerative power source, the grid voltage waveforms are independent of the power injection of the converter.In this way, the response of the converter related to grid frequency can be clearly shown.
The frequency variation of the grid is specified as shown in Figure 15b; the frequency changing slope is ±1 Hz/s.It can be seen in Figure 15a that the current is well regulated; meanwhile, the power injection of the converter opposes the frequency deviation of the grid thanks to the inertia and droop characteristics of the SPC.In order to clearly show the inertia effect, the inertia constant is specified to be 10 s.Particularly, the tracking performance of the tuned current controller is shown in Figure 15c, where the controlled current tracks its reference without visible steady-state error or delay.
In the second scenario, unbalanced voltage sag is given, and the results are shown in Figure 16.The sag of one phase is generated and lasts 1 s, and the phase-to-neutral voltage rms is reduced from 230 V to 190 V.During the sag, the converter keeps connected to the grid, and the injected current is seen to be stable without significant oscillations in Figure 16a,b.As shown in Figure 16c, the injected reactive power in the sag phase presents a significant voltage supporting behavior thanks to the virtual admittance characteristics of the SPC, while the injected reactive power in the other two phases does not experience significant variations.The virtual admittance is achieved based on the well-tuned inner current loop.

Conclusions
A unified current loop tuning procedure was proposed in this paper as a general approach for the control design of grid-connected PV inverters.An analysis-based method was used to determine the system crossover frequency and phase margin, instead of the experience-based method that is seen in existing studies.Additionally, a direct discrete-time domain tuning was used based on the discretized modeling of the system, which guarantees the effectiveness of the controller in digital implementation.Finally, the tuning results were validated in simulation and experiments in different scenarios, where the current loop presents a fast transient response and good steady-state performance.With a good foundation in the current loop, the converter exhibited grid-supporting characteristics when the outer loops of the SPC were activated.

Figure 3 .
Figure 3. Modeling of the current control loop.

Figure 4 .
Figure 4. Executing flow chart of the proposed tuning procedure.

Figure 5
Figure 5 is plotted by specifying different values for ω c and φ m in a large range, and for each obtained solution of K p and K r , the open-loop stability margin, settling time t ss and overshoot of the closed-loop unitary step response and the closed-loop bandwidth are calculated.Figure 5a,b, respectively, shows the influence of ω c and φ m on the performance of the system.

Figure 5 .
Figure 5. Influence of ω c and φ m on the performance of the system: (a) influence of ω c on settling time and gain margin; and (b) influence of φ m on overshoot.

Figure 6 .
Figure 6.Solutions that comply with the tuning limits.

Figure 7 .
Figure 7. Bode diagram of the open-loop system under the selected gains.

Figure 9 .
Figure 9. Simulated performance of the 10-kW system when active power reference jumps from 5 kW to 10 kW: (a) grid injected current; (b) instantaneous active and reactive power injection; (c) current control error on the α and β axis; (d) zoom-in view of (a); (e) zoom-in view of (b); and (f) zoom-in view of (c).

Figure 10 .
Figure 10.Simulated performance of the 100-kW system when active power reference jumps from 50 kW to 100 kW: (a) grid injected current; (b) instantaneous active and reactive power injection; (c) current control error on the α and β axis; (d) zoom-in view of (a); (e) zoom-in view of (b); and (f) zoom-in view of (c).
is captured when the set point of the power is 50 kW and 0 kVar, and the good steady-state performance of the controller is shown.The transient responses of the current controller are shown in Figure13b, when the active power reference jumps from 35 kW to 50 kW.The current is shown to be regulated quickly without a big overshoot.

Figure 13 .
Figure 13.Experimental results of the 100-kW system: (a) active power reference at 50 kW, three-phase current and voltage; and (b) active power reference jumps from 35 kW to 50 kW, current and voltage in one phase.

Figure 14 .
Figure 14.Comparison of the proposed optimal tuning and the classical tuning under a step in the active power reference: (a) current amplitude; and (b) active power.

Figure 15 .
Figure 15.Experimental results of the SPC under grid frequency variations: (a) grid voltage and injected current; (b) the variation of grid frequency imposed by the AC regenerative power source; and (c) current reference and measurement on the α and β axis.

Figure 16 .
Figure 16.Experimental results of the SPC under unbalanced voltage sag: (a) grid voltage and injected current; (b) injected current; and (c) total active power and reactive power in each phase.

Table 2 .
Tuning boundaries of the current controller.

Table 3 .
Selected solution of the controller gains.

Table 4 .
Parameters of the 10-kW converter and the selected controller gains.