## 3 Flight Controller Design
### Position Controller Design
Theorem 2: _The auxiliary dynamic system (18) is asymptotically stable._  
Proof: The auxiliary system can be rewritten as  
\[\dot{E}=-k_{a}\tanh(kE+l\dot{E})-k_{\beta}\tanh(l\dot{E})+\Delta \tag{26}\]where \(\Delta=k_{p}V_{ee}+\dfrac{c_{p}}{m}s_{p}+\dfrac{\varepsilon_{p}}{m}\operatorname{ sgn}(s_{p})\) can be regarded as a disturbance term. Moreover, the nominal auxiliary system without the disturbance term is given as  
\[ \begin{cases}\dot{E}_{1}=E_{2}\\ \dot{E}_{2}=-k_{\alpha}\tanh(kE_{1}+lE_{2})-k_{\beta}\tanh(lE_{2})\end{cases}  \tag{27}\]  
Based on the proof given above, the disturbance term \(\Delta\) converges to zero asymptotically. We focus on proving the convergence of the nominal auxiliary system. Considering the Lyapunov candidate function  
\[L=k_{\alpha}\ln(\cosh(kE_{1}+lE_{2}))+k_{\beta}\ln(\cosh(lE_{2}))+\dfrac{kE_{2} ^{2}}{2} \tag{28}\]  
According to the (27), we have  
\[L =k_{\alpha}\tanh(kE_{1}+lE_{2})^{T}(k\dot{E}_{1}+l\dot{E}_{2})+k_{ \beta}l\tanh(lE_{2})^{T}\dot{E}_{2}+kE_{2}^{T}\dot{E}_{2}\] \[=-l[k_{\alpha}\tanh(kE_{1}+lE_{2})+k_{\beta}\tanh(lE_{2})]^{T}[k _{\alpha}\tanh(kE_{1}+lE_{2})+k_{\beta}\tanh(lE_{2})]-kk_{\beta}E_{2}^{T} \tanh(lE_{2}) \tag{29}\] \[\leq 0\]  
Only if \(E_{1}=0\) and \(E_{2}=0\), we have \(\dot{L}=0\). As a result, the asymptotical stability of the nominal auxiliary system is proved. As the states \(\chi_{ee}\), \(V_{ee}\), \(\dot{E}\), and \(\dot{E}\) are asymptotically stable, we can conclude that the proposed position controller can guarantee the asymptotic stability of the tracking errors \(\chi_{e}\) and \(V_{e}\). The exponential approach law is introduced to improve control performance. However, due to the existence of non-ideality in the practical implementation of \(\operatorname{sgn}(s_{p})\), the chattering problem may not be ignored. To overcome the problem for the position subsystem, \(\operatorname{sgn}(s_{p})\) can be substituted by the hyperbolic tangent function  
\[\tanh(\dfrac{s_{p}}{\rho_{p}})=\dfrac{e^{\frac{s_{p}}{\rho_{p}}}-e^{-\frac{s_{ p}}{\rho_{p}}}}{e^{\frac{s_{p}}{\rho_{p}}}+e^{-\frac{s_{p}}{\rho_{p}}}} \tag{30}\]  
where the parameter \(\rho_{p}\) is selected by considering the trade-off between the hardware capability and the control accuracy and robustness. The virtual thrust \(U_{p}=[U_{x},U_{y},U_{z}]^{T}\) is derived above, then the thrust \(T\), the desired roll angle \(\phi_{r}\), and the pitch angle \(\theta_{r}\) can be extracted. It should be mentioned that the aircraft can provide thrust \(T_{actual}\) along the \(z\)-axis of the body coordinate system during the hover mode. \[ \begin{cases}U_{x}=-T(\cos\phi\sin\theta\cos\psi+\sin\phi\sin\psi)\\ U_{y}=-T(\cos\phi\sin\theta\sin\psi-\sin\phi\cos\psi)\\ U_{z}=-T\cos\phi\cos\theta\end{cases}  \tag{31}\]  
The desired yaw angle \(\psi_{r}\) is given by the user input device or trajectory planner in advance, then we have  
\[ \begin{cases}\theta_{r}=\arctan(\dfrac{U_{x}\cos\psi_{r}+U_{y}\sin\psi_{r}}{ U_{z}})\\ \phi_{r}=\arctan(\dfrac{\cos\theta_{r}(U_{x}\sin\psi_{r}-U_{y}\cos\psi_{r})}{ U_{z}})\\ T=-\dfrac{U_{z}}{\cos\theta_{r}\cos\phi_{r}}\end{cases}  \tag{32}\]  
**Remark 1**. : _By introducing the auxiliary dynamic system, the virtual thrust \(U_{p}\) is bounded. Furthermore, the thrust \(T\) and desired angles \(\phi_{r}\), \(\theta_{r}\) are constrained to a safe range._According to (17), the amplitude of the virtual thrust \(U_{p}\) mainly depends on the desired acceleration \(\dot{\chi}_{r}\). In general, \(\ddot{\chi}_{r}\) cannot be too large; therefore, the virtual thrust \(U_{p}\) is bounded and satisfies  
\[\|U_{p}\|\leq m(\|\ddot{\chi}_{r}\|+\|ge_{3}\|+\sqrt{3}(k_{\alpha}+k_{\beta})) \tag{33}\]  
From (31), it is clear that \(T=\|U_{p}\|\).