An autonomous obstacle avoidance method based on artificial potential field and improved A* algorithm for UAV

. The main purpose of autonomous obstacle avoidance path planning of unmanned aerial vehicles (UAVs) is to find a collision-free flight path from the starting point to the target point in the threatened airspace. This paper mainly studies and designs an autonomous obstacle avoidance algorithm for UAVs. Firstly, the research status of obstacle avoidance is reviewed. Secondly, the problem scene is set up, and the basic algorithm used is described. Furthermore, a modified algorithm is designed to solve the problems mentioned above. Finally, the effectiveness of the method is simulated and verified.


Introduction
Unmanned aerial vehicles (UAVs) are increasingly used as new mission execution platforms for high-risk missions. With the development of technology, the performance of UAV has also been significantly improved. In recent years, UAVs have shown good development potential in the fields of military operation [1] and people's livelihood applications [2]. Autonomous mission execution is the inevitable trend of UAV development in the future, and path planning is one of the key technologies to improve UAV autonomous flight capability [3] and ensure robustness [4] of the system.
The autonomous obstacle avoidance of the UAV means that it can avoid risks and obstacles autonomously in flight through specific algorithms. For decades, a lot of research and discussion on the classic problem of UAV path planning has been done. For example, some traditional and efficient algorithms like the A* algorithm [5], artificial Potential Field (APF) algorithm [6], and neural network algorithm [7] are applied to task scenarios. In addition, reference [8] provides a UAV flight following method combining segmented adaptive B-spline (PABS) method, which significantly improves the mission execution efficiency of UAV. The method in [9] supplements the improved flock algorithm and sets the UAV control quantity as the direct control loop in the flight control system. Reference [10] uses A * algorithm to delete redundant parts in UAV flight exploration space, to reduce search space and improve search efficiency. Moreover, the algorithm of [11] expands the search scope of the UAV, and it cuts off some flight detection space according to the performance constraints of the UAV, thus significantly improving the flight efficiency of UAVs. What's more, rapid-exploration random tree algorithm(RRT) [12], chemical reaction optimization algorithm(CRO) [13], and the seagulls algorithm [14] as several novel algorithms also provide new ideas for UAV path planning.
To sum up, the UAV autonomous obstacle avoidance path planning research direction is mainly focused on the realization of the function of obstacle avoidance and feasible route of high efficient generation, calculating the length of time in the algorithm and the convergence of the algorithm results more, and slightly fewer parts involved for optimal the evaluation standard of obstacle avoidance path planning and the selection of the optimal path of obstacle avoidance. And with the progressively complex task environment, the reachability, convergence, and other performance requirements of the path planning algorithm are also increasing.
Motivated by the above discussions, a modified algorithm combining artificial potential field algorithm and A* algorithm is designed in this paper. The main purpose of the algorithm is to enable UAVs to avoid static and dynamic obstacles simultaneously when cruising at the same altitude in the airspace, meanwhile, to find a flight path with minimum consumption from the starting point to the endpoint.
The rest of this work is organized as follows. In section 2, the problem scenarios are described, the basic principles of the artificial potential field method and A* algorithm are described, and their shortcomings are pointed out. In section 3, the algorithm is optimized and modified to solve the problem in this paper. In section 4, the proposed modified algorithm is verified and analysed by simulation. In section 5, the path planning method proposed in this paper is summarized.

Problem statement
When the UAV with detection radar fly uniformly at a certain altitude in a particular area(figure 1), the starting point and target point are known, the UAV also knows static obstacles (such as mountain obstacles) in this area. Those known obstacles can be approximately treated as a large circle with a certain radius. The radar detection range of the UAV also forms a circle. While other areas are unknown risk areas, requiring airborne radar to detect the airspace situation in real-time.
Firstly, the UAV needs to carry out static path planning to obtain a theoretical optimal collision-free path to the target point. But in the process of actual flight, the UAV also seems to be encountered similar to such an enemy tower before unpredictable unknown obstacles. Thus, it means that the original static planning path may be changed by the implementation of the detection radar detection results, the initial single static planning will be improved for the dynamic path planning.
As depicted in figure 2, | − 0 | is the Euclidean distance between the UAV and the radar center of the enemy. R u is the detection radius of the airborne radar of the UAV. When | − 0 | > R u + R max , the UAV can safely pass through the area without being detected; When R u + R min < | − 0 | ≤ R u + R max , the enemy guard tower can detect the UAV, and the enemy may capture the UAV. When | − 0 | ≤ R u + R min , the UAV will not be able to escape the capture of enemy radar, resulting in obstacle avoidance failure. Therefore, the route planned by the algorithm should be as far away from the detection center of the enemy ITM Web of Conferences 47, 02016 (2022) CCCAR2022 https://doi.org/10.1051/itmconf/20224702016 guard tower as possible. Besides, the UAV also needs to satisfied the constraints of minimum track length and minimum turning radius during flight, so the smoothness of the final planned path is also required. In the following sections, an artificial potential field algorithm and A* algorithm will solve the above problems.

