## 4 Fault Detection
### Fault Detection Based on Residue Generation  
Define the state variables to be:  
\[\mathbf{x}=\left[ \begin{array}{cccccccccccc}x_{1}&x_{2}&x_{3}&x_{4}&x_{5}&x _{6}&x_{7}&x_{8}&x_{9}&x_{10}&x_{11}&x_{12}\end{array} \right]^{T} \tag{31}\]  
where:  
\[\left[ \begin{array}{cccccccccccc}x_{1}&x_{2}&x_{3}&x_{4}&x_{5}&x_{6}\end{array}  \right]^{T}=\left[ \begin{array}{cccccccccccc}\phi&\theta&\psi&x&y&z\end{array}  \right]^{T}\]  
With Equations (2) and (7), the governing equations in state space form could be obtained and written as:  
\[\left\{ \begin{array}{l}\dot{\mathbf{x}}=\mathbf{A}\mathbf{x}+\mathbf{h}( \mathbf{x})+\mathbf{B}(\mathbf{x})\mathbf{\Lambda}[\mathbf{I}-\mathbf{\alpha}] \mathbf{F}+\boldsymbol{\gamma}(t)\\ \mathbf{y}=\mathbf{C}\mathbf{x}\end{array} \right. \tag{32}\]where \(\mathbf{h}\) consists of nonlinear terms, denotes the force distribution matrix, \(\mathbf{F}\) denotes thrust of each propeller, \(\mathbf{\gamma}\) represents disturbance, and \(\boldsymbol{\alpha}\) denotes actuator fault residual signal. The rest system matrices are defined as follows:  
\[\mathbf{A}=\left[ \begin{array}{cc}0_{6\times 6}&\mathbf{I}_{6\times 6}\\ 0_{6\times 6}&0_{6\times 6}\end{array} \right]\ \mathbf{h}(\mathbf{x})=\left[ \begin{array}{cc}0_{6\times 1}\\ \left[\begin{array}{cc}0&0&g\end{array}\right]^{T}\\ \dot{\mathbf{H}}(\mathbf{x})\mathbf{H}^{-1}(\mathbf{x})\dot{\mathbf{\eta}}- \mathbf{H}(\mathbf{x})\mathbf{J}^{-1}\mathbf{P}(\mathbf{x})\end{array} \right], \ \mathbf{C}=\mathbf{I}\]  
\[\mathbf{B}(\mathbf{x})=\left[ \begin{array}{cc}0_{6\times 6}\\ \mathbf{H}(\mathbf{x})\mathbf{J}^{-1}&0_{3\times 3}\\ 0_{3\times 3}&\frac{1}{m}\mathbf{R}(\mathbf{x})\end{array} \right]\left[ \begin{array}{cccc}0&1&0&0\\ 0&0&1&0\\ 0&0&0&1\\ 0&0&0&0\\ 1&0&0&0\end{array} \right]\boldsymbol{\alpha}=\left[ \begin{array}{cccc} \alpha_{1}&0&0&0\\ 0&\alpha_{2}&0&0\\ 0&0&\alpha_{3}&0\\ 0&0&0&\alpha_{4}\end{array} \right]\]  
\[\mathbf{A}=\left[ \begin{array}{cccc}-1&-1&-1&-1\\ -l_{w}&l_{w}&l_{w}&-l_{w}\\ -l_{l}&-l_{l}&l_{l}&l_{l}\\ -\mu&\mu&-\mu&\mu\end{array} \right],\ \mathbf{h}(\mathbf{x})=\left[ \begin{array}{cccc}0_{6\times 1}\\ \left[\begin{array}{cc}0&0&g\end{array}\right]^{T}\\ \dot{\mathbf{H}}(\mathbf{x})\mathbf{H}^{-1}(\mathbf{x})\dot{\mathbf{\eta}}- \mathbf{H}(\mathbf{x})\mathbf{J}^{-1}\mathbf{P}(\mathbf{x})\end{array} \right], \ \mathbf{C}=\mathbf{I}\]  
Since the system is fully observable, the observer could be designed as follows:  
\[\left\{ \begin{array}{l}\dot{\mathbf{x}}=\mathbf{A}\dot{\mathbf{x}}+\mathbf{ h}(\mathbf{\hat{x}})+\mathbf{B}(\mathbf{x})\mathbf{\Lambda}\mathbf{F}+\mathbf{L}( \mathbf{y}-\mathbf{\hat{y}})\\ \dot{\mathbf{y}}=\mathbf{C}\dot{\mathbf{x}}\end{array} \right. \tag{33}\]  
where \(\mathbf{L}\) denotes as the observer gain with proper dimension. In order to analyze the relationship between the states and the estimated ones, the state estimation error is defined by:  
\[\mathbf{\overline{x}}=\mathbf{x}-\mathbf{\hat{x}} \tag{34}\]  
Taking the derivative of Equation (34), and bringing Equations (32) and (33) into the result gives:  
\[ \begin{array}{rl}\dot{\mathbf{\overline{x}}}&=(\mathbf{A}-\mathbf{LC}) \mathbf{\overline{x}}+\mathbf{h}(\mathbf{x})-\mathbf{h}(\mathbf{\hat{x}})- \mathbf{B}(\mathbf{x})\mathbf{\Lambda}\mathbf{\alpha}\mathbf{F}+\mathbf{ \gamma}(\mathbf{x},t)\\ &=\mathbf{A}_{o}\mathbf{\overline{x}}+[\mathbf{h}(\mathbf{x})-\mathbf{h}( \mathbf{\hat{x}})]-\mathbf{B}(\mathbf{x})\mathbf{\Lambda}\mathbf{\alpha} \mathbf{F}+\mathbf{\gamma}(\mathbf{x},t)\end{array}  \tag{35}\]  
where \(\mathbf{A}_{o}\) is a negative definite matrix with a proper pole placement via \(\mathbf{L}\). The following assumptions are imposed for the observer stability proof:  
**Assumption 1**. : _There exists a positive definite matrix, \(\mathbf{Q}\), such that there exists a positive symmetric matrix \(\mathbf{\Xi}\), which satisfies \(\mathbf{A}_{o}^{T}\mathbf{\Xi}+\mathbf{\Xi}\mathbf{A}_{o}=-\mathbf{Q}\)._  
**Assumption 2**.