## 5 Optimal Controller  
Any method based on state feedback can be employed to compute the control coefficients. Nevertheless, such methods may lead to systems where the control action exceeds the allowable limits (saturation). Therefore, the optimal selection is the one that achieves a balance between dynamic response speed and control effort. The LQR fulfills these criteria. Its application to linear systems is demonstrated in [37; 38; 39]. To extend its use to nonlinear systems, a cost function must be minimized within each fuzzy subsystem. The use of the discrete LQR [40; 41] is proposed, given its simplicity in controller design and its applicability to different state-space models. The objective is to minimize the cost function \(J\). To achieve this, appropriate tuning of the weighting matrices \(Q\) and \(R\), as well as knowledge of both the extended state reference and the extended state itself, \(x_{ar}\) and \(x_{a}\), is required.  
\[J=\sum_{k=0}^{\infty}\bigl{[}(x_{a}(k)-x_{ar})^{t}Q(x_{a}(k)-x_{ar})+\Delta u( k)^{t}R\Delta u(k)\bigr{]} \tag{22}\]  
where \(Q\in\Re^{((q+n)\times(q+n))}\) and \(R\in\Re^{(p\times p)}\) are positive definite symmetric matrices. Thus, if the control objective is to achieve a steady-state output \(y_{r}\), in the incremental model this is equivalent to reaching the extended reference state [16]. In other words,  
\[x_{a}=\left[\begin{array}{c}y_{r}\\ \Delta x_{r}\end{array}\right]=\left[\begin{array}{c}y_{r}\\ 0\end{array}\right] \tag{23}\]  
It should be noted that the extended reference state naturally arises without the need for further calculation, as steady-state operation corresponds to a null incremental state. The controller is subsequently described as follows:  
\[\begin{split}\Delta u(k)=K(x_{ar}-x_{a}(k))&=\left[\begin{array} []{cc}K_{y}&K_{x}\end{array}\right]\left(\left[\begin{array}{c}y_{r}\\ 0\end{array}\right]-\left[\begin{array}{c}y(k)\\ \Delta x(k)\end{array}\right]\right)\\ &=\left[\begin{array}{cc}K_{y}&K_{x}\end{array}\right]\left[\begin{array}{ c}y_{r}-y(k)\\ -\Delta x(k)\end{array}\right]\end{split} \tag{24}\]  
where \(K\in\Re^{(p\times(q+n))}\), \(K_{y}\in\Re^{(p\times q)}\) y \(K_{x}\in\Re^{(p\times n)}\), and the control action is:  
\[u(k)=u(k-1)+\Delta u(k) \tag{25}\]  
The Equation (25) is obtained from (8). It should be noted that the control action is calculated incrementally (24), which is equivalent to applying an integral action. Furthermore, if the feedback system is stable and steady-state is achieved, the following condition holds:  
\[\lim_{k\rightarrow\infty}\Delta u(k)=0,\lim_{k\rightarrow\infty}\Delta x(k)=0\]and, thus,  
\[\lim_{k\rightarrow\infty}\Delta K_{y}(y_{r}-y(k))=0\]  
Then, if \(K_{y}\) is of rank \(q\), it is verified that \(\lim_{k\rightarrow\infty}y(k)=y_{r}\). Therefore, the controlled system has a steady-state error equal to zero. Since the goal is to apply the LQR to each of the systems defined in the incremental T-S state-space model, the controller would be defined as follows:  
\[\begin{split}\text{S}^{(i_{1},\ldots i_{m})}:\text{ If }z_{1}(k)\text{ is }M_{1}^{i_{1}}\text{ and } \ldots\text{ and }z_{m}(k)\text{ is }M_{m}^{i_{m}},\text{ then}\\ \Delta u(k)=K^{(i_{1},\ldots i_{m})}((x_{ar}-x_{a}(k)))\end{split} \tag{26}\]  
whose control action is (25).