Modelling and Validation of a Grid-Connected DFIG by Exploiting the Frequency-Domain Harmonic Analysis

: Wind Energy Conversion Systems (WECS) based on a Doubly-Fed Induction Generator (DFIG) represent the most common conﬁguration employed in wind turbines. These systems involve injecting harmonic currents toward an electrical grid from a back-to-back power converter, potentially creating voltage distortions. To assess this phenomenon, a case study of a 3 kW DFIG-based wind turbine connected to the electrical grid is presented for analysis in the harmonic domain. Initially, a DFIG-based load ﬂow analysis for determining the operating conditions is tackled at the fundamental frequency. Then, the modelling of a DFIG under steady-state operating conditions at harmonic frequencies is analyzed discussing its characteristics in the harmonic domain. The high-frequency harmonics in the output voltage of a pulse width modulation-driven inverter feeding the rotor windings of a DFIG and its connection to a three-winding transformer are also analyzed. This investigation produced a complete model of the DFIG connected to the electrical grid. The results demonstrated that although a considerable harmonic contribution up to the 25th order exists, it remains harmless since it is below 5%, according to the Std. IEEE 519.


Introduction
Wind energy generation is developing at a faster rate than the rest of the other renewable energy sources, of which Germany, Spain, Denmark, and the United States are the world's major producers [1]. Conversely, Latin America and the Caribbean are currently the world regions with the lowest wind energy growth and installed capacity. Cuba, however, with its moderate installed capacity is pursuing a program for the development of wind energy. Similarly, Mexican projects are improving their installed capacity by 5500 MW through with 52 new renewable energy generation plants by 2023 [2]. The development of wind energy generation worldwide is also accompanied by advances in wind turbine technology because the knowledge of the technology type associated with wind turbines was utilized in a wind park to determine power quality.
In general, a wind turbine connected to an electrical grid involves several problems associated with the electromechanical energy conversion element, the random characteristics of wind, and the grid conditions. The impact of these problems varies depending on the characteristics of the electrical grid in connection with the wind turbine. In Mexico, a major issue that arises for such a type of connection is harmonic distortion caused by the utilization of the variable-velocity wind turbines, in which power converters for coupling to the electrical grid generate harmonics that can raise concerns in an electrical system involving harmonic resonance.
A type 3-DFIG essentially consists of a wound rotor induction machine with slip rings and a stator, which is directly connected to the electrical grid, whereas the rotor is interfaced to the system by a partially rated back-to-back (B2B) power converter, which handles a fraction (25-30%) of the total DFIG power to achieve full control of the generator [3]. Because this amount of power is significant, the effects of the harmonic distortion introduced by the B2B power converter toward the electrical grid are critical, so that special concerns are focused on power electronics. The DFIG interconnected to an electrical grid is commonly studied for load flow analysis [4][5][6][7][8][9], disturbances in the electrical grid [10][11][12][13][14][15], stability [16][17][18][19][20], and voltage variation [21][22][23][24], with very few studies on harmonic propagation. For example, a second-order model for the prediction of the response of a DFIG wind turbine to grid disturbances is simulated and verified experimentally. Basically, steady-state impact, such as flicker emission, reactive power, and harmonic emission, are measured and analyzed. The results of this whole operating range, and the current THD is always lower than 5% [25]. Other research investigations were compared with the response to a fixed-speed wind turbine. It is found that the flicker emission is very low, the reactive power is close to zero and the subject exposes a converter connected to the electrical grid for the harmonic Linear Time varying Periodically (LTP) system. In this investigation, an electrical grid validates the method [26]. Another article mentions that the harmonic transient analysis of the analysis of a Harmonic State Space (HSS) small-signal model, which is modeled from connected to converter harmonic matrix investigated to analyze the harmonic time-domain simulation results, are represented through the electrical grid of HSS maintenance of the basic parameters of the voltage and frequency, and requires very demanding levels of power quality to ensure the operation of the electrical power behavior interaction and the dynamic transfer procedure. Frequency-domain as well as modeling is used to verify the theoretical analysis. Experimental results are also included, since phenomena such as the continuity of the service, grid stability, and the wind turbine generators requires reliable models for reproducing harmonic dynamics accurately and for ensuring that such models perform close to the actual components. For this reason, in this research a flexible extended harmonic domain (FEHD) technique together with the Time-Domain (TD) are interfaced to produce a hybrid TD/FEHD, which is used to model a synchronous-based wind turbine generator. The obtained results are validated with PSCAD EMTDC ® and are verified with experimental data, revealing a very good agreement [27]. Finally, a study was published regarding the power converters used for coupling wind turbines to the electrical grid.
This study analyzed the generation of high frequency harmonics under the influence of controllers. In this addition, this article studies the relationship between the output and the harmonic source at grid-side and rotor-side converters based on their control features in the DFIG system. The effectiveness of the proposed model is verified through the 2 MW DFIG real-time hardware-in-the-loop test platform by StarSim ® software and real test data, respectively [28].
After analyzing the specialized literature, it is concluded that work has been carried out for the harmonic analysis of wind turbines connected to the electrical grid. However, they do not consider the impact of high-order inter-harmonics on the system. So, the research in this article presents a clear model analysis of frequencies generated by the DFIG for the harmonic and non-harmonic analysis of the DFIG connected to the electrical grid. This investigation is powered by exploiting the frequency-domain harmonic analysis and by considering the impact of the high frequency components on the power quality system. Similarly, wind power plants, like all other sources of electricity generation, should contribute to maintaining the stable grid under any operating condition.

of 23
The major contributions of the paper are pointed out below:

