## 2 Wind Turbine Generator Systems  
In a wind generation system, the rotor converts the kinetic energy of the wind into mechanical energy, and, in turn, spins the generator shaft, multiplying the rotation speed by means of a gearbox [29]. To analyze the mechanical part, a simplified two-mass model is used, represented in Equations (1)to (9) [30]. The rotor torque and the generator electromechanical torque act in opposition, and the resulting torque generates a speed on the rotor shaft \(w_{r}\) and speed on the generator shaft \(w_{g}\). \[\frac{dw_{g}}{dt}=\frac{1}{2H_{g}}\left[-\frac{P_{elec}}{w_{g}+w_{0}}-d_{tg} \Big{(}w_{g}-w_{r}\Big{)}-k_{g}\Delta\theta_{m}\right] \tag{1}\]  
\[\frac{dw_{r}}{dt}=\frac{1}{2H_{r}}\left[-\frac{P_{rotar}}{w_{r}+w_{0}}+d_{tg} \Big{(}w_{g}-w_{r}\Big{)}+k_{tg}\Delta\theta_{m}\right] \tag{2}\]  
where \(k_{tg}\) and \(d_{tg}\) are the constants of elasticity and damping, respectively, of the mechanical two-mass model [18]. \(\theta_{m}\) is the gearbox angular position. \(H_{r}\) and \(H_{g}\) are the rotor inertial and generator inertial moments, respectively, and they are calculated according to:  
\[H_{r}=\frac{J_{r}w_{r}^{2}}{2\ P_{n}} \tag{3}\]  
\[H_{g}=\frac{J_{g}w_{g}^{2}}{2\ P_{n}} \tag{4}\]  
where \(P_{n}\) is the nominal power, \(J_{g}\) is the known inertia of the generator, and the inertia of the rotor \(J_{r}\) can be approximated according to:  
\[J_{r}=\frac{1}{8}m_{r}R^{2} \tag{5}\]  
where \(m_{r}\) is the mass of the rotor and blades, and R is the length of the blade. The torque of the rotor \(T_{r}\) extracted by the blades is determined from the wind \(v\) that crosses the sweeping area, and it is described with the following equation [31]:  
\[T_{r}=\frac{1}{2}\rho\ \pi\ R^{3}v^{2}\ \frac{C_{p}}{\lambda} \tag{6}\]  
The wind density is \(\rho\) and \(C_{p}\) is the power coefficient. \(C_{p}\) can be calculated in relation to TSR \(\lambda\) and the pitch angle \(\beta\) by an approximate method described in Equation (7) [32]:  
\[C_{p}(\lambda,\beta)=0.5176\left(\frac{116}{\lambda_{i}}-0.4\beta-5\right)e^{- \frac{20}{\lambda_{i}}+0.0068\lambda} \tag{7}\]  
\[\lambda_{i}=\left[\left(\frac{1}{\lambda+0.08\beta}\right)-\left(\frac{0.035} {\beta^{3}+1}\right)\right]^{-1} \tag{8}\]  
\[\lambda=\frac{\Omega R}{v} \tag{9}\]  
where \(\Omega\) is the rotation frequency in rad/s. In Figure 1, the influence of the pitch angle in \(C_{p}\) is shown. For this reason, with the pitch angle, it is possible to control speed, acceleration, and deceleration in the rotor, and mechanical stress in the system and electrical current overshoots are reduced [7]. According to the wind speed, the operation of the turbine is divided into four regions, in each of which the objective of the pitch control is different. In region I, the wind is not sufficient to move the rotor; the blade must be in the flag position to avoid possible movement. The objective of pitch control in region II is to maximize energy production through maximum power point tracking (MPPT), as, in this region, the rotor begins to rotate and limits the nominal wind speed. In region III, the wind speed is higher than the nominal speed and pitch control is required to keep the nominal rotation speed constant; the limit is the maximum design wind speed. For region IV, it is required to stop the rotation of the rotor for safety, so the blades should be in the flag position [33; 34]. The regions of operation of a wind turbine are shown in Figure 2.  
A PMSG is mostly used in wind turbines as its characteristics allow efficient operation at variable speed and does not require additional energy consumption [35]. To mathematically represent a PMSG, it is divided into two axes, the d-axis, representing the rotor winding, and the q-axis, displaced by synchronous rotation, 90 electrical degrees in the stator.