Academic Journal of Science and Technology ISSN: 2771-3032 | Vol. 6, No. 3, 2023 93 Research on UAV Cluster Obstacle Avoidance Algorithm Based on Improved Artificial Potential Field Method Lige Zhang Chengdu foreign language school international department, Pidu Chengdu 611700, China Abstract: In view of the shortcomings of the traditional artificial potential field method for the obstacle avoidance of the UAV cluster, this paper solves the safety problem of obstacle avoidance during the flight of the UAV group, introduces the relative speed repulsion force field between the UAV group and the dynamic obstacle, and builds a virtual force field to solve the obstacle avoidance problem of the Calculate the force between the drones according to the distance between the drones. The obstacle generates repulsive force on the drone, the target generates gravity on the drone, and the combined force of gravity and repulsion acts on the drone to control the drone to avoid obstacles. The paper aims to realize multi-UAV obstacle avoidance, and improves the artificial potential field method. Through the design of the formation of UAVs and the UAV obstacle avoidance algorithm, the obstacle avoidance of UAVs is carried out. The simulation results show that the improved artificial potential field can meet the safety, real-time and accessibility requirements of the path planning of the UAV under the dynamic change of targets and obstacles, and improve the tracking and obstacle avoidance speed of the UAV in the dynamic environment. Keywords: UAV cluster, Artificial field method, Dynamic obstacle avoidance. 1. Foreword In recent years, with the continuous development of the UAV industry, UAVs have been widely used. The complementarity between UAV groups has made UAVs synergistic and expandable, and has played a great advantage in practical application. In the existing cluster methods, due to the complexity of the working environment, the multilateral nature and the large size of the group, cluster obstacle avoidance has become one of the key problems that cannot be avoided. In view of the obstacle avoidance of the UAV group, domestic scholars have carried out a lot of research. At present, the commonly used obstacle avoidance algorithms include the artificial potential field Through network method, optimization theory [2], etc. The problem of obstacle avoidance of UAV groups in limited space can provide greater guarantee for the safety of UAVs and the efficiency of carrying out tasks, and the development and improvement of obstacle avoidance systems is the key to UAV group technology. This paper introduces an improved artificial potential field method [3] to solve the obstacle avoidance problem of unmanned clusters. Artificial potential field method is a relatively mature and real-time method in the research of obstacle avoidance algorithms, which is convenient to solve the obstacle avoidance problem of unmanned aerial vehicles in dynamic environment. Based on the traditional artificial potential field method, an improved strategy of artificial potential field method applicable to dynamic environment is proposed. By calculating the size of the repulsive force on the obstacle data returned by the UAV according to the sensor, the velocity vector of the target and the obstacle is introduced into the relative position gravitational field and repulsive field function respectively, and the position change is incorporated into the improved relative velocity gravitational field and repulsive force field, the improved artificial potential field function and the resultant force function of multiple obstacles are established, and the simulation analysis is carried out in the simulation environment. To verify the obstacle avoidance of UAV cluster by the improved artificial potential field method. 2. Basic Principles and Existing Problems of Traditional Artificial Potential Field Method 2.1. Basic principle of traditional artificial potential field Artificial potential field method was proposed by Khatib[4] in 1986 to solve the problem of path planning and obstacle avoidance. The principle of artificial potential field is simple and easy to understand, easy to calculate, and efficient in path planning. It also plays a very important role in the control of multi-UAV formation. The direction is directed by the drone to the target point; A repulsive force field is generated around the obstacle, and the direction is directed from the obstacle to the UAV. Finally, the UAV searches the collision-free track in the direction of potential field decline under the superposition of the gravitational field and repulsive force field [5], as shown in Figure 1. Figure 1. Artificial potential field UAV force map 94 The gravitational and repulsive functions of the traditional artificial potential field method have a certain relationship with the distance [6]. The commonly used gravitational function is π‘ˆ (1) The corresponding gravity on the drone is 𝐹 π‘₯ βˆ†π‘ˆ π‘₯ (2) In the formula: π‘˜ the gravitational gain coefficient; 𝑋 (π‘₯ , 𝑦 ,𝑧 οΌ‰ for the current position of the drone;𝑋 π‘₯ ,𝑦 ,𝑧 the position of the target point;𝑋 𝑋 it is the Euclide distance between the drone and the target point. The commonly used repulsion field function is π‘ˆ π‘₯ π‘˜ 𝑋 𝑋 𝑋 0 , 𝑋 𝑋 ≫ 𝑋 (3) The corresponding drone is repulsive. 𝐹 π‘₯ βˆ†π‘ˆ π‘₯ (4) In the formula: π‘˜ 𝑖𝑑 𝑖𝑠 π‘‘β„Žπ‘’ π‘Ÿπ‘’π‘π‘’π‘™π‘ π‘–π‘œπ‘› π‘”π‘Žπ‘–π‘› π‘“π‘’π‘›π‘π‘‘π‘–π‘œπ‘›; 𝑋 π‘₯ , 𝑦 , 𝑧 the location of the obstacle;𝑋 𝑋 it is the Euclide distance between the drone and the obstacle;𝑋 the impact radius of the obstacle. 2.2. Problems existing in the traditional artificial field method Based on dynamic obstacles, in the background environment of the movement of the target point, the traditional artificial potential field method faces the following problems for the avoidance of the UAV group. (1) The target cannot be reached. When the target point and the obstacle have the same random movement model, the obstacle is near the target point and follows the target point for synchronous movement. Under the assumed artificial field, when the drone approaches the target point, because the unknown obstacle is near the target point, the target point moves synchronously. With the gradual approach of the drone, the attraction between the drone and the target point is gradually decreasing, but the repulsion between the drone and the obstacle is gradually increasing, resulting in the target point. The repulsion generated between the nearby obstacle and the drone is much greater than the attraction of the target point to the drone, causing the drone to constantly oscillate near the target point, but it cannot reach the target point. This situation is called the unreachable target, as shown in Figure 2. Figure 2. The goal is unattainable (2) Local minimum point The artificial potential field method is used to study the track planning of UAVs, and the traction effect of gravity and repulsion force on UAVs should be fully considered. When the obstacle and the target point move in the same direction in the same straight line and when the obstacle and the target point move in the same direction as the drone and in the opposite direction as the drone, there will always be the phenomenon of the local smallest point in the movement process. It is the UAV falling into a static state, as shown in Figure 3. Figure 3. Local minimum point (3) Forced collision The UAV is in the assumed artificial potential field environment. As shown in Figure 4, when the obstacle and the target point move in the same straight line, the UAV moves in the direction of the target point escape from the UAV on the side of the obstacle. The gravity gradually increases, and the speed of repulsion increase is much less than that of gravity. Figure 4. Forced Collision (4) Track planning model The main task of UAV track 95 planning is to find an optimal trajectory from the take-off point to the target point in a certain task area with known and unknown obstacles in accordance with certain evaluation standards. The goal of UAV track planning is to achieve as shown in Figure 5. The UAV is under a randomly moving obstacle, tracking the dynamic target point in real time along the direction of the fastest decline of the potential field. In the process of track planning, the track costs the least in the direction of the fastest gradient. Figure 5. Track Planning Model 3. Improvement of artificial Potential Field Method 3.1. Establish an artificial potential field model In the actual flight process, many obstacles may be detected, which cannot avoid irregular moving obstacles and dynamic environmental factors. Therefore, it is necessary to establish a "detection distance" between the drone and the obstacle. According to the formula (5), the repulsion can be calculated to stay away from the obstacles. R βˆ‘ Ξ± x k x (5) In the formula: the sum of the repulsion received by the drone isR ;the coordinates of the obstacle arex ;the number of obstacles is m; the repulsion coefficient isΞ±, used to adjust the size of the repulsion. The repulsion coefficient is: Ξ± βˆ™ (6) In the formula:d ||x x ||οΌ›d it is the detection distance, which can be adjusted according to the actual requirementsοΌ›Ξ΄ it is constant.The gravity generated by the target point on the UAV is as follows: when the UAV encounters an obstacle far away from the target, the gravity is very large, which is far greater than the repulsion generated by the obstacle, then the UAV cannot avoid the obstacle and will rush to the obstacle under the action of gravity, so it is necessary to set the maximum gravitational distance to solve the obstacle avoidance. When the drone is close to the target, if there is an obstacle near the target point, as the distance between the drone and the obstacle and the target point decreases, according to the traditional artificial potential field theory, the repulsion field will increase and the gravitational field will decrease, which will lead to the inability to reach the target point. We are improving the traditional artificial potential energy repulsion function, introducing the influence of the target point and the distance of the UAV, and find a new repulsion function. When the UAV approaches the target point, the repulsion gradually becomes zero, so that the entire combined field can reach a minimum at the target point, so that the obstacle and the UAV are near the Punctuation. The improved repulsion field function is π‘ˆ π‘₯ , 𝑋 𝑋 0, 𝑋 ≫ 𝑋 (5) The corresponding repulsion function is 𝐹 π‘₯ 𝑋 β‰ͺ 𝑋 0, 𝑋 𝑋 (6) In order to avoid obstacles during the operation of UAV swarm, the relative velocity potential field between UAV and dynamic obstacles needs to be introduced into the repulsion field function, so that the UAV is comprehensively affected by relative distance and speed during movement. The relative velocity potential field between the UAV and the dynamic obstacle is π‘ˆ 𝜐 π‘˜ 𝜐 , 𝑑 𝑋 𝑋 ∩ βˆ… ∈ , 0 , π‘œπ‘‘β„Žπ‘’π‘Ÿ (7) According to the definition of the repulsive force field generated by the traditional artificial potential field method on the obstacle, its scope of action is local. In the corresponding local scope, the direction of the repulsive force in the relative position is pointed from the obstacle to the UAV, which can make the UAV away from the obstacle. The relative speed repulsion force is perpendicular to the relative position direction of the UAV and the obstacle, as shown in Figure 6. When the speed is relatively small, the speed repulsion force is almost perpendicular to the relative speed direction of the UAV and the obstacle, which can make the UAV quickly escape from the dynamic obstacle threat and improve the efficiency of obstacle avoidance route planning. Figure 6. Total force of drones 96 4. Drone Cluster Formation Algorithm 4.1. UAV cluster formation design According to the theory of consistency [7], the formation of the UAV group can keep the position, speed and other status information of each UAV consistent, and the pilot is selected to control the distribution of the UAV group. The first-order continuous system model of the UAV cluster formation system is as follows: π‘₯ =𝑒 (8) π‘₯ 、𝑒 it represents the state quantity and input under the i node respectively; n represents the dimension of the state quantity. In general, the input calculation formula is shown in the formula (9). 𝑒 βˆ‘ π‘Ž π‘₯ π‘₯∈ (9) In the formula: π‘Ž it is a formation adjacent matrix element;𝑁 it is the neighbor set of member i. The algorithm formula of the follower in the drone cluster is as follows: 𝑒 π‘˜ πœ€ βˆ‘ π‘Ž π‘₯ π‘˜ π‘₯ π‘˜ π‘Ÿ π‘˜βˆˆ (10) In the formula: Ξ΅ it is a constant greater than 0; π‘Ÿ it represents the relative position between the drone i and the drone j,so the pilot control formula is shown in (11). 𝑒 π‘˜ π‘š π‘˜ βˆ™ 𝐷 π‘˜ βˆ‘ 𝛼𝑁 π‘Ÿπ‘ π‘˜βˆˆ (11) 4.2. UAV cluster formation design optimization According to the artificial potential field method, the control model of the leader of the UAV group can be obtained as shown in (12): 𝑒 π‘˜ π‘š π‘˜ βˆ™ 𝐷 π‘˜ βˆ‘ 𝛼𝑁 π‘Ÿπ‘ π‘˜ 𝛽 βˆ™ 𝑅 π‘˜βˆˆ (12) The control model of the follower drone is shown in the formula (13) 𝑒 π‘˜ πœ€ βˆ‘ π‘₯ π‘˜ π‘₯ π‘˜ π‘Ÿ π‘˜ 𝛽 βˆ™ 𝑅 π‘˜βˆˆ (13) 5. Research on UAV Obstacle Avoidance Algorithm 5.1. UAV obstacle avoidance path algorithm Real-time planning of the UAV path [8] moves directly in the environment through the potential field force, and a gravitational field is generated around the target point, and the UAV points the direction to the target point; a repulsion field is generated around the obstacle, from the obstacle to the UAV. Finally, under the superposition of the gravitational field Towards motion, the newly established potential field function can ensure the global minimum at the target point, avoiding the problem of goal inachability. When the obstacle and the target point are in the same straight line, the drone is controlled by the force and can only move repeatedly in a straight line, but cannot reach the target point. The improvement case adds the direction coordination force. When calculating the combined force of the x-axis direction,the direction coordination force of the y-axis direction is introduced. When the combined force of the y- Introduce the direction coordination force of the x-axis direction. Assuming that the obstacle felt by the UAV vision sensor [10] is approximately a cylinder, with a surface radius of r and a height of h, and the artificial potential field generated around the cylinder is approximately in the shape of an ellipsoid. The artificial potential field envelops the obstacle with the smallest volume, that is, the smallest ellipsoid that envels the cylinder. The ellipsoid satisfies the following equation π‘₯ π‘₯ 𝑦 𝑦 𝑧 𝑧 =1 (14) The UAV group uses artificial potential field to avoid obstacles, which mainly depends on repulsion. When the UAV formation [9] approaches the obstacle, the repulsion received by the UAV is contrary to its movement speed. The UAV will be in the local minimum position, and the composite artificial potential field can envelop the ellipsoid, so that the UAV group can bypass the obstacle in the optimal path. The composite artificial potential field is composed of two artificial potential fields parallel to the x-y plane and the y-z plane respectively, as shown in Figure 7. Figure 7. Rotating vector field around space obstacles The UAV obstacle avoidance trajectory is the result of the superposition of two rotating vector fields. At the same time, the UAV quickly avoids obstacles with the optimal trajectory, and then quickly gathers to reach the target point. Here,Ο• andΞ³ are affected by two vector fields respectively, and their expressions are as follows. πœ™ arctan 𝑦, π‘₯ ;𝛾 π‘Žπ‘Ÿπ‘ tan 𝑧, π‘₯ 𝑦 (15) The projection line of the drone's motion trajectory in the x-y plane is only affected by the rotating vector artificial potential field parallel to the x-y plane. The rotating vector artificial potential field is divided into two directions: counterclockwise and clockwise. The kinematic equation of the rotating vector field of the parallel x-y plane is as follows π‘₯ π‘₯ π‘₯ 𝑦 𝑦 𝑦 𝐼𝑛 π‘‘β„Žπ‘’ π‘π‘™π‘œπ‘π‘˜π‘€π‘–π‘ π‘’ π‘‘π‘–π‘Ÿπ‘’π‘π‘‘π‘–π‘œπ‘› z 0 (16) 97 π‘₯ π‘₯ π‘₯ 𝑦 𝑦 𝑦 𝐼𝑛 π‘‘β„Žπ‘’ π‘π‘œπ‘’π‘›π‘‘π‘’π‘Ÿπ‘π‘™π‘œπ‘π‘˜π‘€π‘–π‘ π‘’ π‘‘π‘–π‘Ÿπ‘’π‘π‘‘π‘–π‘œπ‘› 𝑧 0 (17) 5.2. Algorithm design based on improved artificial potential field method UAV group obstacle avoidance Through problem analysis and optimization, it effectively solves the problem of effective obstacle avoidance in the completely dynamic environment of the movement of the target point and the movement of obstacles. The track planning is carried out in real time, and the design parameters are shown in Table 1. Table 1. Algorithm Design Parameters Parameter Definition X Location coordinates of the drone at a certain moment 𝑋 The position coordinates of the target at a certain moment 𝑋 Location coordinates of obstacles at a certain moment T X, X The distance between the drone and the target point at a certain moment 𝑃 𝑋, 𝑋 The distance between the drone and the obstacle i at some point 𝑃 Minimum safe distance between drones and obstacles k Repulsion gain coefficient m Gravitational gain coefficient i Number of obstacles n Coordinated force gain coefficient The gravitational field between the drone and the target point is π‘ˆ 𝑋 π‘šπ‘‡ 𝑋, 𝑋 (18) Define the repulsion field between the drone and the obstacle as π‘ˆ 𝑋 π‘˜ βˆ‘ 𝑃 𝑃 𝑋, 𝑋 𝑖 𝑃 0 𝑃 𝑋, 𝑋 𝑖 𝑃 (19) Among P= ( , οΌ‰ , n ∈ R indicates the number of obstacles. The repulsion field function is 𝐹 𝑋 π‘˜ βˆ‘ 𝑃𝐹𝐿 𝑃 𝑋, 𝑋 𝑖 β‰ͺ 𝑃 0 𝑃 𝑋, 𝑋 𝑖 𝑃 (20) The direction coordination force is expressed as: 𝐹 𝑋 𝑛𝑇 𝑋, 𝑋 βˆ‘ 𝑃 (21) The combined force of the improved artificial potential field function is expressed as: FX F x F x F (22) FY F y F y F (23) Step1:Initialize the gravitational gain coefficient k, repulsion gain coefficient m, known static obstacle position coordinates m_obs{π‘₯ , π‘₯ , β‹― π‘₯ }; Step2:The target point sends the current position to the drone, and the drone receives the location coordinate information of the target point m_Target π‘₯ ,𝑦 ; Step3:Initialize the current position coordinates of the drone 𝑋 π‘₯ , 𝑦 ; Step4:Perceive unknown environmental information through sensors to obtain obstacles within the perceptual range m_obs{π‘₯ , π‘₯ , β‹― π‘₯ }; Step5:Drones obtain information about the distance between drones within the range of communication to determine whether they are in a safe range 𝑑 , 𝑑 ;If the drone in the communication range is in the safe zone, jump to step8 and continue to execute;If d>𝑑 ,continue to execute step6,if d<𝑑 continues to execute step7; Step6:Calculate the repulsion between drones, Frep_uav, jump to step8 and continue; Step7: Calculate the gravity between drones Fatt_ uav and continue to perform step8; Step8: According to the improved artificial potential field avoidance algorithm, the improved potential field function is used to calculate as follows (1) Calculate the gravitational angle parameter Angel_ att of the drone and the target point, and calculate the repulsion angle parameter Angel_rep of the drone and the obstacle; (2) Calculate the gravitational parameters of drones (3) Calculate the repulsion parameters of the drone𝐹 ,direction coordination force𝐹 ; (4) Calculate the joint force and direction parameters between the drone and the target point, and between the drone and the obstacle Position_angle(j) ; (5) Calculate the next track point𝑋 𝑋 1 𝑋 1 π‘™π‘œπ‘›π‘”π‘‘β„Ž cos π‘ƒπ‘œπ‘ π‘–π‘‘π‘–π‘œπ‘›_π‘Žπ‘›π‘”π‘™π‘’ 𝑗 ; 𝑋 2 𝑋 2 π‘™π‘œπ‘›π‘”π‘‘β„Ž sin π‘ƒπ‘œπ‘ π‘–π‘‘π‘–π‘œπ‘›_π‘Žπ‘›π‘”π‘™π‘’ 𝑗 ; Step9: Move in the direction of the combined force to the next track pointX ; Step10: Save the coordinates of the current position of the drone and set it to the coordinates of the starting point of the drone𝑋 𝑋 ; Step11: Determine whether the flight time of the UAV meets the time constraint condition t ∈ β‹‚ t , t meets the collaborative time constraint condition and continue to execute step12. If it does not meet the collaborative time constraint, abandon this path; Step12:Determine whether the drone has reached the target point by the location of the drone and the target point: if the drone reaches the target point, the drone will stop the path planning and continue to implement step13; if the drone does not reach the target point, it needs to return to step2 and continue to execute the following Steps. Step13:Finally, according to the simulation results, you can judge whether the UAV has finally achieved path planning to 98 avoid obstacles by comparing the number of steps of the UAV and the maximum number of steps given. Step14: Get the optimal path, and the drone avoidance is over. 6. Algorithm Simulation and Result Analysis MATLAB is used to simulate and analyze the multi-UAV collaborative collision avoidance track planning. During the simulation process, the x-axis coordinates and y-axis coordinates are represented as the simulation environment with a spatial range of 10km*10km, the number of drones is 4, and the number of randomly moving obstacles is 3, a randomly moving target point. The simulation process is to randomly set four coordinates as the preliminary test position of the UAV in space, and randomly set the target points and moving obstacles of random motion in the space. Multi-UAVs use the proposed improved artificial potential field method to carry out the track planning algorithm to obtain the optimal path of a single UAV along the direction of the fastest decline of the potential field. Diameter, and achieve real-time obstacle avoidance. In the simulation, the speed of the UAV and the speed of the obstacle are 1m/s, and the movement speed of the target point is 2m/s. The simulation results verify that the algorithm proposed in this paper can realize the coordinated obstacle avoidance of the UAV group. Figure 8. Many drones encounter obstacles Figure 9. Multiple drones work together to avoid obstacles Figure 10. Multiple drones successfully avoid obstacles Figure 11. Multiple drones fly collaboratively Figure 12. Multiple drones encounter obstacles Figure 13. Multiple drones reach near the target point at the same time 99 Figure 14. Distance curve between drones 7. Conclusion This paper adopts the artificial potential field method for UAV cluster obstacle avoidance [11], and introduces the relative speed potential field between the UAV and the obstacle, which can improve the efficiency of avoiding dynamic obstacles. Combined with the formation theory algorithm and the UAV obstacle avoidance algorithm, the pilot can keep the UAV group in formation and pass through the obstacle avoidance path. In the operation, you can choose the optimal path to bypass the obstacle and make the drone formation fly to the target point. References [1] Xiong Chao, Xie Wujie, Dong Wenhan. UAV obstacle avoidance path planning based on collision cone to improve artificial potential field [J]. Computer Engineering, 2018, 44(9): 314-320 [2] Yuan Yaxiang, Sun Wenyu. Optimization theory and method [M]. Science Press, 1997. [3] Yu Xiang, Jiang Chen, Duan Sirui, etc. Improved path planning of A* algorithm and artificial potential field method [J/OL]. Journal of System Simulation: 1-12 [2023-07-11]. DOI:10.16182/j.issn1004731x.joss.23-0255. [4] KHATIBO.Real-time obstacle avoidance for manipulators and mobile robots[C] Pro-ceedings.1985 IEEE International Conference on Robotics and Automation International Journal Research of Robotics.St.Louis:IEEE,2003:90-98. [5] Guo Yinjing, Liu Qi, Bao Jiankang, etc. Review of the research on AUV obstacle avoidance algorithm based on artificial potential field method [J]. Computer Engineering and Applications, 2020, 56 (4):16-23. [6] Luo Qiang, Wang Haibao, Cui Xiaojin, etc. Improve the path planning of autonomous mobile robots by artificial potential field method [J]. Control Engineering, 2019, 26(6):1091-1098. [7] Qin Wenjing, Lin Yong, Qi Guoqing. Research on consistency- based UAV formation formation and collision prevention [J]. Electronic Design Engineering, 2018, 26 (9). [8] Ding Jiaru, Du Changping, Zhao Yao, etc. UAV path planning algorithm based on improved artificial potential field method [J]. Computer Applications, 2016, 36 (1): 287-290. [9] Zhang Jialong, Yan Jianguo, Zhang Pu, etc. Research on obstacle avoidance control of UAV formation based on improving artificial potential field [J]. Journal of Xi'an Jiaotong University, 2018, 52. [10] Wang Wensheng, Li Shi Jiao. Smart car design based on monocular vision sensor obstacle avoidance [J].Sensors and microsystems, 2023,42(04):119-122. DOI:10.13873/J.1000- 9787(2023)04-0119-04. [11] Wu Xuesong, Yang Xinmin. Preliminary exploration of UAV cluster C2 intelligent system [J]. Journal of the Chinese Academy of Electronic Sciences, 2018, 13 (05): 515-519.