Open access peer-reviewed chapter

Trajectory Planning

Written By

Junsong Lei, Zhaojiang Luo and Chaoqun Li

Submitted: 01 May 2023 Reviewed: 05 May 2023 Published: 11 July 2023

DOI: 10.5772/intechopen.111780

From the Edited Volume

Multi-Robot Systems - New Advances

Edited by Serdar Küçük

Chapter metrics overview

116 Chapter Downloads

View Full Metrics

Abstract

This chapter discusses the trajectory planning of robot. First, the basic principle of trajectory planning is described, which is mainly determined by the geometric path and the motion law, and it is a motion law that defines time according to a given geometric path. Second, the characteristics of the joint space and the operational space are expounded. Then the trapezoidal trajectory and the trajectory with S velocity profile commonly used in industrial practice are introduced. Finally, point-to-point trajectories and multipoint trajectories are described. Point-to-point trajectories include a point-to-point trajectory in the joint space and a straight-line and circle trajectory in the operational space. Multipoint trajectories include Bezier and NURBS curves functions.

Keywords

  • trajectory planning
  • the geometric path
  • the motion law
  • the joint space
  • the operational space
  • point-to-point trajectories
  • multipoint trajectories

1. Introduction

Trajectory planning is a motion law that defines time according to a given geometric path. Therefore, the purpose of trajectory planning is to meet the needs of the tasks and generate the reference inputs required by the control system, so that the robots can perform the movements in Ref. [1]. The inputs of any trajectory planning algorithm are an expected motion path, kinematics, and dynamics system parameters of the robots, and the outputs are the positions, velocities, and accelerations of the interpolation points of each joint or the end effector in Refs. [2, 3]. This chapter will introduce trajectory planning from the perspective of industrial practice, including the basic principle of trajectory planning, the joint space and the operational space, the motion laws, and point-to-point and multipoint trajectories.

Advertisement

2. The basic principle of trajectory planning

The desired trajectory can be fully determined by the geometric path and the motion law. The geometry path is related to space, while the motion law is related to time.

2.1 The geometry of the trajectory

The geometric path p=ps expresses the path of the end effector from the start point to the end point in Ref. [4]. The end point B can be reached in two different path forms from the start point A, see Figure 1. Depending on whether it is necessary to specify the geometry of the trajectory, the planning of trajectory can be carried out in the joint space or the operational space.

Figure 1.

Two different path forms from the start point A to the end point B.

2.2 The motion law

The motion law s=st limits velocity, acceleration, and other parameters of the end effector from the start point to the end point. The end point B can be reached from the start point A according to two different motion laws, see Figure 2. Various functions, such as linear trajectory function with constant velocity or trajectory function with S velocity profile, can be selected to specify the motion law along the geometric path.

Figure 2.

Two different motion laws from the start point A to the end point B.

Therefore, based on the geometric path p=ps and the motion law s=st, the trajectory can be written as

p=pstE1
Advertisement

3. The joint space and the operational space

Trajectory planning is divided into the joint space and the operational space according to the different description spaces. Trajectory planning in the joint space has the characteristics of few constraints and fast calculation speed, while trajectory planning in the operational space is mainly used for scenarios where users have specified path requirements.

3.1 The joint space

Trajectory planning in the joint space is to describe the trajectory of the robot as a function of joint position with respect to time, that is, the trajectory of the end effector can be directly determined by joint variables, so it is easy and simple to carry out trajectory planning in the joint space. Since there is no continuous corresponding relationship between the joint space and the operational space, singularity, and redundant degrees of freedom in motion can be avoided. In addition, the complexity of its path depends on the specific kinematic characteristics of the robot, and the path in the operational space cannot be predicted in Ref. [5]. Therefore, trajectory planning in the joint space is only applicable to the operating scenarios without path requirements.

3.2 The operational space

Trajectory planning in the operational space is based on a function of position and orientation with respect to time to describe the trajectory of the robot, and the corresponding joint position is obtained by the inverse kinematic model.

Since the path planned in the operational space is determined, the trajectory planning in the operational space is suitable for the operating scenarios with strict requirements for the instantaneous change law of position and orientation. In addition, the planning of trajectory in the operational space is prone to problems such as unreachable workspace or singularity, and they are generally avoided by specifying the robots to pass through a set of intermediate points in Ref. [6].

Advertisement

4. The motion law

In order to ensure that the robots can operate efficiently and stably, it is generally required that the motion profile meet at least the continuous first derivative, and it needs to have the characteristics of fast acceleration and deceleration and constant velocity. At present, the velocity control algorithms commonly used in robot systems include the trapezoidal trajectory and the trajectory with S velocity profile.

4.1 The trapezoidal trajectory

