Abstract
The trajectory planning and obstacle avoidance of serial robot is an important area of research and efficient optimization algorithms are needed. This article proposes an intermediate point obstacle avoidance algorithm to ensure smooth trajectory and efficient movement during the obstacle avoidance process. Using the intermediate point obstacle avoidance algorithm, the robotic arm can steer obstacle around with the minimum joint space variations and the shortest end motion trajectory. We also design a novel collision detection strategy and fitness evaluation function based on genetic algorithm to optimize the intermediate point parameters. In order to evaluate the performance of the intermediate point obstacle avoidance algorithm, we have conducted three typical experiments: single obstacle, multiple obstacles, and no obstacle. The experimental results demonstrate that the proposed method can not only effectively realize the obstacle avoidance, but also efficiently improve the movement performance of the robotic arm.
Keywords
Introduction
The past decades have witnessed the extensive applications of serial robot in industrial production, space exploration, and daily life. Nowadays, with different end effectors, serial robot can realize various tasks such as packaging, palletizing, polishing, painting, and medical treatment. In general case, the working environment of serial robot is artificially designed, which means that there are also many assignments that cannot be scheduled in advance. In this condition, the operator uses the remote controller to control the end of manipulator directly. But there are many defects, for example, (1) in order to avoid interference and ensure safety, the movement of manipulator is slow; (2) through monitoring devices, the operator has a limited view of environment; and (3) the operator is prone to fatigue after a period of work (during the working time). Therefore, the trajectory planning of manipulator is a key problem for auxiliary control.
This field has attracted many researchers. MS Huang et al. 1 used real-coded genetic algorithm (RGA) and proposed a novel minimum-energy point-to-point (PTP) trajectory planning method for a motor-toggle servomechanism. H Liu et al. 2 proposed a high smooth trajectory planning method to improve the practical performance of the manipulator with multi-degree splines in Cartesian space and multi-degree B splines in joint space. YT Zhao et al. 3 used quaternion interpolation method to solve the multiple solution problems. AT Hasan et al. 4 developed a method using artificial neural network (ANN) to pass the serial manipulator through singularity configurations. A Gasparetto and V Zanotto 5 presented a smooth trajectory method with the constraint of robot motion, expressed as upper bounds on the absolute values of velocity, acceleration, and jerk. These studies mainly focus on the trajectory generation method of the manipulator.
In recent years, many scholars have also studied the obstacle avoidance algorithm for serial robot. H Dong and Z Du 6 used the workspace density of the manipulator to calculate collision-free paths in complex environments with multiple obstacles. And he demonstrated the effectiveness of the method using simulation results. M Ismail et al. 7 proposed a dynamic path planning algorithm and applied it to a hybrid cable–serial manipulator to find the shortest and the fastest path while ensuring bounded tensions in the actuator cables. RS Novin et al. 8 focused on the optimal motion planning of redundant planar serial robot, by avoiding obstacles within its workspace. He presented a synergy-based algorithm between convex optimization, disjunctive programming, and receding horizon to realize the global optimum solution and low computational time. MP Mann et al. 9 put forward a novel type of serial robot with minimal actuation, through its unique modular structure design, to get pass a confined space and reach the target. In addition, some other methods, such as the artificial potential field, 10 rapidly exploring random tree (RRT),11,12 and probabilistic road map (PRM) 13 have also been used in the obstacle avoidance trajectory planning of the manipulator. These methods transform the Cartesian coordinate space into the configuration space to solve the three-dimensional optimization problems. However, there is little research on the connection between kinematic performance, dynamic performance, and obstacle avoidance.
The trajectory planning of the manipulator should be based on safety, stability, and energy conservation. 14 We transform these aspects into performance indicators, that is, the obstacle avoidance of the manipulator in the course of movement, the minimum joint space variations, and the shortest end motion trajectory. The above indicators are difficult to achieve simultaneously, and our research focuses on optimizing these indicators.
The major contributions of this article can be summarized as follows:
We present an intermediate point obstacle avoidance (IPOA) algorithm to steer the robotic arm around obstacle with the minimum joint space variations and the shortest end motion trajectory, which means that the robotic arm can work in a state of safety, stability, and energy conservation. Through the proposed algorithm, it can be ensured the smooth trajectory and efficient movement during the obstacle avoidance.
In IPOA algorithm, a novel collision detection strategy is put forward to prevent the robotic arm from being disabled. Through matrix transformation method, the mathematical model of connecting rod line segment will be represented. In this way, the collision problem of the manipulator can be transformed into the distance changes between the obstacle point and the connecting rod.
We also design a new fitness evaluation function based on genetic algorithm to optimize the intermediate point parameters. The abundant experimental results have demonstrated the effectiveness of our method.
In the following chapters, the IPOA algorithm is proposed to meet the requirement of obstacle avoidance trajectory planning of serial robot. First, the mathematical model of the serial robot is established in section “Model simplification.” Then, in section “IPOA algorithm,” we have described the IPOA algorithm in detail, including the motion trajectory planning and the collision detection strategy. In order to obtain the intermediate point, we designed the fitness function by genetic algorithm to optimize the target in section “Gene optimization scheme.” Experiments are conducted under different situations to verify the safety and reliability of IPOA algorithm in section “Experimental verification.” Finally, section “Conclusion” extends the algorithm and presents the conclusion.
Model simplification
We are committed to working on a universal robotic arm obstacle avoidance algorithm. So in this article we have chosen a common ideal robotic arm configuration, which is a six-degree-of-freedom serial robot. The robotic arm in this configuration consists of six rotating joints, including two shoulder joints, one elbow joint, and three wrist joints. The second and third joint axes are parallel, and the axes of the fourth, fifth, and sixth joints are perpendicular to each other and intersect at one point. If the joint offset is assumed to be zero, this configuration is identical to most robotic arm structures in the market.
To study obstacle avoidance strategy, a simplified mathematical description of the manipulator model and obstacle model is required. Through Denavit–Hartenberg (D-H) method, we build a model of the robotic arm, the mechanical structure of which is shown in Figure 1(a), and the schematic diagram of the connecting rod can be found in Figure 1(b). The D-H parameters can be found in Table 1. In theory, our algorithm can be extended to any other configurations of the serial robot.

