# Failure Identification Method and LMI-Based Control System for Small Spacecraft
## 4 Reaction Wheels Failure Identification and Control Correction  
In this section, the observer design for the failure and disturbances estimation is addressed. First, a sliding mode observer is designed to detect and identify the failure in the actuation systems. Then, a second sliding mode observer is designed to estimate the disturbances acting on the spacecraft. Finally, the disturbances are coupled with the control input in order to improve the controller performance. The problem of fault diagnosis can be seen as the problem of identifying and reconstructing unknown inputs. The identification of the failing reaction wheel can be used to improve the controller's performance during the maneuver. Considering the following nonlinear system described by  
\[x^{(n)}=g(x,t)\]  
where \(g(x,t)\) is a nonlinear, uncertain function and \(x_{1}\) is the measurement. The [PERSON]'s observer [34] is defined as  
\[ \begin{cases}\dot{\hat{x}}_{1}=-\alpha_{1}e_{1}+\hat{x}_{2}-k_{1}\text{sign}(e _{1})\\ \dot{\hat{x}}_{2}=-\alpha_{2}e_{1}+\hat{x}_{3}-k_{2}\text{sign}(e_{1})\\ \ldots\quad\ldots\\ \dot{\hat{x}}_{n}=-\alpha_{n}e_{1}+\hat{g}-k_{n}\text{sign}(e_{1})\end{cases}  \tag{7}\]  
where \(\alpha_{i}\) is chosen to ensure asymptotic error decaying when \(k_{i}=0\); for a Luenberger observer [27; 35], \(e_{1}=\hat{x}_{1}-x_{1}\) is the observer output error, and \(\hat{g}\) is an estimation of \(g(x,t)\). The ability to generate a sliding motion between the measured plant output and the output of the observer ensures that a sliding mode observer produces a set of state estimates that are precisely commensurate with the actual output of the plant [36; 37; 38]. The reaction wheel fault has been estimated while considering a fault model within the reaction wheels dynamics as  
\[\dot{h}_{tru}=\tau+f \tag{8}\]where \(f\in\mathbb{R}^{4}\) represents the faulty function. The estimation of the faulty function is addressed by the SMO. Considering the angular momentum of each reaction wheel as the observer input, it is possible to identify when a reaction wheel is failing, and it is possible to reconstruct the fault signal. Starting from Equations (7) and (8), the SMO is designed as  
\[ \begin{cases}\dot{h}_{rw}=\tau+\dot{f}+k_{1}\text{sign}(h_{rw}-\dot{h}_{rw})\\ \dot{f}=k_{2}\text{sign}(h_{rw}-\dot{h}_{rw})\end{cases}  \tag{9}\]  
A secondary observer is designed to estimate the disturbances acting on the spacecraft dynamics. First, the ideal behavior of each reaction wheel is supposed so as to have  
\[\dot{h}_{rw}^{*}=\tau\]  
Then, after the failure case is determined from the output of Equation (9), it is included in the reaction wheels model as  
\[\dot{h}_{rw}^{*}=\hat{\Delta}\tau \tag{10}\]  
The secondary SMO is designed as  
\[ \begin{cases}\dot{\omega}=J^{-1}\Big{[}-Z\tau+\hat{d}-\omega\times(J\omega+Zh_ {rw}^{*})\Big{]}+k_{3}\text{sign}(\omega-\hat{\omega})\\ \hat{d}=k_{4}\text{sign}(\omega-\hat{\omega})\end{cases}  \tag{11}\]  
where \(\hat{d}\in\mathbb{R}^{3}\) is the estimation of the disturbances acting on the spacecraft; it takes into account the external disturbances and failure. Considering the ideal case, with \(u_{ext}=0\), the disturbances should match the effects of the fault signal \(\hat{f}\), and this is true if Equation (10) matches the correct failure case. Evidence regarding this is provided in Figure 2 where the failure is estimated from \(\hat{d}\) as \(-Z^{+}\hat{d}\) while assuming different failure cases in the observer model. The left plot from Figure 2 shows the failure estimation from Equation (9) and reports the first reaction wheel failing. The spikes are due to reaction wheels dynamics and the delay generated by the filter between the torque application and angular momentum change. This effect is not present in the other plots, as the observer takes advantage of an ideal reaction wheel model. The center plot shows the failure estimation from Equation (11) assuming no failure, which achieves no matching with the failure case.