The trapezoidal trajectory means that the velocity profile is trapezoidal, and its complete curves are shown in Figure 3. The complete trajectory consists of three phases. In the first phase, the acceleration changes from zero to a fixed acceleration, and the velocity increases linearly with a fixed acceleration from zero. In the second phase, when the velocity reaches the desired value, it enters the constant velocity phase. At this phase, the velocity is constant and the acceleration suddenly changes to zero. In the third phase, the velocity begins to decrease with a fixed acceleration until it reaches zero.

Figure 3.

Position, velocity, and acceleration curves of a trapezoidal trajectory.

Piecewise acceleration equations are expressed as

at=amax0tt10t1tt2amaxt2tt3E2

Piecewise velocity equations are expressed as

vt=amaxt0tt1v2t1tt2v2amaxtt2t2tt3E3

Piecewise position equations are expressed as

st=12amaxt20tt1s1+v2tt1t1tt2s212amaxtt22t2tt3E4

where the time instants t1, t2 and t3 are specified. s1, s2 and s3 are corresponding position values, and v1, v2 and v3 are corresponding velocity values. amax is a maximum acceleration value.

4.2 The trajectory with S velocity profile

The trajectory with S velocity profile means that the velocity profile is S-shaped, which presents that the jerk is constant during acceleration and deceleration, and a smoother velocity curve is generated by controlling the duration of jerk to reduce the impact on machinery. The complete trajectory with S velocity profile includes seven phases: constant positive jerk phase T1 in acceleration, constant zero jerk phase T2 in acceleration, constant negative jerk phase T3 in acceleration, constant velocity phase T4, constant negative jerk phase T5 in deceleration, constant zero jerk phase T6 in deceleration, and constant positive jerk phase T7 in deceleration, see Figure 4. In the first three phases, the velocity increases smoothly, the acceleration presents trapezoidal profile, and the jerk changes abruptly between the desired value and zero. In the fourth phase, when the velocity is accelerated to the desired value, it enters the constant velocity phase. When the end point is approaching, the deceleration phase begins in the last phases. The transition of the entire velocity curve is smooth, and there is a continuous acceleration.

Figure 4.

Position, velocity, and acceleration curves of a trajectory with S velocity profile.

Piecewise jerk equations are expressed as

jt=jmax0tt10t1tt2jmaxt2tt30t3tt4jmaxt4tt50t5tt6jmaxt6tt7E5

Piecewise acceleration equations are expressed as

at=jmaxt0tt1jmaxT1t1tt2jmaxT1jmaxtt1t2tt30t3tt4jmaxtt4t4tt5jmaxT4t5tt6jmaxT4+jmaxtt6t6tt7E6

Piecewise velocity equations are expressed as

vt=vs+12jmaxt20tt1v1+jmaxT1tt1t1tt2v2+jmaxT1tt212jmaxtt22t2tt3v3t3tt4v412jmaxtt42t4tt5v5jmaxT5tt5t5tt6v6jmaxT5tt6+12jmaxtt62t6tt7E7

Piecewise position equations are expressed as

st=vst+16jmaxt30tt1s1+v1tt1+12jmaxT1tt12t1tt2s2+v2tt2+12jmaxT1tt2216jmaxtt23t2tt3s3+v3tt3t3tt4s4+v4tt416jmaxtt43t4tt5s5+v5tt512jmaxT5tt52t5tt6s6+v6tt612jmaxT5tt62+16jmaxtt63t6tt7E8

Where the time instants t1, t2, …, and t7 are specified. s1, s2, …, and s7 are corresponding position values, and v1, v2,…, and v7 are corresponding velocity values. amax and jmax are maximum acceleration and jerk values.

Advertisement

5. Point-to-point trajectories and multipoint trajectories

5.1 Point-to-point trajectories

Point-to-point trajectories are mainly used for robotic tasks such as palletizing, cutting, press tending, and other operations. Point-to-point control first ensures the position and orientation of the teach-in points, and the geometric path between the teach-in points, such as straight-lines and circles, can be specified when programming the robot’s working program.

5.1.1 Point-to-point trajectory in the joint space

According to the requirements of the task, the end effector is required to move linearly in the joint space between point A and point B (Figure 5).

Figure 5.

A point-to-point trajectory in the joint space.

Therefore, the position of each joint at the time instant t+Δt can be expressed as

θt+Δt=1uθA+uθB0u1E9

5.1.2 Point-to-point trajectory in the operational space

5.1.2.1 A straight-line position trajectory

According to the requirements of the task, the position of the end effector needs to be moved in a straight-line between point A and point B. Generally, the positions of the start point A and the end point B in the operational space are known, and the positions of a set of intermediate points on the trajectory AB are calculated, see Figure 6.

Figure 6

A straight-line position trajectory in the operational space.

