## 3 Discrete Time Sliding Mode Control with Type-2 Fuzzy Compensation
The equation validating the control error is:  
\[\mathbf{e}_{c}\left(k\right)=v^{d}(k)-v(k)=-v(k) \tag{35}\]  
The SMC can be illustrated as:  
\[\mathbf{u}_{c}(k)=\frac{2[K^{T}\mathbf{e}_{c}(k)-\frac{1}{2}(\omega_{rf}(k) \phi_{rf}^{T}[z(k)]+\omega_{lf}(k)\phi_{lf}^{T}[z(k)])-\sigma sign\left[s(k) \right]]}{[\omega_{rg}(k)\phi_{rg}^{T}[z(k)]+\omega_{lg}(k)\phi_{lg}^{T}[z(k )]]} \tag{36}\]  
where \(\mathbf{e}_{c}(k)=\left[\mathbf{e}_{c}(k+1-n)\cdots\mathbf{e}_{c}(k)\right]^ {T}\), The vector representing feedback gain is \(K_{G}=\left[k_{n}\cdots k_{1}\right]^{T}\in R^{n}\). The sliding mode gain and switching function are represented by \(\sigma\) and \(s(k)\), respectively, where the switching function is:  
\[s(k)=K_{G}^{T}\left[\mathbf{e}_{c}(k-1)+\frac{1}{K_{G}^{T}}\mathbf{e}_{c}(k)\right] \tag{37}\]  
Since \(\mathbf{e}_{c}(k+1)+K_{G}^{T}\mathbf{e}_{c}(k)=s(k+1)\), so:  
\[\mathbf{e}_{c}(k+1)=A_{D}\mathbf{e}_{c}(k)+B_{D}s(k+1) \tag{38}\]  
where \(A_{D}=\left[ \begin{array}{cccc}0&1&0&\cdots&0\\ 0&0&1&\cdots&0\\ \vdots&&\ddots&&\vdots\\ 0&\cdots&\cdots&0&1\\ -k_{n}&\cdots&\cdots&\cdots&-k_{1}\end{array} \right]\in R^{n\times n}\), \(B_{D}=\left[0,\cdots 0,1\right]^{T}\in R^{n\times 1}\). Now using the concept from [50], the relation \(\det\left(sI-\alpha A_{D}\right)=\alpha^{n}k_{n}+\alpha^{n-1}k_{n-1}s+\cdots+ \alpha k_{1}s^{n-1}+s^{n}\) is validated. The selection of gains are carried out in the manner of \(K_{G}=\left[k_{1}\cdots k_{n}\right]^{T}\) so that the polynomial \(\lambda^{n}+\sqrt{2}k_{1}\lambda^{n-1}+\cdots+2^{\frac{n}{2}}k_{n}\) is stable. This signifies that \(A_{D}\) is stable. If \(A_{D}\) is stable then the Lyapunov equation \(2A_{D}^{T}PA_{D}=Z-U\) has positive definite solutions for \(Z\); moreover, \(U=U^{T}>0\). Using Equations (22), (31) and (32), it can be validated that the modeling error satisfies:  
\[ \begin{array}{l}(\beta_{1}+\beta_{2})e_{m}(k+1)=\frac{1}{2}\left[\tilde{ \omega}_{rf}(k)\phi_{rf}^{T}[z(k)]+\tilde{\omega}_{lf}(k)\phi_{lf}^{T}[z(k)]+ 2\xi_{f}\right]\\ +\frac{1}{2}\left[\tilde{\omega}_{rg}(k)\phi_{rg}^{T}[z(k)]+\tilde{\omega}_{lg} (k)\phi_{lg}^{T}[z(k)]+2\xi_{g}\right]\mathbf{u}_{c}(k)\end{array}  \tag{39}\]  
Combining SMC Equation (36) and the equation of the plant, Equation (22), the system equation in closed-loop form is given by:  
\[ \begin{array}{l}v(k+1)=-\frac{1}{2}\left[\tilde{\omega}_{rf}(k)\phi_{rf}^{ T}[z(k)]+\tilde{\omega}_{lf}(k)\phi_{lf}^{T}[z(k)]+2\xi_{f}\right]\\ +K^{T}\mathbf{e}_{c}(k)-\sigma sign\left[s(k)\right]-\frac{1}{2}\left[\tilde{ \omega}_{rg}(k)\phi_{rg}^{T}[z(k)]+\tilde{\omega}_{lg}(k)\phi_{lg}^{T}[z(k)]+2 \xi_{g}\right]\mathbf{u}_{c}(k)\end{array}  \tag{40}\]Using Equation (36) and the relation \(s(k+1)=K^{T}\mathbf{e}_{c}(k)-v(k+1)\), the following equation can be validated:  
\[ \begin{array}{l}\mathbf{e}_{c}(k+1)+K^{T}\mathbf{e}_{c}(k)+\sigma sign\left[s (k)\right]=\frac{1}{2}\left[\tilde{\omega}_{rf}(k)\phi_{rf}^{T}[z(k)]+\tilde{ \omega}_{lf}(k)\phi_{lf}^{T}[z(k)]+2\xi_{f}\right]\\ \hskip 14.226378 pt+\frac{1}{2}\left[\tilde{\omega}_{rg}(k)\phi_{rg}^{T}[z(k)]+ \tilde{\omega}_{lg}(k)\phi_{lg}^{T}[z(k)]+2\xi_{g}\right]\mathbf{u}_{c}(k)\end{array}  \tag{41}\]  
Now, using Equation (39),  
\[s(k+1)+\sigma sign\left[s(k)\right]=(\beta_{1}+\beta_{2})e_{m}(k+1) \tag{42}\]  
Since \(\left|sign\left[s(k)\right]\right|\leq 1\) and \(\left|e_{m}(k+1)\right|\leq G\)  
\[\frac{1}{G}\left|s(k+1)\right|\leq\frac{\sigma}{G}+(\beta_{1}+\beta_{2}) \tag{43}\]  
where \(G\) is the upper bound of the modeling error. The fuzzy model Equation (31) design parameters are illustrated using \(\beta_{1}\) and \(\beta_{2}\). Theorem 3.1: _If the fuzzy model Equation (31) is implemented for the compensation of the the nonlinear system outlined in Equation (22) with the updated laws:_  
\[