## 3 Coordinate Transformation-Based Fault-Tolerant Control  
### Controller Design  
During the loss of a single rotor, the applied torque can no longer achieve ordinary orientation control. This specific scenario could be regarded as a reduced attitude stabilization problem [37]. In order to maintain flight stability under rotor failure conditions, the control effort on yaw dynamics should be determined [38]. Meanwhile, since there is no control effort imposed on the yaw dynamics, there would be an unexpected yaw motion such that incorrect control torque vector may be induced. Thus, the flight controller in this paper consists of two parts--a coordinate transformation based outer-loop controller and an inner-loop stabilization controller illustrated in Figure 3.  
From Equation (1), it can be represented in detail by:  
\[\ddot{x}=\sin\theta\cos\phi\frac{u}{m}+\frac{1}{m}\Big{(}f_{xx}-\delta\dot{x} \Big{)} \tag{8}\]  
\[\ddot{y}=-\sin\phi\frac{u}{m}+\frac{1}{m}\Big{(}f_{uy}-\delta\dot{y}\Big{)} \tag{9}\]  
\[\ddot{z}=\cos\theta\cos\phi\frac{u}{m}+\frac{1}{m}\Big{(}f_{uzz}-\delta_{z} \dot{z}+mg\Big{)} \tag{10}\]  
For translational dynamics Equations (8)-(10), the sliding mode variables for \(x\), \(y\) and \(z\) are defined respectively as follows:  
\[s_{x}=\dot{e}_{x}+\lambda_{x}e_{x} \tag{11}\]  
\[s_{y}=\dot{e}_{y}+\lambda_{y}e_{y} \tag{12}\]  
\[s_{z}=\dot{e}_{z}+\lambda_{z}e_{z} \tag{13}\]  
By taking the derivative of Equations (11)-(13), the control law could be obtained:  
\[u_{x}=u_{xsq}+u_{xn} \tag{14}\] \[u_{y}=u_{yqq}+u_{yn}\] \[u_{z}=u=u_{zsq}+u_{zu}\]  
where:  
\[\ddot{x}=\sin\theta\cos\phi\frac{u}{m}+\frac{1}{m}\Big{(}f_{xx}-\delta\dot{x} \Big{)} \tag{8}\]0  
\[\ddot{x}=\sin\theta\cos\phi\frac{u}{m}+\frac{1}{m}\Big{(}f_{xx}-\delta\dot{x} \Big{)} \tag{8}\]1  
\[\ddot{x}=\sin\theta\cos\phi\frac{u}{m}+\frac{1}{m}\Big{(}f_{xx}-\delta\dot{x} \Big{)} \tag{8}\]2 Fault-tolerant control strategy. and:  
\[ \begin{array}{l}u_{xni}=-\rho_{x}\frac{m}{u\cos\theta\cos\phi}\Big{(}\frac{s_{x }}{|s_{x}|+\varepsilon_{x}}\Big{)}\\ u_{yn}=-\rho_{y}\frac{m}{\cos\theta\cos\phi}\Big{(}\frac{s_{y}}{|s_{y}|+ \varepsilon_{y}}\Big{)}\\ u_{zn}=-\rho_{z}\frac{m}{\cos\theta\cos\phi}\Big{(}\frac{s_{z}}{|s_{z}|+ \varepsilon_{z}}\Big{)}\end{array}  \tag{16}\]  
The parameters \(\rho_{x}\), \(\rho_{y}\) and \(\rho_{z}\) are applied switching gains, and \(\varepsilon_{x}\), \(\varepsilon_{y}\) and \(\varepsilon_{z}\) are the scaling parameters of the sigmoid function, which are used to eliminate the chattering problem of SMC. To achieve trajectory tracking control in the presence of heading variation, the virtual control inputs are applied to the \(x\) and \(y\):  
\[\theta_{d}=\tan^{-1}(u_{x}) \tag{17}\]  
\[\phi_{d}=\tan^{-1}\Big{(}u_{y}\Big{)} \tag{18}\]  
Equations (17) and (18) are described in an Earth frame, and are used to generate corrected roll and pitch commands when the heading is varying. In other words, the yaw angle obtained from measurement should be applied as a coordinate transformation to get the desired angles such that the torque can be correctly distributed even in the presence of unexpected yaw rotations. With the aid of the yaw-angle based coordinate transformation, the desired angles could be expressed in the body-fixed frame by:  
\[\left[ \begin{array}{c}\phi_{d}\\ \theta_{d}\\ \psi_{d}\end{array} \right]_{B}=\left[ \begin{array}{ccc}\cos\psi&\sin\psi&0 \\ -\sin\psi&\cos\psi&0\\ 0&0&1\end{array} \right]\left[ \begin{array}{c}\phi_{d}\\ \theta_{d}\\ \psi_{d}\end{array} \right]_{E} \tag{19}\]  
where \(B\) denotes body-fixed frame and \(E\) denotes the Earth frame. The desired angles could be obtained by Equations (17)-(19). Combining with Equation (7), the sliding variables are defined as the vector form:  
\[\mathbf{s}_{\eta}=\dot{\mathbf{e}}_{\eta}+\lambda\mathbf{e}_{\eta} \tag{20}\]  
Design the sliding control torque as follows:  
\[\mathbf{\tau}_{\eta}=\mathbf{\tau}_{\eta eq}+\mathbf{\tau}_{\eta\eta} \tag{21}\]  
where:  
\[