Improved Control of Grid-connected DFIG-based Wind Turbine using Proportional-Resonant Regulators during Unbalanced Grid

: The quality of power and current control are the greatest challenges of grid-connected wind farms during abnormal conditions. The negative- and positive-sequence components of the grid currents may be injected into a wind generation system during grid faults, which can a ﬀ ect the power stability and damage the wind system. The proposed work assures a low-voltage ride through capability of doubly-fed induction generator- based wind turbines under the grid voltage sag. A new technique to protect the wind system and to recompense the reactive power during failures of the utility grid according to the Spanish grid code is proposed. The control design is implemented to the power converters, and the grid current regulation is developed by using proportional-resonant regulators in a stationary two-phase ( αβ ) reference frame. The control performance is signiﬁcantly validated by applying the real-time simulation for the rotor-side converter and the hardware in the loop simulation technique for the experiment of the generator’s grid-side converter control.


Introduction
Nowadays, the recent energy production faces an increasing awareness concerning the conventional power generation impact on the environment since it is infected by CO 2 emission [1]. Such a problematic requires new alternative technologies to create energy in environment-friendly ways and, considering the increasing demand for global energy, society has a greater environmental responsibility to develop green technologies. Under the electrical power market expansion, the most rapidly developed sector is wind energy [2].
The whole wind turbine system adopted on a doubly-fed induction generator (DFIG) comprises different components [3], which effectively contribute in the power conversion from the wind kinetic energy to the electrical power transferred to a utility grid [4,5]. The generator model for a grid-connected DFIG used in wind turbines [6] is presented in Figure 1. Since the turbine is related to the rotor by a gearbox, DFIG affords a variable speed because of the power converters which are used to control the rotor current [7,8]. For coupling the converter by slip rings to the rotor, a wound rotor induction generator is used. Conditioned by the converter dimension, the stated concept supports an extended variable speed ranging from around −30% to approximately 30% throughout a synchronous speed [9].
where and are the rotor and stator inductances, respectively, and is the mutual 124 inductance; Is and Ir are the stator and the rotor currents, respectively. Additionally, according to On the one hand, the wind turbines integration into the grid places the ability of power control, which implies that wind turbines need an output-adjusting power to contribute to the dispatch balance (production/consumption) [4,5]. On the other hand, low-voltage ride through (LVRT) and reactive power injection from the DFIG system are important for grid codes [12][13][14][15]. Thereby, the grid-connected wind turbine controllability according to grid compatibility has a great impact on future development [16,17].
Perturbations in the utility grid, even far away from turbines zones, may create a disturbance at the wind system grid connection point [18,19]. The aforementioned perturbation causes an over-current on stator and rotor windings and also increases the DC-link voltage between power converters to unacceptable values [20,21], which can damage the system if no protection is allowed. Besides, it also produces the turbine over-speeding, affecting system safety [22]. For this reason, there are several research works proposing solutions to this fact.
In the functional command of the DFIG, vector controls with the orientation of stator voltage or stator flux have been commonly used [23][24][25]. By using this type of control strategy, proportional-integral (PI) regulators are classically aiming to regulate the power transfer into the utility grid. However, when a voltage sag takes place, the PI controller seems to be overloaded rapidly. In addition, the system regularization is tough to realize. Therefore, the DFIG loses command ability. In order to manage the traditional vector control weakness, different approaches were proposed to improve strategies to reach the LVRT.
According to the obtained results for traditional DFIG vector controllers [26][27][28], the generator still operates within a specific range during a grid fault. Nevertheless, the proper dynamic response of two state variables, such as rotor voltage and rotor current, cannot be assured. This technique can only be used under symmetrical grid faults.
Some research papers have investigated the control and behaviour of DFIG grid-connected converters under abnormal operation of the grid voltage. In [29,30], two regulators were used after the positive-and negative-sequence components (P-N SCs) separation for a current loop's regulation, which can increase the delay and errors of the dynamic response and affect the system stability during this process. The same configurations were adopted in [31,32], that is, under unbalanced grid conditions, a main regulator was employed in a positive-sequence synchronous reference frame and a secondary regulator was employed in a negative-sequence synchronous reference frame. In References [33][34][35] a PI-R current regulator was applied in order to eliminate multiple harmonics in grid converter systems during grid voltage distortion but non-linear transformations abc → dq is mandatory. The operation of DFIG under the abnormal operation of the utility grid was studied in [36][37][38] and many possibilities for reducing oscillations at twice the fundamental frequency have been investigated. Nevertheless, a rotor-side converter (RSC) was examined in this paper and two current regulators were implemented for the P-N SCs. Furthermore, because of the RSC limited control, it is difficult to obtain a simultaneous rejection of power oscillations and therefore, an improved control method was used to deal with unbalanced grid voltages. Unlike the described techniques, in this paper, a new current reference calculation process was proposed, by injecting sinusoidal currents even under abnormal grid conditions using Clark's transformation, which converts a three-phase system (abc) into a two-phase orthogonal system (αβ) and allows proportional-resonant (PR) regulators to track and discard sinusoidal variables. The use of the stationary reference frame is possible with the proposed algorithm, in order to decrease the computational difficulty and avoid the application of the synchronous reference frame. Thus, the non-linear transformation (abc → dq) used with PI-R regulators is changed by the linear abc → αβ transformation using the PR controllers [39,40]. Moreover, as explained in Section 3, PR regulators can control the two sequences generated during grid voltage faults.
This work explores an application of the PR regulators on a DFIG's grid-side converter (GSC), mainly in their capability for the compensation of reactive power, grid current limitation and the stabilization of active power during a grid fault.
The work novelty can be observed in the proposed LVRT algorithm presented in Section 3 according to the IEC 61400-21 [41] and the Spanish grid code, generating the P-N SCs of the grid currents with the implementation of the PR regulators on the DFIG's GSC in the αβ components of the 3-phase inverter currents. This feature will have the capability for the compensation of reactive power and the grid current limitation during a grid fault according to the Spanish grid code.
The paper is structured as follow; firstly, the main control of the DFIG for the RSC and an explanation of the GSC control using the PR controller are presented in Section 2. Section 3 presents the Spanish grid code besides the algorithm presented in this paper. Section 4 presents the digital real-time simulations (DRTS) using the dSPACE ControlDesk environment [42]. In Section 5, some experiments are performed using the controller hardware-in-the-loop (CHIL) technique to validate the proposed strategy for the Fault Ride-Through (FRT) capability. Subsequently, the conclusion is stated in Section 6.