(a) The mechanical structure of the robotic arm and (b) the schematic diagram of the connecting rod.
D-H parameters of the robotic arm.
D-H: Denavit–Hartenberg.
While simplifying the obstacle model, we add the robotic arm’s radial radius to the obstacle radius. In this way, the interference calculation between the robotic arm’s connecting rod and obstacle can be transformed into the distance relationship between the line segment and the obstacle point. Although this method wastes some actual workspace of robotic arm, the advantage of reliability and simplicity makes this method widely applicable in the field of robot obstacle avoidance. 15
IPOA algorithm
Principle of our IPOA algorithm
In this article, we proposed an IPOA algorithm to steer the robotic arm around the obstacle. At the same time, it is ensured the minimum joint space variations and the shortest motion trajectory of end effector. First, to avoid obstacle, an intermediate point is needed to be set. The parameter of the intermediate point is optimized by genetic algorithm. Then, the motion trajectory between the starting point and the intermediate point or the intermediate point and the target point is described through quintic polynomial segment. Finally, an ideal motion trajectory with no collision is planned. For single obstacle avoidance, the schematic diagram is shown in Figure 2. The solid line in the figure represents the trajectory when the intermediate point is set, and the dotted line represents the trajectory where the robotic arm will collide with the obstacle.

The schematic diagram of single obstacle avoidance.
Moreover, the IPOA algorithm has the feature of wide expansibility. In the case of multiple obstacles, after decomposing trajectory and connecting the intermediate point in series, the robotic arm can avoid obstacles in very complex circumstances. For multiple obstacle avoidance, the schematic diagram is shown in Figure 3

