# Rolling-Element Bearing Fault Diagnosis Using Advanced Machine Learning-Based Observer
## 4 Proposed Algorithm for Fault Diagnosis in Rolling-Element Bearing
### Advance Sliding Mode Observer for Fault Estimation
\begin{array}{c}\overline{\hat{J}}_{s-HSMO}(k+1)=\Big{[}\sigma_{s} \overline{\hat{J}}_{s-HSMO}(k)+\sigma_{o}\overline{\hat{J}}_{o-HSMO}(k)\Big{]} +\overline{\hat{\varphi}}_{HSMO}(k)+\\ \sigma_{p}\Big{(}J_{o}(k)-\overline{\hat{J}}_{o-HSMO}(k)\Big{)}+\sigma_{HSM} sgn\Big{(}\Big{(}J_{o}(k)-\overline{\hat{J}}_{o-HSMO}(k)\Big{)}\Big{)}^{\frac{2}{3}}\\ \overline{\hat{J}}_{o-HSMO}(k+1)=(\lambda)^{T}\overline{\hat{J}}_{s-HSMO}(k)\\ \overline{\hat{J}}_{s-HSMO}(k)=J_{s}(k)-\hat{J}_{s-HSMO}(k)\\ \overline{\hat{J}}_{o-HSMO}(k)=J_{o}(k)-\hat{J}_{o-HSMO}(k)\end{array} \right.. \tag{27}\]  
Here, \(\overline{\hat{J}}_{s-HSMO}(k),\overline{\hat{J}}_{o-HSMO}(k)\), and \(\overline{\hat{\varphi}}_{HSMO}(k)\) are the state-estimation error, measured output estimation error, and fault estimation error based on the advanced SMO, respectively. Therefore, to guarantee the stability and robustness, the sliding surface slope coefficients are represented by the following equations [6]. \[\left\{ \begin{array}{c}\sigma_{x_{0}}=1.1\times\Gamma\\ \sigma_{HSM}=1.9\times\sqrt[3]{\Gamma}\\ \sigma_{x}=1.5\times\sqrt[3]{\Gamma}\end{array} \right.. \tag{28}\]  
Here, \(\Gamma\) is an estimation error bounded and based on Equation (26), it can be determined by the nonlinear part of the estimation error performance. Though there is an improvement in the robustness and the attenuation of the chattering based on the ASMO for FEDI, this fails to improve the fault estimation accuracy. Therefore, the T-S fuzzy algorithm is used to improve the ASMO. The T-S fuzzy technique is represented based on the following equation [42]. \[\alpha_{f}(k)=\left\{ \begin{array}{c}if\ r_{x}(k)\ \text{is}\ TH_{n}\ \text{then}\ \alpha_{f}(k+1)=\alpha_{f}(k)+\varsigma_{n}\Big{(}J_{o}(k)-\hat{J}_{o-HSMO}(k) \Big{)}\\ if\ r_{x}(k)\ \text{is}\ TH_{f}\ \text{then}\ \alpha_{f}(k+1)=\alpha_{f}(k)+ \varsigma_{f}\Big{(}J_{o}(k)-\hat{J}_{o-HSMO}(k)\Big{)}\end{array} \right.. \tag{29}\]Here, \(r_{x}(k),\alpha_{f},\ TH_{n},\ TH_{f}\), and \((\varepsilon_{n},\varepsilon_{f})\) are the residual signal, fuzzy estimation function, threshold value for the normal condition, threshold value for the faulty condition, and normal and abnormal coefficients for the T-S fuzzy observer, respectively. Therefore, the proposed advanced fuzzy SMO and the fault estimation are represented in Equations (30) and (31). \[\left\{ \begin{array}{c}\hat{J}_{s-fHSMO}(k+1)=\left[\sigma_{s}\hat{J}_{s-fHSMO }(k)+\sigma_{o}\hat{J}_{o-fHSMO}(k)+\sigma_{i}\hat{J}_{i}(k)\right]+\phi_{fHSMO }(k)+\\ \sigma_{p}\left(J_{o}(k)-\hat{J}_{o-fHSMO}(k)\right)+\sigma_{fHSMO}\hat{sgn} \left|\left(J_{o}(k)-\hat{J}_{o-fHSMO}(k)\right)\right|^{\frac{2}{3}}+\alpha_{ f}(k)\\ \hat{J}_{o-fHSMC}(k+1)=\left(\lambda\right)^{T}\hat{J}_{s-fHSMO}(k)\end{array}  \right., \tag{30}\]  
\[\left\{ \begin{array}{c}\hat{\phi}_{fHSMO}(k+1)=\hat{\phi}_{fHSMO}(k)+\sigma _{p}\left(J_{o}(k)-\hat{J}_{o-fHSMO}(k)\right)+\sigma_{fHSMO}\times sgn\\ \left(J_{o}(k)-\hat{J}_{o-fHSMO}(k)\right)+\sigma_{x}\|J_{o}(k)-\hat{J}_{o- fHSMO}(k)\|^{0.5}sgn\left(J_{o}(k)-\hat{J}_{o-fHSMO}(k)\right)-\delta\\ \hat{\delta}=\sigma_{x_{0}}\times sgn\left(J_{o}(k)-\hat{J}_{o-fHSMO}(k)\right) \end{array} \right.. \tag{31}\]  
Here, \(\hat{J}_{s-fHSMO},\hat{J}_{o-fHSMO},\hat{\phi}_{fHSMO}\), and \(\sigma_{fHSMO}\) are the advanced fuzzy sliding mode system state estimation, advanced fuzzy sliding mode output estimation, advanced fuzzy sliding mode fault estimation, and coefficients, respectively. After estimating the output based on the proposed AFSMO, the residual signal can be calculated as follows:  
\[r_{x}(k)=J_{o}(k)-\hat{J}_{o-fHSMO}(k). \tag{32}\]  
Figures 5-7 illustrate the residual signal in normal and abnormal conditions based on the SMO, ASMO, and AFSMO (the proposed method). Based on these figures, the difference between various states of signals in the AFSMO is more clear than those of the ASMO and SMO. In the next part, the procedure of fault detection and identification is performed and described using the decision tree machine learning technique.