1.
This analysis provides a complete model of the DFIG steady-state operation that is directly applicable to the load flow analysis. It allows a complete knowledge of the steady-state operation condition of a DFIG considering the wind speed as input value.

2.
Considering the attained results from the load flow analysis, a model of the DFIG steady-state operation in the harmonic domain is completed; this model adopts the sum of both effects in each voltage source, that is, both the stator and the rotor, for obtaining a complete solution for a DFIG.

3.
By setting up an experimental test, the obtained results for the proposed model in the steady-state and transient-state of the DFIG under non-sinusoidal voltage conditions are validated with those resulting from the hardware implementation, demonstrating the effectiveness of the model presented.

4.
Furthermore, this analysis provides a clear analysis of the frequencies generated by the DFIG in the steady-state resulting in a complete and proper model for harmonic and non-harmonic analysis of the DFIG connected to the electrical grid.
This paper is structured as follows. In Section 2, the model of a DFIG and its analysis at a fundamental frequency is described. A DFIG-based load flow analysis is addressed in Section 3. In Section 4, the DFIG complete solution for harmonic propagation is derived. A topology of the B2B power converter for grid connection purposes is described in Section 5. In Section 6, the results obtained with the proposed model made in MATLAB-Simulink ® are validated by matching those obtained from real lab measurements and with a complete induction machine model for transient studies. Finally, concluding remarks are given in Section 7.

Analysis of the DFIG at Fundamental Frequency
The general configuration of a DFIG-based wind turbine connected to an electrical grid is shown in Figure 1. The electrical single-equivalent phase circuit of the DFIG is illustrated in Figure 2. This paper is structured as follows. In Section 2, the model of a DFIG and its analysis at a fundamental frequency is described. A DFIG-based load flow analysis is addressed in Section 3. In Section 4, the DFIG complete solution for harmonic propagation is derived. A topology of the B2B power converter for grid connection purposes is described in Section 5. In Section 6, the results obtained with the proposed model made in MATLAB-Simulink ® are validated by matching those obtained from real lab measurements and with a complete induction machine model for transient studies. Finally, concluding remarks are given in Section 7.

Analysis of the DFIG at Fundamental Frequency
The general configuration of a DFIG-based wind turbine connected to an electrical grid is shown in Figure 1. The electrical single-equivalent phase circuit of the DFIG is illustrated in Figure 2.  The circuit displays a conventional steady-state equivalent model, with all parameters referring to the stator. The parameters of Figure 2 were previously described. The equation describing the system is given by Equation (1), The circuit displays a conventional steady-state equivalent model, with all parameters referring to the stator. The parameters of Figure 2 were previously described. The equation describing the system is given by Equation (1), V s = −(r s + jω es L ls )I s + jω es L M I r V r = r r /s + jω es (L lr + L M )I r − jω es L M I s (1) where s is defined as the relative velocity between the magnetic field produced by the currents injected in the stator and the mechanical velocity of the rotor using Equation (2), From Equation (1), the stator and rotor current phasors in the time-domain are obtained by Equation (3): The importance of the slip is analyzed as follows: if the machine is stopped, the shaft's mechanical velocity is zero (ω r = 0), resulting in a slip value of 1 (s = 1) obtained from Equation (2). In this condition the machine operates as a blocked rotor. On the contrary, if the rotor rotates at the magnetic field velocity, then the slip is zero (s = 0). In this case, the magnetic field velocity is termed the synchronous velocity of the machine. If the rotor rotates higher than the synchronous velocity, the slip becomes negative, and the machine operates as a generator. Conversely, if the velocity of the magnetic field of the stator exceeds that of the rotor, the machine operates as a motor. Therefore, the slip defines the operation of the machine. Therefore, when all parameters of the induction generator and the electrical grid are known, the slip determines the point of operation.
To ensure a complete analysis of the DFIG, the effects of the generator's rotor must be considered. The steady-state equivalent circuit model is depicted in Figure 3, with all parameters referring to the rotor [3]. The circuit displays a conventional steady-state equivalent model, with all parameters referring to the stator. The parameters of Figure 2 were previously described. The equation describing the system is given by Equation (1), where s is defined as the relative velocity between the magnetic field produced by the currents injected in the stator and the mechanical velocity of the rotor using Equation (2), From Equation (1), the stator and rotor current phasors in the time-domain are obtained by Equation (3): The importance of the slip is analyzed as follows: if the machine is stopped, the shaft's mechanical velocity is zero ( = 0), resulting in a slip value of 1 ( = 1) obtained from Equation (2). In this condition the machine operates as a blocked rotor. On the contrary, if the rotor rotates at the magnetic field velocity, then the slip is zero ( = 0). In this case, the magnetic field velocity is termed the synchronous velocity of the machine. If the rotor rotates higher than the synchronous velocity, the slip becomes negative, and the machine operates as a generator. Conversely, if the velocity of the magnetic field of the stator exceeds that of the rotor, the machine operates as a motor. Therefore, the slip defines the operation of the machine. Therefore, when all parameters of the induction generator and the electrical grid are known, the slip determines the point of operation.
To ensure a complete analysis of the DFIG, the effects of the generator's rotor must be considered. The steady-state equivalent circuit model is depicted in Figure 3, with all parameters referring to the rotor [3]. Equation (4) describes the system given by, Since the rotor is moving, the slip seen from it is given by Equation (5), Since the rotor is moving, the slip seen from it is given by Equation (5), Considering Equation (4), the stator and rotor currents phasors in the time domain are obtained by Equation (6), i r = |I r | cos(ω er t + ϕ r ) i s = |I s | cos s r ω er t + ϕ s + θ e f f Thus, the complete solution for a DFIG at fundamental frequency considering the stator and rotor effects is given by Equation (7), i s = |I s | cos(ω es t + ϕ s ) + |I s | cos s r ω er t + ϕ s + θ e f f i r = |I r | cos(ω er t + ϕ r ) + |I r | cos sω es t + ϕ r − θ e f f (7)