DFIG Control
The electrical part of DFIG consists of 3-phase stator windings which are connected to a 3-phase windings transformer, while the 3-phase machine's rotor windings are directly excited by two power converters, RSC and GSC, The grid side of the power converters delivers the rotor power to the grid via the 3-winding transformer. The schematic block of the DFIG connected to the utility grid is shown in Figure 1. The rotor voltages control makes it possible to manage the magnetic field inside the machine.
The equivalent electrical circuit of the rotor and the stator windings in an arbitrary reference frame is represented in Figure 2. According to Figure 2, stator and rotor fluxes (ϕ) are expressed as Equations (1) and (2): where L r and L s are the rotor and stator inductances, respectively, and M is the mutual inductance; I s and I r are the stator and the rotor currents, respectively. Additionally, according to Figure 2, the stator and the rotor voltage can be written as: where R r and R s are the rotor and the stator resistances, respectively, ω s is the stator pulsation and ω r is the rotor pulsation.
where and are the rotor and the stator resistances, respectively, is the stator pulsation 127 and is the rotor pulsation.

130
Based on Equations (1) and (2), the rotor flux and the stator current can be written as: 132 where = 1 − .

133
Then, by substituting Equation (4) into Equation (3), the expression of in the arbitrary 134 rotating reference is: The purpose of a reference change is to make the machine equations easier to use. In this study,  Based on Equations (1) and (2), the rotor flux and the stator current can be written as: where σ = 1 − M 2 L r L s . Then, by substituting Equation (4) into Equation (3), the expression of V r in the arbitrary rotating reference is: The purpose of a reference change is to make the machine equations easier to use. In this study, the Park's transformation (two d-q orthogonal axes in the rotating synchronous reference frame) is used for RSC control to apply the vector control technique and Clarke's transformation (two αβ orthogonal axes in the stationary reference frame) for GSC control. This model is obtained after a three-phase (A, B and C) virtual transformation into an equivalent two-phase machine as represented in Figure 3 [43]. three-phase (A, B and C) virtual transformation into an equivalent two-phase machine as 140 represented in Figure 3

