Improved Manipulator Obstacle Avoidance Path Planning Based on Potential Field Method

Aiming at the existing articial potential eld method, it still has the defects of easy to fall into local extremum, low success rate and unsatisfactory path when solving the problem of obstacle avoidance path planning of manipulator. An improved method for avoiding obstacle path of manipulator is proposed. First, the manipulator is subjected to invisible obstacle processing to reduce the possibility of its own collision. Second, establish dynamic virtual target points to enhance the predictive ability of the manipulator to the road ahead. en, the articial potential eld method is used to guide the manipulator movement. When the manipulator is in a local extreme or oscillating, the extreme point jump-out function is used in real time to make the end point of the manipulator produce small displacements and change the action direction to eectively jump out of the dilemma. Finally, the manipulator is controlled to avoid all obstacles and move smoothly to form a spatial optimization path from the start point to the end point. e simulation experiment shows that the proposed method is more suitable for complex working environment and eectively improves the success rate of manipulator path planning, which provides a reference for further developing the application of manipulator in complex environment.


Introduction
e manipulator obstacle avoidance path planning [1] refers to: planning a feasible path from the starting point to the end point of the manipulator end. During the operation, the manipulator is required to not collide with any obstacles. is is a more complicated three-dimensional obstacle path planning problem in space.
Common manipulator obstacle avoidance path planning methods include grid method [2], free space method [3,4], rapidly-exploring random tree (RRT) algorithm [5], probabilistic road map algorithm [6], particle swarm optimization [7], ant colony algorithm [8], genetic algorithm [9], arti cial potential eld method [10], and so on. Compared with other methods, the arti cial potential eld method has the advantages of simple con guration and high operating e ciency, but the algorithm belongs to the local optimization method. It is used in the manipulator of multi-link structure, sometimes there are problems such as stagnation and oscillation. In view of the shortcomings of the arti cial potential eld method in the obstacle avoidance path planning of manipulators, relevant scholars have done a lot of research. Literature [11] introduced the laws of dynamics to improve the arti cial potential eld method, and used the attraction velocity, and the repulsive velocity to construct the joint velocity of the joint space, and planned an obstacle avoidance path for the manipulator. However, the improved algorithm still has the problem of being easily trapped in local extremum. e literature [12] uses the navigation potential function method to deal with the local extremum problem, but the inverse kinematics solution is applied in the overall path planning, which is computationally complex, and ine cient. In literature [13], the solution of adding virtual obstacles is applied to solve the minimum value problem. However, before this scheme, a reasonable set of angle values needs to be obtained, and the related operations are not easy to implement. Literature [14] attracts the current point away from the local extremum by adding a virtual target point. However, geometric methods are used to determine virtual target points, and its applicability is not strong in complex environments. Literature [15,16] combined with the random advantage of RRT algorithm to generate virtual target points to escape local extremum, but there are too many uncertain factors in the process, and the path is not guaranteed to be optimal.
Based on the above analysis, it can be seen that the defects of the arti cial potential eld method restrict the completion quality of the manipulator obstacle avoidance path planning task. is paper starts from reducing the possibility of falling into local extremum and path optimization, by establishing the dynamic virtual target points to improve the ability of the manipulator to predict obstacles in front; by setting the extreme point jump function to help the manipulator to jump out of local extremum or oscillation. Among them, the random principle of the dynamic virtual target point reduces the possibility that the manipulator is trapped in the local extremum, and the extreme point jump-out function not only e ectively solves the problem of extreme point, and oscillation but also reduces the unnecessary moving distance as much as possible, which is bene cial to improve the overall path quality.

Kinematics Modeling of Manipulator.
is paper takes PUMA560 as the research object, and its speci c structure diagram is available from reference [17]. e PUMA560 is an articulated robot whose rst three joints determine the position of the end and the last three joints determine the orientation of the end. Since this paper studies the path planning problem at the end of the manipulator, it does not involve the grasping action, so only the angle changes of the rst three joints are concerned. e degrees of the last three joints are xed to zero in the discussion that follows.
According to the structural diagram of the manipulator and the coordinate system of the link parameters established by the D-H [18,19] parameter method, the link parameters of the PUMA560 [17,20] can be obtained, as shown in Table 1.

