*3.1. Controller Design*

The control strategy proposed in this study consists of two main steps: path planning and the tracking of the path. Path planning, which is the first step of the control strategy, is the process of determining the waypoints that the quadcopter is desired to track during payload transportation mission. Metaheuristic optimization algorithms such as PSO, GWO, and hybrid HHO–GWO are used to identify these waypoints. After determining the waypoints that the quadcopter is desired to track, path tracking is performed as the second step of control strategy. The path tracking process consists of four control structures: translational position, attitude–altitude, angular velocity controllers, and the system model of quadcopter. This path tracking controller is nested with each other. The motion control on the *X* and *Y* axes, attitude–altitude control and the angular velocity control of quadcopter are performed on the outer part, the inner part, and the innermost part, respectively. In the study, noise that occurs as a disruptive effect in attitude, altitude, and angular velocity control is suppressed by Kalman filter [42]. The position errors of quadcopter in *X*, *Y*, and *Z* axes are indicated as:

$$\mathbf{e}\_x = X\_d^G - X^G \qquad \mathbf{e}\_y = Y\_d^G - Y^G \qquad \mathbf{e}\_z = Z\_d^G - Z^G \tag{7}$$

where *ex*, *ey*, and *ez* refer the position errors; *X<sup>G</sup> <sup>d</sup>* , *<sup>Y</sup><sup>G</sup> <sup>d</sup>* , and *<sup>Z</sup><sup>G</sup> <sup>d</sup>* denote the desired positions; and *XG*, *YG*, and *Z<sup>G</sup>* define the measured positions in the *X*, *Y*, and *Z* axes, respectively. The errors of quadcopter in orientation angles are specified as:

$$
\varepsilon\_{\phi} = \phi\_d - \phi \qquad \varepsilon\_{\theta} = \theta\_d - \theta \qquad \varepsilon\_{\psi} = \psi\_d - \psi \tag{8}
$$

where *eφ*, *eθ*, and *e<sup>ψ</sup>* describe the orientation errors; *φd*, *θd*, and *ψ<sup>d</sup>* define the desired orientation angles; and *φ*, *θ*, and *ψ* represent the measured orientation angles in the roll, pitch, and yaw angle, respectively. The angular velocity error is stated as:

$$
\varepsilon\_{\mathcal{V}} = p\_d - p \qquad \varepsilon\_{\emptyset} = q\_d - q \qquad \varepsilon\_{\mathcal{V}} = r\_d - r \tag{9}
$$

where *ep*, *eq*, and *er* are the angular velocity errors; *pd*, *qd*, and *rd* define the desired angular velocity; and *p*, *q*, and *r* express the measured angular velocity along *xb*, *yb*, *zb*, respectively.

#### 3.1.1. Translational Position Control

This controller is responsible for minimizing the measurement difference obtained from the desired position and the quadcopter system model output. As specified in Equations (10) and (11):

$$\theta\_d(t) = K\_{PX} e\_x(t) + K\_{IX} \int\_0^t e\_x(\tau) d\_\tau + K\_{DX} \dot{e}\_x(t) \tag{10}$$

$$\phi\_d(t) = K\_{PY}e\_y(t) + K\_{IY} \int\_0^t e\_y(\tau)d\_\tau + K\_{DY}\dot{e}\_y(t) \tag{11}$$

the desired roll and pitch values are identified by the translational position controller as a result of the minimization of this error with the proportional–integral–derivative (PID) controller, and where *KPX*, *KIX*, *KDX* express PID gains that control the movement of the quadcopter in the *X* position, and *KPY*, *KIY*, *KDY* indicate PID gains that control the movement of quadcopter in the *Y* position, respectively. The inputs of the translational position controller are desired the position (*X<sup>G</sup> <sup>d</sup>* , *<sup>Y</sup><sup>G</sup> <sup>d</sup>* ), the output of the quadcopter system model (*XG*, *YG*), and the controller's output are the desired pitch (*θd*) and roll angles (*φd*). The proposed controller also performs the tracking of waypoints specified in the *X*,*Y* plane with metaheuristic path planning algorithms [38].
