## 3 Flight Controller Design
### Position Controller Design  
The position control is realized by the adjustment of the UAV's attitudes. The desired roll angle \(\phi_{r}\) and pitch angle \(\theta_{r}\) given by the position controller are the reference inputs for the attitude controller. The input of the position controller is the position reference signal \(\chi_{r}=[X_{r},Y_{r},Z_{r}]^{T}\), while the output consists of the virtual thrust \(U_{p}\). The desired attitude \(\phi_{r}\), \(\theta_{r}\) and thrust \(T\) can be obtained using the inverse transformation. The design of the position controller is divided into two steps, the first step is to design control law based on adaptive SMC-AD approach, and the second step is to solve the desired angles and thrust from the control law that is designed in the first step. Similar to a conventional vehicle, the tilt tri-rotor UAV has four virtual control quantities \(R,P,Y\) and \(T\), where \(R\) is directly linked to roll control, \(P\) is used for pitch control, \(Y\) is related to yaw control, and the altitude is controlled by \(T\). The objective of this section is to develop control outputs \(T\) and \(\Gamma=[R,P,Y]^{T}\) for the tilt tri-rotor UAV. Define the position error \(\chi_{e}=\chi_{r}-\chi\), the virtual position error  
Figure 3: Block diagram of the flight control system. \(\chi_{ee}=\chi_{e}-E\), the velocity error \(V_{e}=V_{r}-V\), and the virtual velocity error \(V_{ee}=V_{e}-\dot{E}\), where \(E\) is an auxiliary variable. The virtual thrust is represented by \(U_{p}=-R_{BET}Te_{3}\). Based on (14), the virtual error dynamics of the position subsystem can be given by  
\[ \begin{cases}\dot{\chi}_{ee}=V_{ee}\\ m\dot{V}_{ee}=m\dot{\chi}_{r}-(U_{p}+mge_{3}+d_{F})-m\dot{E}\end{cases}  \tag{16}\]  
Theorem 1: _The position error subsystem in (16) can be asymptotically stabilized if the virtual thrust and the second-order auxiliary dynamic system are defined as follows,_  
\[U_{p}=m(\ddot{\chi}_{r}-ge_{3}+k_{a}\tanh(kE+l\dot{E})+k_{\beta}\tanh(l\dot{E})) \tag{17}\]  
\[\dot{E}=-k_{a}\tanh(kE+l\dot{E})-k_{\beta}\tanh(l\dot{E})+k_{p}V_{ee}+\frac{c_ {p}}{m}s_{p}+\frac{\varepsilon_{p}}{m}\operatorname{sgn}(s_{p}) \tag{18}\]  
_where \(s_{p}=k_{p}\chi_{ee}+V_{ee}\) is a classical sliding manifold, and \(k_{p}\), \(c_{p}\), \(\varepsilon_{p}\), \(k_{a}\), \(k_{\beta}\), \(k\), and \(l\) are positive constants._  
Proof: At first, consider the following Lyapunov candidate for position subsystem  
\[V_{p}=\frac{m}{2}s_{p}^{T}s_{p} \tag{19}\]  
The derivative of the Lyapunov function is then obtained by  
\[ \begin{split}\dot{V}_{p}&=ms_{p}^{T}s_{p}\\ &=s_{p}^{T}(mk_{p}V_{ee}+m\dot{\chi}_{r}-(U_{p}+mge_{3}+d_{F})-m \dot{E})\end{split}  \tag{20}\]  
Substituting (17) and (18) into (20) yields  
\[\dot{V}_{p}=-s_{p}^{T}c_{p}s_{p}-s_{p}^{T}\varepsilon_{p}\operatorname{sgn}(s _{p})-s_{p}^{T}d_{F} \tag{21}\]  
If the value of \(\varepsilon_{p}\) is large enough \(\varepsilon_{p}>\|d_{F}\|\), it can be concluded that  
\[\dot{V}_{p}=-s_{p}^{T}c_{p}s_{p}-s_{p}^{T}\varepsilon_{p}\operatorname{sgn}(s _{p})-s_{p}^{T}d_{F}\leq 0 \tag{22}\]  
As \(V_{p}\geq 0\) and \(\dot{V}_{p}\leq 0\), \(\dot{V}_{p}=0\) only if \(s_{p}=0\). Therefore, we can conclude that \(V_{p}\) is monotonically decreasing and can converge to zero in finite time. According to (19), we have \(s_{p}=0\). \[k_{p}\chi_{ee}+V_{ee}=0 \tag{23}\]  
Substituting (16) into (23) yields  
\[\dot{\chi}_{ee}=-k_{p}\chi_{ee} \tag{24}\]  
From (24), we have  
\[\chi_{ee}=e^{-k_{p}t}\chi_{ee}(0) \tag{25}\]  
where \(\chi_{ee}(0)\) denotes the initial error. Because \(k_{p}\) is a positive parameter, the tracking errors \(\chi_{ee}\) and \(V_{ee}\) of the nominal position error subsystem (16) are asymptotically stable.