An Obstacle Avoidance and Trajectory Tracking Algorithm for Redundant Manipulator End

An obstacle avoidance algorithm was suggested in this study to handle the redundant manipulator’s end trajectory planning problem, with the accuracy of the end trajectory guaranteed to be within the projected error. To accomplish this goal, the calculation method of vector pseudo distance is used instead of the traditional Euclidean distance to express the minimum proximity between the robot arm and the obstacle. This method can express the constraint conditions between the obstacle and the robot arm more clearly and improve the obstacle avoidance efficiency. The virtual repulsion force is generated to make the end of the manipulator far away from the obstacle through the relationship between the velocity vector and the angle vector of the end motion, and the end recovers to the desired trajectory quickly and stably after avoiding the obstacle through the adjustment of the tangent velocity function. The error adjustment coefficient e K is intended to communicate back the actual trajectory of the end obstacle avoidance to the tracking function in real time, and to adaptively change the velocity and acceleration of the end-executor to reduce the end trajectory tracking error. The simulation results show that when an envelope body obstacle appears unexpectedly on the end executor’s expected mission locus, if the expected distance between the endeffector r and the obstacle is greater than or equal to 0.02m, the end of the actuator can avoid the obstacle and return to the expected track quickly and smoothly.


I. INTRODUCTION
With each passing day, the robot industry evolves, with redundant robotic arms gaining more degrees of freedom and flexibility to improve the performance of diverse jobs. Obstacle avoidance is a vital capability not only for mobile robots, but also for robots working in unstructured environments. So far, it has emerged as a popular study topic in the realm of robot technology. Obstacle avoidance of redundant robotic arms, on the other hand, cannot assure safety and adaptability in complicated scenarios [1][2][3]. Scholars both at home and abroad have conducted extensive research to address these issues.
The manipulator's obstacle avoidance algorithm is separated into two parts: offline planning and online adjustment [4]. The offline planning algorithm plans a collision-free path from the beginning to the completion of the work to solve the obstacle avoidance problem. The online adjustment algorithm typically combines control with an optimization performance index function, employs sensors to obtain obstacle information in the path, and the GPM masterslave task conversion obstacle avoidance method is the longest method to realize real-time feedback obstacle avoidance [5], [6]. The joint position will jitter, the terminal speed will fluctuate, and the trajectory tracking error will increase when the manipulator conducts the master-slave job transformation. HAN et al. achieved obstacle avoidance by determining the minimal distance between the robot connecting rod and the obstacle envelope in real time using Kinect V2 [7]. CHEN et al. analyzed the obstacle and redundant robot connecting rod using the ellipsoid nearest to its volume, and presented a virtual force for obstacle avoidance based on the shortest distance between them [8]. WANG et al. simplified robot obstacle avoidance into obstacle avoidance between line segment and ball [9], [10] using the artificial potential field approach. To build the coordinated control strategy of the dual-arm robot, Liu et al. introduced the sliding mode controller based on the hyperbolic tangent function as the switch function. The proposed control technique can output the needed internal forces consistently and provide a highprecision track tracking effect [11]. A weighted minimal norm method is proposed in reference [12] to avoid collisions between redundant manipulators and moving impediments. A new approach for kinematic analysis and singularity analysis for a 7-DOF redundant manipulator with three consecutive parallel axes was proposed [13]. Based on the speed space optimization technique in a dynamic environment, an effective and real-time obstacle avoidance system with smooth and reliable pathways is obtained [14]. Scholars in the literature [15,16] used repulsive force vectors to achieve active full-arm collision avoidance of a 7-DOF redundant manipulator. A trajectory tracking control approach based on FFSR with a general non-singular pre-defined time terminal sliding mode is proposed in [17,18]. When there is continuous interference, the tracking error can converge to any small zero neighborhood within the time limit. Because the suggested trajectory planning approach includes pose feedback, it can be used with a trajectory tracking controller in the control process to boost the control effect even more. Based on polynomial functions, this work provides a collision avoidance strategy for redundant robots with fixed obstacles [19], [20]. The proposed technique allows for smooth trajectories based on the derivative continuity criteria in trajectory curve transitions. When the robot moves away from the imminent collision, an adaptive extended Jacobian matrix is proposed to tackle the inverse kinematics problem. In the literature [21], [22], the author advocated using pseudo distance instead of traditional Euclidean distance to monitor the distance between obstacles and robotic arms more qualitatively and reduce collision risk.
This work proposes an obstacle avoidance and path tracking method for the end of a redundant manipulator. As the distance between the manipulator and the monitoring arm, the new pseudo-distance is used instead of the usual Euclidian distance. The distance model between the obstacles is built by solving the problem where the obstacles arrive unexpectedly on the desired trajectory with the hyper quadratic function. Simultaneously, the error adjustment coefficient is used to feedback the final obstacle avoidance of the actual trajectory real-time tracking function, as well as to adapt the speed and acceleration of the end-effector, in order to solve the problem of low trajectory tracking precision during the robot obstacle avoidance process.