DFIG-Based Load Flow Analysis
A commonly applied approach for determining operating conditions in power systems is the load flow analysis. From the conventional topology and the electrical grid parameters, load flow analysis establishes unknown electrical variables like bus voltages (magnitude and angle), powers through the links, and active and reactive powers. Traditionally, an induction machine was an additional load within the load flow treated as a constant PQ load. The alternative energy sources revived the use of the induction machine as a generator, however, with significant interest in evaluating the performance of such a unit. Thereby, the most refined models are incorporated in the load flow analysis, considering a more realistic mode of the induction machine's characteristics.
For load flow analysis, the DFIG is modeled as a PV or PQ node [29][30][31], depending on the control scheme envisaged. A PV representation is applied when the control objective focuses on terminal voltage control. This is advantageous because only the wind velocity is needed as an input variable. In contrast, a PQ representation is employed when the control objective focuses on controlling the Power Factor (PF). Through load flow analysis, the node voltages of the DFIG's connections, the active power delivered to the grid, and the reactive power consumed by the DFIG are obtained. These results verify whether the DFIG is operating at its nominal power. If it is operating below its nominal power, the rotor velocity is calculated using the power curve generated against the rotor velocity provided by the manufacturer. According to the generated power, the electric torque is determined by T e = P e /ω r . Bearing the rotor velocity, the slip is calculated using Equation (1). Finally, the variables resulting from the initialization method are calculated. If the DFIG operates at its nominal velocity, however, the nominal rotor velocity, the wind velocity, or the inclination angle of the blade are required.
The electric torque, the slip and the resulting variables are calculated. The mechanical power P m provides the power balance in the DFIG and the electrical values in the stator P s , rotor P r , and losses P loss , are given by Equation (8). P m = P s + P r + P loss = P s + P r + I s 2 r s + I r 2 r r Additionally, the stator and rotor powers are given by Equation (9), Thereby, the total active power injected toward the electrical grid by the DFIG is given by Equation (10), The reactive power Q is controllable at specified ranges of the agreed exchange between the generator and the electrical grid. That is, if Q is predetermined at zero, then the power exchange occurs through the stator of the generator, producing a reactive power given by Equation (11).

of 23
A relationship is considered between the mechanical power and the rotor velocity of the generator, which is established in Equation (12), as seen in Figure 4. (12) • Above the synchronous speed (for high wind speed). In this case, the speed control optimizes the power extraction from the wind between the minimum and maximum wind speeds given by Equation (15), using an optimal value for the power coefficient = , and = 0, where = (1 2 ⁄ ) , . In addition, if it is multiplied by the cube of the wind speed, we obtain, = . Now, by substituting the wind speed variable produced in Equation (14), it is obtained that  Regarding Equation (12), the mechanical power P m [W] extracted from the wind can be calculated by Equation (13) where ρ is the air density kg/m 3 , A the area covered by the rotor m 2 , C p is the power coefficient and V w is the wind speed upstream the rotor [m/s]. The power coefficient C p depends on the values of the pitch angle β [deg] and the tip speed ratio λ, defined in Equation (14): where v t is the blade tip speed [m/s]. The three modes of operating the speed control of a DFIG include: • Below the synchronous speed (for low wind speeds). For this case, C p,opt cannot be reached and the DFIG is operated at a constant speed (ω r, min ) and β = 0; • At maximum power production; • Above the synchronous speed (for high wind speed). In this case, the speed control optimizes the power extraction from the wind between the minimum and maximum wind speeds given by Equation (15), using an optimal value for the power coefficient C p = C p,opt and β = 0, where γ = (1/2)ρAC p,opt . In addition, if it is multiplied by the cube of the wind speed, we obtain, P m = γV w 3 . Now, by substituting the wind speed variable produced in Equation (14), it is obtained that Considering the Equations (1) to (12), a set of equations describing the DFIG in a steady-state is obtained. To solve these, another equation set is derived, taking the real and imaginary parts in Equations (1) and (3), obtaining the following: Similarly, the Equations (19) and (20) are obtained: From the Equations (9) and (10), the function Ғ5 is Thus, from Equation (11), the function Ғ6 is, Finally, from the Equations (8), (10), and (12) we obtain In this manner, eleven variables in the previous set of seven nonlinear equations are as following: U s , δ s , Ur, δr, I s , ϕ s , Ir, ϕr, s, P, and Q. To solve the Equations (17)-(23), four variables with known value are required. By selecting V, δ, P, and Q as fixed variables, ss solutions for the Equations (17)- (23) are obtained using the Decoupled Newton-Raphson method expressed as where ∆x and ∆Ғare the incremental variables defined by the Equations (25) and (26): The Jacobian matrix J in Equation (27) contains partial derivatives of the functions in the Equations (17)-(23) for the variables of ∆x in Equation (26). Using adequate initial conditions, the solution of (26) is estimated using a few numbers of iterations. The calculation of the initial conditions depends on the results of the load flow analysis. Thus, the model is calculated from the output of the machine to the inputs. The following assumptions are established: Appl. Sci. 2020, 10, 9014 8 of 23 • The system is modeled in steady-state with all derivatives equal to zero. • Magnetic saturation is neglected.

•
The flow distribution is sinusoidal. • Finally, the losses in the B2B power converter are ignored.

