APP下载

Optimal trajectory planning for robots based on particle swarm optimization

2020-07-24WenxiangZHANGHonglinDONG

机床与液压 2020年12期

Wen-xiang ZHANG, Hong-lin DONG

(Nanjing University of Science and Technology, Nanjing 210094, China)

Abstract: Robot trajectory planning is a focus area of robot motion control research, relating directly to the working efficiency of robots. To keep robots moving at a continuously angular velocity and angular acceleration, a cubic spline interpolation function was used for robot motion trajectory planning in this paper. Considering that an excessively fast angular velocity and excessively high angular acceleration would bring about vibrations and shocks to the robot system, the particle swarm optimization algorithm was used to optimize robot motion time under the constraints of angular velocity and angular acceleration to enable robots to move smoothly in time-optimal conditions. Finally, the MATLAB robotics toolbox was used to conduct a simulation experiment. The experimental results proved the practical applicability of this method to robot trajectory planning.

Key words: Robot trajectory planning, Cubic spline interpolation function, Particle swarm optimization, Time-optimal

1 Introduction

As robots are used more and more widely in various walks of life, people put forward increasingly high requirements for robot performance. Trajectory planning is a very important part of the robot motion control system. Robot trajectory planning means working out the motion trajectory of the robot end-effector in the Cartesian space or joint space by taking operational requirements and robot performance into comprehensive consideration[1]. For an articulated robot, piecewise polynomial interpolations are always applied to its trajectory planning for the reason that the derivative and second derivative of piecewise polynomial interpolations are continuous and Runge’s phenomenon will never occur. The most commonly used piecewise polynomial interpolations include piecewise cubic polynomial interpolation, piecewise quintic polynomial interpolation, and piecewise spline interpolation[1-2].

During trajectory planning, robot motion time is usually selected based on experience. Although robots can thereby move smoothly, motion time is often not optimal, and this affects the working efficiency of robots. To solve this problem, most researchers at home and abroad use a genetic algorithm for time optimization[3-5] while some other researchers use a hybrid algorithm for time optimization[6]. There are also ongoing studies[7-8] focused on searching for the optimal time by particle swarm optimization (PSO).

To ensure that robots would move smoothly and continuously, a cubic spline interpolation function (CSIF) was used for trajectory planning in this paper while PSO was used to search for optimal motion time under the constraints of angular velocity and angular acceleration. The MATLAB robotics toolbox was used to conduct a simulation experiment. The experimental results show that both angular velocity and angular acceleration curves were continuous, and that optimal motion time was determined by PSO under constraint conditions. Therefore, this method can be used in actual production to improve the working efficiency of robots.

2 Construction of a CSIF[9]

Lets(x) be a CSIF that depends onx0,x1,…,xn+1in [a,b], wherea=x0

(1)

wherexj-1≤x≤xj.

It is known that the CSIF has a continuous derivative at the node, and there are known first derivatives at the two end points, so

s′(xj-0)=s′(xj+0),j=1,2,…,n

(2)

(3)

n+2 equations are derived from Formula (1), (2) and (3), expressed in matrix form

(4)

where

The CSIF in the interval [a,b] can be figured out by solving the linear simultaneous equations in Formula (4).

3 Principles of PSO

Interpolation time should be known when the CSIF is used to make trajectory planning, but the usually used interpolation time is rarely optimal time. Therefore, based on trajectory planning by the CSIF, PSO was used in this paper to search for optimal time of trajectory planning with the angular velocity and angular acceleration set as constraints.

PSO is a heuristic algorithm, which is used to find the optimal solution for a problem by simulating the mechanism of cooperation among a flock of birds foraging in nature[10].Mparticles form a swarm in a search space with a dimension ofN, where each particle separately searches for an optimal solution, which is denoted by current individual extremumPbest. Then, the individual extremum is shared by all the other particles in the entire particle swarm, and an optimal individual extremum needs to be found as the global optimal solutionGbestof the entire particle swarm. All particles in the particle swarm adjust their own velocity and position according to their current individual extremumPbestand the current global optimal solutionGbestshared by the entire particle swarm. The update rules for the velocity and position of each particle come from Formula (5), (6), and (7).

