Research Article Path Planning of Multirotor UAV Based on the Improved Ant Colony Algorithm

. Path planning is an important part of the unmanned aerial vehicle (UAV) to realize its autonomous capabilities. Aiming at the shortcomings of the traditional ant colony algorithm-based trajectory planning method, which has slow convergence speed and easy to fall into the local optimum, a path planning method based on the improved ant colony algorithm is proposed. First, a dynamic adjusting factor is added into the heuristic function to improve the directivity of path selection and search speed. Then, the state transition strategy is improved to solve the problem of slow convergence in the initial stage and easy to fall into local optimum in the later stage. Finally, the path inflection point is smoothly optimized through the cubic B-spline curve. Simulation results show that the improved ant colony algorithm can quickly converge to the optimal path and well adapt to the flight requirements of multirotor UAV.


Introduction
With the continuous progress of science and technology, especially the continuous development of microelectronic technology and microelectromechanical technology, UAV has been widely used in military and civil elds.Compared with large UAVs, small UAVs have a broader application space in the elds of police, rescue and disaster relief, tra c management, news media, aerial photography, geological survey, environmental evaluation, pipeline inspection, and so on.Among them, the multirotor small UAV, as a typical representative, has developed particularly rapidly in recent years and received the focus of researchers.
Path planning is one of the key technologies for UAV to realize autonomous ight.A large number of scholars have done research on it and achieved a lot of results.In fact, path planning is to nd an optimal ight path from initial point to target point under certain constraints.Common planning methods include classical algorithms such as the A * (A-star) algorithm [1,2], arti cial potential eld method [3,4], and optimal control method [5,6], as well as intelligent algorithms such as the genetic algorithm [7,8], ant colony algorithm [9,10], and particle swarm optimization algorithm [11].
e classical algorithm is generally only suitable for simple spatial path planning.In the face of complex problems, the di culty of solving them increases exponentially with the increase of dimension, which has certain limitations.With the development of computer and big data technology, intelligent algorithms have more and more obvious advantages of good robustness, positive feedback mechanism, and self-organization.Taking the ant colony algorithm as an example, theoretically, it can nd the optimal solution of the path, which is suitable for path planning in complex environment.However, in practice, we must consider the problems of how to shorten search time, speed up convergence, and jump out of local optimal.Li et al. [12] introduced a weight factor into the probability transfer function and improved the updating way of information.
e simulation results showed that the convergence speed of the improved algorithm is improved, and the optimal path is shorter, but the search results are not stable.Wu et al. [13] adopted the method of integrating the current optimal track pheromone and the historical optimal track update, introduced the pheromone rollback clearing mechanism, and carried out offline calculation, which improved the search efficiency, but did not significantly reduce the number of iterations.Wang et al. [14] used the artificial potential field method to improve the heuristic function of the ant colony algorithm, allocated pheromones reasonably when the algorithm is not running, and improved the volatilization coefficient to find the optimal path of the algorithm.
It can be seen that many research studies are all based on the traditional ant colony algorithm and have achieved certain results.However, the traditional ant colony algorithm has the shortcomings of slow convergence speed and easy to fall into local optimum, which is not applicable to the real flight environment.Aiming at the defects of the basic ant colony algorithm, an improved ant colony algorithm is proposed in this study to make it suitable for path planning of multirotor UAV.First, a dynamic adjusting factor is added into the heuristic function to improve the directivity of path selection and search speed.en, the state transition strategy is improved to solve the problem of slow convergence in the initial stage and easy to fall into local optimum in the later stage.At the same time, combined with the existing pheromone volatilization factor update strategy, the overall performance of the algorithm is improved.Finally, the path inflection point is smoothly optimized through the cubic B-spline curve, so that the path planning of multirotor UAV is more in line with the flight reality.
e study is organized as follows: Section 2 describes the environment in which the UAV performs its mission.Section 3 introduces the basic principle and deficiency of the ant colony algorithm.Section 4 improves the shortcomings of the ant colony algorithm and proposes the UAV track planning method and smoothing method.In Section 5, the proposed algorithm is simulated and analyzed, which verifies the effectiveness of the proposed algorithm.Finally, the full text work is summarized and the next research direction is pointed out.

