## 5 Simulation Results
### Fault Detection Results  
Figure 5 shows the detailed signal processing of residual-based fault detection. The yaw residue result is not considered, since it is sensitive to the unexpected yaw motion induced by loss of efficiency (LOE) or rotor failure. In our case, slight LOE is not classified to an actuator fault since the quadrotor at this situation still has the ability to complete the flight mission. Parameters for the upper and lower boundary discussed in Section 4.1 are set to be Table 2.  
In Figure 6, the fault is detected at 4.12 s when it is set to happen at 3.9 s, where the blue and black lines represent \(r_{i}^{u}\) and \(r_{i}^{\ell}\), respectively. The reaction time is about 0.22 s with the parameter set in Table 2. After getting result, the fault signal would be filtered by a moving average. \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline  & \multicolumn{3}{c}{**Lower Bound**} & \multicolumn{3}{c}{**Upper Bound**} & \multicolumn{1}{c}{**T(s)**} \\ \hline
**State** & \(K_{\ell 1i}\) & \(K_{\ell 2i}\) & \(K_{\ell 3i}\) & \(K_{\mu 1i}\) & \(K_{\mu 2i}\) & \(K_{\mu 3i}\) & \\ \hline \(\phi\), \(\theta\) & 1 & 0.05 & 0.0004 & 1 & 0.05 & 0.0004 & 0.015 \\ \hline \(x\), \(y\), \(z\) & 1 & 0.05 & 0.002 & 1 & 0.05 & 0.002 & 0.015 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Gain selections for the adaptive residue boundary. Figure 5: Flow chart of residue based fault detection process. In order to prevent outliers during the fault estimation process, the moving average method is also applied, where the parameters are shown in Table 3. The fault estimation method performs well under slow time varying fault. Meanwhile, with the implement of moving average, the chance of accidental triggering of fault alarm could be reduced. As the fault signal is being processed by moving average, the threshold illustrated in Table 3 would separate the result into Boolean logic answers that represent whether a fault happened or not. In Figure 7, it is regarded as normal flight when the Flag is 1. Due to the convergent property of the observer, a fault detection result based on residue generation is accurate only around the time that the fault happens. As one can see, some switching between normal and abnormal judgment appears around the fault occurrence time. After taking a moving average, the fault detection results act much better. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Method** & **Moving Window** & **Threshold** \\ \hline residue estimation & & \\ from the 1 st observer & & \\ fault estimation & & \\ from the 2 nd observer & & \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Parameters of the moving average. Figure 6: Residual responses for fault detection. As one could see in Figure 8, the estimated fault becomes smoother, which reduces the chance of accidental triggering. On the other hand, the control law of the quadrotor would be modified, which releases yaw control, right after a fault happens. The unexpected yaw motion would affect the fault estimation result. Thus, the strategy is to take the biggest component of the estimated fault and examine it by using a threshold. In Figure 9, it is regarded as a fault happening when the estimated fault exceeds the threshold. Figure 8: Comparison of fault estimation with estimated fault processed by a moving average. Figure 7: Fault signal filtered by moving average. Figure 10 shows fault judgement results of different cases. The solid line denotes the flag representing the result of the fault judgement, where the Boolean '1' represents normal flight, and '0' represents a detected fault. The transparent blocks are the time when the fault condition is acting on the rotor, where the yellow one denotes the LOE case, and the red one denotes the rotor broken case. The transparent green region denotes the time when a gust disturbance is acting as a perturbation on the quad-rotor.