Kinematics Analysis of the Manipulator.
A er the parameters are determined, the manipulator can be analyzed for positive kinematics. In the case of a given base coordinate, the end position, and attitude can be obtained by the transformation formula. Its transformation formula is as follows: Substituting the link parameters information of PUMA560 into Equation (1), the homogeneous transformation matrix between the links can be calculated. By multiplying the link transformation matrices, a matrix of end positions and poses can be obtained. at is, its positive kinematics equation, as shown in Equation (2).

Modeling of Obstacles.
Obstacle modeling is one of the important steps in obstacle avoidance path planning. In order to ensure that there is no collision and to simplify the calculation as much as possible, this paper uses the circumscribed ball method [21] to establish the obstacle model.
(i) First wrap the obstacle in the smallest cube.
(ii) When the long side of the cube is less than 3 times the short side, make the circumscribed ball of the cube at this time. Otherwise, the cube is divided into two parts by a plane passing through the midpoint of each long side. (iii) e wrapped information of the two parts is released, and the two parts are treated separately as obstacles.
at is, steps (i), (ii), and (iii) are repeated until the obstacle is completely wrapped by the circumscribing ball. (iv) A er converting the obstacle into one or more circumscribed balls, obtain the center and radius of each circumscribed ball.

Collision
Detection. e links of the manipulator have a certain cross-sectional area. In order to conveniently establish a collision detection system, each link is enveloped into a cylinder. e radius of the section of the cylinder is measured as the radius of the link of the manipulator. In order to reduce the complexity of the calculation, the radius of the link of the manipulator is added to the radius of each circumscribed ball of the obstacle. At this time, the positional relationship between the obstacle and the link of the manipulator is transformed into a simple ball-to-wire relationship. e collision detection process is as follows: When the position coordinates of the two ends of the link are , , and +1 , +1 , +1 , a two-point equation of the straight line is established.
A er sorting, a parametric equation is obtained, which is shown in Equation (4).  among them, 0 , 0 , 0 is the coordinates of the center of the circumscribed ball; is the sum of the radius of the circumscribed ball and the radius of the manipulator link. Bring Equation (4) into Equation (5), and get a quadratic equation about . e value of parameter can be used to determine whether the intersection of the line and the ball is within the range of , , to +1 , +1 , +1 . When 0 ≤ ≤ 1, its intersection is within the range of the line segment, otherwise it is not. erefore, by analyzing the solutions 1 and 2 of the equation, the positional relationship between the ball and the line can be judged. e collision analysis [16] is shown in Table 2.

eoretical Basis of Arti cial Potential Field Method in
ree-Dimensional Space. e arti cial potential eld method is an extremely important method in path planning. Its outstanding advantages are high e ciency and operability. e basic principle of the arti cial potential eld method is to place the controlled object in an abstract arti cial potential eld environment. e target point in the environment produces "attractive force" on it, and the obstacle produces a "repulsive force" on it, and the combined force of the two forces guides the controlled object to move.
In three-dimensional space, the attractive potential eld function of the arti cial potential eld method is: is the position coordinate of the th step of the controlled object, that is, the current position point; g = g , g , g is the position coordinate of the target point; is the gain coe cient of the attractive force; , g = ᐉ ᐉ ᐉ ᐉ ᐉ − g ᐉ ᐉ ᐉ ᐉ ᐉ is the shortest distance between and g . For Equation (6) to nd a negative gradient [22] for , the attraction function is: en the attractive component of point on the three coordinate axes is: among them, , , , , and , are the angles between the line connecting the point and the obstacle center and the , , and axes, respectively. e obstacle is treated by the method in Section 3.1, and the radius of the th = (1, 2, . . . , ) circumscribed ball is , and the center of the ball is 0, = 0, , 0, , 0, . e direction vector pointed by the obstacle to is denoted as , as shown in Equation (9). At this time, the position coordinate , = , , , , , of the closest point [21] of and the circumscribed ball can be calculated, as in the Equation (10). among them, e acquisition of the relevant repulsion is transformed into a point-to-point calculation. e repulsive potential eld function is: among them, is the gain coe cient of the repulsive force; 0 is the in uence distance of the obstacle; is the shortest distance between and , . For Equation (12) to nd a negative gradient for , the repulsion function is: ( 1 < 0 and 2 < 0) and ( 1 > 1 and 2 > 1) No Journal of Robotics 4 obstacles of di erent sizes in the space and the di erence in the radius of the circumscribed sphere is large, if a small 0 is used at this time, the phenomenon that the controlled points are too close to the large obstacles is likely to occur. At this time, it is necessary to make a large adjustment to avoid obstacles, which will greatly increase the di culty of control or lengthen the path length. In response to this problem, this paper proposes that the radius of the obstacle itself determines its in uence distance. When the radius of the circumscribed ball of the th obstacle is , its in uence distance 0, is 0, = * , where is a constant.