Artificial potential field algorithm
The artificial potential field algorithm is a popular obstacle avoidance algorithm. Its basic principle can be summarized as follows. Through the artificial potential field (gravitational field and repulsive field), the UAV is regarded as the rolling particle in the area. The target point is the lowest global potential energy point to make the UAV reach the target finally. According to (1), the artificial gravitational field between UAV and target point ( ) can be obtained: where is the set gravitational constant that is greater than 0,� − �is the Euclidean distance between the UAV and the obstacle. Similarly, the repulsive field generated by obstacles in the region ( ) can be obtained: where is the repulsive constant | − 0 | is the Euclidean distance between UAV and obstacle; R is the obstacle influence distance. According to the artificial potential field theory, the negative gradient direction of the potential function at the current position is calculated as the next movement direction of the UAV. The attraction force of the target point to the UAV and the repulsion force of the obstacle to the UAV can be calculated according to (1), (2), respectively: by integrating (1), (2), (3), and (4), the potential field and resultant force of UAV in the moving area can be calculated: Although the artificial potential field method is often used in dynamic path planning, its global search ability is poor and prone to a local minimum [15] and target points unreachable [16]. These are also the two problems that need to be optimized in this design.

A* algorithm
The A* algorithm is a heuristic search algorithm that searches nodes and constructs the optimal path by constantly evaluating the evaluation function value of the path in the search space. The commonly used evaluation function of the A* algorithm is listed as (7). Among them, n indicates the node where the machine is located, F(n) is defined as the evaluation function calculated from the initial node through the ℎ node to the target node; G(n) is defined as the actual cost consumed from the initial node to the ℎ node in the flying area; H(n) is defined as the cost of or will be consumed from the ℎ node to the target node, the predicted cost value to be consumed. The main principle of the A* algorithm applied to global path planning can be summarized as follows: firstly, the movement area of the machine is cut into many identical nodes, and then two lists are established: open list and close list. The open list is used to hold all nodes that have been generated but not checked, and the close list is used to save all navigational nodes that have passed. Specific steps are described in figure 3. The traditional A * algorithm used path planning for unmanned vehicles or robots uses an omnidirectional extension for path node search. Nodes are extended to eight adjacent directions each time ( figure 4). With the increase of the planning area, the time and memory consumed by this method will significantly increase. It is because many useless nodes will appear in the planning of omnidirectional node expansion mode. Suppose they are directly implanted into the autonomous path planning of UAVs without considering the structural constraints of UAVs. In that case, the trajectory planned by the A * algorithm may not apply to UAVs.

