# Robust Control Examples Applied to a Wind Turbine Simulated Model
## 3 Data-Driven and Model-Based Control Designs
### Model-Based Adaptive Control Scheme  
This section describes the model-based adaptive control strategy used in connection with the on-line estimation scheme presented above. In more detail, with reference to the wind turbine system recalled in Section 2, adaptive controllers for processes of second order (\(n_{a}=n=2\)) are designed. Moreover, the considered adaptive controllers are based on the trapezoidal method of discretisation. With reference to Equation (15), the transfer function of the time-varying controlled system with \(n_{a}=n_{b}=n=2\) is considered, whose parameters estimated using the on-line identification approach recalled above:  
\[\hat{\theta}_{k}=\left[\hat{a}_{1},\,\hat{a}_{2},\,\hat{b}_{1},\,\hat{b}_{2} \right]^{T} \tag{35}\]  
Note that the subscript \(k\) for model and controller parameters will be dropped in order to simplify equations and formulas. The control law corresponding to the discrete-time adaptive controller in its difference form of Equation (36):  
\[\left\{ \begin{array}{lcl}\Delta e_{k}&=&e_{k}-e_{k-1}\\ u_{k}&=&\hat{K}_{p}\,\left[\Delta e_{k}+\frac{T_{k}}{\hat{T}_{1}}\,\frac{ \Delta e_{k}}{2}\right]+u_{k-1}\end{array} \right. \tag{36}\]  
with \(e_{k}\) representing the tracking error, with \(e_{k}=r_{k}-y_{k}\), and \(r_{k}\) the reference (set-point) signal. \(T_{s}\) is sampling time. The controller parameters \(\hat{K}_{p}\) and \(\hat{T}_{1}\) are here time-varying and derived from the on-linemodel parameters in the vector \(\hat{\theta}_{k}\). The control law can be represented also in its feedback formulation as described by Equation (37):  
\[u_{k}=\hat{q}_{0}\,e_{k}+\hat{q}_{1}\,e_{k-1}+u_{k-1} \tag{37}\]  
where the new controller variables \(\hat{q}_{0}\) and \(\hat{q}_{1}\) (or \(\hat{K}_{p}\) and \(\hat{T}_{I}\)) are derived from the relations of Equation (38):  
\[\left\{ \begin{array}{rcl}\hat{q}_{0}&=&\hat{K}_{p}\,\left(1+\frac{T_{u}}{2 \,\hat{T}_{I}}\right)\\ \hat{q}_{1}&=&-\hat{K}_{p}\,\left(1-\frac{T_{u}}{2\,\hat{T}_{I}}\right)\end{array} \right. \tag{38}\]  
where the parameters \(\hat{K}_{p}\) and \(\hat{T}_{I}\) are functions of the (time-varying) critical gain and the critical period of oscillations, respectively, \(K_{P_{u}}\) and \(T_{u}\):  
\[\hat{K}_{p}=0.6\,\hat{K}_{P_{u}},\,\hat{T}_{I}=0.5\,\hat{T}_{u} \tag{39}\]  
that depend on the time-varying model parameters in the vector \(\hat{\theta}_{k}\). In particular, when considering a second order model described by its (time-varying) parameters \(\hat{a}_{2}\), \(\hat{a}_{1}\), \(\hat{b}_{2}\) and \(\hat{b}_{1}\), the variables \(\hat{K}_{P_{u}}\) and \(\hat{T}_{u}\) required by the Ziegler-Nichols method used in this work are computed at each time step \(k\) from the following relations [32; 33]:  
\[\left\{ \begin{array}{l}\hat{K}_{P_{u}}=\frac{\hat{a}_{1}-\hat{a}_{2}-1}{\hat {b}_{2}-\hat{b}_{1}}\\ \hat{T}_{u}=\frac{2\pi T_{u}}{\arccos\hat{\gamma}},\quad\text{ with }\,\hat{\gamma}= \frac{a_{2}\,\hat{b}_{1}-\hat{a}_{1}\,\hat{b}_{2}}{2\,\hat{b}_{2}}\end{array} \right. \tag{40}\]  
In this way, the adaptive discrete-time linear controllers of Equations (36) or (37) are designed on the basis of the time-varying linear model of Equation (15) estimated via the on-line identification scheme from the data of the nonlinear wind turbine process of Equation (9). Note that the adaptive regulators considered in this section were implemented in the Simulink(r) environment, integrating also the on-line estimation scheme recalled above. The simulation set-up employs three adaptive regulators used for the control of the blade pitch angle \(\beta(t)\), and the generator control torque \(\tau_{r}(t)\), in the partial and full load working conditions, by using the controlled outputs \(\omega_{g}(t)\) and \(P_{g}(t)\).