## 3 Active Fault-Tolerant Control System Design
### Adaptive Sliding Mode Fault-Tolerant Controller Design  
In this part, the ASMBC is proposed in Section 3.2.1 to handle fault disturbances and time-varying actuator faults in attitude systems through adaptive law and fault estimation as seen in Section 3.1. Then, a modified ASMBC is designed to address the input constraints, which is presented in Section 3.2.2. By defining the state vector as \(\vec{x}=\left[ \begin{array}{cccccc}\phi&\dot{\phi}&\theta&\dot{\theta}&\psi& \dot{\psi}\end{array} \right]^{T}=\left[ \begin{array}{cccccc}\vec{x}_{1}&\vec{ x}_{2}&\vec{x}_{3}&\vec{x}_{4}&\vec{x}_{5}&\vec{x}_{6}\end{array} \right]^{T}\) and the control inputs vector as \(U=\left[ \begin{array}{cccccc}U_{\phi}&U_{\theta}&U_{\psi}\end{array} \right]= \left[ \begin{array}{cccccc}v_{1}&v_{2}&v_{3}\end{array} \right]\), the rotational movement equations of the quadcopter become:  
\[\left\{ \begin{array}{l}\dot{\vec{x}}_{2i-1}=\vec{x}_{2i}\\ \dot{\vec{x}}_{2i}=f_{i}(\vec{x},t)+g_{i}v_{i}(t)+\xi_{i}(\vec{x},t)+\zeta_{i} \end{array} \right. \tag{30}\]  
Let us define the desired attitude as \(\vec{x}_{i}^{d}\). The control goal is to find a control law, \(u_{i}\), such that \(\vec{x}_{2i-1}(t)\rightarrow\vec{x}_{i}^{d}\) as \(t\rightarrow\infty\), with \(i=1,\,2,\,3\). If we define the control error as:  
\[e_{i}=\vec{x}_{2i-1}-\vec{x}_{i}^{d} \tag{31}\]  
Then the first sliding surface can be described as:  
\[s_{1i}=e_{i}+k_{i}\int e_{i}dt \tag{32}\]  
where \(k_{i}\) is the positive constant. Let us now choose the Lyapunov function:  
\[V_{1i}=\frac{1}{2}s_{1i}^{2} \tag{33}\]  
The time derivative is given by:  
\[\dot{V}_{1i}=s_{1i}\dot{s}_{1i}=s_{1i}(\dot{\vec{x}}_{2i-1}-\dot{\vec{x}_{i}}^ {d}+k_{i}e_{i}) \tag{34}\]  
The virtual control input can be defined as:  
\[\alpha_{i}=\dot{\vec{x}_{i}}^{d}-k_{i}e_{i}-A_{i}s_{1i} \tag{35}\]  
Substituting the virtual control value of \(\vec{x}_{2i}\), Equation (34) becomes:  
\[\dot{V}_{1i}=-A_{i}e_{i}^{2}<0 \tag{36}\]  
then, \(e_{i}=0\) is globally asymptotically stable. The second sliding surface has a form as:  
\[ \begin{array}{l}s_{2i}&=\dot{\vec{x}}_{2i-1}-\alpha_{i}\\ &=\dot{\vec{x}}_{2i-1}+k_{i}e_{i}+A_{i}s_{1i}-\dot{\vec{x}_{i}}^{d}\\ &=\dot{e}_{i}+k_{i}e_{i}+A_{i}s_{1i}\\ &=\dot{s}_{1i}+A_{i}s_{1i}\end{array}  \tag{37}\]  
From Equations (30), (31), and (37), \(\dot{s}_{2i}\) can be written as:  
\[ \begin{array}{l}\dot{s}_{2i}&=\dot{\vec{x}}_{2i}+k_{i}\dot{e}_{i}+A_{i}\dot {s}_{1i}-\dot{\vec{x}_{i}}^{d}\\ &=f_{i}(\vec{x})+g_{i}v_{i}(t)+\xi_{i}(\vec{x},t)+\zeta_{i}\\ &+k_{i}\dot{e}_{i}+A_{i}\dot{s}_{1i}-\dot{\vec{x}_{i}}^{d}\end{array}  \tag{38}\]With the sliding surface in Equations (31) and (37), the fault-tolerant control law can be expressed as:  
\[v_{i}=\frac{1}{g_{i}}\left( \begin{array}{c}-f_{i}(x)-\xi_{i}(\overline{x},t)+ \dot{\overline{x}}_{i}^{d}-k_{i}\dot{e}_{i}\\ -A_{i}\dot{s}_{1i}-s_{1i}-\hat{\Gamma}_{i}\text{sign}(s_{2i})\end{array} \right) \tag{39}\]  
and updated by [44]:  
\[\dot{\hat{\Gamma}}_{i}=\beta_{i}|\dot{s}_{2i}| \tag{40}\]  
where \(\beta_{i}\) is a positive constant, and \(\text{sign}(. )\) denotes the sign function. By considering the [PERSON] candidate as:  
\[V_{2i}=\frac{1}{2}\frac{\overline{\Gamma}_{i}^{2}}{\beta_{i}}+\frac{1}{2}(s_{1 i}^{2}+s_{2i}^{2}) \tag{41}\]  
where \(\overline{\Gamma}_{i}=\Gamma_{i}-\hat{\Gamma}_{i}\), \(\hat{\Gamma}_{i}\) is the estimate of \(\Gamma_{i}\). Its derivative is:  
\[ \begin{array}{ll}\dot{V}_{2i}&=\frac{\overline{\Gamma}_{i}\dot{\Gamma}_{i}} {\beta_{i}}+s_{1i}\dot{s}_{1i}+s_{2i}\dot{s}_{2i}\\ &=-(\Gamma_{i}-\hat{\Gamma}_{i})|\dot{s}_{2i}|+s_{1i}(s_{2i}-A_{i}s_{1i})+s_{2 i}\dot{s}_{2i}\\ &=-A_{i}s_{1i}^{2}-\Gamma_{i}|\dot{s}_{2i}|+\zeta_{i}s_{2i}\\ &\leq-A_{i}s_{1i}^{2}-(\Gamma_{i}-\zeta_{i})|s_{2i}|\end{array}  \tag{42}\]  
**Assumption 2**. : _There exits an unknown parameter, \(\Gamma_{i}>0\), such that the uncertainties are assumed to be bounded \(|\zeta_{i}|\leq\Gamma_{i}\)._  
From Assumption 2, it is clear that \(\dot{V}_{2i}\ \leq 0\).