## 4 Trajectory Tracking via Attitude Stabilization  
In this section, a new strategy for trajectory tracking via attitude stabilization is described. Different from the previous approach, where the problem of under actuation is solved using hierarchical controllers, this strategy is based on controlling the quadcopter position (\(y\), \(x\)) through pitch and roll stabilization. The synoptic scheme of this new approach is illustrated in Figure 3.  
Four parameters are mainly controlled (the altitude and the three angles of rotation). The stabilization of the other two positions (\(x,y\)) results from a judicious choice of roll and pitch inputs. The relations between positions (\(y\), \(x\)) and rotations (pitch, roll) are deduced from the natural flight of the quadcopter.  
In fact, to move the quadcopter in a direction \(x\) (or \(y\)), we must first act to obtain a rotation of roll (or pitch). If this rotation is constant or increasing, the drone will move indefinitely. On the other hand, if we wish to reach a given position, we must reduce the control of the rotations to zero [30].  
The rapport between \(x\) (\(y\)) position and roll (pitch) attitude is modeled by the ratio of the roll (pitch) model function to the \(x\) (\(y\)) position model function. In natural flight, when the roll attitude is  
\begin{table}
\begin{tabular}{l l l l l l l l} \hline \hline \multirow{2}{*}{**GAHC Method**} & \multicolumn{6}{c}{**Controllers**} \\ \cline{2-9}  & \(\mathbf{C_{\phi}(s)}\) & \(\mathbf{C_{\theta}(s)}\) & \(\mathbf{C_{\varphi}(s)}\) & \(\mathbf{C_{x}(s)}\) & \(\mathbf{C_{y}(s)}\) & \(\mathbf{C_{z}(s)}\) \\ \hline PD & \(k_{p}\) & 16.83 & 15.78 & 22.82 & 7.92 & 7.41 & 184.0 \\ \cline{2-9} Parameters & \(k_{d}\) & 2.82 & 2.55 & 42.48 & 6.45 & 6.40 & 23.05 \\ \hline \multirow{2}{*}{PID} & \(k_{p}\) & 48.63 & 35.83 & 34.18 & 13.34 & 7.61 & 17.67 \\ \cline{2-9} Parameters & \(k_{i}\) & 8.45 & 1.36 & 7.57 & 0.16 & 0.92 & 0.10 \\ \cline{2-9}  & \(k_{d}\) & 2.29 & 2.35 & 6.50 & 5.23 & 5.46 & 10.40 \\ \hline \hline \end{tabular}
\end{table}
Table 2: PD and PID parameters values of the genetic algorithm hierarchical control (GAHC).  
Figure 3: Synoptic scheme of the proposed trajectory tracking via attitude stabilization strategy.  
stable, the position \(x\) diverges. In this case, roll and \(x\) position behaviors with respect to a unit input can be modeled as follows:  
\[\left\{\begin{array}{l}\phi(s)=\frac{K_{1}}{(1+Ts)s}\\ X(s)=\frac{K_{2}e^{-T_{0}s}}{s^{2}}.\end{array}\right. \tag{27}\]  
Thus, the transfer \(x-\phi\) is given by (28).  
\[F_{x\rightarrow\phi}(s)=\frac{\phi(s)}{X(s)}=\frac{K_{1}s}{K_{2}e^{-T_{0}s}(1 +Ts)} \tag{28}\]  
where \(\{K_{1},K_{2},T,T_{0}\}\) are the adjustable model's parameters, the transition from \(y\) position to pitch can be modeled in the same way.  
According to Figure 3, firstly, four PDs/PIDs controllers are achieved to stabilize the altitude and the three attitude angles. In a second step, we connect the entries \(\phi_{d}\) and \(\theta_{d}\) to the corresponding transfer blocks. Instead of diverging signals, we get \(x\) and \(y\) positions which are also stable.  
The PD/PID gains' of the four controllers are designed by using reference model and genetic algorithm methods, which are detailed in the following subsections.