The position length of the trajectory AB is LAB. The end effector is located at the point Pt and Pt+Δt on the trajectory AB, corresponding to the displacement st and st+Δt=st+Δs at the time instants t and t+Δt. Δt is a control period, corresponding to the displacement Δs .

Length function in normalized form can be expressed as

u=st+ΔtLAB0u1E10

Therefore, the position of the end effector at the time instant t+Δt can be expressed as

PxPyPz=1uAxAyAz+uBxByBzE11

5.1.2.2 A straight-line orientation trajectory

According to the requirements of the task, the orientation of the end effector needs to be moved continuously between point A and point B. Generally, the orientations of the start point A and the end point B in the operational space are known, and the orientations of a set of intermediate points on the trajectory AB are calculated, see Figure 7. Since Euler angles and rotation matrices may have gimbal locking in rotation, and quaternions do not have this problem. Therefore, quaternions can be used to calculate the orientation.

Figure 7

A straight-line orientation trajectory in the operational space.

The orientation unit vector of the start point A is rA, corresponding to the quaternion QA. The orientation unit vector of the end point B is rB, corresponding to the quaternion QB. The angle between two orientation unit vectors is θ. The end effector is located at the point Pt and Pt+Δt on the trajectory AB, corresponding to the angle θt and θt+Δt at the time instants t and t+Δt. Its orientation unit vector is rPt+Δt, and the corresponding quaternion is QPt+Δt.

Angle function in normalized form can be expressed as

u=θt+Δtθ0u1E12

The general linear interpolation will cause uneven changes in angular velocity, while spherical linear interpolation can ensure a smooth curve between two quaternions. Therefore, the orientation of the end effector at the time instant t+Δt can be expressed as

QPt+Δt=sin1uθQA+sinQBsinθE13

When the angle θ is very small, it will result in a large value in the Eq. (13). Therefore, the linear interpolation formula can be used

QPt+Δt=1uQA+uQBE14

5.1.2.3 A circle position trajectory

According to the requirements of the task, the position of the end effector needs to be moved in a circle between points A, B, and C. Generally, the positions of the start point A, the middle point B and the end point C in the operational space are known, and the positions of a set of intermediate points on the trajectory ABC are calculated, see Figure 8. Based on the position of the start point A, the middle point B, and the end point C, the radius R and center M of the circle can be solved. Then the unit normal vector n of the circle, the unit tangent vector e of the start point, and the unit vector wA from the center to the start point can be solved.

Figure 8

A circle position trajectory in the operational space.

Length function in normalized form can be expressed as

u=st+ΔtLABC0u1E15

Therefore, the position of the end effector at the time instant t+Δt can be expressed as

PxPyPz=MxMyMz+RcosuSRwA+RsinuSReE16

5.1.2.4 A circle orientation trajectory

According to the requirements of the task, the orientation of the end effector needs to be moved continuously between points A, B, and C. Generally, the orientations of the start point A, the middle point B and the end point C in the operational space are known, and the orientations of a set of intermediate points on the trajectory ABC are calculated, see Figure 9.

Figure 9.

A circle orientation trajectory in the operational space.

The orientation unit vector of the start point A is rA, corresponding to the quaternion QA. The orientation unit vector of the middle point B is rB, corresponding to the quaternion QB. The orientation unit vector of the end point C is rC, corresponding to the quaternion QC. The angle of the orientation unit vectors between the start and the middle point is αAB. The angle of the orientation unit vectors between the middle and end point is αBC. The angle of the orientation unit vectors between the start and end point is α. The end effector is located at the point Pt+Δt on the trajectory AB, corresponding to the angle αt+Δt at the time instant t+Δt. Its orientation unit vector is rPt+Δt, and the corresponding quaternion is QPt+Δt.

Middle angle function in normalized form can be expressed as

uMiddle=αABαE17

Angle function in normalized form can be expressed as

u=αt+ΔtαE18

If uuMiddle, the orientation of the end effector at the time instant t+Δt can be expressed as

QPt+Δt=sin1uuMiddleαABQA+sinuuMiddleαABQBsinαABE19

If uMiddleu, the orientation of the end effector at the time instant t+Δt can be expressed as

QPt+Δt=sin1uuMiddle1uMiddleαBCQB+sinuuMiddle1uMiddleαBCQCsinαBCE20

5.2 Multipoint trajectories

Multipoint trajectories are often used for complex operations such as painting, arc welding, or surface machining. The user teaches a series of points (such as start, end, and intermediate points) on a continuous path, and the robots connect the path points or multi-segment paths sequentially using polynomial functions, Bezier curve functions, or spline functions.

5.2.1 Bezier curve functions