Handling of Invisible
Obstacles. Due to the complex structure of the manipulator, its end may collide with itself during operation. In order to reduce this possibility, the initial joint angle portion of the manipulator is treated as an invisible obstacle. e circumscribed ball center of the obstacle is the position coordinate of the starting joint angle, and the radius is set to 1.5 times the link radius. It participates in the calculation of all relevant repulsions.

Set the Extreme Point Jump-Out
Function. If the current joint angle has caused the resultant force at the end of the manipulator to be the smallest among all adjacent joint angles [23], but the end position corresponding to the joint angle does not reach the target point, the manipulator at this time has fallen into a local minimum point. In order to e ectively solve this problem, this paper sets the extreme point jump-out function. is function is called in time when it is detected that the end position of the manipulator is repeated with a position that has passed before (including the case of oscillation). First, Bloch Quantum Genetic Algorithm (BQGA) [24] is used to generate a small displacement at the end of the manipulator. en, the RRT algorithm [5,15,16] is used to change the direction of motion of the manipulator. Finally, under the joint action of the two algorithms, the local extremum is jumped out. e process of using BQGA to generate small displacements is as follows: (1) Parameter initialization of BQGA. Current iteration number , initial group ( ), maximum number of iterations − g, variables 1 , 2 , 3 , and so on. (2) e spatial transformation of the solution yields an approximate solution set ( ).
(3) Calculate tness. Collision detection of the end of the manipulator. If it collides, the tness function is set to in nity. Otherwise, calculate the tness function (the resultant force at the end of the manipulator). Obtain contemporary optimal solutions and contemporary optimal chromosomes . (4) Take as the global optimal solution and as the global optimal chromosome . (5) In the loop, set ← + 1, and obtain a new population ( ) by updating and mutating ( − 1). According to the resultant force and the step size , the position +1 = +1 , +1 , +1 of the next step can be determined, and the components are as shown in Equation (17).
According to the above theory, obstacle avoidance path planning in a three-dimensional space with respect to one point can be achieved. is laid the foundation for the more complex manipulator's obstacle avoidance path planning.

Establish Dynamic Virtual Target Points.
e arti cial potential eld method belongs to a kind of local optimization algorithm. In order to achieve better global optimization e ect, this paper uses dynamic virtual target points to guide the manipulator movement. at is, before each step of action, a virtual target point is determined according to a certain principle, which attracts the end of the manipulator and guides the arm to move. e selection process of the virtual target point is as follows. First consider the end of the manipulator as a point. en, according to the theory of Section 4.1, taking the current coordinates of the point as the starting point and the target point as the end point, an optimal path for obstacle avoidance is planned. Calculate the total length of the path. When its length is small, the virtual target point is equal to the target point. Otherwise, a point on the path (which is a random point within the speci ed range) is selected as the virtual target point of the manipulator's current action. Record the virtual target point here as gg .

Variable
Parameter 0 Is Used. In the normal case, 0 is set to a xed value, that is, the in uence distance in the whole process adopts the same standard. However, when there are (14) rep e application of these measures improves the e ectiveness and applicability of the manipulator's obstacle avoidance path planning system, and is conducive to planning a more ideal obstacle avoidance path.

