# Wind Turbines Optimal Operation at Time Variable Wind Speeds
## 6 Case Study
### PID-Based Control of the PMSG's Optimal Power  
For the case study in this paragraph, the same experimental data are used as those used for the previous case studies. Therefore, the system of differential equations in Equation (33) becomes  
\[\left\{ \begin{array}{l}1.15\times 10^{5}\frac{dc(t)}{dt}\omega(t)+1.15\times 10^{5 }\varepsilon^{2}(t)=3040.7^{\frac{dS_{w}^{3}(t)}{dt}}-\frac{dP_{PMSG,PD}(t)}{ dt}\\ \frac{dP_{PMSG,PD}(t)}{dt}=k_{p}\frac{d\omega(t)}{dt}-23.091k_{p}\frac{dS_{w}(t )}{dt}+k_{i}\omega(t)-23.091k_{i}S_{w}(t)+k_{d}\frac{d^{2}\omega(t)}{dt^{2}}-2 3.091k_{d}\frac{d^{2}S_{w}(t)}{dt^{2}}\end{array} \right. \tag{63}\]  
The second order derivative of the wind speed time-varying curve, \(S_{w}(t)\), is obtained by derivation of Equation (45):  
\[\frac{d^{2}S_{w}(t)}{dt^{2}}=7.2086\times 10^{-4} \tag{64}\]  
Then, by replacing the wind speed time-varying curve, \(S_{w}(t)\), its first order derivative, \(\frac{dS_{w}(t)}{dt}\), and its second order derivative, \(\frac{d^{2}S_{w}(t)}{dt^{2}}\), from Equations (44), (45) and (64), respectively, the below system of differential equations is obtained, as:  
\[\left\{ \begin{array}{l}115\times 10^{5}\frac{dc(t)}{dt}\omega(t)+1.15\times 10^{5 }\varepsilon(t)^{2}=3040.7^{\frac{d\left(-1.5724\times 10^{-6}\mu^{2}+7.2086\times 10^{ -4}t+6.24\right)^{3}}{dt}}-\frac{dP_{PMSG,PD}(t)}{dt}\\ =3040.7\left(-3.84\times 10^{-28}\left(3931\mu^{2}-1.8022\times 10^{6}t-1.56\times 1 0^{10}\right)^{2}\left(3931t-9.0108\times 10^{5}\right)\right)\\ -\frac{dP_{PMSG,PD}(t)}{dt}\\ \frac{dP_{PMSG,PD}(t)}{dt}=k_{p}\frac{d\omega(t)}{dt}-23.091\times k_{1}\times \left(-3.1448\times 10^{-6}t+7.2086\times 10^{-4}\right)\\ +k\left(\omega(t)-23.091\times\left(-1.5724\times 10^{-6}\mu^{2}+7.2086\times 1 0^{-4}t+6.24\right)\right)\\ +k_{d}\left(\frac{d^{2}\omega(t)}{dt^{2}}-1.6645\times 10^{-2}\right)\end{array} \right. \tag{65}\]  
The initial conditions of the differential equations system in Equation (65) are calculated for the wind speed value from Table 1, corresponding to \(t=0\) (s). Their expressions are the following ones:  
\[\left\{ \begin{array}{l}\omega(0)=\omega_{optim}(0)=23.091\times S_{w}(0)=23. 091\times 6.24=144.09\\ \varepsilon(0)=\frac{d\omega(0)}{dt}=23.091\frac{dS_{w}(0)}{dt}=23.091\times \left(-3.1448\times 10^{-6}\times 0+7.2086\times 10^{-4}\right)=1.6645\times 10^{-2}\\ P_{PMSG,PD}(0)=2.2566\times 10^{6}\left(\frac{624}{14.09}-2.6247\times 10^{-2} \right)^{-58.617}\frac{624}{1428}\left(6.24\right)^{3}-1.15\times 10^{5}1.6645 \times 10^{-2}144.09\\ =4.6297\times 10^{5}\end{array} \right. \tag{66}\]  
The values of the proportional constant, \(k_{p}\), of the integral constant, \(k_{i}\), and of the derivative constant are also determined through the trial and error tuning method, so that the power oscillations  
Figure 3: Powers variations in time: \(P_{PMSG,PI}(t)\) and \(P_{PMSGqtim}(t)\). are as small as possible, and the PMSG's angular speed value, \(\omega\), is made to tend to the optimal value of the PMSG's angular speed, \(\omega_{optim}\). For example, at \(t=570\) (s), the PMSG's angular speed value is \(\omega(570)=141.76\) (rad/s) and \(\omega_{optim}(570)=141.78\) (rad/s). From the simulations, it results that the PMSG's power oscillations are lowest for \(k_{p}=10,\ k_{i}=2700\) and \(k_{d}=1000\), as can also be seen in Figure 4, and using those from Equation (65) together with the initial conditions in Equation (66), the equations system in Equation (65) becomes  
\[\left\{