In order to further improve the efficiency of the tasks, the robot end effector is required to achieve continuous operation between multiple trajectories. That is to say, the displacement and speed motion profiles are continuous. Due to the characteristics of the geometric invariance and convex hull, high-order Bezier curves are often used in industrial practice to connect multi-segment paths in Ref. [7]. Taking the connection of two straight-line trajectories as an example, the position of point A, point B and point C of line 1 and line 2 is generally known, and the end point B of line 1 is used as the start point of line 2, see Figure 10.

Figure 10.

A quartic Bezier curve trajectory.

A circle with B as center point and the given transition value R as radius can be obtained, and it intersects the AB and BC trajectories at D and E points, respectively. A quartic Bezier curve is used to connect the two trajectories, and five control points need to be specified on the DB and BE segments. The center point B is the control point P2, and the points D and E are the control points P0 and P4, respectively. P1 is taken halfway through the DB segment and P3 is taken halfway through the BE segment.

The quartic Bezier curve function can be written as

Pt=i=04PiBi,4t,t01E21

The corresponding expansion in Eq. (21) is

Pt=1t4P0+4t1t3P1+6t21t2P2+4t31tP3+t4P4,t01E22

Recursive equation is

Pik=Pi1tPik1+tPi+1k1k=0k=1,2,,4,i=0,1,,4kE23

5.2.2 NURBS curve functions

For the complex trajectories of the end effector in the operation space, the NURBS curve has been widely used because it can accurately and uniformly express standard analytical curves and free curves and has the characteristic of flexible shape control in Ref. [8]. Any k-th degree NURBS curve can be represented as a piecewise rational polynomial function.

Pt=i=0ndiωiNi,kti=0nωiNi,ktE24

where ωi are the weight factors, di are the curve control points, and Ni,kt are B-spline basis functions determined by the node vectors ti .

Based on De Boor-Cox recursive function, the basis function can be written as

Ni,0=10,ttiti+1,otherwiseNi,k=ttiti+ktiNi,k1t+ti+k+1tti+k+1ti+1Ni+1,k1tE25

where 00=0 is specified in Eq. (25).

Due to the computational complexity of the control points solved by the via-points of the NURBS curve, the De Boor-Cox algorithm is often used to avoid repeated iteration. More details on NURBS curve calculations can be found in Ref. [9].

Advertisement

6. Conclusions

This chapter discusses the trajectory planning of robots. First, the basic principle of trajectory planning is described, which is mainly determined by the geometric path and the motion law. Second, the characteristics of the joint space and the operational space are expounded. Then the trapezoidal trajectory and the trajectory with S velocity profile commonly used in industrial practice are introduced. Finally, point-to-point trajectories and multipoint trajectories are described. Point-to-point trajectories include a point-to-point trajectory in the joint space and a straight-line and circle trajectory in the operational space. Multipoint trajectories include Bezier and NURBS curves functions.

References

  1. 1. Zixing C, Bin X. Robotics. 3rd ed. Beijing: Tsinghua Press; 2015. p. 273
  2. 2. Caselli S, Reggiani M, Sbravati R. Parallel path planning with multiple evasion strategies. In: Proceedings of the IEEE International Conference on Robotics and Automation (ICRA ‘02); 11–15 May 2002; Washington, DC. New York: IEEE; 2002. pp. 260-266
  3. 3. Yonglun C, Shiqiang Z, Lijia L. Kinematics analysis and simulation of QJ-6R welding robot based on Matlab. Mechanical and Electrical Engineering Magazine. 2007;24:107-110. DOI: 10.3969/j.issn.1001-4551.2007.11.034
  4. 4. Luigi B, Claudio M. Trajectory Planning for Automatic Machines and Robots. Berlin: Springer-Verlag; 2008. pp. 7-9
  5. 5. John JC. Introduction to Robotics: Mechanics and Control. 3rd ed. Beijing: China Machine Press; 2012. pp. 161-179
  6. 6. Saeed NB. Introduction to Robotics: Analysis, Control, Applications. 2nd ed. Beijing: Electronic Industry Press; 2013. pp. 136-153
  7. 7. Alba-gomez OG, Pamanes JA, Wenger P. Trajectory planning of parallel manipulators for global performance optimization. In: International Symposium on Advances in Robot Kinematics, 1-5 January 2008. Netherlands: Springer; 2008. pp. 253-261
  8. 8. Faires JD, Burden RL. Numerical Methods. 4th ed. Pacific Grove: Brooks/Cole Publishing Company; 2012. pp. 157-170
  9. 9. Les P, Wayne T. The NURBS Book. 2nd ed. Beijing: Tsinghua Press; 2010. pp. 32-72

Written By

Junsong Lei, Zhaojiang Luo and Chaoqun Li

Submitted: 01 May 2023 Reviewed: 05 May 2023 Published: 11 July 2023