Manipulator's Obstacle Avoidance Path Planning
Process. According to the above theory, the basic steps of the obstacle avoidance path planning of the manipulator are summarized as follows: (1) e manipulator's kinematics modeling and obstacle modeling using the methods of Sections 2.1 and 3.1, respectively.
(2) Parameter initialization. For example, the initial angle is denoted as 0 , the starting point is marked as 0 , the target point is marked as g0 , the step size is recorded as , the gain coe cient of the attractive force is denoted as , the gain coe cient of the repulsive force is denoted as , the joint angle combination is recorded as (initialized as = 0 ), the corresponding end position is denoted by (initialized as = 0 ), the dynamic virtual target point is denoted by g , and the switching instruction is denoted by g (initialized to g = 0).  (6), nd the end position where the resultant force is the smallest, and save the end position (denoted as next ) and its corresponding angle combination (denoted as next ). (8) It is judged whether next in step (7) reaches the vicinity of the target point g0 , and if so, it ends, otherwise, it goes to step (9). (9) Determine whether the next at this time is the same as the position that has passed before, and if so, call the extreme point jump-out function and set g = 1 , then return to step (3). Otherwise, the manipulator is driven according to the angle information at this time, that is, = next , = next , and then returns to step (3). e corresponding ow chart is shown in Figure 1: so that the corresponding end position can be obtained according to the kinematics of the manipulator, that is, the process of completing the small displacement of the end of the manipulator. e process of changing the direction of motion using the RRT algorithm is as follows: (1) Start with the current position of the end of the manipulator and record it as start . Given the separation distance Δ . (2) A random point rand is generated in the working space of the manipulator.
e direction in which start points to ggg is taken as the next action direction of the manipulator.
In the commonly used path planning method [16], the virtual target point method is also used to jump out of the local extremum. Its process is to create a virtual target point near the end, a er the end needs to reach the virtual target point, and then move to the nal target point. In contrast, the method in this paper only changes the direction of the action through the randomly generated virtual target point, and does not need to arrive, that is, a er running one step, the virtual target point disappears instantly. is can improve work e ciency and ensure path quality.
In general, the random principle of dynamic virtual target points reduces the likelihood that the manipulator will fall into local extremum. e dynamic virtual target point and the appropriate in uence distance make it di cult for the end of the manipulator to reach a dangerous area that is too close to the obstacle, which improves the obstacle prediction ability of the manipulator to some extent. e invisible obstacle treatment better overcomes the problem of the structural structure of the manipulator. Setting the extreme point jump-out function solves the stagnation and oscillation of the manipulator.

Journal of Robotics 6
at is, Δ , −1 is the distance between two points and −1 . 0 is the starting position coordinate. erefore, the end moving distance during the entire movement is approximately:

Simulation Experiment of Single Obstacle Path
Planning. Let the coordinates of the target point be It can be seen from the Figure 2 that the manipulator avoids the obstacle and accurately reaches the vicinity of the target point, forming a relatively smooth path. It can be seen

Simulation Experiment
In order to verify the e ectiveness of the path planning method proposed in this paper, simulation experiments were carried out with Matlab R2016b. e simulation experiment is from single obstacle to multi-obstacle, and compared with the simulation results of common methods. e initialization of the parameters is shown in Table 3.
Record the total number of steps required for the manipulator to complete the task as sum . During the movement, the angle changes of the three joints are respectively recorded as Δ 1, , Δ 2, , and Δ 3, , where = 1, 2, . . . , sum , then their cumulative angle changes are: erefore, the cumulative angle change of the entire manipulator is: During the movement, the coordinate value of the end position of the manipulator is recorded as = 1, 2, . . . , sum , and the change of the end position is as follows: It can be seen from Figure 4 that the manipulator can still avoid obstacles successfully reaching the vicinity of the target point in a complicated working environment with three obstacles. During the operation, the whole manipulator did not collide with the obstacles, and it was not too close to the obstacles, which proved that the manipulator can predict the obstacles in advance. It can be seen from Figure 5 that the joint angle of the manipulator changes continuously without abnormal uctuation or static phenomenon. e overall movement of the manipulator is stable, and the end running path is smooth. sum is only 59 when the process is completed. e cumulative angular change of the entire manipulator Δ sum from Figure 3 that the angles of the joint angles of the manipulators change continuously in small amplitude during the stepping process, which ensures the stability of the movement of the manipulator. Observing the whole movement process of the manipulator, the joints and links do not collide with the obstacle. Under a certain safety margin, the end of the manipulator advances step by step toward the target point.
sum is only 52 when the process is completed. e cumulative angular change of the entire manipulator Δ sum is 4.1783 rad, and the cumulative end moving distance Δ sum is 1.2232 m.
In the experiment of single obstacles, there was no situation of falling into local extremum or oscillation, and the path planning task was completed smoothly.