A. THE ESTABLISHMENT OF OBSTACLE MODELS
The minimum Euclidean distance between the obstruction and the manipulator is a regularly used collision-free distance requirement. Because it is difficult to solve and analyze the minimal distance using a standard mathematical expression, the Euclidean distance expression becomes more sophisticated when different shapes of the obstacle are considered. However, in the real test, the obstacle avoidance control algorithm does not need to be precisely computed; it merely needs to calculate that the manipulator does not collide with the envelope in the working space where the obstacle is located. In this paper, pseudo-distance is introduced as a discriminant index of collision-free distance to replace Euclidean distance, analytic functions are used to represent multi-shape obstacles, a coordinate system is established with the geometric center of obstacles as the origin, and the unified analytic equation of hyperquadric surface is used to describe obstacles as: In Formula (1), ( ) S, ac sq represents the pseudo-distance function expression , . Regular geometry is used to suit the shapes of some irregular barriers in the environment in order to ease the estimation of their shapes. In this study, ideal geometric spheres are utilized to describe irregularly shaped barriers, and the pseudodistance of a hyperquadric surface from space points to obstacles is expressed as:  x y z  , there is no collision between the manipulator and the obstacle, the manipulator is in a safe state.

B. Minimum pseudo distance point calculation method
Since complex formula calculation can be avoided through vector method, equation (2)  That is, the pseudo distance between D and the barrier envelope is expressed as: By type (6) min c The goal of the minimal pseudo-distance value of the manipulator's obstacle avoidance is expressed as a function of the joint vector Q, namely To ensure the safety of the obstacle avoidance process, the minimum pseudo distance is always greater than the obstacle envelope's preset threshold: This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI 10.1109/ACCESS.2022.3173404, IEEE Access VOLUME XX, 2017 9

A. TRADITIONAL OBSTACLE AVOIDANCE
Obstacles appear in the operating environment of the manipulator, and collisions may occur between obstacles and the connecting rod of the manipulator because the distance is too close, as shown in Figure 3.

FIGURE 3. Obstacle appears on desired trajectory
The obstacle avoidance motion of the manipulator based on redundancy has two basic requirements, namely, meeting the requirements of terminal trajectory and avoiding obstacles as: In robotics, for the null-space obstacle avoidance problem of redundant robots, the inverse kinematics solution is: Where, Physical significance of Equation (14): The first ensures the joint motion required for the desired end-effector velocity; The second item realizes the projection point to avoid the obstacle movement. Therefore, based on the Equation (15) can not only realize manipulator end estimated tracking and planning of redundant manipulator null space obstacle avoidance route, the traditional algorithm of obstacle avoidance in most environment configuration is valid, but it also has some limitations, such as when obstacles appear on the expected at the end of the track or too close to the route, it will lead to manipulator swinging around the obstacle, If the obstacle cannot be avoided in a safe way, the end track tracking motion will conflict with the null-space obstacle avoidance motion, that is, the algorithm fails.

