**2. Modelling, Simulation, and Control of DFIG**

In the wind power sector, the DFIG based wind turbine with a variable speed variablepitch control scheme is the most prevalent wind power generator. This machine may be used as a grid-connected or stand-alone unit. To optimally extract the power from the wind and precisely predict its performance, a complete insight of the modelling, control, and SSA of this machine in both operation modes is required. In this paper, the author design and examine three-phase PWM voltage source converter models defined in the ABC and DQO synchronous reference frames, as well as their control strategies. Furthermore, utilizing Matlab/Simulink software, a DFIG-based wind turbine model coupled to a constant voltage and frequency grid is designed, as well as its associated generator control framework. This control mechanism, as well as the SS behavior of the wind plant, are clearly outlined. Figure 1 shows the DFIG models as well as the three-phase two-level PWM voltage source converter models. The control schemes are also necessary to achieve optimum output power from the wind turbine. The RSC control and the GSC control are two of these control techniques. The GSC controller is used to keep the voltage across the capacitor constant and ensure that the grid operates at a unity power factor. The torque, active power, and reactive power are all controlled by the rotor-side converter controller. As the most complete and established RSC control, it is coupled with powerful stator flux-oriented vector control. The vector control's goal is to make the AC machine act like an independently stimulated DC machine, which involves decoupling the flux and torque components.

**Figure 1.** Configuration of DFIG wind turbine with RSC and GSC control. **Figure 1.** Configuration of DFIG wind turbine with RSC and GSC control.

#### *2.1. SS Model of DFIG 2.1. SS Model of DFIG*

The model comprises a DFIG specifically a wound rotor induction generator which has a power converter connected to the sliprings of the rotor. The stator is directly coupled to the grid. The various parameters of the machine are defined in Table A1. For deriving the SS magnitudes of DFIG by magnetizing the machine through a rotor with idr = 0, the step-by-step procedure is as follows [13]. By assuming SS and the alignment of the stator flux with the d-axis, it is possible to obtain the following sets of the equation: The model comprises a DFIG specifically a wound rotor induction generator which has a power converter connected to the sliprings of the rotor. The stator is directly coupled to the grid. The various parameters of the machine are defined in Table A1. For deriving the SS magnitudes of DFIG by magnetizing the machine through a rotor with idr = 0, the step-by-step procedure is as follows [13]. By assuming SS and the alignment of the stator flux with the d-axis, it is possible to obtain the following sets of the equation:

$$\mathbf{i}\_{\rm dst} = \frac{\begin{vmatrix} \rightarrow \\ \Psi\_{\rm st} \end{vmatrix}}{\mathbf{L}\_{\rm st}} \tag{1}$$

$$\mathbf{i}\_{\rm qst} = -\frac{\mathbf{L}\_{\rm m}\prime}{\mathbf{L}\_{\rm st}}\,\mathbf{i}\_{\rm qrt} \tag{2}$$

$$\mathbf{v\_{dst}} = \mathbf{R\_{st}} \,\mathrm{i\_{dst}} \tag{3}$$

$$\mathbf{v}\_{\rm qst} = \mathbf{R}\_{\rm st} \mathbf{i}\_{\rm qst} + \boldsymbol{\omega}\_{\rm st} \begin{vmatrix} \stackrel{\rightarrow}{\boldsymbol{\psi}} \\ \boldsymbol{\psi}\_{\rm st} \end{vmatrix} \tag{4}$$

$$\left|\mathbf{v\_{st}^{\rightarrow}}\right|^2 = \mathbf{v\_{dst}^2} + \mathbf{v\_{qst}^2} \tag{5}$$