(5)

(6)

(7)

whereirepresents theithparticle;krepresents the number of iterations;c1andc2are acceleration factors;r1andr2are random numbers in [0,1];ωrepresents the inertia weight;Vrepresents the particle velocity;Xrepresents the particle position. Fig.1 shows the algorithm flow chart.

Fig.1 PSO algorithm flow chart

4 Simulation experiment and result analysis

The core of joint space trajectory planning for articulated robots is to represent the joint angle, angular velocity, and angular acceleration as a function of time, it shows that the joint space trajectory planning has the same algorithm principle. Therefore, different joint space trajectory planning algorithms have certain generality in articulated robots.[11]. Among the many articulated robots, the PUMA560 robot is the most typical model, it is used by many researchers as examples of robot kinematic analysis teaching and joint space trajectory planning algorithm research, the results obtained from experiments using it are representative[12]. With PUMA560 robot taken as an example, the MATLAB robotics toolbox was used in this paper to analyze its kinematic principle[13], and a joint space trajectory planning simulation experiment was conducted by the CSIF and PSO.

Two additional path points were selected between the start and end points of the motion path. With the time spent in each interval set tot1,t2andt3, respectively, each joint angle under every path point was calculated based on the principle of robot inverse kinematics. Then, the CSIF was used to interpolate the joint angles in each interval. On this basis, PSO was used to search for optimal motion time under the constraints of the angular velocity and angular acceleration. The fitness value calculation function is shown in Formula (8).

fit(i)=ti1+ti2+ti3

||Vi||≤Vmax, ||Ai||≤Amax

(8)

whereirepresents the time particle of theithgroup; ||Vi|| represents the current actual velocity of the joint; ||Ai|| represents the current actual acceleration of the joint;Vmaxrepresents the maximum velocity;Amaxrepresents the maximum acceleration. During the experiment, when the joint angular velocity and angular acceleration in none of the groups of time particles meet constraints,fit(i)=∞.

PSO parameters were set as follows in the experiment:c1=c2=1.5,N=30,m=30,r1andr2represent random numbers in [0,1], the initial particle position is a random one in 0~4 s, the particle velocity is in [-2,2],ωmax=0.9,ωmin=0.4. Table1 shows the values (unit: rad) of the joint angles corresponding to all the joint path points; Table 2 shows the maximum of the angular velocity and angular acceleration of each joint.

Table 1 The corresponding angle values of the joint path points

Table 2 The maximum constraint value of angular velocity and angular acceleration

Whent1=t2=t3=4 s, the CSIF was used to make trajectory planning for each joint. The results are shown in Fig.2, where the graph on the left is a curve of the relation between the joint position and time, the middle graph is a curve of the relation between the joint angular velocity and time, and the graph on the right is a curve of the relation between the joint angular acceleration and time.

As can be seen in Fig.2, the position, angular velocity, andangular acceleration of the robot are continuous during the whole motion process, suggesting that the CSIF can be well used for robot trajectory planning.

Fig.2 Curves of the relation between the joint position and time, between angular velocity and time, and between the angular acceleration and time

With time intervals determined, the PSO algorithm was used to search for optimal motion time under the constraints of angular velocity and angular acceleration. Each joint was tested using this method. Fig.3 shows curves of the relation between the position, angular velocity, andangular acceleration of joints 1~3 and time under time-optimal conditions.

As can be seen in Fig.3, the motion trajectory curve worked out by PSO is continuous and smooth, and the motion time is shorter. This suggests that the algorithm can be used for robot control, and that the joint angular velocity and angular acceleration meet the constraints. That is, this method can be well used for robot trajectory planning.

Fig.3 Curves of the relation between the position, angular velocity, andangular acceleration of joints 1~3 and time

5 Conclusion

On the basis of analyzing the principle of robot kinematics, this paper combined the CSIF with PSO for robot trajectory planning. According to the analysis of the experimental results, with angular velocity and angular acceleration as constraints, the motion trajectory, angular velocity, andangular acceleration curves worked out by this method are continuous and smooth, and that the motion time is optimal, thus improving the working efficiency of the robot. The present study is of some practical significance for robot applications.


登录APP查看全文