Research on path planning of multi-rotor UAV based on improved artificial potential field method

UAV needs sensor to fly in an environment with obstacles. However, UAV may not be able to move forward when it encounters a large obstacle, or UAV will be in a dangerous state when the sensor fails briefly which disturbed by the environment factors. In order to solve these problems, the following methods are proposed in this paper. Aiming at the first problem, this paper proposes an improved APF method for path planning, and verified by simulation experiments that this method can find the optimal path. Aiming at the second problem, this paper proposes a solution to expand the range of obstacles and dynamically change the distance in the APF repulsion function. It is verified that the UAV can fly safely within the short time of the sensor problem by simulation experiments. In conclusion, this paper has an important reference value for the application of UAV online dynamic path planning in engineering.


Introduction
With the rapid advancement of science and technology, the technology of unmanned aerial vehicle(UAV) has developed rapidly. The obstacle avoidance sensors used on UAV have higher accuracy, longer detection distances and stronger anti-interference performance. Subsequently, many scholars proposed a lot advanced path planning algorithms, there are traditional methods such as A* algorithm [1][2][3], APF method [4][5], and Ant Colony algorithm [5][6][7][8], as well as intelligent path planning methods based on Neural Network [9] and Genetic algorithms [10] etc.
However, there may be some problems as follow that are not considered in the above methods in engineering applications.
(1)When the UAV encounters a striped obstacle (such as a wall), the traditional APF method may not work properly. The addition of lateral disturbance may temporarily leave the local optimal state, but it may cause the UAV path to oscillate, which is not conducive to flying; (2)In the case of interference from the external environment, the sensor may have problems such as decreased accuracy and shorter detection range. When the global information is unknown and the sensor is not working properly, the traditional path planning method will put the UAV into a dangerous state. Therefore, this paper mainly studies these two issues.

Artificial potential field method
The APF method is a virtual force method, which equates the movement of a UAV in an environment to the movement of a charged ball in a force field environment with both positive and negative charges. The APF method has strong adaptability to unknown environments and relatively simple calculations. Therefore, it is widely used because it meets the requirements that UAV can avoid obstacle real-time [4].
The repulsion field function of the traditional APF method is as follows: is the distance between the UAV and the obstacle, and 0 ρ is the radius of influence of the obstacle. If 0 ( , ) obs q q ρ ρ > , it means that the UAV is in a safe area and there is no need to avoid collision.
The repulsion can be understood as the gradient function of the repulsion field: Similarly, the gravitational field function and gravity are: att att obs F q U q q q ξρ = −∇ = (4) In the end, the direction of the UAV's movement is the combined force of the obstacle's repulsion and the target's gravity.

Bug2 algorithm
The principle of the Bug algorithm [11] is similar to the movement strategy of insect crawling. When the sensor does not detect the obstacle, the UAV moves to the target in a straight line. When encountering the obstacle, the UAV keeps a certain distance from the obstacle and moves along the obstacle. This algorithm is relatively simple and not affected by the global position information and the shape of obstacles, but the planned path is longer and inefficient.
Bug2 is a bit simpler than the Bug1 algorithm, there are still two main actions: motionto-goal and boundary-following, as shown in

Improved path planning algorithm
The UAV may encounter obstacles with special shapes during the flight, such as the barshaped obstacles shown in Fig.1. If the traditional path planning method such as APF or bug2 algorithm is used alone, it may not be able to bypass the obstacles or fly extra distances. Next, we compare and analyse the advantages and disadvantages of the above two.
1 H q is the point where the UAV first encounters the obstacle, we can call it hit point, so 1 2 、 must be the leave point. When the UAV is at the point 1 H q , the UAV is very likely to fall into the local optimal position and cannot move forward, if the traditional APF method is used for path planning, If lateral disturbance is applied to the UAV, then this method will plan an oscillation path, which is not conducive to actual flight. The solid line is the path planned by the Bug2 algorithm, and the curve segment 2 L goal q X is the path planned by the APF method. Obviously, the path 1 2 2 H L L goal q q q X 、 planned by Improved APF method is the best path. This paper proposes an improved APF algorithm that combines the advantages of traditional APF and Bug2 algorithms. The specific obstacle avoidance process is shown in Table1.

Obstacle avoidance method when the sensor fails briefly
In the normal flight of the UAV, the sensor can detect obstacles in advance, and make obstacle avoidance actions to re-plan the path after entering the obstacle's influence range. However, the sensor is likely to be affected by the external environment in actual engineering applications, the performance of the sensor will deteriorate or temporarily fail. The safest strategy at this time is to slow down or hover, but in order to increase the cruising distance, the UAV should be kept in motion state as long as possible.
This paper judges the sensor fault condition as: max is the maximum detection distance when the sensor fails, ρ is the radius of the obstacle's influence range.
Generally, max is the maximum detection distance when the sensor works normally.
The flight of a UAV can be regarded as the process of tracking a fixed or dynamic target. Of course, the UAV is in the most dangerous state when the sensor fails briefly when tracking a dynamic target. In this case, the position of the target point is updating, and the magnitude and direction of the target's attractive force on the UAV are changing. We can assume that the UAV's flight trajectory is a straight line in a short time and only consider the situation that the UAV is in the expanded influence range of the obstacle. x y ,which remains unchanged(see Fig.1). Before the sensor returns to normal, we can get the distance between the UAV and the obstacle by using the real-time position coordinates ( , ) x y of UAV and the coordinates ( ', ') x y of the obstacle. From this distance, we can judge whether UAV is within the expanded influence range of the obstacle.
If we get B ρ − Ι ≤ (5) is the distance between the UAV and the obstacle detected at the last moment of the sensor failure; 2 1 2 v t a t Ι = ∆ + ∆ is the distance the UAV moved forward in time t ∆ ; B r ρ + is the radius after the expansion of the obstacle's influence range, and r is the radius of the obstacle. We believe that UAV has entered the influence range of obstacle, and need to re-plan a new path when inequality expression (5) holds. Now, the distance between the UAV and the obstacle in the repulsion function expression satisfies ( , ) obs q q ρ = − Ι , and keep ( , ) obs q q ρ is changing before the sensor returns to the normal state, Equation (6) shows the longer flight time in the influence range of the obstacle, the smaller ( , ) obs q q ρ will be, thereby the repulsion will increase and "drives" the UAV out.