Environmental Model
In order to accurately describe the path planning process of UAV, its two-dimensional environment map [15,16] needs to be modeled.
e conventional environment modeling methods include the grid method [17,18], geometric information method, and view method.Considering that the grid method has the advantages of simple drawing, clear data structure, and easy implementation, we select the grid method to complete the UAV flight environment modeling.
e grid method decomposes the plane map into a series of grids to facilitate the analysis of map information.e grid map is composed of 0 and 1 matrices with binary values.In the matrix, 0 stands for free grid, in which the UAV can enter and exit freely, represented by white grid, and 1 stands for obstacle grid, in which the UAV needs to move around, and represented by black grid.e grid environment and the electronic map are shown in Figure 1. e map is numbered from left to right and top to bottom.e grid serial number corresponds to coordinates one by one, and the expression of the relationship between them is shown in equation (1).e result obtained is the center point of the grid.
x i � r × mod(i, R) − 0.5, where r is the grid size, i represents the number of the grid, R is the number of rows of the grid matrix, mod () is the remainder operation function, and ceil () is the rounding up operation function.
In order to prevent the collision between UAV and obstacles, when the obstacle is less than one grid, it is filled into a complete grid.At this time, the UAV is treated as a particle.
e flight rules of UAV are as follows: it can only appear in the white grid and cannot pass through the black grid, but it can pass through the four corners of the black grid; it is forbidden to repeat the same grid; and in unit time, it can only move between two adjacent grids.We use Euclidean distance to measure the length of the flight path.For example, if moving up, down, left, and right, the path length is 1 unit and if moving to the four corners of the grid, the path length is 1.41 units.

Basic Ant Colony Algorithm
Ant colony algorithms are inspired by the foraging behavior of ant populations, in which each ant in the colony leaves pheromones in its movement path to communicate information to the colony.e shorter the moving path is, the higher the pheromone concentration is, and the probability that the path is selected by ants, which forms the positive feedback mechanism for ants to find the shortest path.e basic principle of the ant colony algorithm is as follows.
Ants select paths according to pheromone concentration and heuristic function, and the probability of ant k moving from grid i to grid j can be expressed as where α is the pheromone heuristic factor and β is the distance expectation function factor, which affect the importance of pheromone and distance heuristic function, respectively, A k indicates the next destinations ants can reach, τ ij (t) is the pheromone concentration on the moving path at time t, and η ij (t) represents the distance heuristic function.Here, 2 Journal of Robotics Each ant will leave a certain amount of pheromone when moving.
erefore, when the algorithm iterates continuously, the pheromone content in the path gradually accumulates and volatilizes at the same time.When all ants in the population complete each round of iteration, the pheromone content on the path will be updated according to the following rules: where ρ is the pheromone volatilization coefficient, Δτ ij represents the sum of pheromones released on the path between the two nodes, Δτ k ij denotes the pheromone increment, L k is the path length of ant k, and Q is the pheromone enhancement coefficient.

The Improved Ant Colony Algorithm
4.1.e Improved Heuristic Function.When using the basic algorithm to plan the path, the ant colony has not left pheromone in the initial stage.At this time, the pheromone on the path is scarce.e ant cannot select the next grid according to the pheromone concentration.e search has no purpose and cannot quickly search the feasible path.On the basis of the heuristic function in [19], we add a dynamic regulation factor ξ. e new expressions of heuristic function and ξ are shown as where d jE is the Euclidean distance between j and the target point, iter is the current number of iterations, and iter max is maximum number of iterations.

e Improved State Transition Rule.
In the basic ant colony algorithm, ants mainly rely on the probability function to select the next node.However, in the early stage of the algorithm, the difference between the pheromone concentrations of the path is very small, which cannot effectively guide the ant to choose the path.Based on the initial transition probability, the convergence speed of the algorithm is guaranteed by introducing pseudorandom rules.e ant will select the next node j according to the following formula.
where q represents a random number between (0, 1), and q 0 is a design parameter, which is usually determined by previous experience and repeated experiments.Its value determines the path selection mode.If the value of q 0 is too large, the path shift is more likely to be a deterministic pattern, and the convergence speed is faster, but the global search capability is reduced.On the contrary, if the value of q 0 is very small, the path shift is more inclined to the roulette mode, which not only increases the randomness of the global search but also reduces the convergence speed.erefore, setting a reasonable value of q 0 has an important influence on the convergence process.In order to better improve the problem of slow convergence in the initial stage and easy to fall into local optimization in the later stage, we designed it as a dynamical parameter adjusted with the number of iterations.e details expression is as follows: Journal of Robotics

Pheromone Volatilization Factor Update Strategy.
Due to the particularity of path planning, different volatilization coefficients are required in different stages: if ρ is too large, ants cannot complete path search according to the pheromone information, resulting in slow convergence speed; if ρ is too small, the pheromone will accumulate excessively, easily make the path search fall into local optimization.Referring to the research ideas of [19], the adaptive updating strategies of pheromone volatile factors are designed as follows: In order to search as many paths as possible, the pheromone content should be controlled at a low level at the initial stage of algorithm optimization.erefore, the value of the initial volatile factor ρ should not be too small.At this time, pheromone concentration has little interference in the process of path exploration, and ants can search more possible paths.With algorithm iteration step by step, the value of ρ gradually decreases, and the negative feedback effect is weakened.e pheromone content on the moving path is increased, and the guiding effect of pheromone concentration on ant colony is enhanced.When the number of iterations increases to a certain number, ant colony will converge to the path with a higher pheromone content.
erefore, the improved algorithm can expand the searching range of ant colony and improve the convergence speed.e changing curve of ρ is shown in Figure 2 (initial ρ � 0.8).

