## 5 Simulation Results
### Hierarchical Controllers for Trajectory Tracking  
The GA was applied in the hierarchical controller to tune the PD/PID gains firstly for the inner loop and then for the outer loop. However, in the RMHC, the PD/PID gains were determined by using the RM method separately for the inner and the outer system's loops.  
It is clearly shown in Figure 4 that the proposed hierarchical controller achieves accurate reference tracking with different settling time values. For the \(x\) and \(y\) positions, the RMHC-PD controller drives the system to the desired reference in three second without overshoot. In comparison, the use of PID controllers instead of PD for RMHC makes these flight parameters respond faster. Conversely, PD controllers in GAHC offer better performance with a settling time of 1.5 s for the \(x\) and \(y\) positions and 0.3 s for the altitude, \(z\). Regarding the altitude, \(z\), the settling time is faster and equal to 0.5 s with RMHC-PD, instead of 3 s with RMHC-PID.  
\begin{table}
\begin{tabular}{l c} \hline
**Parameter (Unit)** & **Value** \\ \hline \(m\) (Kg) & 0.53 \\ \(g\) (m/s\({}^{2}\)) & 9.81 \\ \(l\) (m) & 0.4 \\ \(b\) (N/rad/s) & \(4.15\times 10^{-5}\) \\ \(d\) (N\(\cdot\)m/rad/s) & \(7.5\times 10^{-7}\) \\ \(I_{x}\), \(I_{y}\) (Kg\(\cdot\)m\({}^{2}\)) & \(7.86\times 10^{-3}\) \\ \(I_{z}\) (Kg\(\cdot\)m\({}^{2}\)) & \(1.173\times 10^{-3}\) \\ \(J_{r}\) (Kg\(\cdot\)m\({}^{2}\)) & \(2.8385\times 10^{-5}\) \\ \(K_{fax}\), \(K_{fay}\), \(K_{ftx}\), \(K_{fty}\) (N/rad/s) & \(5.567\times 10^{-4}\) \\ \(K_{faz}\) (N/rad/s) & \(6.354\times 10^{-4}\) \\ \(K_{ftz}\) (N/rad/s) & \(3.354\times 10^{-4}\) \\ \hline \end{tabular}
\end{table}
Table 5: Physical parameters of the quadrotor unmanned aerial vehicle (UAV).  
Turning to the attitude responses presented in Figure 5, the PID controllers give faster responses than PD in both cases (GAHC and RMHC). On the other hand, PID controllers in RMHC provide an overshoot in the corrected attitude behavior. Differently, in GAHC, the use of PID controllers gives smooth and faster response, compared to PD. As we require in our specification a faster response without overshoot, the PD controllers are the more adequate when the reference method is adopted. As illustrated in Figures 6 and 7, the second simulation for the hierarchical structure was carried out for a circular trajectory.  
Figure 4: Quadcopter position step response obtained by RMHC and GAHC approaches.  
Figure 5: Quadcopter attitude step response obtained using the RMHC and GAHC approaches.  
The tracking of a circular trajectory in 3D space is illustrated in Figure 8.  
The quadrotor is initially located at the origin (0, 0, 0). Figure 8 shows that the quadrotor trajectory converges to the reference trajectory without trajectory deviations or changes of direction. The controlled quadcopter manages to accurately track the reference path and provides fast and accurate responses. From the aforementioned simulation results in two different cases (reference  
Figure 8: Quadcopter tracking of a circular trajectory in 3D space (solid red line) performed using the RMHC and GAHC approaches.  
Figure 6: Quadcopter position trajectory tracking performed using the RMHC and GAHC approaches.  
Figure 7: Quadcopter attitude trajectory tracking performed using the RMHC and GAHC approaches.  
model PD/PID and genetic optimized PD/PID), we can conclude that the proposed hierarchical controller can achieve the given trajectory. Furthermore, PD controllers in hierarchical structure give better performance in terms of trajectory tracking, steady-state error, and overshoot compared to PID controllers. To conclude, the PD controllers in the hierarchical structure provide better results than the PID controllers.