PQ Bus Model
The reactive power requirements of the system depend on the wind turbine involved. Wind turbines (WTs) based on the DFIG, for instance, require reactive compensation. The control scheme design defines the relationship between the following variables: active and reactive power, power delivered, and nodal voltage. The capacitor banks or reactive power sources are individually added to wind turbines for supplying the reactive power deficit locally without importing from other parts of the electrical grid. The fluctuations of the active and reactive power caused by the wind speed are necessary since the active power depends on the speed [9]. Therefore, the three variables required as input for the PQ bus model are: wind speed V W , active P and reactive Q power. Thus, the Equations (17)-(23) are solved, with the unknown values given in Equation (26). This process provides the machine's operating point in a steady-state.

PV Bus Model
In the PV bus model, the active power of the generator P, the stator voltage V s , and the wind speed V W are input variables. The active power of the generator P remains constant in the load flow analysis for calculating the reactive power and the slip. The difference between the reactive power and that obtained in the load flow analysis is modeled as an admittance in the admittance characteristic of the load node. The difference between the generator's reactive power and the initial reactive power of the node is obtained by adding a reactive power compensation in parallel. As in the previous method, the set of the Equations (17)-(23) is solved, with the unknown values given in Equation (26). The result of this process also provides the machine's operating point in steady-state. The characteristics of the PQ and PV methods for the load flow analysis with the input and the unknown variables derived from the solution process are presented in Table 1.

Wind Speed Analysis
For conventional wind turbines, the operating point can be obtained by an iterative process combined with the load flow analysis considering all characteristics provided by the manufacturer. To obtain all electrical variables of the operating point in steady-state for the DFIG, however, the mechanical power based on the wind speed given by the manufacturer should be estimated, for controlling the reactive power. This procedure presents the active power P and the stator voltage (V s = V s ∠δ s ) as unknown variables in the model. By establishing a new equation for Ғ7, given by: P − P m + I s 2 r s + I r 2 r r , the value of P is known, but P is a proposed value. This could be resolved if the process is iterative and a more accurate calculation is performed. Another way to conduct the simulation is by assuming the slip value, which depends on the control mode since the slip value is different for each wind speed. Considering the above, the slip value is known once the input value of the wind speed is available. This facilitates the calculation since the unknown in Equation (26) is eliminated and Equation (27) is a 6 × 6 matrix. Since all DFIG variables are known, the harmonic analysis is performed as described in subsequent sections.

Harmonic Analysis of the DFIG
DFIG generates harmonics through the stator or rotor voltage sources: the harmonic frequencies for stator and rotor are f sh = h f es and f rh = h f er , respectively. Two fundamental frequencies are available: one in the stator ( f es ) and another in the rotor ( f er ). To perform the frequency-domain analysis of the DFIG at harmonic frequencies by analyzing the generator with its independent voltage sources, it is necessary that only the effects of the stator are considered. This is done by feeding the DFIG by the stator with frequency f sh and keeping the rotor short-circuited ( Figure 5). Equation (28) describes the circuit as follows: (28) where the harmonic slip seen from stator is given by Equation (29) s h = ±hω es − ω r ±hω es (29) Appl. Sci. 2020, 10, x FOR PEER REVIEW 9 of 22 = −( + ℎ ) + ℎ 0 = ⁄ + ℎ ( + ) − ℎ (28) where the harmonic slip seen from stator is given by Equation (29) = ±ℎ − ±ℎ (29) In Equation (29), the (+) and (-) represent positive and negative harmonic sequences. By solving the Equation (28), the stator and rotor harmonic current phasors in the time-domain are obtained by Equation (30) where ± is (-) for the positive and (+) for negative sequence. On the contrary, feeding the DFIG by the rotor with frequency keeps the stator in short-circuit ( Figure 5), and the equation (31) represents the circuit, where the harmonic slip seen from rotor is given by Equation (32) = ±ℎ + ±ℎ (32) Similarly, the (+) and (-) signs in Equation (32) represent the positive and negative harmonic sequence, respectively. By considering Equation (4) In Equation (29), the (+) and (-) represent positive and negative harmonic sequences. By solving the Equation (28), the stator and rotor harmonic current phasors in the time-domain are obtained by Equation (30) i sh = |I sh |cos(hω es t + ϕ sh ) i rh = |I rh |cos s h hω es t + ϕ rh ± θ e f f (30) where ± θ e f f is (-) for the positive and (+) for negative sequence. On the contrary, feeding the DFIG by the rotor with frequency f rh keeps the stator in short-circuit ( Figure 5), and the equation (31) represents the circuit, 0 = r s /s rh + jhω er (L ls + L M )I sh − jhω er L M I rh V rh = r r + jhω er (L lr + L M )I rh − jhω es L M I sh (31) where the harmonic slip seen from rotor is given by Equation (32) Similarly, the (+) and (-) signs in Equation (32) represent the positive and negative harmonic sequence, respectively. By considering Equation (4), the stator and rotor current phasors in the time-domain are obtained by Equation (33), i rh = |I rh | cos(hω er t + ϕ rh ) i sh = |I sh | cos s rh hω er t + ϕ sh + θ e f f (33) where ± θ e f f is (-) for the positive and (+) for the negative sequence. Finally, the effects of the harmonic voltage sources in the stator and rotor summed to provide the complete solution for the DFIG are given by Equations (34) and (35): i sh = |I sh | cos(hω es t + ϕ sh ) + I sh cos s rh hω er t + ϕ sh ± θ e f f (34) i rh = |I rh | cos(hω er t + ϕ rh ) + I rh cos s h hω es t + ϕ rh ± θ e f f Regarding the zero sequence components, in a DFIG only the wye connections with insulated neutral and delta connect the stator phases of the induction generator. The wye connection with the neutral connected to the electrical grid is not used in these machines. This indicates that homopolar currents are absent in the stator of these machines. Therefore, Figure 2 is invalid since the induction generator operates as two decoupled windings for the zero sequence. Equation (36) represents the components of the zero sequence in the induction generator as follows: V sh = (r s + jhω es L ls )I sh V rh = (r s + jhω es L ls )I rh (36) By considering Equation (36), the stator and rotor harmonic current phasors in the time-domain are obtained by Equation (37) i sh = |I sh | cos(hω es t + ϕ sh ) i rh = |I rh | cos(hω er t + ϕ rh ) In summary, if voltage sources are considered in balanced conditions at the fundamental frequency, as well as the harmonic frequencies in each winding, then the general solution is given by Equation (38).  (37) and is interpreted as follows: first, all current harmonics are generated by a non-sinusoidal voltage source in the stator for positive, negative, and zero sequences. All current harmonics are then induced on the rotor from the stator of the positive sequence. Finally, all current harmonics are induced on the rotor from the stator of negative sequence. The same interpretation is used for Equation (39).