B. Improved obstacle avoidance algorithm for manipulator end
For the above situation, this paper intends to use virtual gravitational repulsion force to plan the end trajectory of the manipulator, that is, a novel virtual repulsion force is generated between the obstacle envelope body and the end executor, and the end executor trajectory is modified to make it appear on the desired trajectory when the obstacle is completed.
In the traditional artificial potential field method, the repulsive potential field is generated around the obstacle and only acts in the local task space. The repulsive force function is defined as x y z is the position of the robot,  represents the proportionality coefficient, 0  represents the radius of the scope of action of the repulsive force field, and ( , , ) p S x y z is the Euclidean distance between the robot and the obstacle. By applying negative gradient in the potential field, the repulsive force acting on the robot can be obtained as follows:  (16) However, the traditional potential field method only plans the distance between the end executor and the obstacle, it ignores the influence of the speed and movement direction of the end executor. Therefore, it is not enough to only consider the distance in obstacle avoidance movement, which may lead to the possibility of collision. To solve these problems, the repulsive potential field function above is improved as follows: The dynamic repulsive force produced by the negative gradient of the repulsive potential field function is: Where () p S x is the pseudo distance between the end of the manipulator and the obstacle,  is a constant that can adjust the influence of θ . As shown in Figure 3, the angle between the current velocity vector  and the position of the end executor c q (relative to the position of the obstacle) can be calculated by using a Formula (18). When  between ( , ] 2   , it means that the robot is approaching the obstacle and the dynamic repulsion field starts to work; When the value θ is within (0, ] 2  , the robot is away from the obstacle and the dynamic repulsive field should not work. The repulsive force generated by dynamic state field can improve the obstacle avoidance behavior of the robot considering three factors: velocity, position and direction. The repulsive force is inversely proportional to the distance p s to the obstacle and proportional to the velocity ν , and is also related to the angle between the velocity vector and the direction vector to the obstacle when the velocity ν is null or p s greater than the threshold, and zero if the angle θ is less than 2  (The end executor is away from the obstacle).
Based on the virtual repulsive force generated by formula (9) above, the terminal velocity 0 x of the manipulator is modified, and the resulting velocity adjustment quantity is adj x  , and the modified velocity trajectory is: That is, the inverse kinematics solution of Equation (14) is modified as The second 0 x is the avoidance speed related to obstacle avoidance, which is related to the nearest point on the connecting rod of the manipulator to the obstacle. In the last section of this paper, the traditional obstacle avoidance algorithm is improved, formula (21) above is the inverse solution of the redundant degree of the optimized manipulator to realize obstacle avoidance at the end of the manipulator. In order to improve the tracking accuracy of the trajectory of the end, the control method of correcting the error between the expected task trajectory of the end and the actual motion trajectory is adopted below. In speed control, replace terminal speed ce x with modified trajectory speed x , defined: Where, ce x is the correction speed, e K is the positive definite gain matrix of mm  , d x is the desired trajectory, and the corresponding expected velocity is d x ; x is the actual trajectory, and the corresponding velocity is x , e is the trajectory tracking error, which is the difference between the expected task trajectory d x and the actual motion trajectory x , and max V represents the maximum velocity scalar of the manipulator in the task space.
The inverse solution of the redundant degree of the manipulator after optimization is: To sum up, based on the proposed obstacle avoidance and trajectory tracking algorithm at the end of redundant mechanical arm (equation (25)), the mechanical arm can not only solve the obstacle appearing on the expected trajectory of the task quickly and effectively, but also recover to the expected trajectory smoothly after obstacle avoidance.

