**1. Introduction**

Path planning and tracking are the main tasks studied for unmanned vehicles, especially unmanned aerial vehicles (UAVs), unmanned ground vehicles, and unmanned underwater vehicles [1–4]. UAVs, which have been used extensively in defense industry and academic studies in recent years, perform tasks such as surveillance, target tracking, search and rescue, and payload transportation [4–7]. The obstacles and their positions in the region where UAVs will operate play an important role in the effective operation of UAVs [8]. Establishing a safe path by determining the risky areas in military operation and natural disaster areas, following the path that has been generated, and releasing the payloads to the predefined regions are critical for the successful performance of the mission [9]. In this study, a new path planning and tracking algorithm based on metaheuristic optimization is developed for the payload hold–release task by avoiding the obstacles at the target points defined around the planned path.

A path planning and tracking is required for the UAV to safely reach the target location from the starting location depending on certain restriction conditions such as minimum flight distance and time [10]. UAVs may be exposed to inconvenient land and weather conditions while performing critical tasks. UAVs try to overcome this problem with their maneuverability and altitude capabilities [1]. This situation causes the UAV to consume more energy [11]. In the presence of obstacles and constraints, optimal path planning is required for the UAV to safely follow the specified path with minimum energy and time consumption [12,13]. The UAV path planning problem is a complex optimization

**Citation:** Belge, E.; Altan, A.; Hacıo ˘glu, R. Metaheuristic Optimization-Based Path Planning and Tracking of Quadcopter for Payload Hold-Release Mission. *Electronics* **2022**, *11*, 1208. https:// doi.org/10.3390/electronics11081208

Academic Editors: Luis Hernández-Callejo, Sergio Nesmachnow and Sara Gallardo Saavedra

Received: 12 March 2022 Accepted: 8 April 2022 Published: 11 April 2022

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Copyright:** © 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

problem that requires efficient algorithms to solve. This optimization problem can be solved with classical algorithms as well as by using quite efficient metaheuristic algorithms. Simple path planning for UAV is performed with the Voroni diagram algorithm [14], the probabilistic roadmaps algorithm [15], the A\* algorithm [16], and rapidly discovered tree-based algorithms [17]. However, since the kinematic and dynamic constraints of the UAV are rarely considered, these algorithms are generally not preferred in practical applications. In recent years, various approaches have been proposed for the autonomous path planning of the UAV, including meta-heuristic optimization algorithms. In [18], modeling of the battery performance of the UAV is emphasized. A multi-variable linear regression model has been created for the minimum energy consumption of the UAV on the specified path. The generated energy consumption model is used as a fitness function in the optimization algorithm. The performance of the proposed algorithm has been verified with various scenarios for the minimum energy consumption of the UAV. In [19], a path planning algorithm based on k-degree smoothing is proposed to define the coordinated path planning of the UAV in a safe and efficient manner. In the study, a kdegree smoothing method that aims to obtain a safer path using the ant colony optimization (ACO) algorithm [20] is presented. The proposed algorithm draws attention with its slow convergence speed and high probability of being stuck to local optima. In order to deal with these problems, a hybrid optimization algorithm obtained by combining maximum– minimum ACO (MMACO) and Cauchy mutant (CM) operators is recommended in [21]. As paths with faster convergence speed and better solution optimization are preferred in practical applications, swarm-based bio-inspiring optimization algorithms with low computational complexity and high computational speed are used extensively. In [22], an improved particle swarm optimization (PSO) algorithm has been proposed to achieve faster convergence speed and better solution optimization in the path planning of the UAV. The performance of the algorithm has been tested on various UAVs under many environmental constraints with Monte Carlo simulations. In [23], the 3D path planning problem of the UAV in the presence of obstacles is solved with the grey wolf optimization (GWO) algorithm [24] and the performance of the proposed algorithm is compared with metaheuristic algorithms such as PSO, the whale optimization algorithm (WOA), and the sine cosine algorithm (SCA). In the literature, metaheuristic optimization algorithms play an important role in solving different engineering problems, as well as path planning and tracking [25–27].