The main results
As discussed in section 2.3, for the defects caused by applying the traditional A* algorithm to the UAV, some UAV's flight constraints are introduced into the A * algorithm to improve path planning efficiency in this design. In Fig. 5, constraints (maximum turn angle, minimum step size) are added to node expansion to improve computational efficiency. Considering the current heading of UAV and limiting the next node search area, make the heading angle of the following search node meet the constraint less than . Generally speaking, the forward flight space of a UAV at this time is a sector area. In (11), the current node X(n) = [ ( ), ( )] and the extension node X(n + 1) = [ ( + 1), ( + 1)] of a UAV needs to satisfy the constraint of maximum steering angular velocity. So in this way, the change of control heading angle can be adjusted.
among them, = * , L is the UAV search step, and is the maximum turning angle, is the minimum turning radius, is linear flight speed. Therefore, the A* algorithm adopted in this design is different from the traditional A* algorithm after the above optimization. The original omnidirectional node search is improved to the vertebral node search. The node search is faster and more effective, saves memory, and is more in line with the kinematics law of UAV.
The A* algorithm optimized above has a better ability to adapt to the static path planning of the UAV. But in order to have better dynamic planning performance, it is necessary to design an improved obstacle avoidance algorithm combined with the artificial potential field method. Thus, a modified algorithm of UAV obstacle avoidance path planning is proposed in the following.
The modified algorithm is divided into two stages. The first stage is the static obstacle planning stage. The ground flight management department sends spatial area information to UAV, and the A* algorithm is used to plan a stationary obstacle avoidance path. When the UAV flies along the static route, the scanning radar on the aircraft always searches and scans the airspace within a specific radius circle area. When the radar detects enemy signals, it enters the dynamic obstacle planning stage. The artificial potential field method is adopted to avoid obstacles for dynamic obstacles. As shown in Fig. 6, path a is a static obstacle avoidance path planning by the A* algorithm. When the UAV is cruising along the path a, if ITM Web of Conferences 47, 02016 (2022) CCCAR2022 https://doi.org/10.1051/itmconf/20224702016 the UAV's radar detects a new enemy unit ( R u + R min ≤ | − | ≤ R u + R max ), the artificial potential field algorithm is immediately activated to avoid obstacles. For example, point A is the starting point of the local artificial potential field method. Point B is the termination point, a path point far from the enemy radar detection area calculated by the UAV control system. It is taken as the endpoint of the local artificial potential field method. The artificial potential field method avoids obstacles between A and B, then obtains path b as the final path. The modified algorithm designed in this section retains the global programmability of the A* algorithm and uses the good dynamic programmability of the artificial potential field method. It makes up for the shortcomings of the former dynamic programming and avoids the problems of local minimum and unreachable target points in the latter to a certain extent.

Simulation and analyze
The 130km*130km flight map was established by simulation. The gravitational coefficient of the artificial potential field method was set as 5, and the repulsive coefficient was set as 10. The rasterization length of the A* algorithm is 1km; Four groups of data composed obstacles, one starting point, and one target point are used as four navigation test routes:  figure 7, there are only two static obstacles in the initial known area of the UAV, and the threat radius is known. The planned path in figure 7(a) is the stationary obstacle avoidance path calculated by the A* algorithm, referred to as the preliminary obstacle avoidance path mentioned above. Initially, the UAV follows the initial obstacle avoidance path. If the airborne radar detects obstacles, regard them as dynamic obstacles. The node where the UAV is located when the dynamic obstacle is first scanned is used as the entry point, such as points 1, 3 in figure 7(b). Then set a point far away from the dynamic obstacle as the passing point, such as points 2, 4 in figure 7(b). At this time to start the artificial potential field algorithm. From figure 7(b), it can be concluded that the UAV realized dynamic obstacle avoidance based on the original obstacle avoidance path and well circled away from the area that may cause risks, successfully avoiding obstacles.  figure 9(a), when the original artificial potential field method was used for path planning of scene 3, although the UAV avoided the newly emerged unknown obstacle, the UAV stopped at the local minimum point because the repulsive force of the known obstacle and the attraction of the target point was 0. It results in obstacle avoidance failure. Nevertheless, as shown in figure 9(b), since the A* algorithm used in the modified algorithm does not have the local minimum problem, the initial path  figure 10(a), the original artificial potential field method is used to plan the path for scene 4. Because the distance between the target point and obstacle is too close, the repulsive force received by the UAV builds up at the end of the path, and the gravitational force drags down. It results in the unreachable problem of the target point. While the conclusion drawn from figure 10(b) is that the problem of unreachable target points is greatly improved after the artificial potential field method is mixed with the A* algorithm.

Conclusion
Combined with the above results, the modified algorithm can accomplish the task of dynamic path planning well in four simulation scenarios. In scenario 1, the simulation environment is mainly used to verify the feasibility of the dynamic path planning algorithm. In scenario 2, there are unknown obstacles that do not affect the initial path, which verifies the reservation of the modified algorithm for the initial path. In scenario 3 and scenario 4, the problem of local minimum point and target point unreachable is solved. In conclusion, compared with the A* algorithm, the modified algorithm designed in this paper has dramatically improved its dynamic programming ability. Compared with the artificial potential field algorithm, its global search ability has improved. Under certain circumstances, the modified algorithm is effective for UAV autonomous path planning.