DFIG Connected at Electrical Grid
The integration of wind farms to the electrical grid is a complicated problem. Numerous studies related to the impact of wind penetration on power systems have been conducted, including those related to stability [32][33][34][35], and electrical protection response and harmonic effects in the grid [36][37][38][39]. This article, however, focuses on the analysis of the harmonics generated by the B2B power converter and its interconnection to the electrical grid.

B2B Power Converter Analysis
The B2B power converter topology used in this analysis comprises a rectifier and an inverter connected in series to a DC bus in parallel with a capacitor. This converter type is bidirectional, allowing operation in the four quadrants of the XY plane, and, therefore, both converters operate as rectifiers or inverters. The difference between the rectifier and the inverter is the definition of the power sign. The active and reactive powers through the rotor and the stator are controlled by adjusting the amplitude, phase and frequency of the voltage introduced to the rotor. The rotor-side converter provides a three-phase voltage at a variable amplitude and frequency, controlling the generator torque and the reactive power exchange between the stator and the electrical grid. The grid-side converter exchanges the active power with the electrical grid obtained or injected by the rotor-side converter from the rotor. The output frequency of the grid-side converter is constant, while the output voltage varies depending on the exchange of the active and reactive powers with the electrical grid. Because of the greater flow of power injected by the stator generator, the B2B power converter is designed to operate between 25% and 30% of the nominal power of the generator. This reduces the design cost of the power converter and the losses of the generation scheme. Thus, the wind turbine's generated power is distributed between the stator and the supply through the rotor. The three-phase B2B power converter is shown in Figure 6. The converter is modeled with bidirectional switches, where the ideal switch is created by a semiconductor with an anti-parallel diode allowing current to flow in both directions. The semiconductor used is an isolated gate bipolar transistor (IGBT) with ideal operation. For the synchronization and power injection of the B2B power converter toward the electrical grid, it is necessary to know the phase's sequence and to synchronize one phase of the grid by the phase-locked loop (PLL) method. This method requires estimating the grid angle to accomplish the necessary transformations using the d-q reference frame of the grid voltage.

Loop Controller
There are many papers in the literature on control strategies for controlled current three-phase power converters. Basically, the control problem is identical to synchronous-machine control. Since the B2B power converter control method is not the main point of this work, only a brief description of the control strategy implemented in this analysis will be mentioned. In this paper, the synchronous PI controllers are used. This is one of the most popular control methods. The idea is to transform currents and voltages into a rotating reference frame, where the controlled currents are constant in steady-state and use ordinary PI controller outputs back to the fixed reference frame. The drawbacks are the nonlinearities introduced in the transformation and the less than optimal control performance. The advantage is that it is simple to understand and simple to implement. Synchronous PI controllers work with averaged voltages and currents. The converter is controlled via a PWM modulator that generates a switching pattern that corresponds to the desired average voltage. In this paper, the line current controller is assumed to be a synchronous PI controller. Its properties are well known in the power electronics area. Furthermore, by assuming this type of controller, the three-phase converter can be modeled as two separate four quadrant converters: one for the active power and one for the reactive power. The reactive power is assumed to be zero, which means that this part can be removed. It is important to consider that the controlled system is nonlinear, but the large-signal stability is not examined. The stability of the closed-loop system should be examined with methods for non-linear The converter is modeled with bidirectional switches, where the ideal switch is created by a semiconductor with an anti-parallel diode allowing current to flow in both directions. The semiconductor used is an isolated gate bipolar transistor (IGBT) with ideal operation. For the synchronization and power injection of the B2B power converter toward the electrical grid, it is necessary to know the phase's sequence and to synchronize one phase of the grid by the phase-locked loop (PLL) method. This method requires estimating the grid angle to accomplish the necessary transformations using the d-q reference frame of the grid voltage.

