## 4 Quadrotor Control
### Helical Trajectory Tracking  
Through the last simulation, we will investigate more the efficiency of the proposed intelligent control methods (PSO, CS, and PSO-CS) to search for optimal PID autotuned controllers for the quadrotor, when the desired trajectory is a helix. Simulation results of each position's tracking (\(x\), \(y\), \(z\)), and the tracking in 3D plan are presented in Figure 15. The tracking of roll and pitch attitudes (\(\phi\) and \(\theta\)) are presented in Figures 16 and 17. Table 7 summarizes the obtained ISE errors.  
Figure 15 clearly shows the possibility of the quadrotor system to follow a linear movement in altitude \(z\) in the first mode from 0 to 18 s and to keep perfectly a stable attitude \(z\) of 20 m in the second mode from 18 to 30 s. For translation motion, the quadrotor makes a complete circle of 2 m of radius in 30 s, where we notice that the errors in \(x\), \(y\), and \(z\) axis are very small (from Table 7). The same figure illustrates in \(3D\) plan that the quadrotor tracks the helix trajectory and ends by a circle form. Also, the quadrotor avoids with high precision the overturning and maintains exactly \(0^{\circ}\) in yaw attitude.  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \multirow{2}{*}{**Method**} & \multicolumn{5}{c}{**Errors ISE for Output**} \\ \cline{2-7}  & \(x\) & \(y\) & \(z\) & \(\phi\) & \(\theta\) & \(\psi\) \\ \hline PSO & 1.254 & 1.161 & 14.212 & 0.524 & 0.982 & \(1.056\times 10^{-28}\) \\ \hline CS & 1.498 & 1.334 & 21.612 & 0.147 & 2.441 & \(7.378\times 10^{-35}\) \\ \hline PSO-CS & 1.079 & 0.685 & 3.287 & 0.183 & 0.195 & \(8.157\times 10^{-36}\) \\ \hline RM & 2.555 & 1.573 & 33.776 & 0.272 & 0.704 & \(5.467\times 10^{-35}\) \\ \hline \end{tabular}
\end{table}
Table 6: Errors (ISE-Integral Square Error) obtained Particle Swarm Optimization (PSO), Cuckoo Search (CS), Particle Swarm Optimization-Cuckoo Search (PSO-CS), and Reference Model (RM) for the quadrotor with disturbance (rectangular trajectory).  
Figure 15: Quadrotor’s positions (\(x\), \(y\), \(z\)) using Particle Swarm Optimization (PSO), Cuckoo Search (CS), Particle Swarm Optimization-Cuckoo Search (PSO-CS), and Reference Model (RM) (helical trajectory).  
Figure 16: Quadrotor’s roll attitude (\(\phi\)) using Particle Swarm Optimization (PSO), Cuckoo Search (CS), Particle Swarm Optimization-Cuckoo Search (PSO-CS), and Reference Model (RM) (helical trajectory).  
Figure 17: Quadrotor’s pitch attitude (\(\theta\)) using Particle Swarm Optimization (PSO), Cuckoo Search (CS), Particle Swarm Optimization-Cuckoo Search (PSO-CS), and Reference Model (RM) (helical trajectory).  
Figures 16 and 17 and Table 7 illustrate that PSO, CS, and PSO-CS help to follow perfectly the sensor signals (\(\phi_{d}\) and \(\theta_{d}\)). These results prove the possibility of our system to follow the imposed combined trajectory form with precision, for all variables (positions (\(x\) and \(y\)), altitude \(z\), and attitudes (\(\phi\), \(\theta\), and \(\psi\)).  
These controllers are tested in order to evaluate their performances under the same disturbance (a random input of variable amplitude) inserted in the altitude \(z\) closed loop scheme of the quadrotor. It can be observed from Figures 18-20 and Table 8 that PSO and PSO-CS controllers reject the disturbance effects and drive all variables to the desired ones. Therefore, we can affirm that despite the usage of a combined trajectory form and the presence of forcible disturbance, adaptive PSO-CS and PSO are proven as remarkably robust and efficient for quadrotor control.  
Figure 19: Quadrotor’s roll attitude (\(\phi\)) using Particle Swarm Optimization (PSO), Cuckoo Search (CS), Particle Swarm Optimization-Cuckoo Search (PSO-CS), and Reference Model (RM) with disturbance (helical trajectory).  
Figure 20: Quadrotor’s pitch attitude (\(\theta\)) using Particle Swarm Optimization (PSO), Cuckoo Search (CS), Particle Swarm Optimization-Cuckoo Search (PSO-CS), and Reference Model (RM) with disturbance (helical trajectory).