## 3 Controller Synthesis
### Control Strategy  
The core of the control strategy is the flight control system, but it also relies on the Kalman filter estimator discussed above, along with transfer blocks for Earth-to-body frame transformation and force-to-angular speed transformation, as illustrated in the figure below. The FCS structure in Figure 5 is based on regulator C1, managing altitude and yaw (\(z\) and \(\psi\)), and regulator C2, controlling roll and pitch (\(\varphi\) and \(\theta\)) intrinsically (\(x_{Rb}\), \(y_{Rb}\)). Block C1 is a nonlinear backstepping approach, while C2 consists of two nested loops: an inner loop that uses backstepping and an outer loop with a PID controller. This modular control strategy allows flexibility towards different desired scenarios, ensuring optimal performance under varying flight conditions. The output signals from the sensor fusion stage are filtered with EKF. The Earth-to-body frame blocks facilitate coordinate transformations for calculation purposes. The forces-to-angular speed block transfers inputs \(u_{1},\ u_{2},\ u_{3}\), and \(u_{4}\) to outputs \(\omega_{1},\ \omega_{2},\ \omega_{3}\), and \(\omega_{4}\), which serve as command inputs for the different rotors. **Flight Control System:**  
_C1 block_  
According to (4) and (7), the instantaneous mathematical model describing the system altitude and yaw angle can be expressed by the following nonlinear differential equations. \[\left\{ \begin{array}{l}\dot{z}_{1}=z_{2}\\ \dot{z}_{2}=\frac{u_{1}}{m}\text{cos}(\theta_{1})\text{cos}(\varphi_{1})- \frac{c_{ik}}{m}z_{2}-g+w_{k}\end{array} \right. \tag{21}\]  
\[\left\{ \begin{array}{l}\dot{\psi}_{1}=\psi_{2}\\ \dot{\psi}_{2}=\frac{u_{4}}{l_{5}}-\frac{c_{mk}}{l_{5}}\dot{\psi}_{2}^{2}-\frac {\left(l_{y}-l_{k}\right)}{l_{5}}\varphi_{2}\theta_{2}+w_{k}\end{array} \right. \tag{22}\]  
Figure 5: Trajectory tracking structure of underactuated UAV. Let the tracking errors defined as:  
\[ \begin{array}{l}e_{z1}=z_{1}-{z_{1}}^{*};\\ e_{\varphi 1}=\psi_{1}-{\psi_{1}}^{*}\end{array}  \tag{23}\]  
where  
\(e_{z1}\) describes altitude tracking error;  
\(z_{1}^{*}\) is the desired trajectory altitude specified by a reference model;  
\(e_{\varphi 1}\) is the yaw tracking error;  
\({\psi_{1}}^{*}\) is the desired orientation specified by a reference model. _Step 1_: Based on the Equation above, the derivative of the tracking errors therefore is  
\[ \begin{array}{l}\dot{e}_{z1}=z_{2}-\dot{z_{1}}^{*},\\ \dot{e}_{\varphi 1}=\psi_{2}-\dot{\psi}_{1}^{*}\end{array}  \tag{24}\]  
To ensure stability, the first Lyapunov candidate functions are given by:  
\[ \begin{array}{l}V_{1z}=\frac{1}{2}e_{z1}^{2}\\ V_{1\varphi}=\frac{1}{2}e_{\varphi 1}^{2}\end{array}  \tag{25}\]  
Its time derivative is given by:  
\[ \begin{array}{l}\dot{V}_{1z}\ =\ \mathrm{e}_{z1}\dot{e}_{z1}\ =\ \mathrm{e}_{z1}\ (z_{2}\ -\ \dot{z_{1}}^{*})\\ \dot{V}_{1\psi}\ =\ \mathrm{e}_{\varphi 1}\dot{e}_{\varphi 1}\ =\ \mathrm{e}_{ \varphi 1}\ (\psi_{2}\ -\ \dot{\psi}_{1}^{*})\end{array}  \tag{26}\]  
To ensure stability, the derivative of the Lyapunov functions must be negative. For that, the following new virtual control laws to stabilize the system and zero the tracking errors are suggested:  
\[ \begin{array}{l}{z_{2}}^{*}\ =\ -C_{z1}\ e_{z1}\ +\ \dot{z_{1}}^{*}\\ \dot{\psi}_{2}^{*}\ =\ -C_{\varphi 1}\ e_{\varphi 1}\ +\ \dot{\psi}_{1}^{*}\end{array}  \tag{27}\]  
where \(C_{z1}\) and \(C_{\varphi 1}\) are non-zero positive constants. Now, considering Lyapunov derivative functions, we have:  
\[ \begin{array}{l}\dot{V}_{1z}\ =\ -C_{z1}\ e_{z1}^{2}\\ \dot{V}_{1\psi}\ =\ -C_{\varphi 1}\ e_{\varphi 1}^{2}\end{array}  \tag{28}\]  
_Step 2_: The augmented second Lyapunov candidate functions are introduced as:  
\[ \begin{array}{l}e_{z2}\ =\ z_{2}\ -\ z_{2}^{*}\\ e_{\varphi 2}\ =\ \psi_{2}\ -\ \psi_{2}^{*}\end{array}  \tag{29}\]  
Let us consider the following choice for the augmented Lyapunov function:  
\[ \begin{array}{l}V_{2z}\ =\ V_{1z}\ +\ \frac{1}{2}e_{z1}^{2}\\ V_{2\varphi}\ =\ V_{1\psi}\ +\ \frac{1}{2}e_{\varphi 1}^{2}\end{array}