## 6 Conclusions  
In this paper, to accomplish a high performing and robust controller for trajectory tracking; two different methods were developed and applied in two different controller strategies. First, the dynamic model of the quadcopter derived from the Newton-Euler and the Euler-Lagrange equations was presented. Then, the hierarchical strategy was employed in controller design to drive the quadcopter through a desired trajectory. This controller is composed of an inner loop for attitude stabilization and an outer loop for position control. These loops are a set of PD/PID controllers, in which the gains were determined firstly using the RM method, then, optimized by utilizing GA techniques. This paper also presents a novel control strategy to deal with the under actuation of the system studied. This strategy  
Figure 17: Quadcopter position trajectory tracking using TTRM and TTGA (PD/PID) in the presence of disturbances.  
Figure 18: Quadcopter tracking of a circular trajectory in 3D space (solid red line) achieved using TTRM and TTGA (PD/PID) in the presence of disturbances.  
consists of trajectory tracking via attitude stabilization, driving the quadcopter towards the desired trajectory only by adjusting the system's orientation. As with the first developed controller, this later was synthesized by using both methods (RM and GA). The performance of the proposed controllers was validated through extensive numerical simulations using the Matlab-Simulink environment. The results of the RMHC-PD/TTRM-PD and GAHC-PD/TTGA-PD controllers were compared to the RMHC-PID/TTRM-PID and GAHC-PID/TTGA-PID controllers. In hierarchical structure, the results demonstrate that PD controllers in the inner loop and PID controllers in the outer loop provide better performance. For trajectory tracking via attitude stabilization, PD improves responses in the absence of disturbances. In conclusion, the quadrotor achieves the desired conditions in both set point hovering flight and path following flight in hierarchical structure and trajectory tracking via attitude stabilization.  
In both cases (the hierarchical controller and trajectory tracking via attitude stabilization), the disturbances affect the quadcopter position, but within acceptable boundaries, which allow the quadcopter to not lose track of the reference trajectory. In conclusion, the robustness of all proposed controllers was tested and validated in spite of disturbances. The objective of developing an effective and robust trajectory tracking control system for a quadcopter in the presence of disturbances has been achieved.  
Data curation, I.S.; Investigation, I.S. and M.M.; Methodology, I.S. and M.M.; Resources, I.S.; Supervision, M.M., H.A. and A.E.K.; Validation, M.M.; Writing--original draft, I.S.;Writing--review and editing, I.S. and M.M.  
This research received no external funding.  
The authors declare no conflict of interest.  
The following abbreviations are used in this manuscript:  
\begin{tabular}{l l} PD & Proportional, Derivative \\ PID & Proportional, Integral, Derivative \\ GA & Genetic Algorithm \\ RM & Reference Model \\ RMHC & Reference Model based Hierarchical Controller \\ GAHC & Genetic Algorithm based Hierarchical Controller \\ TTRM & Trajectory Tracking by using Reference Model \\ TTG & Trajectory Tracking by using Genetic Algorithm \\ \end{tabular}