- Research
- Open Access

# A 6-DOF robot-time optimal trajectory planning based on an improved genetic algorithm

- Jiayan Zhang
^{1}, - Qingxi Meng
^{1}Email authorView ORCID ID profile, - Xugang Feng
^{1}and - Hao Shen
^{1}

**Received:**8 November 2017**Accepted:**14 May 2018**Published:**3 July 2018

## Abstract

By using quintic polynomial function to interpolate several given points of each joint of the robot, the mathematical expressions of each joint variable of the robot with time are established. In addition, to improve the search algorithm performance crossover operator and mutation operator of the genetic algorithm are improved in cosine form. Furthermore, the improved adaptive genetic algorithm is applied to optimize the time interval of interpolation points of each joint, so as to realize time optimal trajectory planning. Moreover, MATLAB simulation is carried out, and the results show that the method proposed in this paper reduces the running time of the robot tasks. Meanwhile, the curves of angle position, velocity and acceleration of each joint are smooth enough, which ensure accomplish its tasks in a stable and efficient way.

## Keywords

- Industrial robot
- Trajectory planning
- Adaptive genetic algorithm (AGA)
- Time optimal

## Background

Robot trajectory planning usually refers to track points given several expectations and target pose, and timely adjust the rotation angle of each joint of the robot to the end effector at a prescribed trajectory followed by each point to eventually reach the target point. The trajectory planning in joint space is simpler and convenient than that of Cartesian space. Therefore, several fixed points which located at the end of several robotic arms are usually given. Then, these track points for the robot are computed by using the inverse kinematics so as to convert it from Cartesian space to joint coordinate space. Next, the track points are used to carry out interpolation operation using various spline functions, polynomial functions or other forms of curves, and the expressions about the time of each joint variable for the robot are obtained. In addition, in light of the mechanical characteristics of the robot, the speed and acceleration of each joint should be limited to the allowable range. Therefore, it is necessary to optimize the speed and acceleration of each joint arm, not only to ensure the smooth operation of the joint arm but also to reduce the wear and impact to prolong the working life of the robot.

The method of optimal trajectory planning generally includes time optimal trajectory planning [1–3], energy minimum trajectory planning [3, 4] and impact minimum trajectory planning [5], or multi-objective trajectory optimization combining these estimation schemes. Among them, the optimal trajectory planning with the robot running time as main consideration is favored by many scholars. In recent years, many researchers have made some achievements in the field of robot trajectory planning. Tohfeh and Fakharian [6] constructed a function expression for the omnidirectional robot’s energy dissipation by combining obstacle avoidance performance, and the optimization problem was transformed into a parameter minimization problem by the polynomial interpolation method, which provided a more effective way for the study of robot obstacle avoidance. However, due to the complexity of this method, there is a certain degree of difficulty in practice. Bende [7] studied a method of modeling underwater robot based on bond graph theory and optimized the model parameters with the genetic algorithm to obtain the optimized trajectory of the robot. Experiments were carried to show the significance of this method. Zhu and Liu [8] applied the seventh-order B-spline curve for the interpolation operation of robot’s articulation arm trajectory and applied the sequential quadratic programming for the trajectory planning, which achieved the optimal planning goal and the angular displacement, velocity and acceleration curve of each joint of the robot are smoother.

In this paper, from the point of view of robot running time, the trajectory of robot joint is planned by the quintic polynomial interpolation under the premise of smooth operation of the manipulator, and the time interval of trajectory interpolation point is optimized by the improved adaptive genetic algorithm, so that the robot accomplishes task time as short as possible.

## Model

## Trajectory planning analysis

The number of desired track points of the robot end effector in the Cartesian space is transformed into the corresponding joint variables by the kinematic inverse operation, and then, track points of the joint space are interpolated to obtain the joint variables of the robot a function of time-varying expression [9]. In this paper, the quintic polynomial is used to interpolate trajectory points in the robot joint space.

Introducing the above factors into Eq. (3), the robot trajectory equation of the quintic polynomial can be derived.

## Improvement in genetic algorithm

The basic knowledge of the kinematics of the robot and the basic principle of the interpolation of the trajectory points of the joint space by the quintic polynomial have been introduced in the preceding narrative. On this basis, it is necessary to optimize the time interval of the interpolation point of the track point by using the genetic algorithm to realize the optimal planning of the robot time and further make the angular displacement, velocity and acceleration curve of each joint movement smoother.