Loop Controller
There are many papers in the literature on control strategies for controlled current three-phase power converters. Basically, the control problem is identical to synchronous-machine control. Since the B2B power converter control method is not the main point of this work, only a brief description of the control strategy implemented in this analysis will be mentioned. In this paper, the synchronous PI controllers are used. This is one of the most popular control methods. The idea is to transform currents and voltages into a rotating reference frame, where the controlled currents are constant in steady-state and use ordinary PI controller outputs back to the fixed reference frame. The drawbacks are the nonlinearities introduced in the transformation and the less than optimal control performance. The advantage is that it is simple to understand and simple to implement. Synchronous PI controllers work with averaged voltages and currents. The converter is controlled via a PWM modulator that generates a switching pattern that corresponds to the desired average voltage. In this paper, the line current controller is assumed to be a synchronous PI controller. Its properties are well known in the power electronics area. Furthermore, by assuming this type of controller, the three-phase converter can be modeled as two separate four quadrant converters: one for the active power and one for the reactive power. The reactive power is assumed to be zero, which means that this part can be removed. It is important to consider that the controlled system is nonlinear, but the large-signal stability is not examined. The stability of the closed-loop system should be examined with methods for non-linear systems. The load power is a factor in all coefficients of the characteristics equation of the closed-loop system, and the poles of the linearized system move around with the load of the B2B power converter. Consequently, the controller parameters must be chosen to keep all poles in the LHP of the complex plane under all load conditions.

Modulation Method
The B2B power converters have as their main component a voltage source converter, which uses pulse width modulation (PWM) for controlling purposes. This technique uses power semiconductors that operate at high frequencies. In this paper, the sinusoidal PWM (SPWM) is used since it is mature technology. In this method a triangular wave is compared with a sinusoidal wave. For the SPWM technique, with an amplitude modulation index less than one, the fundamental voltage amplitude varies linearly with this modulation index, but the fundamental frequency is less. When you have an amplitude modulation index greater than one, the amplitude also increases, leading to overmodu-lation, and the output waveform contains many harmonics. The dominant harmonics in the linear range may not be so in overmodulation; the amplitude of the fundamental component does not vary linearly with the amplitude modulation index. In power applications, the overmodulation region should be avoided as much as possible to minimize distortion in the output voltage. Within the MATLAB-Simulink ® software, the SPWM technique is developed using some blocks that have already been designed in the master library. The carrier signal operates at 5 kHz and is compared with the modulated signals at 60 Hz.

Electrical Grid Configuration
In this analysis, the electrical grid is represented by a Thevenin equivalent circuit, consisting of a constant magnitude short-circuit power S cc = 10 kVA and a grid impedance angle ϑ cc = 80 • . For simplicity, the electrical system is represented by a straightforward model using the commercial program MATLAB-Simulink ® . This representation is convenient in the absence of a specific grid, with generalized conclusions being sought. The interconnection diagram of the DFIG with the electrical grid is displayed in Figure 7. The power exchange of the machine is carried out by the stator and the B2B power converter on the grid side converter. Meanwhile, the total active power of the machine is equal to the sum of the stator power and B2B power converter power on the grid-side converter. The grid-side converter is assumed to operate with a unit power factor so that the grid side converter only exchanges active power with the electrical grid, and the reactive power exchange is with the stator circuit. To connect the DFIG with the electrical grid, a transformer is used to adjust the values of the generated voltage to the distribution value of the electrical grid. This establishes an interconnection point where the stator voltage and the converter voltage of the grid-side converter are in low voltage and have different magnitudes.
grid-side converter is assumed to operate with a unit power factor so that the grid side converter only exchanges active power with the electrical grid, and the reactive power exchange is with the stator circuit. To connect the DFIG with the electrical grid, a transformer is used to adjust the values of the generated voltage to the distribution value of the electrical grid. This establishes an interconnection point where the stator voltage and the converter voltage of the grid-side converter are in low voltage and have different magnitudes.

Model Validation
An experimental test is performed on a three-phase DFIG of 3 kW, 230/400 V, and 11.5 A to validate the proposed model. The PWM converters used were standard 4.5 kW with a maximum switching frequency of 5 kHz. The schematic and block diagram of the experimental rig are exhibited in Figures 8 and 9, respectively.

Model Validation
An experimental test is performed on a three-phase DFIG of 3 kW, 230/400 V, and 11.5 A to validate the proposed model. The PWM converters used were standard 4.5 kW with a maximum switching frequency of 5 kHz. The schematic and block diagram of the experimental rig are exhibited in Figures 8 and 9, respectively.   The detailed parameters of the experimental setup are listed in Table 2. The DFIG parameters are provided in Appendix A. The detailed parameters of the experimental setup are listed in Table 2. The DFIG parameters are provided in Appendix A. This system contains an induction motor, a single helical gearbox, an adjustable frequency drive (AFD), a three-phase DFIG wind turbine, and a three-phase B2B power converter. This system involves a 10 HP squirrel-cage induction motor with its rotor coupled directly to a single helical gearbox, where the 3 kW-DFIG is also connected. The speed of the induction motor is controlled by an AFD to simulate different wind speeds.
The rotor winding of the DFIG is connected to the rotor-side converter of the B2B, while the stator winding of the DFIG is connected directly to the electrical grid by means of the three-winding transformer. The grid-side converter controls the DC-link voltage at 160 V. The sampling and switching frequencies for both converters are 5 and 2.5 kHz, respectively.
The results of the model proposed in steady-state are compared with real lab measurements. The machine's steady-state operating point results from the load flow analysis are presented in Table 3, assuming wind speeds P and Q as input data. Different wind speeds are considered as input data assuming a unit power factor, which means that the grid-side converter transmits active power in both directions (positive and negative), so that the B2B power converter operates with a unit power factor; the reactive power should be zero. If the power factor is positive, the electrical grid consumes the active power from the B2B power converter. The power factor is a unit because the reactive power is zero. In this mode of operation, the current and voltage must be in phase with the electrical grid. Alternatively, if the power factor is negative, the electrical grid provides active power to the B2B power converter. From the electrical grid, the active power is negative, indicating that active power is generated and consumed by the B2B power converter. Again, in this operating mode, the unit power factor is suitable because the reactive power is zero. Concerning the voltage and current of the electrical grid, a phase shift of 180 • exists. Finally, another operation mode of the B2B power converter is analyzed, when the exchange of active power with the electrical grid is minimal such that the B2B power converter is considered to operate with a power factor of zero. In this situation, only the reactive power exchange takes place, without considering the voltage drop in the resistance. Additionally, the current is delayed by 90 • relative to the voltage of the electrical grid, indicating the availability of inductive reactive power. The operating condition that enables increasing the available power because of a rise in the wind is considered. The results in Table 3 present an active power, with a minimum increase as the wind speed increases, until the maximum power is reached. Meanwhile, the wind turbine begins to absorb reactive power as the wind speed increases and remains stable when the wind speed attains 10 m/s. Note that the DFIG exhibits a broader range of operation than other wind generation systems because it operates at its nominal speed and at higher or lower synchronization speeds. This is achieved by adjusting its variables to obtain the maximum power before the speed variation.

