# Fault Diagnosis for a Class of Robotic Systems with Application to 2-DOF Helicopter
## 4 Study Case
### Residual Design  
The observer-based residuals are built following the method presented in Section 3.  
For the construction of the residual generator sensible to sensor fault 1, we considered the first subsystem:  
\[\dot{x}_{1} = \frac{x_{3}}{l^{2}(m_{1}+m_{2})}, \tag{49}\] \[\dot{x}_{3} = \frac{-x_{4}^{2}\sin(x_{1})}{l^{2}\text{cos}^{3}(x_{1})(m_{1}+m_{ 2})}-gl\cos(x_{1})(m_{1}-m_{2})+U_{p},\] (50) \[\dot{x}_{4} = U_{y},\] (51) \[y_{s1} = x_{1}, \tag{52}\]  
it leads to its generalized Hamiltonian representation, with  
\[\frac{\partial H}{\partial x}=[x_{1}\quad x_{3}\quad x_{4}]^{T}. \tag{53}\]  
In this mode, we have to:\[J(x) = [0]\in\mathbb{R}^{3x3}, \tag{54}\] \[S(x) = [0]\in\mathbb{R}^{3x3},\] (55) \[F(x) = \begin{bmatrix}\frac{x_{3}}{l^{2}(m_{1}+m_{2})}\\ \frac{-x_{4}^{2}\sin(x_{1})}{l^{2}\cos^{2}(x_{1})(m_{1}+m_{2})}-gl\cos(x_{1})( m_{1}-m_{2})\\ 0\end{bmatrix},\] (56) \[G = \begin{bmatrix}0&0\\ 1&0\\ 0&1\end{bmatrix},\] (57) \[C = \begin{bmatrix}1&0&0\end{bmatrix} \tag{58}\]  
The pair \((C,S)\) is detectable agree with the definition 2.1 in ref. [27] since the matrix \(\begin{bmatrix}C\\ \lambda I_{3\times 3}-S\end{bmatrix}\) is of full rank for any value of \(\lambda\) in \(\mathbb{Z}_{<0}=\{\tilde{\lambda}\in\mathbb{Z}:\ \Re\{\tilde{\lambda}\}<0\}\). So, the residual is defined from the observer,  
\[\dot{\hat{x}}_{1} = \frac{\hat{x}_{3}}{l^{2}(m_{1}+m_{2})}+L_{1}(y_{1}-\hat{x}_{1}),\] \[\dot{\hat{x}}_{3} = \frac{-\hat{x}_{4}^{2}\sin(x_{1})}{l^{2}\cos^{3}(x_{1})(m_{1}+m_{ 2})}-gl\cos(x_{1})(m_{1}-m_{2})+U_{p},\] \[\dot{\hat{x}}_{4} = U_{y},\] \[\dot{g}_{s1} = \hat{x}_{1}\]  
Note that the residual is designed from a copy of the original subsystem and the correction factor \(L_{1}(y_{1}-\hat{y}_{1})\).  
For the fault in the second sensor \((f_{s2})\), and the faults in the two actuators \((f_{a1})\) and \((f_{a2})\), the decoupling is similar to the procedure utilized in the fault \((f_{s1})\). In Table 2, a summary of the sensitivity of each one of the different faults is presented, where \(\surd\) means that the subsystem is sensitive to the corresponding fault.  
In the table we can to see that the subsystem 2 and 4 have the same sensitivity to the faults \(f_{s1},f_{s2},f_{a2}\), therefore, one of them does not provide additional information. The four residuals are obtained assuming that only one fault at a time is present, and not all of them simultaneously. A residual is obtained by considering a derivative in time, so obtaining this derivative could be a difficult task in the presence of noise. It is important to notice that the generation of residuals based on observers constitutes a reliable option to reduce noisy effects, by virtue of the inherent filtering characteristic of the observer, see ref. [24].  
The considered design allows us to isolate all single faults. However, when more than one simultaneous fault is present, an alarm can be activated, but we cannot know which faults are involved.  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline  & \multicolumn{4}{c}{**RESUDIAL**} \\ \hline
**FAULT** & \(\mathbf{r_{1}}\) & \(\mathbf{r_{2}}\) & \(\mathbf{r_{3}}\) & \(\mathbf{r_{4}}\) \\ \hline \(f_{s1}\) & \(\surd\) & \(\surd\) & \(\surd\) & \(\surd\) \\ \(f_{s2}\) & & \(\surd\) & \(\surd\) & \(\surd\) \\ \(f_{a1}\) & \(\surd\) & & \(\surd\) & \\ \(f_{