IV. Simulation Results and Analysis
In order to verify the effectiveness and feasibility of the obstacle avoidance algorithm proposed in this paper, this method is applied to the LBRiiwa14R280, a 7-DOF mechanical arm model, as shown in Figure 5. The robot is composed of shoulder-elbow-wrist (S-R-S) structure and consists of seven rotating joints. The algorithm proposed in this paper only performs null-space obstacle avoidance, end obstacle avoidance and end track tracking of iiWA14 manipulator, so the attitude of the end can be ignored and only its position can be considered. The simulation experiments were carried out in matlab2020A software to verify the superiority and effectiveness of the proposed algorithm.
The simulation conditions are pre-set as follows: The plane is taken as the simulation research object. In order to observe whether the mechanical arm can proceed stably in the whole movement process and whether the end can accurately achieve the trajectory tracking, the end is expected to move with an arc curve. The simulation results of the classic obstacle avoidance algorithm are shown in Figure 6-9. The total running time of the simulation movement is T=3s. Figure 6 depicts the entire obstacle avoidance movement process when the mechanical arm performs the typical obstacle avoidance algorithm. Figure  7 shows that when T1=0-0.5s and T2=2.7s-3s, the mechanical arm reaches the warning area of the obstacle envelope, performs null-space obstacle avoidance, and successfully avoids obstacles 1 and 2. The end of the manipulator, however, enters the risky area of the obstacle envelope and collides with obstacle 3 at T3=0.9-2.3s and T5=1s-1.7s, indicating that the typical obstacle avoidance algorithm fails in this environment and the obstacle avoidance goal cannot be met. Figure 8 illustrates that the tracking error distance of the mechanical arm's end track in the standard obstacle avoidance algorithm is small only at the speed of the beginning and ending points. As the obstacle avoidance movement progresses, the error becomes higher and larger, and the collision error reaches the maximum at T3=0.9-2.3s instant and the tracking accuracy is average. At the same time, the joint angle diagram in Figure 9 shows that obstacles appear on the expected trajectory of the manipulator's end, which does not meet the traditional algorithm's expectation requirements, resulting in small amplitude chattering and discontinuity in the space movement of the manipulator joints, and the operation is not smooth enough.
The obstacle avoidance algorithm proposed in this paper will be adopted below. The coefficient in the main diagonal of the error adjustment coefficient matrix e K is The error adjustment coefficient matrix e K is in dynamic change in the whole obstacle avoidance movement process. According to the error generated by the end position, the joint velocity is adjusted adaptively, and the tracking accuracy is adjusted to achieve the purpose of reducing the error.  Figure 10 depicts the changes in the spatial configuration of each rod during the mechanical arm's obstacle avoidance. The end follows the expected trajectory, successfully avoids all predetermined obstacles, and completes the obstacle avoidance movement at the joint and the end of the mechanical arm. Figure 11 shows that in the first stage, the minimum pseudo distance p S between the mechanical arm and the obstacles is greater than the pseudo distance 3 pm d = threshold corresponding Euclidean distance (0.06m) at simulation time T=0-0.9s, the obstacles have no effect on mechanical arm terminal trajectory tracking precision, and the motion continues along the desired trajectory. Figure 12 shows that the actual error generated by the expected trajectory of the end is less than 0.02m, and the tracking accuracy is higher than the traditional obstacle avoidance algorithm.
When T=0.9s in the second stage, the manipulator's end enters the dangerous area of obstacle 3, and the minimum pseudo distance p S decreases. Figure 13 shows that the virtual force increases significantly in the X-and Y-axis directions, and high-precision tracking of the end track is sacrificed quickly for obstacle avoidance measures, promoting the end to stay away from the obstacle, which is consistent with the actual situation. Simultaneously, it is demonstrated that the proposed algorithm has greater sensitivity and effectiveness, as well as greater practicability, than the traditional obstacle avoidance algorithm. When the simulation time T7=2.3-3s gradually increases in the third stage, the end-effector leaves the dangerous area of obstacles and the obstacle avoidance motion begins to weaken. The end track's tracking error gradually decreases until it converges to the desired track and returns to the starting point. As a result, the end obstacle avoidance method proposed in this paper realizes the robot end's rapid obstacle avoidance task.
Simultaneously, the diagram of joint Angle changes of the mechanical arm in Figure 14 shows that there is no shaking phenomenon throughout the movement process, and the joint position is stable, preventing the mutation of each joint velocity induced by obstacle avoidance movement. Furthermore, the overall fluctuation range of the robot's joint velocity is smaller than that of the classic obstacle avoidance algorithm, implying that the proposed method, to some extent, avoids the problems of joint singularity and velocity saturation. During the trajectory tracking process, the adaptive error adjustment matrix e K continuously changes itself based on the terminal's real-time tracking situation, and the adjustment results are fed back to the manipulator online in real time. It also indicates that the error adjustment matrix e K was properly chosen and that the system's adaptive feedback result is good, both of which play an essential part in the continuous and stable changing of joint angle. The tracking quality of the common obstacle avoidance manipulator's end track is currently low, and the position inaccuracy grows with the sampling time step. When the sample step dt=0.1s, the end error is frequently more than 0.05m. When compared to the traditional trajectory tracking technique, the greatest error at the end of the proposed algorithm under the identical conditions is 0.02m in the y direction, as shown in Figure 12. The precision of the z axis tracking is also improved, as is the mechanical arm terminal trajectory tracking effect. The movement is smooth and continuous, and simulation is utilized to test the algorithm's performance.
After completing four groups of experiments, this paper asserts that the proposed manipulator end obstacle avoidance algorithm can avoid obstacles in the task quickly and efficiently on the desired trajectory, that in the recovery part our algorithm can smoothly return to the desired trajectory, and that the trajectory tracking accuracy at the end is within 0.02 m. It also demonstrated that using pseudo range as the minimum distance monitoring index is superior to that of Euclidean distance. The actual trajectory of the end obstacle avoidance is fed back to the tracking function in real time in the error adjustment coefficient e K , and the speed and acceleration of the end executor are adjusted adaptively to ensure the obstacle avoidance of the manipulator's connecting rod in the case of high-precision trajectory tracking. Figure 15 depicts the manipulator's path planning process based on the obstacle avoidance algorithm proposed in this paper.  This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication.