The schematic diagram of multiple obstacle avoidance.
For multiple obstacle avoidance, if there are
Motion trajectory planning
The motion trajectory planning of the robotic arm usually uses the high spline curve to keep it smooth and continuous. For joint space trajectory planning, cubic polynomial, quintic polynomial, parabolic curve, and B-spline curve can be used. Since the quintic polynomial has a feature of simple calculation, there is no mutation in the velocity and acceleration curve. In this article, the quintic polynomial 16 trajectory planning in the joint space is adopted.
Whether the track is between the starting point and the intermediate point or the intermediate point and the target point, we all use this trajectory planning method
Through quintic polynomial, a smooth and continuous trajectory for position, velocity, and acceleration of each joint is planned. By calculating boundary restrictions, the coefficients of the polynomial can be solved. Assume that at zero moment the joint angle is
After the calculation, the result is
Normally, the velocity and acceleration initially and at the termination is 0, that is,
This section focuses on the generation method of point-to-point motion trajectory planning. In the following sections, we will use the quintic polynomial as the basis element to plan the movement of the manipulator in the Cartesian coordinate space.
Collision detection strategy
In the past, the collision detection strategy of robotic arm was mostly to transfer obstacles from the Cartesian coordinate space to the configuration space (C space). T Lozano-Perez17,18 first proposed the free space method based on C space to avoid obstacle. After that, other scholars have also done a lot of research on this aspect. The method transforms the obstacle avoidance from the high-dimensional space into low-dimensional space, and uses the heuristic search algorithm to find the motion path of the manipulator in the free space. Although it can realize collision-free path planning of manipulators, the method of mapping obstacles into the C space is complicated and the expression is not intuitive enough. 19
In our research, we provide a novel collision detection strategy in our proposed algorithm to prevent the robotic arm from being disabled. The method directly determines whether the robotic arm and obstacle interfere in the Cartesian coordinate space. The specific realization is that under the condition of model simplification, the position and attitude matrices of the joints are, respectively, expressed, and the pose of the connecting rod is expressed. Interference or collision is judged by the distance between the obstacle point and the straight line segment of the connecting rod.
First, the coordinate matrix representation of each joint is obtained. Through matrix transformation method, the mathematical model of the connecting rod line segment will be represented. For robotic arm discussed in this article
where
Then, it is determined whether the distance between the connecting rod segment and the obstacle point exceeds the obstacle expansion radius.
where
Finally, it is discussed whether the intermediate point can be used to avoid obstacles both in front and back motion trajectories. Set the obstacle point
where
Compared with the previous research on collision detection, such as the method of determining the interference of obstacle and robotic arm in two vertical cross-plane projections, 20 or other ways of converting the Cartesian coordinate space into robot configuration space,21,22 our method does not require the projection or transformation of obstacle, the calculation is simpler, and the expression is more intuitive. So it can be found that our method is far more simple and effective.
Through our collision detection strategy, the robot model is simplified, so that the complex space problem can be transformed into a simple distance problem. Using the distance between the obstacle point and the connecting rod, it can be determined whether the robotic arm is conflicted with obstacle.
Gene optimization scheme
In our IPOA algorithm, we need to choose a method to optimize the intermediate point parameters. There are many kinds of optimization methods to deal with a particular form of problem. The situation is quite different, depending on the objective function (linear or non-linear, mono- or multi-objective) and the nature of constraints. Here several commonly used optimization algorithms are as follows: the penalty function method, 23 relax penalty method, 24 particle swarm optimization, 25 and evolutionary algorithms. 26 In our case, we choose to use the genetic algorithm27–30 to optimize the intermediate point. It has proved to be robust in highly non-linear situation. Through gene iterations, it is able to solve complex optimization problems in a reasonable computational time.
Genetic algorithm is not affected by specific areas of the problem, and it has a strong robustness to different types of problems. For multimodal problem, genetic algorithm will not stuck into local optimal solution, and it is easy to achieve parallelizing. Based on the above advantages, we choose genetic algorithm to optimize the intermediate point parameters. In addition, some other scholars have also adopted genetic algorithm to optimize the manipulator trajectory planning.31,32
It is worth noting that the intermediate point solved by genetic algorithm is not necessarily the optimal solution. But it is one of many solutions to the domain near the optimal solution under the condition of constraints. We can further improve the optimization performance by increasing population size and changing the crossover or mutation factors. However, during the trajectory planning of the robotic arm, it is of little significance to obtain the only optimal solution at the expense of calculation time.
Genetic algorithm
Genetic algorithms begin with an initial population of potential solutions, and the chromosome characteristics are expressed through genetic coding such as binary coding. By simulating the natural evolutionary process, survival of the fittest, a better approximate solution is produced. According to the fitness function, the individual is selected and the new population is formed through the process of crossover and mutation. After iterations, the best solution of the problem is obtained by decoding the optimal individual. The theoretical basis and formula of genetic algorithm are not repeated in this article. We invoke the genetic algorithm and direct search (GADS) toolbox to implement its function.
This article focuses on the multi-objective optimization problem of the six robotic joint variables. The general mathematical model of multi-objective optimization problem can be described as shown in equation (13)
where
The ultimate optimization objective is the six joint angles at the intermediate point, which have the same degree of importance, so each of the weight factors
Design of fitness function
In practical application, to realize efficient work, the robotic arm should avoid unnecessary repetitive motions. In the case of kinematic considerations only, the trajectory planning should focus on the variations of each joint angle and the length of end effector motion trajectory.
In GADS toolbox, the goal of genetic evolution is to minimize the fitness function. Using the interpolation point method, the trajectory of the quintic polynomial can be divided into several points. The joint variations
with
with
with
The weight factors are
Assume that if we design the fitness function as
The pseudo code for IPOA algorithm is shown as follows:
We set the number of interpolation points. The variable to be optimized is the intermediate point parameter, which corresponds to six joint angles
In summary, our fitness function is shown in formula (15) and our objective function is
Experimental verification
In order to verify that the IPOA algorithm proposed in this article is reliable, we set different experimental conditions. First we verify the effectiveness of the IPOA algorithm for single obstacle with different expansion radiuses. Then we test the reliability of the IPOA algorithm when multiple obstacles exist. Besides, the superiority of the algorithm is proved when the obstacle is not on the planned path. Finally, through the performance comparison experiment, the relationship between the number of intermediate points and obstacle avoidance performance is analyzed.
We all know that each joint angle corresponds to a position and attitude of the robotic arm in the Cartesian coordinate space. So the starting point and the target point in the Cartesian coordinate space can be represented by the joint space. In the following experiments, we set the starting point of the joint angle as
Single obstacle avoidance with different expansion radiuses
Set the experimental conditions as follows: the obstacle point in the Cartesian coordinate space is
Figure 4 indicates the variation curve of the fitness function along with the genetic iteration process.

