# Robust Control Examples Applied to a Wind Turbine Simulated Model
## 3 Data-Driven and Model-Based Control Designs
An on-line version of the batch Frisch scheme estimation methodology summarized above is recalled in the remainder of this section for estimating the parameters of dynamic EIV models. For the derivation of the adaptation law, an on-line bias-compensating algorithm is also implemented. Thus, the on-line Frisch scheme estimation is generalized to enhance its applicability to real-time implementations. Moreover, by means of an exponential forgetting factor included in the adaptation law, the algorithm is able to deal with Linear Parameter-Varying (LPV) structures, that are exploited in connection with the model-based design of the adaptive control scheme, presented in Section 3.2. Note that the adaptive algorithm proposed here exploits an iterative procedure that starts from an initial controller estimated off-line, for example using the baseline controller already implemented in the wind turbine simulator, and described in Section 2. This initial controller model is subsequently adapted on-line using the recursive laws in order to track the different operating conditions of the process under investigation. Thus, the considered scheme is proposed for the on-line identification of the process modeled by the following transfer function \(G(z)\):  
\[G(z)=\frac{A(z^{-1})}{B(z^{-1})}=\frac{b_{1}\,z^{-1}+\ldots+b_{n_{b}}\,z^{-n_{b }}}{1+a_{1}\,z^{-1}+\ldots+a_{n_{a}}\,z^{-n_{a}}} \tag{15}\]where \(a_{i}\), \(b_{i}\), \(n_{a}\) and \(n_{b}\) represent the unknown parameters and the structure of the model, defining the polynomials \(A(z^{-1})\) and \(B(z^{-1})\), whilst \(z\) is the discrete-time complex variable. The parameter vector describing the linear relationship is given by:  
\[\theta=\left[a_{1}\,\dots\,a_{n_{a}}\,\,b_{1}\,\dots\,b_{n_{b}}\right]^{T} \tag{16}\]  
whose extended version is defined as in Equation (17):  
\[\bar{\theta}=\left[1\,\,\theta^{T}\right]^{T} \tag{17}\]  
An equivalent expression of the considered relations is obtained by using vector and matrix notations, in the form of Equation (18):  
\[\psi_{k}^{T}\,\bar{\theta}=0 \tag{18}\]  
where the regressor vector \(\psi_{k}\) is defined as:  
\[\psi_{k}=\left[-y_{k}\,-y_{k-1}\,\,\dots\,-y_{k-n_{a}}\,\,u_{k-1}\,\,\dots\,\, u_{k-n_{b}}\right]^{T} \tag{19}\]  
where the subscript \(k\) denotes the sample index. The Frisch scheme provides the estimates of the measurement errors affecting the input and output signals \(u_{k}\) and \(y_{k}\), i.e., \(\sigma_{u}\) and \(\sigma_{y}\) and \(\theta\) for a linear time-invariant dynamic system. Note that the polynomial orders \(n_{a}\) and \(n_{b}\) in the relation of Equation (15) are assumed to be fixed in advance. From the Frisch scheme method, the following expression is considered:  
\[\left(\Sigma_{\psi}-\Sigma_{\bar{\psi}}\right)\,\,\bar{\theta}=0 \tag{20}\]  
where the noise covariance matrix is given by:  
\[\Sigma_{\bar{\psi}}=\left[ \begin{array}{cc}\sigma_{y}\,I_{n_{a}+1}&0\\ 0&\sigma_{u}\,I_{n_{b}}\end{array} \right] \tag{21}\]  
which are approximated by the sample covariance matrix over \(N\) samples:  
\[\Sigma_{\bar{\psi}}\approx\frac{1}{N}\,\sum_{k=1}^{N}\psi_{k}\,\psi_{k}^{T} \tag{22}\]  
Thus, the Frisch scheme aims at providing suitable noise variances \(\sigma_{u}\) and \(\sigma_{y}\) such that \(\left(\Sigma_{\psi}-\Sigma_{\bar{\psi}}\right)\) results to be a matrix singular positive semidefinite as it is rank-one deficient. On the other hand, the system represented by the expression of Equation (20) can be solved, and \(\bar{\theta}\) represents its solution. The expression of Equation (23) is determined:  
\[\epsilon_{k}\left(\bar{\theta}\right)=A(z^{-1})\,y_{k}-B(z^{-1})\,u_{k} \tag{23}\]  
whilst the so-called sample auto-covariance is defined in the form of Equation (24):  
\[r_{eh,\,N}=\frac{1}{N}\sum_{l=1}^{N}\epsilon_{l}\left(\bar{\theta}\right)\, \epsilon_{l+h}\left(\bar{\theta}\right) \tag{24}\]  
where the subscript \(h\) in Equation (24) indicates a time-shift.