V. CONCLUSION
In this paper, the redundant manipulator obstacle avoidance method was investigated, in light of the traditional mechanical arm obstacle avoidance algorithm's inability to overcome obstacles appearing at the end of the desired trajectory, can adjust local movement problem of joint space, is proposed based on a type of obstacles and the virtual force at the end of the mechanical arm obstacle avoidance method, combined with the movement of the joint space to adjust, Complete the end obstructed path. 1) In this paper, a vector calculation method of pseudo distance is used to indicate mechanical arm and obstacles between the minimum approach degree, in the form of a simple and primitive unified modeling of various obstacles, which replaced the traditional Euclidean distance, more qualitatively expressed the obstacles between manipulator and the constraint conditions, and finally the experimental simulation is proven feasible.
2) The disadvantage of the traditional algorithm only considering distance in solving the end obstacle avoidance problem is changed. The dynamic repulsive field can generate smooth virtual force, add an obstacle avoidance velocity increment to the end-effector, and solve the problem of the obstacle appearing on the desired trajectory of the end effector via the relationship between the velocity vector and the Angle vector of the end motion.
3) An adaptive error adjustment matrix e K was designed to feed the end-actual effector's trajectory to the tracking function in real time, and the end-velocity effector's and acceleration were adaptively adjusted to reduce the tracking error of the end-effector trajectory.
The effectiveness and superiority of the proposed algorithm are confirmed by comparing simulation experiments, which can realize high-precision tracking of the terminal trajectory while completing the multi-obstacle avoidance, and the tracking effect of the terminal trajectory is good. The static obstacle avoidance problem of a redundant manipulator is primarily addressed in this paper. Later research focuses on the dynamic obstacle avoidance problem of a manipulator in an unstructured environment.