## 3 Fault Diagnosis: Machine Learning-based Adaptive Neuro High-Order Variable Structure Observer
### Adaptive Neuro High-Order Variable Structure Observer
The HVSO reduces high-frequency oscillations in the classical VSO, but suffers in terms of accuracy for signal estimation and fault identification. To improve signal estimation and reduce estimation error in the HVSO, use of a neural network (NN) is recommended. Thus, a three-layer NN with a nonlinear hidden layer and a linear output layer is used to improve the observation-based signal estimation, creating a neuro HVSO (NHVSO). The activation function based on the tangent hyperbolic and the derivative of the function can be defined through the following equations, respectively [27]:  
\[g(x)=2\bigg{(}\frac{1}{1+e^{x}}\bigg{)}-1, \tag{13}\]  
\[\dot{g}(x)=\frac{1-g^{2}(x)}{2}. \tag{14}\]  
The NN-based LPF torque is represented by the following equation:  
\[\hat{\tau}_{LPF,NN,k}=\left[\sum_{n=1}^{m}\omega_{nk}^{2}\left(2\bigg{(}\frac{ 1}{1+e^{-\sum\omega_{n}^{1}\gamma_{j}+b_{x}^{1}}}\bigg{)}-1\right)\right]+{b_ {k}}^{2}. \tag{15}\]  
Here, \(\hat{\tau}_{LPF,NN,k},\omega_{n\gamma}^{1},\omega_{nk}^{2},b_{n}^{1},b_{x}^{2 },x_{j}\), and \(m\) are the estimated filtered torque for every joint based on the neural network algorithm, the weight of the first layer, the weight of the second layer, the input and the number of hidden layer neurons, respectively. To optimize the biases and weights of the NN robot dynamic estimation, a backpropagation algorithm (BP) is applied. Thus, the following equation is used to represent the NHVSO in the robot manipulator to improve the estimation accuracy in the HVSO:  
\[\left\{ \begin{array}{c}\hat{X}_{1-NHVSO}=\hat{X}_{2}+\mu_{1}sgn\big{(}X_{1}- \hat{X}_{1}\big{)}^{\frac{3}{3}}\ sgn\big{(}X_{1}-\hat{X}_{1}\big{)}\,,\\ \hat{X}_{2-NHVSO}=\hat{\alpha}^{-1}\big{(}\hat{X}_{1}\big{)}\hat{\tau}_{LPF,NN, k}+\hat{\alpha}^{-1}\big{(}\hat{X}_{1}\big{)}\hat{\beta}\big{(}\hat{X}_{1} \big{)}+\hat{\gamma}\big{(}\hat{X}_{1}\big{)}+\hat{\alpha}^{-1}\hat{\Theta}_{ NHVSO}+\\ \mu_{2}sgn\Big{(}\hat{X}_{1}-\hat{X}_{2}\Big{)}+\mu_{6}\|X_{1}-\hat{X}_{1}\|^ {\frac{1}{2}}sgn\big{(}\hat{X}_{1}-\hat{X}_{2}\big{)}-\Delta,\\ \Delta=-\mu_{5}sgn\big{(}X_{1}-\hat{X}_{1}\big{)},\\ \hat{Y}_{NHVSO}=\big{(}e^{T}\big{)}\hat{X}_{1}\end{array} \right., \tag{16}\]  
The fault can be estimated based on the NHVSO and represented by the following equation:  
\[\hat{\Theta}_{NHVSO}=\mu_{3}sgn\big{(}X_{1}-\hat{X}_{1}\big{)}+\mu_{7}\|X_{1} -\hat{X}_{1}\|^{\frac{1}{2}}sgn\big{(}X_{1}-\hat{X}_{1}\big{)}. \tag{17}\]  
Here, \(\big{(}\hat{X}_{1-NHVSO},\hat{X}_{2-NHVSO}\big{)},\hat{Y}_{NHVSO},\) and \(\hat{\Theta}_{NHVSO}\) are the observation state estimation based on the NHVSO, the estimated output based on the NHVSO, and the fault estimation based on the NHVSO technique, respectively. To increase robustness and reliability in the presence of unknown parameters, system uncertainties and faulty conditions, the adaptive (online tuning) technique is added to the NHVSO to produce the proposed ANHVSO. From Equation (17), \(\mu_{3}\) and \(\mu_{7}\) are the main coefficients used to estimate the signals and faults in unknown conditions. To optimize these coefficients, the adaptive technique, based on a fuzzy algorithm, is implemented as follows:  
\[\left\{ \begin{array}{c}\mu_{3-New}=\mu_{3}\times\Upsilon\\ \mu_{7-New}=\mu_{7}\times\Upsilon\end{array} \right., \tag{18}\]  
where \(\big{(}\mu_{3-New},\mu_{7-New}\big{)}\) and \(\Upsilon\) are the adaptive tuning coefficients for improving the fault and signal estimation accuracy, and the output of the fuzzy technique that is used to tune the NHVSO coefficients. The proportional and derivative (PD) Mamdani-based fuzzy technique is used to design an adaptive technique. This technique has two inputs (error (e) and the derivative of the error (e)) and one output (\(\Upsilon\)). The membership functions of the fuzzy set for tuning the fault and signal estimation coefficients for (e) in the interval \(\left[ \begin{array}{cc}-0.6,&0.6\end{array}