UAVs may encounter various obstacles while performing specified missions by sticking to a path. In [28], an obstacle avoidance algorithm based on ellipsoid geometry is proposed for the UAV to remain loyal to its original path and avoid the obstacles in its environment by creating waypoints in the presence of obstacles that obstruct the UAV flight path. The search for an avoidance path in the proposed algorithm is based on the use of ellipsoid geometry as a limited region containing the obstacle. Considering the geometry of the defined obstacle, a limited ellipsoid zone is created, and new crossing points are calculated within this zone. A convolutional neural network (CNN) approach based on depth estimation using molecular camera data to enable the quadrotor UAV to independently avoid collisions with obstacles in unknown and unstructured environments is presented in [29]. In [30], a new algorithm has been proposed that analytically calculates the path efficiently and effectively to create an environment map with a path without collision. In the developed algorithm, an initial path is created by the intersection of two 3D surfaces. Each obstacle position is shaped around the obstacles by adding a radial function to one of the two surfaces. The developed algorithm ensures that the intersection between deformed surfaces does not intersect with obstacles. The algorithm provides that the safe path is created in real time in the UAV's path tracking. In [31], every point in the motion environment is scanned with the 2D lidar on the UAV and the position of the UAV is estimated using the point cloud correction method. Unlike many studies with lidar, the effects of motion on the point cloud have been taken into account. In the proposed algorithm, point cloud features obtained by laser radar are extracted and a clustering is made based on relative distance and density. A robust nonlinear flight controller framework with

six dimensional force and torque estimators that includes a model predictive controller (MPC)-based trajectory plan that considers the trajectory planning problem as an optimal control problem with nonlinear obstacle avoiding limitations is proposed in [32].

The ability of the UAV, which has a payload transportation system, to move around the reference trajectory and hold payloads from a certain point and to release payloads to specified targets with minimum error makes the UAV important for critical missions. In releasing the payloads to the specified targets, the UAV should be able to determine the path on its own or stay loyal to the specified path. In [33], neural-network-based real-time UAV control is performed in order to release the payloads to the marked targets by following a certain path with minimum error. The controller structure includes feature extraction and selection stages. In order for the UAV to release the payloads on the predetermined coordinates with the highest accuracy, the full mathematical model of the UAV, as well as the model of the payload transportation system, is needed. In [34], both the dynamic model parameters and the payload transportation system model of the UAV are handled together with the controller approach based on the law of feedback linearization. It is stated that the stabilization of the UAV, especially when releasing payload, is improved with the proposed controller approach. The controller scheme robust to payload changes in various weights is presented in [35]. The proposed controller provides the stabilization of the UAV in the suspended position by compensating the weight changes in the UAV with payload transportation system. In [36], an optimization-based controller algorithm has been developed for the UAV moving around a certain trajectory to make minimum oscillation at maximum payload. It is emphasized that the developed algorithm performs optimal control, especially in maneuvers.

In this study, a new metaheuristic-optimization-based path planning and tracking algorithm with a very high convergence speed is proposed to the UAV with payload transportation system in order to plan a path by avoiding obstacles under constraints such as mass uncertainty, unknown parameters, and unmeasurable external disturbances and to release the payloads to the target points with minimum error while staying loyal to path. The proposed algorithm is robust as it copes with unknown system dynamics and adverse environmental factors. The main contributions of this study are that the new hybrid Harris hawk optimization (HHO)–GWO algorithm for path planning is proposed, the new path planning and tracking control strategy is developed together, and the path-tracking performance of the quadcopter in payload hold–release mission has been analyzed. In addition, the positional error due to the mass uncertainty can be minimized by the proposed control strategy, as well as the energy function. The results of the study are shown that the mass uncertainty and energy of quadcopter during payload hold–release mission have been minimized using the new proposed path planning and tracking algorithm.

The remainder of this paper is organized as follows. The dynamic model of the quadrotor UAV used in the study is given in Section 2. The proposed controller approach for the path planning and tracking of the UAV is introduced in Section 3, including GWO and HHO algorithms. The generated maps are presented in Section 4. The results obtained with the proposed model are discussed in Section 5. Finally, in Section 6, the main results of the study, and future work are highlighted.

## **2. Dynamic Model of Quadcopter**