DFIG Control Strategy
After the Park's transformation application, and with a reference linked to the rotating field, the expressions of the stator and rotor voltages along the d-q axes are: Stator voltage : Rotor voltage : The matrix system of the flux can be written as: Stator flux : ϕ sd = L s I sd + MI rd ϕ sq = L s I sq + MI rq , Rotor flux : ϕ rd = L r I rd + MI sd ϕ rq = L r I rq + MI sq .
The expression of DFIG's electromagnetic torque is expressed as follows: The transferred active and reactive powers from DFIG (through the stator and rotor windings) to the utility grid are written as follows [44]: The stator flux has been oriented with the d-axis to apply the vector control technique. The choice of this reference makes the generated reactive power and the electromagnetic torque depend on the dand qcomponents of rotor currents I rq and I rd , respectively. Thus, these stator powers can be controlled independently of each other.
Tow control blocks are implemented on the RSC, i.e., the maximum power extraction from the wind and the vector control block using the PI regulators.
In the following, the maximum power point tracking (MPPT) is briefly explained [45]. The mechanical torque Tm, which is taken by the turbine, is given as: where: ρ is the air density, C p is the power coefficient, V w is the wind velocity and R is the turbine radius.
In order to pull out the utmost power by the wind turbine at different wind speeds, Figure 4 represents the trajectory of an MPPT curve, which can be expressed in terms of the mechanical torque T m,MPPT by the following equation: where K opt is the optimal coefficient torque and ω m is the mecanical rotation speed.

170
After the stator flux orientation along d-axis and neglection of the per phase stator resistance where is considered constant (its derivative is zero) and equal to the stator flux vector modulus; and can be written as: The stator voltage in Equation (7) becomes: The electromagnetic torque in Equation (10) is written as: Then, Equation (10) of the stator fluxes according to Equation (20) becomes: Finally, the reactive power and active power in Equations (13) and (14) are written as follows: After the stator flux orientation along d-axis and neglection of the per phase stator resistance [9], the d-component of the stator flux is written as: where ϕ sd is considered constant (its derivative is zero) and equal to the stator flux vector modulus; ϕ sd and ϕ sq can be written as: The stator voltage in Equation (7) becomes: The electromagnetic torque in Equation (10) is written as: Then, Equation (10) of the stator fluxes according to Equation (20) becomes: Finally, the reactive power and active power in Equations (13) and (14) are written as follows: The generator is used to transform the mechanical power into AC power, and then the RSC and GSC are used to control and convert that power into a grid connection. By using the GSC, the incoming AC power is injected into the utility grid with its synchronized frequency and phase for power factor control. The configuration of the DFIG's RSC control blocks is shown in Figure 5.

187
The GSC is able to regulate the DC voltage in order to generate the reference of active power 188 , by using a PI regulator [46] and also to regulate the injected reactive power into the utility 189 grid. The latter is achieved by regulating properly the P-N SCs of the grid currents to deal with the 190 grid voltage disturbance conditions and the power oscillations furnished by the RSC to the DC-link.

191
The P-N SCs of the faulty utility grid must be calculated from the measured three-phase voltages.

192
The PR current regulators in the stationary reference frame are applied in this section [47]. This

195
detailed study of the PR regulator was presented in [48] and hence, only a short explanation is 196 provided in this paper. The transfer function of the PR regulator is expressed as: where is the proportional constant, is the integral constant of the regulator, is the cutoff 198 frequency and is the resonance frequency.

199
The grid current references expressions in the stationary reference frame ( * and * ) are

