# A Vibration Based Automatic Fault Detection Scheme for Drilling Process Using Type-2 Fuzzy Logic
## 2 Type-2 Fuzzy Logic Modeling Technique
For all \(p\) rules,  
\[y_{lj}=\frac{\sum_{i=1}^{p}f_{l}^{i}y^{i}_{lj}}{\sum_{i=1}^{p}f_{l}^{i}},\quad y _{rj}=\frac{\sum_{i=1}^{p}f_{r}^{i}y^{i}_{rj}}{\sum_{i=1}^{p}f_{r}^{i}} \tag{16}\]  
where \(f_{l}^{i}\) and \(f_{r}^{i}\) are the firing strengths associated with \(y^{i}_{lj}\) and \(y^{i}_{rj}\) of \(i\)-th rule. By the minimization and maximization operation, \(y_{lj}\) and \(y_{rj}\) can be expressed as  
\[y_{lj}=\frac{\sum_{i=1}^{p}f_{lj}^{i}y_{lj}+\sum_{i=1}^{p}f_{rj}^{i}y_{lk}}{ \sum_{i=1}^{q}f_{r}^{i}+\sum_{i=1}^{q}f_{l}^{i}},\quad y_{rj}=\frac{\sum_{i=1}^ {p}f_{lj}^{i}y_{rj}+\sum_{i=1}^{p}f_{rj}^{i}y_{rk}}{\sum_{i=1}^{q}f_{r}^{i}+ \sum_{i=1}^{q}f_{l}^{i}} \tag{17}\]  
where \(q^{i}_{lj}=\frac{f_{l}^{i}}{\sum_{i=1}^{p}f_{l}+\sum_{i=1}^{q}f_{l}^{i}}\), \(q^{i}_{rj}=\frac{f_{r}^{i}}{\sum_{i=1}^{p}f_{l}+\sum_{i=1}^{q}f_{l}^{i}}\). By singleton fuzzifier, the \(j\)th output of the fuzzy logic system can be expressed as  
\[\hat{f}_{j}=\frac{y_{rj}+y_{lj}}{2}=\frac{1}{2}\Big{[}(\phi_{rj}^{T}(z)w_{rj}( z)+\phi_{l}^{T}(z)w_{lj}(z)\Big{]} \tag{18}\]  
where \(j=1,2,3\). \(w_{rj}\) is the point at which \(\mu_{B_{rj}}=1\), \(w_{lj}\) is the point at which \(\mu_{B_{\bar{l}_{j}}}=1\). The plant dynamics which is nonlinear in nature can be described by employing a \(p\)-rule IT2 T-S fuzzy model [36; 38]. The rule is formulated in such a manner that the antecedent has IT2 fuzzy sets, whereas the consequent is represented by a linear dynamical system as follows:  
\[ \begin{array}{l}Rule\ j:IF\ F_{1}(z(k))\ is\ V_{1}^{j}\ AND...F_{\sqrt{p}}(z(k))\ is\ V_{\sqrt{p}}^{j}\\ \ THEN\ F_{\sqrt{p}}=Az(k)+Bu_{c}(k)\end{array}  \tag{19}\]Here, \(\hat{V}_{\alpha}^{j}\) is termed as an IT2 fuzzy logic set having a rule which is \(j\) corresponding to the function \(F_{\alpha}(z(k))\), \(\alpha=1,2,3...\Psi\), also \(j=1,2,\ldots,p\); \(\Psi\) is a positive integer. The illustration of the state vector associated with the system is represented by \(z(k)\in R^{n}\). Again, \(A\in R^{n\times n}\) and \(B\in R^{n\times m}\) are the unknown system and unknown input matrices, respectively. The input vector is illustrated as \(u_{c}(k)\in R^{m}\). The pattern of type-2 fuzzy set is [52]:  
\[ \begin{array}{c}y(z(k))=\frac{y_{rk}+y_{lk}}{2}\\ \\ =\frac{1}{2}(\xi_{rk}^{T}\odot_{rk}+\xi_{lk}^{T}\odot_{lk})\\ \\ =\frac{1}{2}[\xi_{rk}^{T}\xi_{lk}^{T}]\left[\begin{array}{c}\odot_{rk}\\ \odot_{lk}\end{array}\right]=\xi^{T}\odot\end{array}  \tag{20}\]  
where \(y_{lk}\) and \(y_{rk}\) represents the numerical illustration of left and right most points, respectively, as:  
\[ \begin{array}{c}y_{lk}=\frac{1}{\sum_{i=1}^{c}f_{i}^{2}}\sum_{z=1}^{L}f_{i}^ {z}y_{lk}^{s}\\ \\ y_{rk}=\frac{1}{\sum_{i=1}^{c}f_{i}^{2}}\sum_{z=1}^{L}f_{i}^{z}y_{rk}^{s}\\ \\ y_{lk}=\sum_{i=1}^{L}q_{lk}^{lo.}y_{lk}+\sum_{d=L+1}^{Q}q^{up.}y_{lk}\\ \\ =[Q_{lk}^{lo}\ Q_{lk}^{up}]\left[\begin{array}{c}y_{lb}^{lo}\\ y_{lk}^{T}\end{array}\right]=\xi_{lk}^{T}\odot_{lk}\end{array}  \tag{21}\]  
also, \(\xi^{T}=\frac{1}{2}[\xi_{rk}^{T}\ \xi_{lk}^{T}]\) and \(\odot^{T}=[\odot_{rk}^{T}\odot_{lk}^{T}]\) and \(f_{i}^{z},f_{i}^{z}\) termed as firing strengths of \(y_{lk}^{s}\) and \(y_{rk}^{s}\) of rule \(p\).The discrete-time nonlinear system represented by Equation (11) along with fault dynamics can be represented by an IT2 T-S fuzzy model with \(r\) rules as:  
The Rule in Details:  
If \(\delta_{1}(Z(k))\) is \(\hat{N}_{1}^{i}\)**AND**\(\ldots\ldots\)**AND**\(\delta_{p}(Z(k))\) is \(\hat{N}_{p}^{i}\)**THEN**, the discretized state space system with output will be:  
\[ \begin{array}{c}Z_{dis}(k+1)=A_{d}Z_{dis}(k)+B_{d}u_{c}(k)\\ \\ +D_{d}v(k)+f_{t}(y_{dis},\Phi),\\ \\ y_{dis}(k)=C_{d}Z_{dis}(k)\end{array}  \tag{23}\]  
where \(\hat{N}_{a}^{i}\) stated as an interval type-2 fuzzy set having rule \(i\) associated with the function \(\delta_{a}(Z(k)),i=1,2,\ldots r\), \(r\) = the number of IF-THEN rules. Again, \(a=1,2,\ldots p\), with \(p\) considered to be positive integer.