Test Case 1: A 3 kW DFIG-Based Wind Turbine Connected to the Electric Grid
For the harmonic analysis of the DFIG, the results obtained are directly usable as initial values in a steady-state model of the machine. A wind speed of 10 m/s is considered input data. For this case, the induction generator is excited with a sinusoidal three-phase balanced voltage of 436 V at 60 Hz in the stator winding from the electrical grid and a non-sinusoidal three-phase balanced voltage of 22.5 V at 45 Hz applied to the rotor winding generated by the B2B power converter, which produced the harmonic components of order: 5th, 7th, 11th, 13th, 17th, 19th, 23th, 25th, and 29th, known as the characteristic harmonics of the B2B power converter. The magnitude and angle of the voltage harmonic components are presented in Table 4. The waveform of the rotor voltage is shown in Figure 10; furthermore, current waveforms from measurements and simulations are displayed in Figures 11 and 12, respectively. in the stator winding from the electrical grid and a non-sinusoidal three-phase balanced voltage of 22.5 V at 45 Hz applied to the rotor winding generated by the B2B power converter, which produced the harmonic components of order: 5 ℎ, 7 ℎ, 11 ℎ, 13 ℎ, 17 ℎ, 19 ℎ, 23 ℎ, 25 ℎ, and 29 ℎ, known as the characteristic harmonics of the B2B power converter. The magnitude and angle of the voltage harmonic components are presented in Table 4. The waveform of the rotor voltage is shown in Figure  10; furthermore, current waveforms from measurements and simulations are displayed in Figures 11  and 12, respectively.    The rotor current harmonic caused by the switching of the rotor-side converter of the B2B power converter appears at frequencies of = (6ℎ ± 1) , ℎ = 0,1,2,3 ,... i.e., at the 5 ℎ, 7 ℎ, 11 ℎ, 13 ℎ … of the fundamental frequency in the currents of the induction generator as summarized in Table 5, where the current waveforms presented in this study are attained by applying the solution of Equations (38) and (39) in the previous section. Table 5 also shows the current THD index of the current waveforms, both stator and rotor are presented in Figures 11 and 12. The rotor harmonic currents establish rotating magnetic fields in the airgap, inducing currents of corresponding frequencies to the stator winding. The DC current distortion introduced by the grid-side converter is also reflected in the rotor currents, which causes the appearance of additional harmonics. The full harmonic content of the rotor current is then given by = |(6ℎ ± 1) ± 6 | , ℎ, = 0,1,2,3, … setting = 0 yields the "conventional" harmonic frequencies caused by the rotor-side converter.   The rotor current harmonic caused by the switching of the rotor-side converter of the B2B power converter appears at frequencies of = (6ℎ ± 1) , ℎ = 0,1,2,3 ,... i.e., at the 5 ℎ, 7 ℎ, 11 ℎ, 13 ℎ … of the fundamental frequency in the currents of the induction generator as summarized in Table 5, where the current waveforms presented in this study are attained by applying the solution of Equations (38) and (39) in the previous section. Table 5 also shows the current THD index of the current waveforms, both stator and rotor are presented in Figures 11 and 12. The rotor harmonic currents establish rotating magnetic fields in the airgap, inducing currents of corresponding frequencies to the stator winding. The DC current distortion introduced by the grid-side converter is also reflected in the rotor currents, which causes the appearance of additional harmonics. The full harmonic content of the rotor current is then given by = |(6ℎ ± 1) ± 6 | , ℎ, = 0,1,2,3, … setting = 0 yields the "conventional" harmonic frequencies caused by the rotor-side converter.  The rotor current harmonic caused by the switching of the rotor-side converter of the B2B power converter appears at frequencies of f rh = (6h ± 1)s f es , h = 0, 1, 2, 3, ... i.e., at the 5th, 7th, 11th, 13th . . . of the fundamental frequency in the currents of the induction generator as summarized in Table 5, where the current waveforms presented in this study are attained by applying the solution of Equations (38) and (39) in the previous section. Table 5 also shows the current THD index of the current waveforms, both stator and rotor are presented in Figures 11 and 12. The rotor harmonic currents establish rotating magnetic fields in the airgap, inducing currents of corresponding frequencies to the stator winding. The DC current distortion introduced by the grid-side converter is also reflected in the rotor currents, which causes the appearance of additional harmonics. The full harmonic content of the rotor current is then given by f rh = (6h ± 1)s ± 6m f es , h, m = 0, 1, 2, 3, . . . setting m = 0 yields the "conventional" harmonic frequencies caused by the rotor-side converter. The last expression explains the harmonic frequencies at 45 (fundamental rotor frequency), 225, 315, 495, 585, 765, and 855 Hz, corresponding to h = 5, 7, 11, 13, 17, 19. The same principle is applicable to the harmonics of the grid-side converter, appearing at the frequencies f sh = (6m ± 1)s ± 6hs f es , h, m = 0, 1, 2, 3, . . . , with the "integer" harmonics obtained presented in Table 5. For h 0, yields of the sub-and inter-harmonic contents of the recovery cascade current are derived, and these are quite significant depending on the operating slip. The rotor harmonic currents establish rotating magnetic fields in the airgap, inducing currents of corresponding frequencies to the stator winding. Since the slip s is a non-integer, the stator current harmonic content consists mainly of sub-and inter-harmonics, creating undesirable effects on the supply system. For instance, low-frequency sub-harmonics appear as unidirectional components superimposed on the phase currents, while sub-and inter-harmonics near the supply frequency may create a beat effect on the stator current magnitude.