$$\mathbf{T\_{em1}} = -\frac{3}{2}\mathbf{p}\ \frac{\mathbf{L\_{m'}}}{\mathbf{L\_{st}}} \begin{vmatrix} \stackrel{\rightarrow}{\psi} \\ \stackrel{\rightarrow}{\mathbf{v}} \end{vmatrix} \mathbf{i\_{qrt}} \tag{6}$$

First, it is necessary to calculate the stator flux amplitude of the machine. From these six sets of equations, it is easy to compute the stator flux using Equations (7)–(10). For the calculation of stator flux, we only need the parameters of the machine, stator voltages, stator currents, and torque.

$$\left| \stackrel{\rightarrow}{\psi}\_{\rm st} \right| = \sqrt{\frac{-\mathbf{B}\prime \pm \sqrt{\mathbf{B}\prime^2 - 4\mathbf{A}\prime \mathbf{C}\prime}}{2\mathbf{A}\prime}}\tag{7}$$

$$\mathbf{A}\prime = \left(\frac{\mathbf{R\_{st}}}{\mathbf{L\_{st}}}\right)^2 + \boldsymbol{\omega}\_{\rm st}^2 \tag{8}$$

$$\mathbf{B}\prime = \frac{4}{3} \frac{\mathbf{R}\_{\rm st} \mathbf{T}\_{\rm em1} \boldsymbol{\omega}\_{\rm st}}{\mathbf{p}} - |\mathbf{v}\_{\rm st}|^2 \tag{9}$$

$$\mathbf{C}\prime = \left(\frac{2}{3}\frac{\mathbf{R}\_{\rm st}\mathbf{T}\_{\rm em1}}{\mathbf{p}\mathbf{L}\_{\rm m}\prime}\right)^{2} \tag{10}$$

Once the flux is obtained, the remaining SS magnitudes can be calculated using the below equations in a step-by-step manner. The rotor current is derived using the following three equations.

$$\mathbf{i}\_{\rm drt} = \mathbf{0} \tag{11}$$

$$\mathbf{i\_{qrt}} = \frac{\mathbf{T\_{em1}}}{-\frac{3}{2} \mathbf{p} \frac{\mathbf{I\_{m'}}}{\mathbf{L\_{st}}} \left| \stackrel{\rightarrow}{\boldsymbol{\Psi}\_{\rm st}}}\right| \tag{12}$$

$$\left| \stackrel{\rightarrow}{\mathbf{i}}\_{\mathbf{rt}} \right|^2 = \mathbf{i}\_{\mathbf{dr}t}^2 + \mathbf{i}\_{\mathbf{qrt}}^2 \tag{13}$$

The magnitude of the stator currents,

$$\left| \stackrel{\rightarrow}{\mathbf{i}}\_{\mathbf{st}} \right|^2 = \mathbf{i}^2\_{\mathbf{dst}} + \mathbf{i}^2\_{\mathbf{qst}} \tag{14}$$

The rotor speed and slip using the following two equations

$$
\omega\_{\rm rt} = \omega\_{\rm st} - \omega\_{\rm mec} \tag{15}
$$

$$\mathbf{s} = \frac{\boldsymbol{\omega}\_{\rm tr}}{\boldsymbol{\omega}\_{\rm st}} \tag{16}$$

The rotor voltages from the following three equations.

$$\mathbf{v\_{drt}} = \mathbf{R\_{rt}i\_{drt}} - \boldsymbol{\omega}\_{\mathrm{rt}} \boldsymbol{\sigma} \mathbf{L\_{rt}i\_{qrt}} \tag{17}$$

$$\mathbf{v\_{qrt}} = \mathbf{R\_{rt}}\mathbf{i\_{qrt}} + \omega\_{\mathbf{rt}}\sigma\mathbf{L\_{rt}}\mathbf{i\_{qrt}} + \omega\_{\mathbf{rt}}\frac{\mathbf{L\_{m'}}}{\mathbf{L\_{st}}} \left| \stackrel{\rightarrow}{\boldsymbol{\psi}}\_{\rm st} \right| \tag{18}$$

$$\left| \stackrel{\rightarrow}{\mathbf{v}\_{\rm rt}} \right|^{2} = \mathbf{v}\_{\rm drt}^{2} + \mathbf{v}\_{\rm qrt}^{2} \tag{19}$$

The rotor fluxes using,

$$
\Psi\_{\rm drt} = \mathbf{L}\_{\rm m} \mathbf{\dot{\mathbf{i}}\_{\rm dst}} + \mathbf{L}\_{\rm rt} \mathbf{\dot{i}}\_{\rm drt} \tag{20}
$$

$$
\psi\_{\rm qrt} = \mathbf{L}\_{\rm m} \mathbf{\dot{\imath}\_{\rm qst}} + \mathbf{L}\_{\rm rt} \mathbf{\dot{\imath}\_{\rm qrt}} \tag{21}
$$

$$\left|\stackrel{\rightarrow}{\psi\_{\rm rt}}\right|^2 = \psi\_{\rm drt}^2 + \psi\_{\rm qrt}^2 \tag{22}$$

The active powers of the machine, stator, and rotor by

$$P\_{\rm mec} = T\_{\rm em1} \frac{\omega\_{\rm mec}}{\mathbf{P}} \tag{23}$$

$$P\_{\rm st} = \frac{3}{2} (\mathbf{v}\_{\rm dst} \mathbf{i}\_{\rm dst} + \mathbf{v}\_{\rm qst} \mathbf{i}\_{\rm dst}) \tag{24}$$

$$\mathbf{P\_{rt}} = \frac{3}{2} (\mathbf{v\_{drt}i\_{drt}} + \mathbf{v\_{qrt}i\_{drt}}) \tag{25}$$

The reactive powers of the stator and rotor

$$\mathbf{Q\_{st}} = \frac{3}{2} (\mathbf{v\_{qst}}\mathbf{i\_{dst}} + \mathbf{v\_{dst}}\mathbf{i\_{qst}}) \tag{26}$$

$$\mathbf{Q\_{rt}} = \frac{3}{2} (\mathbf{v\_{qrt}}\mathbf{i\_{drt}} + \mathbf{v\_{drt}}\mathbf{i\_{qrt}}) \tag{27}$$

The efficiency for motoring mode using Equation (28) and generator mode using Equation (29).

$$
\eta\_{\rm DFM} = \frac{\mathbf{P\_{mec}}}{\mathbf{P\_{st}} + \mathbf{P\_{rt}}} \left| If \,\,\, P\_{mec} > \,\,\mathbf{0} \tag{28}
$$

$$
\eta\_{\rm DFM} = \frac{\mathbf{P\_{st}} + \mathbf{P\_{rt}}}{\mathbf{P\_{mec}}} \left| If \,\,\, P\_{mec} < \,\, \mathbf{0} \right. \tag{29}
$$

where, idst, iqst, vdst, vqst, idrt, iqrt, vdrt, vqrt, Ψdrt, and Ψqrt are the current, voltages, and flux alignment in the d-axis and q-axis. → ψst , → ψrt , → vst , → vrt , → i st , and → i rt are the magnitudes of flux, current, and voltage. Tem1, ωst, ωrt, ωmec, s, Pmec, Pst, Prt, Qst, and Qrt is the torque, speed, slip, active, and reactive powers of the machine. ηDFIM is the efficiency of the machine. Lm0, Lst, Lrt, Rst, and Rrt are the self, mutual inductances, resistances of the stator, and rotor windings. The subscript notation st and rt is used to indicate the stator and rotor.

#### *2.2. Simulation of DFIG*

The overall simulation model of the electrical system, which comprises the DFIG, is shown in Figure 2. An asynchronous machine was used to represent the DFIG model with its rotor parameters referred to as the stator side. The stator was connected to a three-phase programmable voltage source. The rotor was connected to a power electronic converter RSC implemented by a universal bridge with three arms and ideal switches. We used a two-level PWM generator to control the RSC. The control signal for the PWM generator (Vabc\_ref) came from the RSC control block. Instead of a GSC, a DC voltage source was used to simplify the system. Zero-order hold was used at the input for the control block for Ir, Vs, θ, and ω<sup>m</sup> to make the system work as close to reality as possible. All the elements presented a constant sample time 1/fsw. The DC voltage source had the same value as bus voltage. In the RSC control block, a field-oriented control for current loops was considered for controlling the RSC. It is discussed in the next subsection.

**Figure 2.** Simulation model of a 2 MW DFIG with RSC Control.