Grid-Side Converter Regulation Using PR regulators
The second converter in DFIG is the GSC which controls the balance of power between the DFIG and the utility grid.
The GSC is able to regulate the DC voltage in order to generate the reference of active power P g,re f by using a PI regulator [46] and also to regulate the injected reactive power into the utility grid. The latter is achieved by regulating properly the P-N SCs of the grid currents to deal with the grid voltage disturbance conditions and the power oscillations furnished by the RSC to the DC-link. The P-N SCs of the faulty utility grid must be calculated from the measured three-phase voltages.
The PR current regulators in the stationary reference frame are applied in this section [47]. This kind of regulators commonly contains a PR regulator plus a resonant filter tuned to the fundamental frequency in order to reach a zero steady-state error when sinusoidal signals are controlled. A detailed study of the PR regulator was presented in [48] and hence, only a short explanation is provided in this paper. The transfer function of the PR regulator is expressed as: where K p is the proportional constant, K i is the integral constant of the regulator, ω c is the cutoff frequency and ω e is the resonance frequency. The grid current references expressions in the stationary reference frame (i * gα and i * gβ ) are written according to the active and reactive current components (i * gα,P and i * gβ,P ) and (i * gα,Q and i * gβ,Q ), respectively [49]: where Figure 6 describes the GSC block diagram control using the PR regulators; meanwhile, the P-N SCs of grid voltage are calculated from the measured grid voltage [50]. The four grid voltage components (u + gα , u − gα , u + gβ and u − gβ ) generated by the P-N SCs detector together with P g,re f and Q g,re f are used to compute the two grid currents references in the stationary reference frame (i * gα and i * gβ ) with the current references calculation module. The two currents references i * gα and i * gβ are compared to the measured signals, and the difference is supplied to the PR regulators. The outputs of these regulators are the inverter voltage signals in the stationary reference frame, and hence, the inverse Clarke's transformation is applied to these variables in order to feed the pulse width modulation (PWM). The outputs of PWM are the switching signals for the three-phase inverter. The P-N SCs block is represented in Figure 7. The P-N SCs block is used to compute the grid voltage positive and negative sequences (u + g,abc and u − g,abc ). After Clark's transformation, the positive sequences are used to calculate the voltage sag in order to generate the fault signal based on Equation (32). The main outcomes of this paper are the generation of the P-N SCs of the grid currents in an easy way by applying Equations (27)-(31) to exert a constant active power control, which will decrease the oscillations amplitude at twice the fundamental frequency in the DC voltage, protecting the link capacitor for its potential destruction. 204 Figure 6. Schematic diagram GSC control. 205 Figure 6 describes the GSC block diagram control using the PR regulators; meanwhile, the P-N 206 SCs of grid voltage are calculated from the measured grid voltage [50]. The four grid voltage

217
The P-N SCs block is represented in Figure 7. The P-N SCs block is used to compute the grid

Grid Code (Output Current Limitation)
The wind system must respect the LVRT requirements and must stay connected to the grid when severe faults occur, according to the grid code used. In addition, the grid code imposes the necessity to inject some reactive power for specific levels in the depth of the voltage dips [51] and to limit the current amplitude near its nominal value in order to avoid the generator disconnection from the grid. Figure 8a presents the LVRT requirements according to IEC 61400-21 [41]; Figure 8b presents the Spanish grid code requirements for the reactive power during grid faults [49].   for the reactive power [52].

234
As it was motioned in the previous section, the measured grid voltage is used to calculate the P- As it was motioned in the previous section, the measured grid voltage is used to calculate the P-N SCs, and the extracted positive sequence is used to detect the voltage sag by dividing it with the nominal value of the line-to-line utility grid voltage as expressed in the following equation [49]: where U g is the root-mean-square value of the line-to-line grid voltage and V g, f ault is the normalization depth of the voltage sag. According to the Spanish grid code, a grid fault is defined by a voltage amplitude less than 0.85 pu. The organigram represented in Figure 9 describes the applied algorithm for LVRT capability and the reactive power required to inject it into the utility grid based on the Spanish grid code. Once the voltage sag is less than 0.85 pu, the grid fault is detected. In this condition, if the grid fault is less than 0.2 for a duration t of >0.15 s, or between 0.2 and 0.5 for more than 0.58 s, or between 0.5 and 0.85 for more than 0.27 s, then the DFIG system must be disconnected from the grid. Actually, reactive power injection becomes important, according to the depth of the utility grid voltage fault as given in Equation (32):