The best and mean fitness variation curve along with the genetic iterations process: (a) obstacle expansion radius
In the case of

Robotic arm motion trajectory when the obstacle expansion radius is

Robotic arm motion trajectory when the obstacle expansion radius is
In Figures 5 and 6, red line represents the straight line of two points, and blue line represents the actual motion trajectory of the end effector. It can be seen that the shortest distance between the connecting rod and the obstacle during the movement of the manipulator is when the connecting rod is tangent to the obstacle.
Figure 7 illustrates the distance change curves between the two connecting rods and the obstacle point, where S1 and S2 represent the distance of the connecting rods 1 and 2 to the obstacle point from the starting point to the intermediate point; S3 and S4 represent the distance of the connecting rods 1 and 2 to the obstacle point from the intermediate point to the target point. The two motion trajectories of the robotic arm are fitted with 25 interpolation points, each of which corresponds to the distance of the two connecting rods to the obstacle point. As can be seen from the graph, the distance of all connecting rods to the obstacle point is greater than each obstacle expansion radius

Distance change curves between the connecting rod and the obstacle point when (a) obstacle expansion radius
Through the above experiments, the reliability of the IPOA algorithm for single obstacle in the condition of different expansion radiuses is validated.
Experimental analysis for multiple obstacle avoidance
In the actual application scenario, the working conditions of serial robot will be more complicated and multiple obstacles must be taken into account. The multi-obstacle avoidance problem is about to be solved. In this article, we take the IPOA algorithm introduced in section “Principle of our IPOA algorithm,” expand the basis method, and connect it in series. The experiment of two obstacle points is carried out and the more complex approach is similar.
Set the experimental conditions as follows: the two obstacle points in the Cartesian coordinate space are
As shown in Figure 8, after 132 iterations, the fitness function

The best and mean fitness variation curve when multiple obstacles exist.

(a) Robotic arm motion trajectory when multiple obstacles exist; (b) the position and attitude of the robotic arm during the movement.
We can also obtain the distance change curves between the two connecting rods of the manipulator and two obstacle points in Figure 10.

Distance change curves between the connecting rod and the obstacle point in different motion periods.
Among them, the curve
Through the above experiments, we verify that the IPOA algorithm can be used to solve the problem of multi-obstacle avoidance for serial robot.
The superiority analysis of the IPOA algorithm without obstacle
Aimed at the situations where the robotic arm does not need to consider the obstacle avoidance, that is, when the obstacle is not in the working space or on the planned path, we have also analyzed and discussed this kind of classification. In this case, an intermediate point can also be optimized by genetic algorithm, but this intermediate point will not prevent the robotic arm from avoiding the obstacle. The superiority of the IPOA algorithm is validated by comparing the motion trajectory length and the joint space variations of two experimental results.
Set the experimental conditions as follows: the obstacle point in the Cartesian coordinate space is