Test Case 2: A 50 kW DFIG-Based Wind Turbine Connected to the Electric Grid
To ensure that the DFIG model for harmonic analysis works with great precision, an additional test case is proposed considering a higher power DFIG, i.e., 50 kW. In this test case, the induction generator is excited with a sinusoidal three-phase balanced voltage of 460 V at 60 Hz in the stator winding coming from the electrical grid and a non-sinusoidal three-phase balanced voltage of 20 V at 45 Hz generated by a B2B power converter. The magnitude and phase angle of the harmonic components of the non-sinusoidal voltage are shown in Table 6. A mechanical torque of 198 N × m was used. It is important to note that only a simulation was performed, but again the results match well between the results obtained from the transient-state model and those obtained from the proposed steady-state model. Equations of the transient-state model are obtained and described in Appendix A. The current waveforms obtained from the simulation are shown in Figures 13 and 14. Table 7 summarizes the harmonic currents in the DFIG for the test case. Table 7 also shows the current THD index of the current waveforms, both stator and rotor presented in Figures 13 and 14. It should be noted that the models were compared after 2 s, which was the time that the model in transient-state reached the steady-state.

Conclusions
This paper demonstrates that a grid-connected DFIG model derived by employing the frequency-domain harmonic analysis is able to reproduce the steady-state behavior and the transient dynamics with a high effectiveness since the proposed model suitably matches with the actual measurements of the grid-connected DFIG implemented. The main results are summarized in the following concluding remarks.
1. The DFIG model at fundamental frequency considering three-phase non-sinusoidal balanced voltage in both windings of the machine to determine the current response was analyzed. 2. An iterative analysis of the DFIG's steady-state operation was presented. The model is directly applicable to load flow analysis when wind speed, active and reactive powers are considered  Figure 14. Rotor current.

Conclusions
This paper demonstrates that a grid-connected DFIG model derived by employing the frequency-domain harmonic analysis is able to reproduce the steady-state behavior and the transient dynamics with a high effectiveness since the proposed model suitably matches with the actual measurements of the grid-connected DFIG implemented. The main results are summarized in the following concluding remarks.

1.
The DFIG model at fundamental frequency considering three-phase non-sinusoidal balanced voltage in both windings of the machine to determine the current response was analyzed.

2.
An iterative analysis of the DFIG's steady-state operation was presented. The model is directly applicable to load flow analysis when wind speed, active and reactive powers are considered as input variables. The results are usable as initial values in a steady-state model for the DFIG and internal variables for the generator. 3.
The DFIG model at harmonic frequencies considering three-phase non-sinusoidal voltage in both windings of the machine was analyzed. Harmonic and non-harmonic currents were generated on both sides of the machine depending on the slip and the fundamental frequency.

4.
The power balance in the B2B power converter, as well as the interconnection to the rotor winding of the machine, were analyzed considering that the B2B power converter works in a bidirectional operation.
Finally, the DFIG was connected to the electrical grid for harmonic studies. The results from the proposed model were consistent with those from lab measurements. This paper provides an easy and clear analysis of frequencies generated by the DFIG in the steady-state, yielding a proper model for harmonic and non-harmonic analysis of the DFIG connected to the electrical grid.  Electric angular velocity, equivalent to 2πf es f es Excitation source frequency in the stator ω r Rotor mechanical velocity f er Excitation source frequency in the rotor θ eff Phase angle between the rotor and stator in steady-state s and s r Stator slip and rotor slip T e Electric torque, equivalent to P e /ω r P m , P s and P r Mechanical, stator and rotor power, respectively P loss Losses power, equivalent to I s 2 r s +I r 2 r r P and Q Active and reactive powers, respectively ρ Air Magnitude and angle of the harmonic rotor current s h and s rh Harmonic slip in stator and rotor, respectively S 1 ,S 1 ,. . . S 6 IGBT's switches of the rotor-side converter S 1 ,S 2 ,. . . S 6 IGBT's switches of the grid-side converter

Appendix A
The parameters of the three-phase induction generator used for the cases studies are presented below (See Table A1).
The apostrophe means quantities referring to the stator and p the derivative, and v abcs and v abcr are the phase stator and rotor voltages in volts, respectively. In addition, i abcs and i abcr are the phase stator and rotor currents in amperes, respectively, while r s and r r are the stator and rotor resistances in ohms. Ll s and Ll s are the leakage inductances of the stator and rotor in Henries. The general model of the induction machine is given by Equation (A2), v abcs v abcr = r s 0 0 r r i abcs i abcr + ρ λ abcs λ abcr (A2) The matrices of stator and rotor resistances are given by Equation (A3) In matrix notation, the flux linkages of the stator and rotor windings λ s , λ r , in terms of sr the winding inductances and currents are given by Equation (A4)