The genetic algorithm, which is an artificial intelligence optimization algorithm for simulating the genetic and evolutionary processes in nature [10–12], owns the characteristics of simplicity and robustness, and starts from the parallel solution of the problem (rather than a single solution). Therefore, it not only has excellent global optimization but also is used in the optimization process of practical problems [13].

Equation (10) shows that a larger fixed crossover probability is given when the fitness value of the cross parent is small. And the greater the fitness of the two chromosomes, the smaller the crossover probability is. The adjustment of the mutation probability in Eq. (11) is consistent with the crossover probability.

For the crossover probability adjustment method in Eq. (12), \( p_{c0} \) represents a crossover probability for the average fitness of the population, and the size of \( p_{c0} \) can be determined based on the required problem and the algorithm optimization process. If \( p_{c0} \) is larger, it means raising the crossover probability of the individual in the population and promoting the change in the individual gene pattern from a wide range. If *x* is small, the opposite is true. Therefore, in order to improve the optimization performance of the algorithm, we need to adjust the value of \( p_{c0} \) to balance the global optimization ability and local optimization ability of the algorithm.

## Combining the improved algorithm with trajectory planning

### Problem description

*n*points (including the start and the end points).

*N*points can be converted into n corresponding joint variables of the joint space by the inverse kinematics of the robot, that is produced

*n*− 1 time segment with length of \( T_{i} (i = 1,2,3, \ldots ,n - 1) \), \( T_{i} = t_{i + 1} - t_{i} \), where

*x*represents the moment when the robot end effector reaches the

*i*-th path point. The total time is:

*T*is the total time of the robot movement which is the objective function of the problem; \( T_{i} {\kern 1pt} {\kern 1pt} {\kern 1pt} (i = 1,2,3 \ldots ,n - 1) \) is the time interval of the joint variable; the constraint is the maximum angular velocity, acceleration and jerk of the joints of the robot. Therefore, the problem of time optimal trajectory planning for robot is described as follows:

- (1)
Objective function:

$$ {{\rm min}} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} T = \sum\limits_{i = 1}^{n - 1} {T_{i} } $$(15) - (2)constraint condition:
- (A)
angular velocity