249
In this section, the DRTS of the planned RSC control is presented. The dSPACE DS5202 signal

Digital Real-Time Simulation of the RSC
In this section, the DRTS of the planned RSC control is presented. The dSPACE DS5202 signal acquisition board, together with the DS1006 processing board [52], is used for implementing the DRTS. These boards afford compatible libraries with MATLAB/Simulink software tool (R2010a, The MathWorks, Inc., Natick, MA, USA). Furthermore, dSPACE affords a monitoring software (ControlDesk) which communicates with the algorithm placed in the data acquisition board in real time.
The simulation model used in this study is made by using a 2 MW DFIG-based wind turbine as the most used generators for wind farms connected to the utility grid. Firstly, the RSC control of DFIG system with a fixed DC-link voltage (V DC = 800 V) is simulated with the MATLAB/Simulink environment, and secondly, the dSPACE blocks are added to the system in order to run in the digital real-time simulator. The generator parameters are given in Table 1.  Figure 10 shows the real-time simulation results of the RSC control at a step change in the wind turbine speed V m from 7 m/s to 12 m/s for a duration time t of 10 s as represented in Figure 10a.
According to Figure 10b, the RSC vector control guarantees the MPPT, the rotor mechanical speed changes with the wind speed variation and tracks his optimal value ω * m which ensure the MPPT capability. Moreover, the active current i rq tracks the reference value i rq_re f with a quick dynamic performance, and without overshoots, as shown in Figure 10c, the active current value i rq_re f increase from 900 A to 2500 A at the step beginning and return to the normal value with good control performance. The reactive current i rd is well controlled and tracks the imposed reference value i rd_re f of 0 in order to minimize power losses (see Figure 10c). The same phenomena are observed for the electromagnetic torque which tracks this reference value with a good dynamic performance, as shown in Figure 10d. dynamic performance, and without overshoots, as shown in Figure 10c

277
In this section, some tests are realized to verify the proposed GSC algorithm effectiveness by 278 applying the HIL simulation [46,54]. This method uses a DRTS with various input/output digital 279 signals, digital-to-analogue and analogue-to-digital converters , in order to simulate the power 280 system behaviour in real time.

Controller Hardware-in-the-Loop Simulation for the Grid-Side Converter
In this section, some tests are realized to verify the proposed GSC algorithm effectiveness by applying the HIL simulation [46,53]. This method uses a DRTS with various input/output digital signals, digital-to-analogue and analogue-to-digital converters, in order to simulate the power system behaviour in real time.
The platform for this study is built with the TMS320F28379D microcontroller from Texas Instruments [54] and the PLECS RT Box1 (Plexim) HIL boards with several analogues and digital input/outputs [55] (see Figure 11). The file with the C-code was created and uploaded into both targets [46], and the voltages and currents measurements are recorded in the host PC in order to monitor them as described in Figure 11. Tables 2 and 3 present the power parameters for the grid side and the control subsystem parameters, respectively. side and the control subsystem parameters, respectively. 287 288 Figure 11. CHIL block diagram.   298 Figure 11. CHIL block diagram.  Table 3. Control subsystem parameters. Four tests are assigned to deal with LVRT requirements at the three-phase output of the GSC in order to prove the strategy performance during different failure conditions. Generally, grid codes force the wind system to still connect even when grid voltage faults happen and inject reactive power to the utility grid according to the voltage depth level, forcing a grid currents limitation to its nominal amplitude. Consequently, there are two control modes for each test: the first mode is the control under normal conditions; the second control mode is based on the proposed LVRT strategy application, mainly activated when the grid voltage faults occur.  Figures 12 and 13 present the GSC control strategy response to a three-phase voltage sag (0.1 pu) using the PR regulators under a full nominal power and a half nominal power, respectively, in order to verify the limitation imposed to the output grid currents. During the faults, it seems that the three-phase grid currents do not exceed the nominal value for both cases, injecting a reactive power of 50 kVAr and zero active power into the grid according to the grid code. Thus, the system control behaviour with PR regulators deals with the capability to inject the reactive power according to the grid code previously presented and with the limitation of three-phases grid current. Additionally, after the fault disappearance, the normal operation of the GSC controller is attained and the reactive power is zero for unity power factor operation. full nominal power and a half nominal power, respectively, in order to verify the current limitation.