(a) Motion trajectory with no obstacle and no intermediate point and (b) motion trajectory with no obstacle and one intermediate point.
It is obvious that the trajectory length will be shorter when setting the intermediate point. By calculation, the fitness function in Figure 11(a) is
Through the above experiments, the superiority of the IPOA algorithm is proved when the obstacle is not in the workspace or on the planned path.
Comparison experiment on the number of intermediate points
We set the intermediate point to steer the robotic arm around the obstacle; but is there any connections between the number of intermediate point and the optimal target? In this section, we have conducted experiment with more intermediate points or less intermediate points and discuss the performance through comparison analysis.
In section “Single obstacle avoidance with different expansion radiuses,” one intermediate point is set to move the robotic arm around one obstacle. Now we set two intermediate points to observe the fitness function, the joint space variations, and the length of end motion trajectory. The experimental conditions are set as before and the obstacle expansion radius is

Motion trajectory with one obstacle and two intermediate points.
Through genetic algorithm, the two intermediate points are found which are
Performance comparison analysis on the number of intermediate points when one obstacle exists.
OB: obstacle; IP: intermediate point.
In Table 2, we can find that the fitness function decreases by
In section “Experimental analysis for multiple obstacle avoidance,” two intermediate points are set to move the robotic arm around two obstacles. Now we set one intermediate point to observe the fitness function, the joint space variations, and the length of the end motion trajectory (Figure 13).

Motion trajectory with two obstacles and one intermediate point.
Through genetic algorithm, the one intermediate point is found which is
Performance comparison analysis on the number of intermediate points when two obstacles exist.
OB: obstacle; IP: intermediate point.
In Table 3, we can observe that the fitness function decreases by
In conclusion, through the above experiments, we analyze the relationship between the number of obstacle points and the number of intermediate points. The experiment shows that when there are
In terms of computational complexity, all the codes of our IPOA algorithm are implemented by robotic toolbox 9.8 versions and genetic algorithm toolbox in MATLAB, and run on a computer with Intel(R) Core(TM) i5-4590 at 3.30 GHz and 4 GB RAM in 64-bit win7 operating system. Taking the first experiment
The IPOA algorithm proposed in this article has an optimization time of about 300 s for intermediate point parameter, which obviously cannot meet the requirement of real-time performance. In order to solve real-time problems, we proposed possible solutions. From the changes of fitness function during the iteration, we can see that after an average of 30 iterations the algorithm tends to converge. So, from the aspect of efficiency, we can stop the iteration ahead of schedule to improve the real-time performance. Or we can choose another optimization algorithm to achieve the purpose of optimizing the intermediate point parameter. The improvement of real-time problem is one of the key tasks for our follow-up work. Through the programming language transformation from MATLAB to C and the improvement of optimization algorithm, we believe that the real-time performance of IPOA will be further enhanced.
Conclusion
In this article, an IPOA algorithm is proposed to improve the movement efficiency of robotic arm while avoiding the obstacle. Through IPOA algorithm, an ideal non-collision trajectory can be obtained, with the joint velocity and acceleration being smooth and continuous, with the minimum joint space variations and the shortest end motion trajectory. This means that the robotic arm can work in a state of safety, stability, and energy conservation. It is worth noting that the intermediate point solved by genetic algorithm is not necessarily the optimal solution, but it is one of the many solutions near the optimal solution in the case of constraint conditions. We can increase the number of population size or change the crossover and mutation fraction to further improve the performance. However, it is unnecessary to get the optimal solution at the cost of computational time.
In theory, the IPOA algorithm can be extended to arbitrary freedom of the robot’s obstacle avoidance. And through connecting the IPOA algorithm in series, it can realize the multi-obstacle avoidance of robotic arm in complex environment. The theoretical research on obstacle avoidance of this article has a propelling effect on the application of serial robot. In addition, our study can be referenced by the related research of serial robot.
Footnotes
Handling Editor: Jan Torgersen
Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This work is supported by the Science and Technology Pillar Program, Tianjin, China, under Project 16YFZCSF00 590.