where \( \theta_{ \max }^{{\prime }} \) is the maximum angular velocity allowed by the arm joint.$$ \left\{ {\begin{array}{*{20}l} {\forall t \in [t_{i} ,t_{i + 1} ]} \hfill \\ {|\theta_{i}^{{\prime }} (t)| \le \theta^{{\prime }}_{ \max } } \hfill \\ \end{array} } \right. $$(16) - (B)
acceleration

where \( \theta_{ \max }^{{\prime \prime }} \) is the maximum angular acceleration value allowed by the robot joint.$$ \left\{ {\begin{array}{*{20}l} {\forall t \in [t_{i} ,t_{i + 1} ]} \hfill \\ {|\theta^{{\prime \prime }}_{i} (t)|\; \le \theta^{{\prime \prime }}_{ \max } } \hfill \\ \end{array} } \right. $$(17) - (C)
jerk

where \( \theta_{ \max }^{{{\prime \prime \prime }}} \) is the maximum jerk value allowed for the arm joint.$$ \left\{ {\begin{array}{*{20}l} {\forall t \in [t_{i} ,t_{i + 1} ]} \hfill \\ {|\theta^{{\prime \prime }}_{i} (t)|\; \le \theta^{{\prime \prime }}_{ \max } } \hfill \\ \end{array} } \right. $$(18)

- (A)

### Time-optimal simulation

The constraints of the robot joints

Joint | Constraints | ||
---|---|---|---|

\( \theta^{\prime } (t)/(^{ \circ } /{\text{s}}) \) | \( \theta^{{\prime \prime }} (t)/(^{ \circ } /{\text{s}}^{2} ) \) | \( \theta^{{{\prime \prime \prime }}} (t)/(^{ \circ } /{\text{s}}^{3} ) \) | |

1 | 100 | 45 | 60 |

2 | 95 | 40 | 60 |

3 | 100 | 75 | 55 |

4 | 150 | 70 | 70 |

5 | 130 | 90 | 75 |

6 | 110 | 80 | 70 |

*M*= 80; maximum crossover probability \( P_{c1} = 0.9 \), minimum value \( P_{c2} = 0.4 \), \( P_{c0} = 0.7 \); maximum mutation probability \( P_{m1} = 0.1 \), minimum value \( P_{m2} = 0.01 \), \( P_{m0} = 0.7 \); Evolutional generation

*G*= 100. A MATLAB program for the optimal trajectory planning of the first three joints of PUMA560 is written by combining the quintic polynomial interpolation trajectory [15, 16]. In the optimization process, the trajectory of the robot joint is composed of the seven-segment polynomial curve, and its optimization precision is 0.001 s. The results are shown in Table 2.

Optimization Results

Time interval | Joint | |||
---|---|---|---|---|

Initial value | 1 | 2 | 3 | |

\( h_{1} \) | 4 | 2.785 | 2.113 | 3.349 |

\( h_{2} \) | 4 | 2.032 | 2.128 | 2.064 |

\( h_{3} \) | 4 | 2.316 | 1.764 | 1.626 |

\( h_{4} \) | 4 | 1.578 | 1.918 | 1.659 |

\( h_{5} \) | 4 | 1.824 | 1.706 | 2.113 |

\( h_{6} \) | 4 | 1.487 | 1.874 | 1.629 |

\( h_{7} \) | 4 | 1.707 | 2.878 | 2.208 |

Total time (s) | 28 | 13.729 | 14.381 | 14.648 |

It can be seen from Table 2 that after the optimization of the running time of the robot, the time taken by the robot to reach the target point is obviously reduced under the constraint of the joint angular velocity, acceleration and jerk of the robot. For the first three joints, the total time of the original run is 28 s. After optimization of this method, it is shortened to 13.729, 14.381 and 14.648 s, which was at least 47.7% shorter than 28 s. Compared with several literatures that use PUMA560 as the object for MATLAB simulation, the same constraints apply. The reference literature [17] describes the method of interpolating the trajectory of the robot with seventh-order B-spline curves and optimizing the robot trajectory using the genetic algorithm. After optimization, the time is shortened from the original 20–15.620 s, which is shortened by 21.9%. In reference literature [18], a cubic B-spline curve is used to interpolate the robot motion trajectory, and then an improved genetic algorithm based on the crossover operator and mutation operator adjusted with evolutionary algebraic average fitness is used to perform the time optimal trajectory planning for the robot motion trajectory. The time after optimization was shortened from the original 20–13.072 s, a 34.6% reduction. It can be seen that the improved genetic algorithm, which the crossover operator and the mutation operator in the general adaptive genetic algorithm are adjusted cosine, based on quintic polynomial interpolation described in this paper satisfies the goal of the shortest time trajectory planning.

### Simulation and analysis of smoothness of joint operation

The optimization of the robot’s running time is shown in the previous section, and then, we simulate the angular displacement, velocity and acceleration curves of the first three joints of the robot.

## Conclusions

Based on the PUMA560 robot model, this paper briefly describes the method of locating the trajectory with the quintic polynomial interpolation in the joint space. Then, the crossover operator and the mutation operator in the general adaptive genetic algorithm are adjusted cosine to improve the performance of the algorithm. Using the improved algorithm to optimize the interpolation time of the robot trajectory, the simulations show that the running time of each joint of the robot has been greatly reduced. The angular displacement, velocity and acceleration curve of the joint operation shows that the smoothness of the robot is better and the oscillations and shocks of the manipulator can be reduced. In conclusion, the method of this paper realizes the optimal trajectory planning target for robot time.

## Declarations

### Authors’ contributions

JYZ completed the system modeling and the main algorithm improvement. QXM worked on algorithm optimization and simulation. XGF and HS studied the improved method of adaptive genetic algorithm, analyzed the simulations and revised the manuscript. All authors read and approved the final manuscript.

### Acknowledgements

This research study was supported financially by the National Natural Science Foundation of China under Grant No. 61473171 and the Natural Science Foundation of Anhui Province (KJ2015A058).

### Competing interests

The authors declare that they have no competing interests.

### Ethics approval and consent to participate

Not applicable.

### Funding

This research has been funded by the National Natural Science Foundation of China under Grant No. 61473171 and the Natural Science Foundation of Anhui Province (KJ2015A058).

### Publisher’s Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Open Access**This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.

## Authors’ Affiliations

## References

- Kim KB, Kim BK. Minimum-time trajectory for three-wheeled omnidirectional mobile robots following a bounded-curvature path with a referenced heading profile. IEEE Trans Rob. 2011;27(4):800–8. https://doi.org/10.1109/tro.2011.2138490.View ArticleGoogle Scholar
- Chen H, Fang Y, Sun N, Qian Y (2015) Pseudospectral method based time optimal trajectory planning for double pendulum cranes. In: Control conference. IEEE; p. 4302–4307. https://doi.org/10.1109/chicc.2015.7260305.
- Haili XU. Global time-energy optimal planning of industrial robot trajectories. J Mech Eng. 2010;46(9):19–25.View ArticleGoogle Scholar
- Liu H, Lai X, Wu W. Time-optimal and jerk-continuous trajectory planning for robot manipulators with kinematic constraints. Rob Comput Integr Manuf. 2013;29(2):309–17. https://doi.org/10.1016/j.rcim.2012.08.002.View ArticleGoogle Scholar
- Yang JT, Jiang WG, Lin YC. Jerk-optimal trajectory planning algorithm of industry robot. Sci Technol Eng. 2014;28:64–9. https://doi.org/10.3969/j.issn.1671-1815.2014.28.013.Google Scholar
- Tohfeh F, Fakharian A (2015) Polynomial based optimal trajectory planning and obstacle avoidance for an omni-directional robot. In: Ai and robotics, vol. 2010. IEEE; p. 1–6. https://doi.org/10.1109/rios.2015.7270731.
- Bende V, Pathak PM, Dixit KS, Harsha SP. Energy optimal trajectory planning of an underwater robot using a genetic algorithm. Proc Inst Mech Eng Part I J Syst Control Eng. 2012;226(8):1077–87. https://doi.org/10.1177/0959651812447232.View ArticleGoogle Scholar
- Zhu S, Wang. Time-optimal and jerk-continuous trajectory planning algorithm for manipulators. J Mech Eng. 2010;46(3):456–62. https://doi.org/10.3901/jme.20.Google Scholar
- Guan-zheng Tan, Sheng-yuan HU. Real-time accurate hand path tracking and joint trajectory planning for industrial robots (I). J Cent South Univ Technol. 2002;9(4):273–8. https://doi.org/10.1007/s11771-002-0041-z.View ArticleGoogle Scholar
- Xu D, Liu M, Zhu L (2013) Single frequency GNSS integer ambiguity resolution with adaptive genetic algorithm. In: International conference on information science and technology. IEEE; p. 1049–1051. https://doi.org/10.1109/icist.2013.6747716.
- Ling Wang. Intelligent optimization algorithm and its application. Beijing: Tsinghua University Press; 2001.Google Scholar
- Liang Xu. Modern intelligent optimization hybrid algorithm and its application. 2nd ed. Beijing: Publishing House of electronics industry, Beijing; 2014
**(In Chinese)**.Google Scholar - Ying-Ying YU, Yan C, Tao-Ying LI. Improved genetic algorithm for solving tsp. Control Decis. 2014;29(8):1483–8. https://doi.org/10.13195/j.kzyjc.2013.0598.Google Scholar
- Ren ZW, San Y. Improved adaptive genetic algorithm and its application research in parameter identification. J Syst Simul. 2006;18(1):40–1. https://doi.org/10.16182/j.cnki.joss.2006.01.011.Google Scholar
- Yingjie L, Shanwen Z, Xuwu L et al (2005) MATLAB genetic algorithm toolbox and its application. Xi’an Electronic and Science University press, Xi’an (In Chinese).Google Scholar
- Jinwu Zhuo. The application of MATLAB in mathematical modeling. Beijing: Beijing Aerospace publishing house; 2011.Google Scholar
- He J, Zhu L, Cheng L, Yin J (2015) Time-optimal trajectory planning of 6-dof robot based on genetic algorithm. J Mech Transm. https://doi.org/10.16578/j.issn.1004.2539.2015.09.010.Google Scholar
- Niu Y (2013) Time-optimal trajectory planning of 6DOF serial robot. Dissertation, Changchun University of Technology, Changchun, Jilin, China.Google Scholar