321
During the faults, there is no overcurrent on the three-phase output grid currents, which means its 322 nominal value is not exceeded for both cases. Meanwhile, the active power decrease to 0 and the 323 reactive power increases to 150 kVAr. Thus, the used strategies behaviour deals with LVRT 324 capability and injects reactive power according to the grid code. Additionally, when the grid fault 325 ends, the normal operation of the GSC controller is achieved and the reactive power is zero. In order to verify the capability of the proposed strategy during a deeper voltage dip, a voltage sag of 0.3 pu for the same duration (t = 0.11 s) is applied. Figures 14 and 15 represent the GSC control strategy response to the symmetrical three-phase grid fault of 0.3 pu for the PR regulators under a full nominal power and a half nominal power, respectively, in order to verify the current limitation. During the faults, there is no overcurrent on the three-phase output grid currents, which means its nominal value is not exceeded for both cases. Meanwhile, the active power decrease to 0 and the reactive power increases to 150 kVAr. Thus, the used strategies behaviour deals with LVRT capability and injects reactive power according to the grid code. Additionally, when the grid fault ends, the normal operation of the GSC controller is achieved and the reactive power is zero.      In order to verify the PR controller capability under unbalanced grid faults, a deep voltage sag for a duration t of 0.27 s in phase 3 is applied under a full nominal power ( Figure 16) and a half nominal power (Figure 17), respectively. As shown in Figures 16 and 17, the three-phase grid currents do not exceed its nominal value for both cases; meanwhile, a specific quantity of active and reactive powers is injected into the utility grid. The oscillating nature of the reactive power during the unbalanced grid faults at twice the nominal frequency is due to the proper control of the negative sequence of the grid currents delivered to the grid, which also produces a constant active power control. However, the grid currents are unbalanced under this assumption. Finally, the system attains its normal operation when the unbalanced fault ends. control. However, the grid currents are unbalanced under this assumption. Finally, the system 348 attains its normal operation when the unbalanced fault ends.

357
In Figures 18 and 19, the one-phase voltage test with the same duration of the previous test control. However, the grid currents are unbalanced under this assumption. Finally, the system 348 attains its normal operation when the unbalanced fault ends.

357
In Figures 18 and 19, the one-phase voltage test with the same duration of the previous test In Figures 18 and 19, the one-phase voltage test with the same duration of the previous test considers different levels of the grid voltage fault (0.5 pu), and the grid currents do not exceed its nominal amplitude value for both cases. Furthermore, because of the slight voltage drop compared to those in the previous tests, a higher active power is injected to the grid. Again, the reactive power oscillations during the unbalanced grid faults, for constant active power control, is due to the control of the negative sequence of the grid currents delivered to the grid; the system attains its normal operation when the unbalanced fault ends.
Finally, the GSC control strategy behaviour, dealing with the capability to inject the reactive power into the utility grid following the Spanish grid code previously presented and with the limitation of the three-phase grid currents amplitude, is validated.

Conclusions
The proposed control algorithms in this paper are used for a grid-connected DFIG to improve the quality of power and to deal with LVRT requirements according to the Spanish grid code. The vector control using the stator-flux-oriented control strategy has been applied to the RSC, and the performance of this control has been verified using the DRTS. Moreover, the GSC is controlled to compensate the reactive power and reduce the active power oscillations during the unbalanced grid operation. For this reason, the PR regulators have been proposed in the stationary reference frame in order to control the negative and positive sequences of the grid currents. The different types of grid voltage sags have been tested, and the experiments using CHIL simulation validate the proposed control algorithms for all tests, by limiting the amplitude of the grid currents, injecting the required reactive power and stabilizing the active power transferred into the grid.