Simulation Experiment of Multiple Obstacle Path
Planning. Let the number of obstacles be three,    Journal of Robotics 8 adjustments, the arm jumped out of the local extremes that were trapped. e reason why the repeated position information does not appear in the process is because the adjusted information covers the repeated information when the extreme point jump-out function adjusts the manipulator. In this way, the manipulator will not stop moving during the whole operation. In this operation, the manipulator not only e ectively addresses the extreme point and oscillation problems but also ensures the path quality as much as possible. Eventually, the manipulator runs stably along a more desirable path to the vicinity of the target point.  Table 4, the end position information is di erent. However, when observing the running process of the program, it was found that the manipulator had a phenomenon of repeating with the previous position in the 21th step and the 24th step, that is, the manipulator was caught in the local extreme value. A er this happens, the main program calls the extreme point jump-out function twice, and adjusts the position of the end of the manipulator and its action direction in time. A er only two commonly used method for manipulator obstacle avoidance path planning. e disadvantage of using this method is that because the target point is xed, the manipulator is more likely to fall into local extremum, and the path quality cannot be guaranteed during the process of jumping out of the local extremum. In order to further prove the e ectiveness and superiority of the method in this paper, the following comparative experiments under the same conditions were carried out. e comparison data of the six groups are shown in Tables 5-7. Among them, the data results obtained by the method of this article are placed outside "()", the data results obtained by the commonly used method are placed inside "()", and ∞ indicates that the planning fails. It can be obtained from Table 5 ( Figures 6-8) that in the case of an obstacle, the di erence between the two methods is not large, and the path planning task can be completed well. However, it can be seen from the Table 6 ( Figures 9-11) of the two obstacles that the probability of occurrence of extreme points in the commonly used methods begins to increase, and even the phenomenon of planning failure occurs. From the simulation data of three or more obstacles shown in Table 7 ( Figures 12-14), when the environment is more complicated, the improved method proposed in this paper shows a big advantage in terms of the number of steps, the cumulative angle change, and the cumulative end moving distance. From the comprehensive analysis of the data in Tables 5-7, it can be seen that when the improved obstacle avoidance path planning method is applied, the manipulator can complete the task with fewer steps, and the overall angle change is small, and the end moving distance is obviously shortened. e success rate of path planning has also increased signi cantly. It can be calculated that the improved method proposed in this paper reduces the possibility of the manipulator falling into the extreme point by about 27.78%, and reduces the possibility of planning failure by about 22.22%. Observe the relevant simulation results of two or more obstacles and analyze the data that both methods are planned successfully. It can be obtained that compared with the

Comparison with Commonly Used Path Planning
Methods. Literatures [15,16] use the hybrid algorithm of arti cial potential eld method and RRT algorithm to realize the obstacle avoidance path planning of the manipulator. e main idea of the method is as follows: the arti cial potential eld method is used for path planning; when the manipulator is trapped in the local extremum, the RRT algorithm is used to establish the virtual target point to jump out of the local extremum; when the manipulator jumps out of the local extremum, the arti cial potential eld method continues to be used for path planning. is method is common in the existing literature. erefore, this paper refers to it as the   with complex working environment, the system still has the advantages of smooth running of the manipulator, continuous change of joint angle, less control steps, smaller cumulative angle change, and shorter cumulative end moving distance. It improves the success rate of path planning and also ensures path quality. e improved method proposed in this paper solves the problem of obstacle avoidance path planning of mechanical arm in three-dimensional space, which provides reference for manipulator control in saving energy and nding optimized path. commonly used method, the improved method of this paper reduces the planned step number by about 27.37%, reduces the cumulative angle change by about 31.66%, and shortens the cumulative end moving distance by about 28.77%, which fully re ects the e ectiveness and superiority of the method.

Summary
Aiming at the problems existing in the commonly used path planning methods, this paper establishes a relatively complete mechanical arm obstacle avoidance path planning system by adopting a series of improvement measures such as establishing dynamic virtual target points and setting extreme point jumpout functions. e simulation results show that when dealing     Data Availability e data used to support the ndings of this study are included within the article. e source program used to support the ndings of this study is included within the supplementary information le.

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