Quadcopter is an underactuated type of UAV with four motors and six degrees of freedom (three translational and three rotations) and capable of landing and taking off in limited areas [37]. The evaluation of translation and rotation dynamics together in the motion control of a quadcopter is an important control problem. In the solution of this control problem, it is very important to take into account the non-linear parameters in the dynamics of the quadcopter. The main components of the quadcopter, Euler angles (roll, pitch, yaw), body frame, and global frame are illustrated in Figure 1.

**Figure 1.** The main components of quadcopter.

The following parameters:


are assumed in the model of quadcopter [38]. Position changes during quadcopter flight are measured in the frame, accelerometer, and gyro values are measured in the body frame. For this reason, it is necessary to define the transformations between body and coordinate systems. In this study, *cos*(.), *sin*(.), and *tan*(.) are represented by *c*(.), *s*(.), and *t*(.), respectively. Considering these transformations, the velocity expression in the frame is obtained by using the velocity in body frame as:

$$
\begin{bmatrix}
\mathcal{X}^G\\\mathcal{Y}^G\\\mathcal{Z}^G
\end{bmatrix} = \begin{bmatrix}
c(\boldsymbol{\uprho})c(\boldsymbol{\uptheta}) & c(\boldsymbol{\uprho})s(\boldsymbol{\uprho})s(\boldsymbol{\uptheta}) - c(\boldsymbol{\uprho})s(\boldsymbol{\uprho}) & c(\boldsymbol{\uprho})c(\boldsymbol{\uprho})s(\boldsymbol{\uptheta}) + s(\boldsymbol{\uprho})s(\boldsymbol{\uprho})\\s(\boldsymbol{\uprho})c(\boldsymbol{\uptheta}) & s(\boldsymbol{\uprho})s(\boldsymbol{\uptheta})s(\boldsymbol{\uptheta}) + c(\boldsymbol{\uprho})c(\boldsymbol{\uprho}) & c(\boldsymbol{\uprho})s(\boldsymbol{\uprho})s(\boldsymbol{\uptheta}) - c(\boldsymbol{\uprho})s(\boldsymbol{\uprho})\\-s(\boldsymbol{\uptheta}) & c(\boldsymbol{\uptheta})s(\boldsymbol{\uptheta}) & c(\boldsymbol{\uprho})c(\boldsymbol{\uptheta})
\end{bmatrix} \begin{bmatrix}
\mathcal{X}^b\\\mathcal{Y}^b\\\mathcal{Z}^b
\end{bmatrix} \tag{1}
$$

where *X*˙ *<sup>G</sup>*, *Y*˙ *<sup>G</sup>*, *Z*˙ *<sup>G</sup>* velocities (m/s) (*X*,*Y*, *Z*) in global frame, *φ*, *θ*, *ψ* (roll, pitch, yaw angles), (rad), and *x*˙ *<sup>b</sup>*, *y*˙ *<sup>b</sup>*, *z*˙ *<sup>b</sup>* velocities (*X*,*Y*, *Z*) in the body frame [38,39]. The equations of motion of the quadcopter consist of two main components, dynamic and kinematic. Dynamic components explain the motion of the quadcopter according to Newton's second laws, while kinematic components explain the quadcopter's transformation equations. The rotational kinematics of the quadcopter describe the relationship between the angular rate and Euler angles. According to this rotation kinematics, since the angular rate is given in the body frame and the Euler angles are given in the frame, the relation between each other is obtained as:

$$
\begin{bmatrix}
\dot{\phi} \\
\dot{\theta} \\
\dot{\psi}
\end{bmatrix} = \begin{bmatrix}
1 & s(\phi)t(\theta) & c(\phi)t(\theta) \\
0 & c(\phi) & -s(\phi) \\
0 & \frac{s(\phi)}{c(\theta)} & \frac{c(\phi)}{c(\theta)}
\end{bmatrix} \begin{bmatrix}
p \\ q \\ r
\end{bmatrix} \tag{2}
$$

by using the transformation matrix, where *p*, *q*, *r* roll, pitch, yaw rates (rad/s) and *φ*˙, ˙ *θ*, *ψ*˙, and (rad/s) time derivatives of Euler angles, respectively [38,40]. Translational *s* describes the linear motion of all forces acting on the quadcopter during flight according to the

coordinate frame. Equations of motion resulting from translational *s* of the quadcopter are obtained as in Equation (3), according to Newton's second law:

