## 3 Discrete Time Sliding Mode Control with Type-2 Fuzzy Compensation
Now considering the relation \(kTt(k+1)T\) to be valid:  
\[f_{n}(t)=f_{n}(kT)\text{ and }\mathbf{u}_{c}(t)=\mathbf{u}_{c}(kT) \tag{19}\]  
considering \(V(k)\) to be a state vector with \(A_{dis}\) as a state matrix; moreover, \(A_{dis}=e^{A_{D}T}\) and \(B_{dis}\) = input vector, \(B_{dis}=\left(\int e^{A_{D}T}d\tau\right)B_{D}\), \(\mathbf{u}_{c}(k)\) = scalar input, \(F_{kn}(Z(k))\) = model uncertainty matrix and \(f_{dn}(k)\) = nonlinearity involved in cutting forces and frictional forces; using Equation (18), the discretized model is [48; 49]:  
\[V(k+1)= A_{dis}Z(k)\!+\!B_{dis}\mathbf{u}_{c}(k)\!+\!F_{kn}(Z(k))\!+\!f_{dn}(k) \tag{20}\]  
From Equation (20), the discrete time model is:  
\[V(k+1)= A_{dis}V(k)\!+\!B_{dis}\mathbf{u}_{c}(k)\!+\!F_{kn}(Z(k))\!+\!f_{dn}(k) \tag{21}\]  
From the viewpoint of preciseness and for the introduction fuzzy system to compensate nonlinearities, the following step is considered:  
\[V(k+1)= j\left[z(k)\right]+h\left[z(k)\right]\mathbf{u}_{c}(k) \tag{22}\]  
where \(j\left[z(k)\right]=A_{dis}V(k)\!+\!F_{kn}(Z(k))\!+\!f_{dn}(k)\) and \(h\left[z(k)\right]=B_{dis}\), \(A_{dis}\) and \(B_{dis}\) are unknown and \(F_{kn}(Z(k))+f_{dn}(k)\) is nonlinear. So the terms \(j\left[z(k)\right]\) and \(h\left[z(k)\right]\) will be modeled using the type-2 fuzzy logic technique. The type-2 fuzzy sets have a greater capability of modeling big magnitude uncertainties with minimal fuzzy rules when compared to the type-1 fuzzy sets. The concept of membership functions in type-2 fuzzy systems is that it is no longer a crisp value and is considered to be in the interval of \(\left[0,1\right]\)[26]. The fuzzy rules are defined as follows:  
\[ \begin{array}{l}\text{R}^{i}\text{: IF }\left(x_{i}\text{ is }A_{1i}\right)\text{ and }\left(y_{i}\text{ is }A_{2i}\right)\text{ and }\left(\dot{x}_{i}\text{ is }A_{3i}\right)\text{ and }\left(\dot{y}_{i}\text{ is }A_{4i}\right)\\ \text{ THEN }\left(f\left[z(k)\right]\text{ is }B_{1i}\right)\\ \text{R}^{i}\text{: IF }\left(x_{i}\text{ is }A_{1i}\right)\text{ and }\left(y_{i}\text{ is }A_{2i}\right)\text{ and }\left(\dot{x}_{i}\text{ is }A_{3i}\right)\text{ and }\left(\dot{y}_{i}\text{ is }A_{4i}\right)\\ \text{ THEN }\left(g\left[z(k)\right]\text{ is }B_{2i}\right)\end{array}  \tag{23}\]  
where the type-2 fuzzy sets are represented by the terms \(A_{1i}\cdots,A_{ii}\), \(B_{1i}\), \(B_{2i}\). If \(G_{A}\) is the membership function, then the type-2 fuzzy set \(A\) is expressed as:  
\[A=\left\{(x,\varsigma),G_{A}(x,\varsigma)\mid\forall x\varepsilon R,\forall \varsigma\varepsilon M_{x}\subseteq\left[0,1\right]\right\} \tag{24}\]  
with \(\varsigma\) as an auxiliary variable and \(M_{x}\) as a primary membership function validating the relation \(0G_{A}(x,\varsigma)1\). The type-2 fuzzy logic system with \(j\)th output can be expressed as:  
\[fuz_{j}=\frac{y_{rj}+y_{lj}}{2}=\frac{1}{2}\left[(\phi_{rj}^{T}(z)w_{rj}(z(k))+ \phi_{lj}^{T}(z)w_{lj}(z(k))\right] \tag{25}\]where \(y_{lj}=\frac{\sum_{i=1}^{p}f_{lj}^{i}y_{lj}+\sum_{i=1}^{p}f_{lj}^{i}y_{lj}}{\sum_{i=1 }^{q}f_{i}^{i}+\sum_{i=1}^{q}f_{l}^{i}},y_{lj}=\frac{\sum_{i=1}^{p}f_{lj}^{i}y_{ ij}+\sum_{i=1}^{p}f_{lj}^{i}y_{ik}}{\sum_{i=1}^{q}f_{i}^{i}+\sum_{i=1}^{q}f_{l}^{i}},q_{lj }^{i}=\frac{f_{lj}^{i}}{\sum_{i=1}^{q}f_{i}^{i}+\sum_{i=1}^{q}f_{l}^{i}},\text{ and }q_{rj}^{i}=\frac{f_{lj}^{i}}{\sum_{i=1}^{q}f_{i}^{i}+\sum_{i=1}^{q}f_{l}^{i}}.\]  
Again, \(f_{l}^{i}\) and \(f_{r}^{i}\) are the firing strengths associated with \(y_{lj}^{i}\) and \(y_{rj}^{i}\) of the \(i\)-th rule. So the compensation technique for \(j\left[z(k)\right]\) and \(h\left[z(k)\right]\) are applied as follows:  
\[ \begin{array}{l}\hat{j}=\frac{1}{2}w_{rf}(k)\phi_{rf}^{T}[z(k)]+\frac{1}{2} w_{lf}(k)\phi_{lf}^{T}[z(k)]\\ \hat{h}=\frac{1}{2}w_{rg}(k)\phi_{rg}^{T}[z(k)]+\frac{1}{2}w_{lg}(k)\phi_{lg}^ {T}[z(k)]\end{array}  \tag{26}\]  
For Equation (26), the following learning laws are implemented:  
\[