Unit 7
Unit 7
7.1 INTRODUCTION
The goal of trajectory planning is to generate a function according to which a robot will
move. This function generation depends on the robot tasks, for example, to pick-up an
object from one point and to place it in another point, or to weld two metal pieces along a
curve. In the former case, initial and final points are assigned, i.e., it is a
“point-to-point” motion, whereas in the latter situation a finite sequence of points need to
be specified, i.e., a “Continuous-path” motion. A robot user typically specifies a number
of parameters to describe a point-to-point or continuous-path task. A trajectory planning
algorithm then computes the inputs for the motion controller of the robot. Trajectory
planning can be done either in the joint space, i.e., in terms of joint positions, velocities
and accelerations, or in Cartesion space (also called operational space), i.e., in terms of
the end-effector’s positions and orientations, and their velocities and accelerations.
Usually, the latter is preferred since it allows a natural description of the task the robot
has to perform. However, the control action of the robot is carried in the joint space.
Thus, a suitable inverse kinematics algorithm is to be used to reconstruct the time
sequence of the joint variables corresponding to the above sequence of Cartesion
variables.
Objectives
After studying this unit, you should be able to
• understand the meaning, and necessity of trajectory planning,
• types of trajectory generation schemes,
• how to generate a trajectory,
• choose a suitable trajectory, and
• calculate the path points.
θ ( t f ) = θ f = a o + a1t f + a 2 t 2f + a 3 t 3f + a 4 t 4f + a 5 t 5f
θ&(0 ) = θ&0 = a1
θ&( t f ) = a1 + 2 a 2 t f + 3 a 3 t 2f + 4 a 4 t 3f + 5 a 5 t 4f
&
θ&(0 ) = &
θ&0 = 2 a 2
&
θ&( t f ) = 2 a 2 + 6 a 3 t f + 12 a 4 t 2f + 20 a 5 t 3f . . . (7.7)
Solving Eq. (7.7), the unknown coefficients, a 0 − a 5 , that satisfy Eqs. (7.1)-(7.3) are
given by
1 &
a o = θ o ; a1 = θ&o ; a 2 = &θo
2
a3 =
1
2 t 3f
[20 ( θ f − θ o ) − ( 8 θ&f + 12 θ&o ) t f − ( 3 &
θ&o − &
θ&f ) t 2f ]
a4 =
1
2 t 4f
[30 ( θ o − θ f ) + (14 θ&f + 16 θ&o ) t f + ( 3 &
θ&o − 2 &
θ&f ) t 2f ]
a5 =
1
2 t 5f
[12 ( θ f − θ o ) − 6 ( θ&f + θ&o ) t f − ( &
θ&o − &
θ&f ) t 2f ] . . . (7.8)
Example 7.1
Fourth Order Polynomial
Referring to the end point accelerations, if & θ&o = &θ&f = 0 , and the relation
shown in Figure 7.1 is satisfied by θ o , θ f , θ&o , and θ&f that is, if
tf
θ f − θo = ( θ&o + θ&f ) . . . (7.9)
2
then a5 = 0, which implies that only a fourth-order polynomial is required
for θ (t).
Using combinations of fourth-order polynomials and straight lines,
trajectories for various cases can be determined fairly easily. Let us consider
two such cases.
6
θ Trajectory Planning
θf
θ&0 θ&t
tf
( θ&0 + θ&f )
2
θ0
o tf t
tf / 2
Figure 7.1 : Boundary Conditions &
θ&o = &
θ&f = 0
θf2 θf
θf1
θ02
θ01
θ0
O
t
Δ Δ Δ Δ
Figure 7.2 : Trajectory with Acceleration, Constant Velocity and Deceleration Phases
Example 7.2 7
Trajectory Planning Initial and Final Points are Known
and Control of Robots
Applying the above method to the two-link planar manipulator shown in
Figure 7.3, a trajectory that starts from rest at the initial position,
Figure 7.3(a), and comes to a complete stop at the final position,
Figure 7.3(b), in 2 sec is generated. Suppose Δ = 0.25 sec. Then, the first
joint angle, θ1, is obtained as follows : First, choose θ01 = 90o at time,
t = 0.25 sec, and θf2 = 60o at t = 1.75 sec. Straight line equation is then
obtained as
570
θ = − 20 t +
6
Hence, θ02 at t = 0.5 sec, and θf1 at t = 1.5 are found as
θ02 = 85o ; and θ f 1 = 65o
Now, for the 4th order polynomial between θ0 and θ02, the coefficients are
obtained as
a0 = 90; a1 = a2 = 0; a3 = − 80; and a4 = 80
Y Y
o
60
a2 = l
o
120
a1 = l
o
90
o
60
O O
X X
tf
Note that, θ&
& = θ&
0
& = 0 , and θ − θ =
f f 0 (θ&f + θ&0 ) conditions are used to find
2
the coefficient values. For the interval, 0 < t ≤ 0.5, the joint trajectory is then
obtained as follows :
θ1 = 90 − 80 t 3 + 80 t 4
For the straight line between θ02 and θf1, i.e., 0.5 < t ≤ 1.5, it can be easily obtained
as
θ1 = 85 − 20 (t − 0.5)
Finally, the 4th order polynomial between θf2 and θf, i.e., 1.5 < t ≤ 2.0, can be
written as
t = 0.5
t = 1.0
o o
5
o 10 10
o
5
t = 1.5
O
t=2 X
Figure 7.4 : Endpoint Trajectory
(ii) Several Positions are Known
A trajectory that starts from rest at initial position θ0 passes through
intermediate positions θ1 and θ2, and stops at final position θf is generated.
First, it is considered that the trajectory need not pass exactly through θ1 and
θ2. In this case, auxiliary points are specified, namely,
θ02, θ11, θ12, . . . , θf1, as in Figure 7.5. Note that the values at point θ0 and θ01
are the same, and the values at θf2 and θf are same. Moreover, θ02 and θ11 are
on the straight line between θ01 and θ1. Points θ12, . . . , θf1 are also
determined in the same way. Then, the trajectory segments for
(θ0 , θ02 ), (θ11 , θ12 ), . . . , (θ f 1 , θ f ) are determined using fourth-order
polynomials, and those for (θ02 , θ11 ), (θ12 , θ21 ) and (θ22 , θ f 1 ) using
straight lines. The resulting trajectory is shown in Figure 7.5 by solid line.
Next, consider the case when the trajectory is required to pass exactly
through θ1 and θ2. This case can be dealt with by increasing the number of
auxiliary points. A scheme is shown in Figure 7.6(a). Auxiliary points are
determined as follows : As shown in Figure 7.6(b), θi2 (i = 1, 2) is the
midpoint between A (the intersection of the line, t = ti – Δ, with the straight
line between θi-1 and θI) and B (the intersection of the line, t = ti – Δ with the
straight line between θi and θi+1). Point θi3 is determined similarly. The
trajectory segments for
(θ0 , θ02 ), (θ11 , θ1 ), (θ1 , θ14 ), . . . , (θ f 1 , θ f )
θf2
θf
θf1
θ1
θ12
θ11
θ22
θ21
θ2
θ02
θ01
θ0
t
Δ Δ Δ Δ Δ Δ Δ Δ
θ12 θ13
θ1 θf2
θf
θf1
θ11 θ14
θ21 θ24
θ22 θ23
θ2
θ02
θ01
θ0
O t
Δ
t1 t2 tf
(a)
B
θi
θi4
θi3
θi2
θil
A θi+l
θi−l
Δ
ti
(b)
Figure 7.6 : Trajectory Passing through the Intermediate Points
(a) Intermediate Points, (b) Determination of Points θi2 and θi3
10
polynomials. More specifically, a third-order polynomial of the following Trajectory Planning
form
θ (t ) = a0 + a1 t + a2 t 2 + a3 t 3 . . . (7.10)
can be used in such cases instead of a fifth-order one. The above constants
are determined as follows :
a = θ ; a = θ&
0 0 1 0
1
a2 = [3 (θ f − θ0 ) − (2θ&0 + θ&f ) t f ]
t 2f
1
a3 = [− 2 (θ f − θ0 ) + (θ&f + θ&0 ) t f ] . . . (7.11)
t 3f
In particular, if θ0 , θ f , θ&0 , and θ&f satisfy Eq. (7.9), then a3 = 0, and so θ (t)
becomes a second-order polynomial. Hence, for cases (i) and (ii) treated
above, one can also use second-order polynomials.
SAQ 1
(a) What is the order of a trajectory that has to satisfy position, velocity and
acceleration constraints at the initial and final points?
(b) What is the advantage of joint space scheme?
11
Trajectory Planning ⎧3 3 4
and Control of Robots ⎪ 2 − 4t + 4t 0 ≤ t ≤ 0.5
⎪
⎪5
y (t ) = ⎨ − (t − 0.5) 0.5 < t ≤ 1.5
⎪4
⎪1 3 4
⎪ 4 − (t − 1.5) + 4 (t − 1.5) − 4 (t − 1.5) 1.5 < t ≤ 2
⎩
t=0
t = 0.5
t = 1.0
t = 1.5
O
t = 2.0 X
As for the effector orientation of the end-effector one may have several
choices to represent it. For example, Euler angles of the end-effector can be
used which, however, is difficult to visualise because three angles are the
three rotations of the end-effector about three time-varying axes. Hence, an
alternative method based on the rotation about a fixed axis is presented.
Other methods like double axis rotation, etc. are also available in the
literature.
Single-axis Rotation Method
In this method, an orientation representation between two frames, FA and FB, B
having the same origin is given by the pair, [e, α], where e ≡ [e x , e y , e z ]T is
the equivalent axis of rotation and α is the equivalent angle of rotation. This
pair is used to obtain FB from FA by a single rotation about the unit vector e
B
⎡ ex2 Vα + Cα ex e y Vα − ez Sα ex ez Vα + e y Sα ⎤
⎢ ⎥
Q (e , α) = ⎢ ex e y Vα + ez Sα e 2y Vα + Cα e y ez Vα − ex Sα ⎥ . . . (7.12)
⎢ ⎥
⎢ ex ez Vα − e y Sα e y ez Vα + ex Sα ez2 Vα + Cα ⎥
⎣ ⎦
result, the first column of matrix Q (e, α) is [0 1 0]T which is true from Eq.
(7.12) for e = [0 0 1]T and α = 90o. Similarly, other columns can be verified
as [– 1 0 0]T and [0 0 1]T.
12
Now, given two orientations of a frame, say, FA and FB, the latter can be
B
Trajectory Planning
obtained by rotating the former by an angle α about e, i.e., α is to be varied
from 0 to αf about the fixed e. Hence, the boundary conditions are given by
α (0) = 0, α (t f ) = α f
α
&(0) = α
& &0 , α (t f ) = α
& &
&f
for 0 ≤ t ≤ tf. The trajectory for α is then obtained similar to θ in Section 7.2.
Example 7.4
Single-axis Rotation
Suppose that a trajectory that transfers the end-effector orientation from rest
at the initial orientation shown in Figure 7.8(a) to the final rest orientation
shown in Figure 7.8(b) in time, tf = 1, is to generated. The problem is solved
using the single-axis rotation method. It is easily seen from Figure 7.8 that
the rotation matrix Q representing the final orientation with respect to the
initial one is
⎡0 0 1 ⎤
Q = ⎢⎢1 0 0 ⎥⎥
⎢⎣ 0 1 0 ⎥⎦
Comparing this matrix with Eq. (7.12), i.e., the summation of the diagonal
terms gives, αf = 120o, while the element wise comparisons lead to
T
⎡ 1 1 1 ⎤
e≡⎢ , , ⎥
⎣ 3 3 3⎦
Z0 YF
Y0
XF
X0
ZF
(a) (b)
SAQ 2
(a) What are the difficulties of Cartesian space scheme?
(b) When one uses Cartesian space scheme?
13
Trajectory Planning
and Control of Robots 7.4 POINT-TO-POINT MOTION
During the point-to-point motion, a manipulator has to move from an initial configuration
to a final one in a given time tf, be it a joint or Cartesian motion space. In such cases, the
actual path is of no concern. The algorithm generates a trajectory which, in respect to the
above general requirement, is also capable to optimize some performance index. A
suggestion for choosing the index is the energy dissipation in the motors. Let I be the
moment of a rigid body about its rotation axis and it is taken from an initial value θ0 to a
final value θf in a time tf. Assuming that the rotation is executed through a torque τ
supplied by a motor, the trajectory generation problem based on the optimization is then
formalized as follows : Set θ&= ω, and determine the solution of the differential equation
given by
Iω
&= τ
∫ ω (t ) dt = θ f − θ0
0
∫ τ2 (t ) dt
0
ω (t ) = at 2 + bt + c
Even though the joint dynamics cannot be described in the above simple manner, the
above polynomial function of joint speed, ω(t), to generate a joint trajectory represents a
valid solution for the problem at hand. Therefore, to determine a joint motion, θ(t), the
cubic polynomial must be chosen, i.e.,
θ (t ) = a3 t 3 + a2 t 2 + a1 t + a0 . . . (7.13)
Since four coefficients are available, it is possible to impose, besides the initial and final
joint position values θ0 and θf, also the initial and final joint velocity values θ&0 and θ&f ,
which are usually set to zero. Determination of a specific trajectory is then given by the
solution to the following system of equations :
a0 = θ0
a1 = θ&0
a3 t 3f + a2 t 2f + a1 t f + a0 = θ f
14
that allows computing the coefficients of the polynomial in Eq. (7.13). If it is desired to Trajectory Planning
assign also the initial and final values of acceleration, six constraints have to be satisfied
and than a polynomial of at least fifth order is needed, as obtained in Section 7.1.
An alternative approach with time laws of blended polynomial type is frequently adopted
in industrial practices. It allows to verify whether the resulting velocities and
accelerations can be supported by the physical mechanical manipulator. In this case, a
trapezoidal velocity profile is assigned, which imposes a constant acceleration in the start
phase, a cruise velocity, and a constant deceleration in the arrival phase. The resulting
trajectory is formed by a linear segment connected by two parabolic segments to the
initial and final positions. As can be seen from the velocity profiles in Figure 7.9, it is
assumed that both initial and final velocities are nil and the segments with constant
accelerations have the same time duration. This implies an equal magnitude of & θ&0 in the
two segments. Notice also that the above choice leads to a symmetric trajectory with
1 1
respect to the average point θ m = (θ f + θ i ) at t m = t f . The trajectory has to satisfy
2 2
some constraints to ensure the transition from θ0 and θf in time tf. The velocity at the end
of the parabolic segment must be equal to the (constant) velocity of the linear segment,
i.e.
& θ − θc
θ&c tc = m . . . (7.14)
t m − tc
where θc is the value attained by the joint variable at the end of the parabolic segment at
time tc with constant acceleration &θ&c . It is then
1&
θ c = θ0 + θ&c tc2 . . . (7.15)
2
Combining Eqs. (7.14)-(7.15) and substituting θm and tm in terms of θf, θ0 and tf yields
&
θ&c tc2 − &
θ&c t f tc + θ f − θ0 = 0 . . . (7.16)
Usually, &
θ&c is specified and then for given tf, θ0, and θf, the solution for tc is computed
from Eq. (7.16), for tc ≤ tf, as
1
tf t 2f &
θ&c − 4 (θ f − θ0 )
tc = − . . . (7.17)
2 2 &
θ&
c
When the acceleration, & θ&c , is chosen so as to satisfy Eq. (7.18) with the equality sign, the
resulting trajectory does not feature the constant velocity segment any more and has only
the acceleration and deceleration segments (triangular profile). Given θ0 , θ f and t f ,
and thus also an average transition velocity, Eq. (7.18) allows imposing a value of
acceleration consistent with the trajectory. Then, tc is computed from Eq. (7.17), and the
following sequence of polynomials is generated
⎧ 1& & 2
⎪θ c + θc t 0 ≤ t ≤ tc
⎪⎪ 2
θ (t ) = ⎨ θc + &
θ&c tc (t − tc ) tc < t ≤ t f − tc . . . (7.19)
⎪
⎪θ f − 1 &θ&c (t f − t ) 2 t f − tc < t ≤ t f
⎪⎩ 2
15
Trajectory Planning θ
and Control of Robots
θf
θm
θc
θo
O tC tf −tC tf t
(a) Position
θ
θc
O tC tf −tC tf t
(b) Velocity
θc
tf −tC
O tC t
−θc
(c) Acceleration
Figure 7.9 : Characterisation of a Time Law with Trapezoidal Velocity Profile
Figure 7.10 illustrates a representation of the motion time law obtained by imposing the
data : θ0 = 0, θ f = π, and & θ&c = 6π . The adoption of a trapezoidal velocity profile
results in a worse performance indeed compared to the cubic polynomial. The decrease
tf
is, however, limited. The term, ∫ τ2 dt , increases by 12.5% with respect to the optimal
0
case.
2
[ Rad ]
(a) Position
16
5 Trajectory Planning
[ Rad/s ] 2
20
10
0
[ Rad/s∧2 ]
− 10
− 20
(c) Acceleration
Figure 8.10 : Time History of Position, Velocity and Acceleration with
a Trapezoidal Velocity Profile Time Law
• The values of θ&(t ) at the path points are assigned according to a certain
criterion.
• The acceleration &
θ&(t ) shall be continuous at the path points.
Only the first case is shown here. Other two can be found in the literature.
θ
θ2
θN = θf
ρ2
θ3 ρ3 ρN-l
ρ1 ∫∫
θl = θi
∫∫
tl = 0 t2 t3 tN = t f t
The result is N − 1 systems of four equations in the four unknown coefficients for
each cubic polynomial, which can be solved independent of the other. The initial
and final velocities of the trajectory are typically set to zero (θ&1 = θ&N = 0) and
continuity of velocity at the path points is ensured by setting
ρ&k (tk ) = ρ&k + 1 (tk + 1 )
4
[ Rad ]
0 2 4 6
[s]
(a) Position
5
[ Rad/s ]
−5
0 2 4 6
[s]
(b) Velocity
20
[ Rad/s ]
2
−20
−40
0 2 4 6
[s]
(c) Acceleration
Figure 7.12 : Time History of Position, Velocity and Acceleration with a Time Law of
Interpolating Polynomials with Velocity Constraints at Path Points
SAQ 3
(a) Write the applications for point-to-point and continuous path planning?
(b) How one can avoid the use of higher order polynomials while several points
are specified?
19
Trajectory Planning
and Control of Robots 7.6 SUMMARY
In this unit, several ways to plan a trajectory for the robot motion control are presented.
Joint and Cartesian space schemes are explained, as well as the point-to-point and
continuous path motion. The latter two motions appear in pick-and-place and welding
like operations, respectively.
20
Trajectory Planning
FURTHER READING
Sciavicco, L., and Siciliano, B. (2000), Modelling and Control of Robot Manipulator,
Springer-Verlag, London.
Yoshikawa, T. (1990), Foundation of Robotics, The MIT Press, Massachusetts.
21