$$\begin{bmatrix} \ddot{X}^G\\ \ddot{Y}^G\\ Z^G \end{bmatrix} = \begin{bmatrix} \frac{1}{m}(-[c(\phi)c(\psi)s(\theta) + s(\phi)s(\psi)]u\_1 - K\_{dx}\dot{X}^G) \\\ \frac{1}{m}(-[c(\phi)s(\psi)s(\theta) - c(\psi)s(\phi)]u\_1 - K\_{dy}\dot{Y}^G) \\\ \frac{1}{m}(-[c(\phi)c(\theta)]u\_1 - K\_{dz}\dot{Z}^G) + \mathcal{g} \end{bmatrix} \tag{3}$$

where *X*¨ *<sup>G</sup>*, *Y*¨ *<sup>G</sup>*, *Z*¨ *<sup>G</sup>* accelerations (m/s2) *X*,*Y*, *Z* in the coordinates, *m* mass of quadcopter (kg), *Kdx*, *Kdy*, *Kdz* drag coefficients, *X*˙ *<sup>G</sup>*, *Y*˙ *<sup>G</sup>*, *Z*˙ *<sup>G</sup>* velocities *X*,*Y*, *Z* in the coordinates, and *u*<sup>1</sup> is total thrust of all motors, respectively [41]. The rotational *s* of quadcopter describes the relationship:

$$
\begin{bmatrix}
\dot{\Phi} \\
\dot{\theta} \\
\dot{\Psi}
\end{bmatrix} = \begin{bmatrix}
\frac{\left[\left(f\_y - f\_z\right)qr - f\_r q (w\_1 - w\_2 + w\_3 - w\_4) + lK\_T u\_2\right]}{f\_x} \\
\frac{\left[\left(f\_z - f\_x\right)pr + f\_r p (w\_1 - w\_2 + w\_3 - w\_4) + lK\_T u\_3\right]}{f\_y} \\
\frac{\left[\left(f\_x - f\_y\right)pq + K\_d u\_4\right]}{f\_z}
\end{bmatrix} \tag{4}
$$

between the second derivatives of Euler angles (*φ*¨, ¨ *θ*, *ψ*¨) (rad/s2) on each axis depending on the square of its motor speeds (*w*1, *w*2, *w*3, *w*4) (rad/s), namely, torques, and *Jx*, *Jy*, and *Jz* (kg m2) quadcopter moments of ineartia on each axis. *u*<sup>2</sup> refers roll control input, *u*<sup>3</sup> describes pitch control input, *u*<sup>4</sup> indicates yaw control input, *KT* is the thrust coefficient, *Kd* is the drag torque proportionality constant, and *l* is the arm length of quadcopter (m) as in Equation (4) [38,41]. The quadcopter moments of inertia on each axis and mass of quadcopter are expressed [41]:

$$I\_X = I\_Y = \frac{2(m\_c + m\_l)R^2}{5} + 2l^2 m\_{ll} \qquad I\_{\overline{z}} = \frac{2(m\_c + m\_l)R^2}{5} + 4l^2 m\_{ll} \qquad m = 4m\_{ll} + m\_c + m\_l \tag{5}$$

where *mc* is the center mass of quadcopter (kg), *R* is the radius of center mass (m), *mm* is the motor mass (kg), and *ml* is the payload mass (kg). In this study, the total mass in the system model of the quadcopter is changed during the payload hold–release mission depending on the weight of the payload carried, and the moment of inertia in each axis is directly related to this mass change. To summarize, the dynamic and kinematic model of the quadcopter with six degrees of freedom is represented as Equations (1)–(4). The relationship between motor speeds and control variables is defined as:

$$
\begin{bmatrix} u\_1 \\ u\_2 \\ u\_3 \\ u\_4 \end{bmatrix} = \begin{bmatrix} K\_T & K\_T & K\_T & K\_T \\ 0 & -lK\_T & 0 & lK\_T \\ lK\_T & 0 & -lK\_T & 0 \\ K\_d & -K\_d & K\_d & -K\_d \end{bmatrix} \begin{bmatrix} w\_1^2 \\ w\_2^2 \\ w\_3^2 \\ w\_4^2 \end{bmatrix} \tag{6}
$$

Note that the control variables are directly proportional to the squares of the motor speeds.
