## 3 Fault Diagnosis: Machine Learning-based Adaptive Neuro High-Order Variable Structure Observer
### Fault Tolerant Control Using an Adaptive Modern Fuzzy Backstepping Variable Structure Controller  
After designing a machine learning (SVM)-based ANHVSO for fault detection and identification, an active, modern, adaptive, fuzzy, backstepping, variable structure controller (AMFBVSC) is designed for fault tolerance. Based on Figure 1, the fault-tolerant control (FTC) algorithm for a robot manipulator has the following sub-blocks: (i) A robust backstepping variable structure controller (BVSC) for FTC is implemented. (ii) To reduce the effects of system uncertainties, a new fuzzy BVSC (FBVSC) based on the PID fuzzy technique is designed and implemented. (iii) To reduce the effect of faults and chattering, an SVM-based ANHVSO is used in parallel with the FBVSC and the new FBVSC (MFBVSC). (iv) To increase robustness and reduce chattering in faulty conditions, an adaptive algorithm is used for the online tuning of the coefficient in the MFBVSC to design the AMFBVSC. Based on [28], the mathematical definition of the VSC technique is obtained by the following equation:  
\[\left\{ \begin{array}{c}U_{VSC}=U_{f}+U_{M}\\ U_{f}=\hat{a}\big{(}\hat{X}_{1}\big{)}\times\left[\mu_{1}sgn\big{(}X_{1}-\hat{X }_{1}\big{)}+\mu_{2}sgn\big{(}X_{2}-\hat{X}_{1}\big{)}\right]\\ U_{M}=\hat{a}\big{(}\hat{X}_{1}\big{)}\times\left[\hat{\beta}\left(\begin{array} []{cc}\hat{X}_{1}&\hat{X}_{2}\\ \end{array}\right)+\gamma\big{(}\hat{X}_{1}\big{)}+\mu_{1}\frac{d}{dt}\Big{(} \big{(}X_{1}-\hat{X}_{1}\big{)}+\Big{(}X_{2}-\hat{X}_{1}\big{)}\Big{)}\Big{]} \times\hat{a}^{-1}\big{(}\hat{X}_{1}\big{)}\\ \hskip 142.26378 pt+\hat{a}^{-1}\big{(}\hat{X}_{1}\big{)}\hat{\Theta}_{ANHVSO} \end{array} \right.. \tag{41}\]  
where \(U_{VSC},U_{f},\) and \(U_{M}\) are the VSC output, the function based on the VSC, and the dynamic model based on the VSC, respectively. To improve robustness and unmodeled disturbance, a backstepping technique is used in parallel with the VSC and the designed BVSC. \[U_{BVSC}=U_{VSC}+U_{B} \tag{42}\]  
Here, \(U_{BVSC},\) and \(U_{B}\) are the BVSC output and the backstepping technique to find the robot output, respectively. In order to obtain an accurate response and a finite-time convergence based on the BVSC, the sliding surface is defined as the following equation. \[\left\{ \begin{array}{c}S=\int(k_{1}e+k_{2}\hat{e})\\ e=\Big{(}X_{1}-\hat{X}_{1}\Big{)}\end{array} \right.. \tag{43}\]  
Here, \(k_{1}\) and \(k_{2}\) are coefficients. The integral term is used to reduce the effect of the transient response and to reduce the steady state error. Therefore, when the sliding surface \(S\) converges to zero, we have:  
\[S=k_{1}e+k_{2}\hat{e}=0 \tag{44}\]The first and second derivative of the sliding surface can be defined as follows:  
\[\left\{ \begin{array}{l}\dot{S}=k_{1}e+k_{2}\dot{e}\\ \ddot{S}=k_{1}\dot{e}+k_{2}\dot{e}\end{array} \right., \tag{45}\]  
Therefore, based on Equations (43) and (45), the order of the system is changed from second-order to third-order. \[\left\{ \begin{array}{l}\dot{S}_{1}=S_{2}\\ \dot{S}_{2}=S_{1}\\ \dot{S}_{3}=\frac{d}{dt}\big{(}k_{1}\dot{e}+k_{2}\times\left[\alpha^{-1}(X_{1 })\tau_{LPF}+\alpha^{-1}(X_{1})\beta\Big{(}\begin{array}{cc}X_{1}&X_{2}\end{array} \end{array} \right)+\gamma(X_{1})+\alpha^{-1}\Theta-\ddot{X}_{1}\big{]}\right)^{ \prime}, \tag{46}\]  
To design an effective control input of system (46), and based on (42), the backstepping technique is proposed. Therefore, the Equation (46) can be rewritten by:  
\[\left\{ \begin{array}{l}\delta_{1}=S_{1}\\ \delta_{2}=S_{2}-\alpha_{1}\\ \delta_{3}=S_{3}-\alpha_{2}\end{array} \right., \tag{47}\]  
where \(\alpha_{1}\) and \(\alpha_{2}\) are virtual controllers. Hence, the derivative of \(\delta_{1}\) can be defined by:  
\[\left\{ \begin{array}{l}\dot{\delta}_{1}=\dot{S}_{1}=\delta_{2}+\alpha_{1}\\ if\ \alpha_{1}=-\zeta\delta_{1},\ \ \zeta>0\end{array} \right., \tag{48}\]  
The Lyapunov function and the derivative of the Lyapunov function can be introduced:  
\[\left\{