## 3 Fault Detection Algorithm  
The objective of the fault detection algorithm is detecting relative errors between the expected output torque and the actual output torque by limited measurable output data [28]. With the increment of relative errors, the fault possibility of the robot manipulator increases. In this context, we can transform the fault detection to an identification problem of parameter \(\theta\). The relative errors between the expected output torque and the actual output torque can be represented as \(|1-\theta|\). Therefore, regarding \(\theta\) as the unknown parameter, we apply the idea of adaptive state observer (ASO) [29] to identify the value of \(\theta\). Before giving the fault detection algorithm, some assumptions are given below. The state \(x(t)\), the control \(u(t)\) and the unknown parameters \(\theta\) are bounded, i.e., \(x(t)\in\mathcal{X}\), \(u(t)\in\mathcal{U}\), and \(\theta\in\mathcal{W}\) with compact sets \(\mathcal{X}\in R^{2n}\), \(\mathcal{U}\in R^{n}\) and \(\mathcal{W}\in R^{n}\). The function \(\Phi_{0}(x)\) and \(\Phi_{1}(x)\) are Lipschitz with respect to \(x\) uniformly in \(u\), where \((u,x)\in\mathcal{U}\times\mathcal{X}\). Let the Lipschitz constants be \(L_{0}\) and \(L_{1}\), it can be obtained that  
\[\left\|\Phi_{0}(x)-\Phi_{0}(\hat{x})\right\| \leq L_{0}\left\|x-\hat{x}\right\|, \tag{3}\] \[\left\|\Phi_{1}(x)-\Phi_{1}(\hat{x})\right\| \leq L_{1}\left\|x-\hat{x}\right\|. \tag{4}\]  
In order to identify the true value of \(\theta\), we design an ASO as  
\[\left\{ \begin{aligned} \hat{x}(t)=& A\hat{x}(t)+\Phi_{0}( \hat{x})+\Phi_{1}(\hat{x},u)\hat{\theta}(t)-(S^{-1}+\mathrm{Y}(t)P(t)Y^{T}(t))C ^{T}(C\hat{x}(t)-y(t)),\\ \dot{\hat{\theta}}=&-P(t)\mathrm{Y}^{T}(t)C^{T}(C \hat{x}(t)-y(t)),\\ \dot{\mathrm{Y}}(t)=&(A-S^{-1}C^{T}C)\mathrm{Y}^{T}( t)+\Phi_{1}(\hat{x},u),\\ \dot{P}(t)=&-P(t)\mathrm{Y}^{T}(t)C^{T}\mathrm{CY}(t )+kP(t),\end{aligned} \right. \tag{5}\]  
where \(\mathrm{Y}(t)\in R^{2n\times n}\), \(P(t)\in R^{n\times n}\) are two auxiliary matrices, the symmetric positive definite matrix \(S\) is the unique solution of \(kS+A^{T}S+SA-C^{T}C=0\) with a constant \(k\), \((A-S^{-1}C^{T}C)\) is the Hurwitz matrix, \(U\) is bounded and \(\left\|\mathrm{Y}(t)\right\|\) has an upper bound. The input \(U\) is such that for any trajectory \(\hat{x}\) of system starting from \(\hat{x}(0)\in X\), the matrix \(\mathrm{CY}(t)\) is persistently exciting in the following sense: \(\exists\delta_{1},\delta_{2}>0,\exists T>0\),  
\[\delta_{1}I_{n}\leq\int_{t}^{t+T}\mathrm{Y}^{T}(\tau)C^{T}\mathrm{CY}(\tau)d \tau\leq\delta_{2}I_{n},\ \ \ \ \forall t\geq 0. \tag{6}\]  
When the observation algorithm satisfies the Assumptions 1-3, there exists a constant \(k_{0}\), such that for any \(k>k_{0}\) and initial value \((x(0),\hat{x}(0))\in X^{2}\), the mean of the estimated errors \(E(\hat{x}-x)\) and \(E(\hat{\theta}-\theta)\) converge to 0. Denote the errors between the true values of \(x,\theta\) and the observed values of \(\hat{x},\hat{\theta}\) be \(\hat{x}=\hat{x}-x\) and \(\bar{\theta}=\hat{\theta}-\theta\), we can get the derivation of errors as  
\[\left\{ \begin{aligned} \hat{x}&=(A-S^{-1}C^{T}C)\hat{x}+ \bar{\Phi}_{0}(\hat{x},x)+\bar{\Phi}_{1}(\hat{x},x)\theta+\Phi_{1}(\hat{x},u) \bar{\theta}+\mathrm{Y}(t)\hat{\theta}+(w(t)+S^{-1}C^{T}v(t)),\\ \dot{\bar{\theta}}&=-P(t)Y^{T}(t)C^{T}C\bar{x}+P(t)Y^{T} (t)C^{T}v(t),\end{aligned} \right. \tag{7}\]  
where \(\bar{\Phi}_{0}(\hat{x},x)=\Phi_{0}(\hat{x})-\Phi_{0}(x)\) and \(\bar{\Phi}_{1}(\hat{x},x)=\Phi_{1}(\hat{x},u)-\Phi_{1}(x,u)\). Denote \(\eta(t)=\hat{x}(t)-\mathrm{Y}(t)\bar{\theta}(t)\), one can derive  
\[ \begin{aligned} \hat{\eta}(t)&=\hat{x}-\dot{ \mathrm{Y}}(t)\bar{\theta}-\mathrm{Y}(t)\dot{\bar{\theta}}\\ &=(A-S^{-1}C^{T}C)\eta+\bar{\Phi}_{0}(\hat{x},x)+\bar{\Phi}_{1}( \hat{x},x)\theta+(w(t)+S^{-1}C^{T}v(t)).\end{aligned}  \tag{8}\]  
Firstly, we discuss the convergence of the system without noise signals, i.e., \(w(t)=0\), \(v(t)=0\).