Path Smoothing Method.
e optimal path generated by the improved ant colony algorithm is not smooth enough and has sharp inflection point.erefore, cubic B-spline smoothing is introduced to optimize the path at the inflection point.e total equation of the B-spline curve is [20,21] e basis function in cubic B-spline curve equation is Furthermore, the mathematical expression of the basis function of cubic B-spline curve is e cubic B-spline curve equation can be converted by bringing the basis function into the general equation: Based on the above cubic B-spline curve equation, the flight path can be smoothed.Figure 3 shows the simulation of local path smoothing results.e red line is the path to be smoothed, and the blue dotted line is the smoothing result.e goal of this strategy is to replace the broken line with a curve near the inflection point, so that the obtained path is smoother and more in line with the reality of UAV flight.e flow of the improved ant colony algorithm is shown in Figure 4.

Simulation Analysis
e simulation hardware environment is the Huawei MateBook Pro laptop equipped with Intel Core I7-8565U processor.Software environment is the Win10 operating   and 2.

Performance Test.
In order to verify the optimization ability of the improved ant colony algorithm in this study, first, the typical single-mode test function Sphere and multimode test function Alpine are used for the optimization comparison test.e dimension value of the two functions is 30, the value range of Sphere is [−100, 100], the value range of Alpine is [−10, 10], and the theoretically achievable minimum value of both functions is 0. e two function expressions are as follows, respectively: e basic ant colony algorithm (BACA) and the improved ant colony algorithm (IACA) are independently run for 20 times on each test function, and the common parameters of the algorithm remained consistent.e results are given in Table 3.

Perform smoothing on the optimal path
Whether the maximum number of iterations is reache Save the path length, select the current optimal path, and update the global optimal path

Journal of Robotics
According to the test results in the above table, the IACA algorithm proposed in this study has a good optimization effect.e theoretical global optimal value can be obtained by searching for Sphere function and Alpine function.

Comparison Test of Path Planning.
In order to verify the effectiveness of IACA in UAV path planning, BACA and GA (genetic algorithm) are used as a comparison to conduct simulation comparison tests in 20 × 20 and 30 × 30 environment maps.

20 × 20 Simulation Environment.
e simulation test is first carried out in a 20 × 20 grid map, with the starting point at the upper left corner of the map and the target point at the lower right corner.BACA, GA, and IACA proposed in this study are used to plan the flight path of UAV, respectively, with the maximum iteration times of 100.Path planning diagram and iterative convergence curve are shown in Figures 5-7.e experimental results are given in Table 4.
It can be seen from the above table that the shortest path length obtained by applying the IACA algorithm proposed in this study is 15.4% shorter than that obtained by applying the BACA algorithm, and the running time is reduced by 14.1%.Compared with GA, IACA is 22.8% shorter, and the running time is reduced by 14.6%.

30 × 30 Simulation Environment.
When the flight environment is large and obstacles are densely distributed, the 100 iteration times of 20 × 20 map cannot be effectively converged to the shortest path.We increase the maximum    5, the shortest path obtained by IACA is 14.2% shorter than that obtained by BACA, and the system running time is reduced by 8.7%, respectively.Compared with GA, though the system running time is added by 6.4%, the shortest path obtained by IACA is 13.8% shorter than that obtained by GA.

Conclusion
In this study, we proposed an improved ant colony algorithm for multirotor UAV path planning.By redesigning the heuristic function of the ant colony algorithm and improving the state transition matrix, the running time of the algorithm and the distance of the optimal moving path are effectively shortened.At last, we smoothed the final moving path to make it more in line with the flight reality of UAV.
rough the comparison of MATLAB simulation experiments, it can be seen that the improved algorithm has more advantages than the basic algorithm in the optimization effect and reflects the effectiveness of the algorithm in the operation time and the shortest path.
In practical applications, UAVs usually perform tasks in a swarm.erefore, how to complete the coordinated trajectory planning of UAV swarms on the basis of this study will become the focus of our next research.

Data Availability
e data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest
e authors declare that they have no conflicts of interest.

Figure 1 :
Figure 1: Grid map and electronic map.

Figure 3 :
Figure 3: Simulation of local path smoothing results.
point, target point and algorithm parameters Put the ant colony at the starting point and start to search the path Select the next node according to the probability formula of heuristic

Table 1 :
Basic parameter settings of BACA and IACA.

Table 2 :
Basic parameter settings of GA.

Table 3 :
Comparison of test functions for optimization results.