Simulation
We use simulation experiments to verify the effectiveness and feasibility of the algorithm proposed in this paper. The simulation environment is MATLAB (R2017b).

Simulation experiment with large obstacle
When encountering a large obstacle, if the UAV tracks a dynamic target point, it may get rid of the obstacle and move on, but this possibility is very small when tracking a fixed target point, so this paper only considers the situation that tracking fixed target point when encountering a large obstacle.
In the motion environment, MATLAB is used for three simulations: the APF method is used alone, the Bug2 algorithm is used alone, and Improved APF method to perform path planning simulation. The simulation parameters are shown in Table2 and Table3. And the starting point of the UAV is (5,5), the end point is (80,100), there is a bar-shaped obstacle (black part) between the start point and the end point(see Fig.3).

Parameter Name
Parameter Value

UAV step 10
Distance from obstacles 5.0/m According to Fig.3(a), it can be seen that the APF method is used alone, the UAV cannot bypass the obstacle because the obstacle is "large" enough, even if a lateral disturbance is applied. According to Fig.3(b), if we use the Bug2 algorithm alone, although UAV can eventually reach the target point, it has gone the extra distance and the path is not the best. According to Fig.3(c), the UAV flies along the wall after encountering a huge obstacle, when the obstacle is bypassed, the UAV finally uses the APF's potential field strategy to plan the best path and waste the shortest time. We counted the performance of various algorithms, as shown in Table4.

Simulation experiment with fixed target point
The simulation parameters are shown in Table5. Table 5. Fixed target point simulation parameter setting.

Parameter Name Parameter Value
Normal maximum detection distance max We set when UAV is 4.5m away from the No.2 obstacle, the sensor fails and the sensor detection distance is shortened to 2m. From Fig.5(a), the shortest distance from UAV to the obstacle is 2.446m, the sensor cannot detect the obstacle, so UAV keeps flying straight and does not avoid the obstacle. Therefore, the UAV is in a dangerous state during actual flight. This method is not desirable.
During adopting the improved obstacle avoidance method, the UAV normally flies at a distance of 4.5m from the No.2 obstacle, which is not yet in the expanded influence area, after advancing 0.5m, the UAV enters the expanded influence range of obstacle, and jumps within and outsides the obstacle's influence area, which affected by gravitational and repulsive forces from target point. From Fig.5(b), the minimum distance between UAV and the obstacle is 3.418m, which is greater than the normal radius of the obstacle's influence range, the UAV is safe, and successfully avoids the obstacle, as shown in Fig.4(b).

Simulation experiment with dynamic target point
The simulation parameters are the same as those in Table5. The UAV follows a fixed target in a linear motion before encountering the No.3 obstacle, and tracks the dynamic target near the No.3 obstacle.
We set when UAV is 4.5m away from the No.3 obstacle, the sensor fails and the sensor detection distance is shortened to 2m. As shown in Fig.7(a), the shortest distance between UAV and the obstacle is 2.325m, which exceeds the detection range of the sensor, so the obstacle avoidance is not triggered, but the UAV is in a dangerous state at this time. As shown in Fig.7(b), after using the improved obstacle avoidance method, the UAV will be affected by the obstacle's repulsion after it enters the expanded influence area of the obstacle, and the repulsion will increase with time. At the same time, the position change of the target point will cause the change of magnitude and direction. From Fig6(b), the shortest distance between UAV and the obstacle is 3.563m, which is larger than the normal radius of the obstacle's influence range, and the UAV finally "escapes" the obstacle safely, as shown in Fig.6(b).

Summary
This paper mainly studies the path planning of multi-rotor UAV when the sensor is affected by the environment or encountering a large obstacle when tracking fixed or dynamic target point. When encountering a large obstacle, the Bug2 algorithm has the feature of "walking along the wall" and it can reach the target point without being surrounded by obstacles. Therefore, the improved APF path planning algorithm is used to solve the problem that the target blocked by obstacles is not reachable. If the detection distance affected by the environment becomes shorter or the obstacle cannot be detected in time, we can expand the influence range of the obstacle, dynamically change the distance between the UAV and the obstacle in the repulsion function, and combine the prior distance to perform avoidance actions in advance, which can effectively ensure the safety of the UAV. The validity and feasibility of the algorithm are verified by the above simulation experiment, which has important reference value for the promotion of practical engineering application. This paper does not consider the obstacle avoidance problem of multi aircraft flight and the complex situation of more fixed obstacles and dynamic obstacles. In the future, it needs to verify the feasibility of the algorithm in the more complex situation.