## 4 Results and Discussion
### PD Controller  
Table 1 shows the RMSE statistics for the simulation with 20 individuals, 20 evolutions and 30 repetitions of the eight algorithms under test. The HGS algorithm is the one that obtains the best value \(RMSE=0.037263535506379\), the MPA algorithm is the one that obtains the best average, standard deviation and worst values. Figure 5a show the RMSE during the 20 iterations, the three best values are HGS, MPA and PSO. In the box plot, the lowest variability is obtained by GWO and MPA and the highest variability of the RMSE value is in PSO algorithm. The 12 parameters identified by each algorithm are shown in Table 2, where the HGS parameters are the best for obtaining a lower RMSE. Table 3 contains the RMSE statistics for the simulation with 30 individuals, 20 iterations and 30 repetitions. The algorithm that obtains the best performance is again the HGS with a \(RMSE=0.03725093743996\); for this case, the GWO algorithm gets the best average, standard deviation and worst values. Figure 5b show the RMSE during the 20 iterations; the three best values are HGS, PSO and MPA. In the box plot, the lowest variability is  
Figure 4: Flowchart: controller parameter tuning process. obtained by GWO, HGS, MPA y SMA and the highest variability of the RMSE value is obtained by PSO algorithm. The 12 parameters identified by each algorithm are shown in Table 4. The HGS parameters are the best for getting the lowest RMSE. Table 5 contains the RMSE statistics for the simulation of 40 individuals, 20 evolutions and 30 runs with the corresponding algorithms. The algorithm that obtains the best performance is the HGS with a \(RMSE=0.037247252379126\). The MSA algorithm gets the best average, standard deviation, and worst values for this case. The 12 parameters identified by each algorithm are shown in Table 6. In Figure 5c, the box plot shows the lowest variability is obtained by GWO, HGS, MPA and SMA. The highest variability of the RMSE value is obtained by PSO algorithm. We evaluated the performance of optimized parameters obtained (Table 2) for all six dynamics, (x, y, z, \(\phi,\theta,\psi\)) and algorithms (Figures 6-11) at 20 iterations with 20 individuals. For translational dynamics (x and y), the desired trajectory is trapezoidal and for altitude (z) and yaw (\(\psi\)) dynamics is a ramp. The sharp effect observed in the Z axis of Figure 8 is due to the compensation between the force of gravity and the control signal. Negative values are associated with the instant in which the value of gravity is more significant than the control signal. Please note that this effect is only visible in the simulation; in real life, this effect is observed as a time delay until the force of gravity is countered by the control signal. The best trajectory is determined by the minimal value of cost function achieved by HGS as shown in Table 1.  
The highest cost function value will define an acceptable performance for all dynamics. Here, the algorithm LSPACMA reached the highest value (0.040248443990318). As we can see, HGS algorithms performed best with a minimum square error (RMSE), which is the lowest obtained for all algorithms. LSPACMA has the largest error in most of the dynamics performance. Figures 9 and 10 show the angles (\(\phi\) and \(\theta\)) of orientation of the QUAV. Dotted lines show the desired angles calculated as described in Section 2.2.1. Simulations show that \(\phi\) angles are coupled with the axis Y and rotational movements of \(\theta\) are coupled with axis X. When a change in direction is necessary, the controls are robust enough to generate changes in the orientation in response to the desired angles. Figure 12 shows the control signals calculated by (7), (13)-(15). It is noted that the controllers reach their steady states during the flight. Signals \(u_{2}\) and \(u_{3}\) respond to changes in direction on the desired path and \(u_{1}\) is affected and responds to small variations in altitude.