You are on page 1of 40

CHAPTER SEVEN

TRAJECTORY PLANNING

Introduction to Robotics: Analysis, Control,


Applications, Third Edition. Saeed B. Niku. ©
2020 John Wiley & Sons Ltd. Published 2020 by
Introduction to Robotics: Analysis, Control, Applications, Third Edition.
Saeed B. Niku.
© 2020 John Wiley & Sons Ltd. Published 2020 by John Wiley & Sons Ltd.

This solution manual may not be copied, posted, made available to students,
placed on any outlet, any other electronic media system, and the Internet
without prior expressed consent of the copyright owner.
This material may not be used except in conjunction with the “Introduction to
Robotics: Analysis, Control, Applications”

Introduction to Robotics: Analysis, Control,


Applications, Third Edition. Saeed B. Niku. ©
2020 John Wiley & Sons Ltd. Published 2020 by
Introduction

 In this chapter we discuss the joint-space and Cartesian-


space trajectory planning.
 We also discuss the methods that can be used for achieving
desired velocity and accelerations limits and maximum
values and blending motion portions.

Introduction to Robotics: Analysis, Control,


Applications, Third Edition. Saeed B. Niku. ©
2020 John Wiley & Sons Ltd. Published 2020 by
Path versus Trajectory

 A path is the collection of positions and orientations that a


robot (or its joints) goes through between different
locations.
 A trajectory is the time history of the locations and
orientations that the robot (or its joints) goes through
between different points.
 A trajectory in the time history of a path; therefore, it
includes how the joint values change in time.

Introduction to Robotics: Analysis, Control,


Applications, Third Edition. Saeed B. Niku. ©
2020 John Wiley & Sons Ltd. Published 2020 by
Joint-Space versus Cartesian-Space

 Cartesian-space describes the location and orientation of


robot’s end effector in space.
 Joint-space is the description of joint values in time. The
collection of joint-space values creates the Cartesian-space
values.
z

x
y

Introduction to Robotics: Analysis, Control,


Applications, Third Edition. Saeed B. Niku. ©
2020 John Wiley & Sons Ltd. Published 2020 by
Cartesian-Space Trajectory Problems

 Robot running into itself


 Sudden changes in orientation while making a motion.

x
y

Introduction to Robotics: Analysis, Control,


Applications, Third Edition. Saeed B. Niku. ©
2020 John Wiley & Sons Ltd. Published 2020 by
Basics of Trajectory Planning

 Assume joints moves at their maximum value.


 The resulting motion is non-uniform and unpredictable.

Time
y 5 4 3 (sec)
 
6 2
B 0 20 30
1 30 40
1
2 40 50
A
3 40 60
4 40 70

5 40 80


o x

Introduction to Robotics: Analysis, Control,


Applications, Third Edition. Saeed B. Niku. ©
2020 John Wiley & Sons Ltd. Published 2020 by
Basics of Trajectory Planning: Cont.

 Normalizing the joints to start and stop together improves


the motion.
 The path is unpredictable.

y Time
6 5 4 (sec)
 
3
B 2 0 20 30
1 1 24 40
A 2 28 50
3 32 60
 4 36 70
5 40 80


x

Introduction to Robotics: Analysis, Control,


Applications, Third Edition. Saeed B. Niku. ©
2020 John Wiley & Sons Ltd. Published 2020 by
Basics of Trajectory Planning: Cont.

 Planning a desired path (such as a straight line) improves


the outcome.
 Acceleration or velocities may be unachievable.
y Time
6 (sec)
 
5
B 4 0 20 30
3
2 1 13 56
1
2 15 69
A
3 19 78
 4 28 82
5 40 80


x

Introduction to Robotics: Analysis, Control,


Applications, Third Edition. Saeed B. Niku. ©
2020 John Wiley & Sons Ltd. Published 2020 by
Basics of Trajectory Planning: Cont.

 Dividing the path (becomes a trajectory) into variable


portions to control velocities and accelerations improves
the outcome.
 Boundary velocities and accelerations are specified.
#  
y
8 7 1 20 30
6
B 5 2 16 40
4
3 21 3 15 50
A 4 13 59
5 15 70
 6 25 80
7 32 81
8 37 80

x
Introduction to Robotics: Analysis, Control,
Applications, Third Edition. Saeed B. Niku. ©
2020 John Wiley & Sons Ltd. Published 2020 by
Blending of Motion Portions

 To prevent stop/start regimes at every point, motion portions may be


blended together.
 There may be a need for additional via points to ensure passage
through a desired location.
y B y B''
C C B
B'

A A

x x

y y D
B B
B' E
C C
A A

Introduction to Robotics: Analysis, Control, x x


Applications, Third Edition. Saeed B. Niku. ©
2020 John Wiley & Sons Ltd. Published 2020 by
Trajectory Planning in Joint-Space

 It is more desirable and more practical to plan a trajectory


in joint-space.
 We will use the joint-space trajectories to create a motion
that is specified in Cartesian-space.
 In joint-space trajectory planning, it is the motions of each
individual joint that is planned based on some regime
(higher-order polynomials, controlled acceleration limits,
blended motions, and so on).
 Each joint’s motion is planned individually based on the
values calculated from the inverse kinematic equations.

Introduction to Robotics: Analysis, Control,


Applications, Third Edition. Saeed B. Niku. ©
2020 John Wiley & Sons Ltd. Published 2020 by
Third-Order Polynomial Trajectory Planning

 Initial and final positions and velocities are known; 4


values
 (ti )  i  (t f )   f
 (t )  0
i  (t )  0
f

 4 unknowns may be calculated; therefore, a third-order


polynomial.
2 3
 (t )  c0  c1t  c2t  c3t
 (t )  c1  2c2t  3c3t 2
Introduction to Robotics: Analysis, Control,
Applications, Third Edition. Saeed B. Niku. ©
2020 John Wiley & Sons Ltd. Published 2020 by
Third-Order Polynomial Trajectory Planning: Cont.

 Substitute the initial and final conditions into these equations to get:
 (ti )  c0   i
2 3
 (t f )  c0  c1t f  c2t f  c3t f
 (t )  c  0
i 1

 (t f )  c1  2c2t f  3c3t f  0
2

 Or in matrix form:

  i  1 0 0 0   c0 
   0 1 0 0   c1 
 i  
 f  1 t f tf 2 t f  c2 
3

    
 f  0 1 2t f 3t f 2   c3 
Introduction to Robotics: Analysis, Control,
Applications, Third Edition. Saeed B. Niku. ©
2020 John Wiley & Sons Ltd. Published 2020 by
Third-Order Polynomial Trajectory Planning: Cont.

 From the inverse kinematic equations the boundary values


are determined.
 Each joint is driven based on the third-order polynomial.
 The resulting motion follows the desired trajectory.

Introduction to Robotics: Analysis, Control,


Applications, Third Edition. Saeed B. Niku. ©
2020 John Wiley & Sons Ltd. Published 2020 by
Example:
 Going from 30 to 75 degrees in 5 sec.
 Acceleration needed may be too high.
80
Position
60

40

20
Velocity
0
Acceleration
-20
0 1 2 3 4 5
Seconds

Introduction to Robotics: Analysis, Control,


Applications, Third Edition. Saeed B. Niku. ©
2020 John Wiley & Sons Ltd. Published 2020 by
Fifth-Order Polynomial Trajectory Planning

 Initial and final positions, velocities, and accelerations are


known; 6 values
 6 unknowns may be calculated; therefore, a fifth-order
polynomial.

 (t )  c0  c1t  c2t 2  c3t 3  c4t 4  c5t 5

 (t )  c1  2c2t  3c3t 2  4c4t 3  5c5t 4


(t )  2c2  6c3t  12c4t 2  20c5t 3

Introduction to Robotics: Analysis, Control,


Applications, Third Edition. Saeed B. Niku. ©
2020 John Wiley & Sons Ltd. Published 2020 by
Fifth-Order Polynomial Trajectory Planning: Cont.

 Substitute the initial and final conditions into these


equations and solve for the constants.
 Use the equation to run each joint based on the data
calculated from the inverse kinematic equations.

Introduction to Robotics: Analysis, Control,


Applications, Third Edition. Saeed B. Niku. ©
2020 John Wiley & Sons Ltd. Published 2020 by
Example:
 i  30 i  0 / sec i  5 / sec 2
 Given:
 f  75  f  0 / sec f  5 / sec 2

80
Position
60

40

20
Velocity
0
Acceleration
-20
0 1 2 3 4 5
Seconds

Introduction to Robotics: Analysis, Control,


Applications, Third Edition. Saeed B. Niku. ©
2020 John Wiley & Sons Ltd. Published 2020 by
Linear Segments with Parabolic Blends

 Run the joints at constant speed between the initial and final locations.
 Equivalent to a first-order polynomial, where the velocity is constant,
and acceleration is zero.
 Requires infinite accelerations to create instantaneous velocities at the
boundaries.
 Blend linear segment with parabolic sections at the beginning and at
the end of the motion segment to create a continuous position and
velocity
f
B
Position

i  
A
i

0 tb t tf-tb tf Time
Introduction to Robotics: Analysis, Control,
Applications, Third Edition. Saeed B. Niku. ©
2020 John Wiley & Sons Ltd. Published 2020 by
Linear Segments with Parabolic Blends: Cont.

 Assume initial and final positions are  i and  f at


times ti = 0 and tf and parabolic segments are
symmetrically blended at blending times tb and tf - tb
1
 (t )  c0  c1t  c2t 2
2
 (t )  c1  c2t
(t )  c
2

Introduction to Robotics: Analysis, Control,


Applications, Third Edition. Saeed B. Niku. ©
2020 John Wiley & Sons Ltd. Published 2020 by
Linear Segments with Parabolic Blends: Cont.

 Substitute boundary conditions to get:


 (t  0)   i  c0  c0   i
 
 (t  0)  0  c1  c1  0
   
 (t )  c2  c2  

 and
1 2
 (t )   i  c2 t
2
 (t )  c2 t
(t )  c2
Introduction to Robotics: Analysis, Control,
Applications, Third Edition. Saeed B. Niku. ©
2020 John Wiley & Sons Ltd. Published 2020 by
Linear Segments with Parabolic Blends: Cont.

 adding constant acceleration for the linear segment we get:

1 2
 A   i  c2 tb
2
 A  c2 tb  
 B   A   ((t f  tb )  tb ))   A   (t f  2tb )
B   A  
 f   B  ( A   i )
  0
f

Introduction to Robotics: Analysis, Control,


Applications, Third Edition. Saeed B. Niku. ©
2020 John Wiley & Sons Ltd. Published 2020 by
Linear Segments with Parabolic Blends: Cont.

 The necessary blending time can be calculated as:

i   f   t f
tb 

 Maximum velocity can be calculated as:

 max  2( f   i ) t f
 Final parabolic segment is symmetrical with the initial
parabola, but with a negative acceleration
Introduction to Robotics: Analysis, Control,
Applications, Third Edition. Saeed B. Niku. ©
2020 John Wiley & Sons Ltd. Published 2020 by
Linear Segments with Parabolic Blends and Via
Points

 To prevent stop-and-go motion, blend them together.


 The final conditions for one section is the initial condition
for the next.
 Make sure maximum allowable accelerations are not
exceeded

Introduction to Robotics: Analysis, Control,


Applications, Third Edition. Saeed B. Niku. ©
2020 John Wiley & Sons Ltd. Published 2020 by
Higher-order Polynomials

 When more segments are present, more information is


available.
 Higher-order polynomials may be used, but more difficult to
solve higher-order polynomials:

 (t )  c0  c1t  c2t 2    cn 1t n 1  cnt n


 Use combinations of lower-order polynomials for different
segments of the trajectory and blend them together to satisfy
all required boundary conditions.
 Can use a 4-3-4 trajectory, a 3-5-3 trajectory, and a 5-cubic
trajectory to replace a 7th-order polynomial
Introduction to Robotics: Analysis, Control,
Applications, Third Edition. Saeed B. Niku. ©
2020 John Wiley & Sons Ltd. Published 2020 by
Higher-Order Polynomials: Cont.

 In a 4-3-4 trajectory we use:


 a 4th-order polynomial to plan a trajectory between the initial point
and the first via point (e.g. lift-off),
 a 3rd-order polynomial between two via points (e.g. lift off and set-
down),
 and a 4th-order polynomial between the last via point (e.g. set-
down) and the final destination.
 A 3-5-3 trajectory is planned between the initial and the
first via point, between the successive via points, and
between the last via point and the final destination.

Introduction to Robotics: Analysis, Control,


Applications, Third Edition. Saeed B. Niku. ©
2020 John Wiley & Sons Ltd. Published 2020 by
Higher-Order Polynomials: Cont.

 We must solve for 4 coefficients for a third-order polynomial, 5 for a


fourth-order polynomial, and 6 for a fifth-order polynomial.
 Both 4-3-4 and 3-5-3 trajectories require solving for a total of 14
coefficients. For the 4-3-4 trajectory, the unknown coefficients are in
the form:

 (t )1  a0  a1t  a2t 2  a3t 3  a4t 4


 (t )2  b0  b1t  b2t 2  b3t 3
 (t )3  c0  c1t  c2t 2  c3t 3  c4t 4

Introduction to Robotics: Analysis, Control,


Applications, Third Edition. Saeed B. Niku. ©
2020 John Wiley & Sons Ltd. Published 2020 by
Higher-Order Polynomials: Cont.

1. Initial position of is known.


2. Initial velocity may be specified.
3. Initial acceleration may be specified.
4. Position of the first via point is known, and is the same
as the final position of the first fourth-order segment.
5. The first via point's position is the same as the initial
position of the third-order segment for continuity.
6. Continuous velocity must be maintained at the via point.
7. Continuous acceleration must be maintained at the via
point.
Introduction to Robotics: Analysis, Control,
Applications, Third Edition. Saeed B. Niku. ©
2020 John Wiley & Sons Ltd. Published 2020 by
Higher-Order Polynomials: Cont.

8. Position of a second (and other) via point is specified and is


the same as the final position of the third-order segment.
9. The position of the second (and other) via point is the same
as the initial position of the next segment for continuity.
10. Continuous velocity must be maintained at the next via
point.
11. Continuous acceleration must be maintained at the next via
point.
12. Position of destination is specified.
13. Velocity of the destination is specified.
14. Acceleration of the destination is specified

Introduction to Robotics: Analysis, Control,


Applications, Third Edition. Saeed B. Niku. ©
2020 John Wiley & Sons Ltd. Published 2020 by
Higher-Order Polynomials: Cont.
 The result is:
1 0 0 0 0 0 0 0 0 0 0 0 0 0 
1   a 
  0 1 0 0 0 0 0 0 0 0 0 0 0 0   0
 a
 1  0 0 2 0 0 0 0 0 0 0 0 0 0 0   1
1   2 3 4   a2 
  1  1 f 1 f 1 f 1 f 0 0 0 0 0 0 0 0 0   
 2  0 0 0 0 0 1 0 0 0 0 0 0 0 0   
a3
 2     a4 
  0 1 2 1 f 3 1 f
2
4 1 f
3
0 1 0 0 0 0 0 0 0  b 
0  2   0
 0  0 0 2 6 1 f 12 1 f 0 0 2 0 0 0 0 0 0  b 
1
  2 3  
 3  0 0 0 0 0 1 2 f 2 f 2 f 0 0 0 0 0   b2 
  0 0 0 0 0 0 0 0 0 1 0 0 0 0   b3 
 3    
 0  0 0 0   c0 
2
0 0 0 0 1 2 2 f 3 2 f 0 1 0 0
 0  0 0 0 0 0 0 0 2 6 2 f 0 0 2 0 0   c1 
     
 4  0 0 0 0 0 0 0 0 0 1 3 f 3 f
2
3 f
3
 3 f   c2 
4

   2 3
 c 
 4  0 0 0 0 0 0 0 0 0 0 1 2 3 f 3 3 f 4 3 f   3 

 4  0 0 0 0 0 0 0 0 0 0 0 2 6 3 f
2 c 
12 3 f   4 

Introduction to Robotics: Analysis, Control,
Applications, Third Edition. Saeed B. Niku. ©
2020 John Wiley & Sons Ltd. Published 2020 by
Higher-Order Polynomials: Cont.

 Or simply:

    M C 
C    M   
1

 This can be used to run a joint based on a 4-3-4


polynomial.
 Similar results may be obtained for 5-3-5 or 5-cubic
regiments.

Introduction to Robotics: Analysis, Control,


Applications, Third Edition. Saeed B. Niku. ©
2020 John Wiley & Sons Ltd. Published 2020 by
Cartesian-Space Trajectories

 All the regiments for joint-space can also be used here.


 We can do the following in a loop to run a robot in
Cartesian-space:
 Increment the time by t  t  t .
 Calculate the position and orientation of the hand based on the
selected function for the trajectory,
 Calculate the joint values for the position and orientation through
the inverse kinematic equations of the robot,
 Send the joint information to the controller,
 Go to the beginning of the loop.

Introduction to Robotics: Analysis, Control,


Applications, Third Edition. Saeed B. Niku. ©
2020 John Wiley & Sons Ltd. Published 2020 by
Straight-Line Trajectory

 Straight-line motions between points are the most


practical trajectories for industrial applications.
 Blending the motions for multiple destinations (such as
via points) is also very common.
 For a straight-line trajectory, the transformation between
the initial and final positions and orientations must be
calculated and divided into small segments.

Introduction to Robotics: Analysis, Control,


Applications, Third Edition. Saeed B. Niku. ©
2020 John Wiley & Sons Ltd. Published 2020 by
Straight-Line Trajectory: Cont.

 The total transformation R between the initial


configuration Ti and final configuration Tf can be
calculated as follows:
T f  Ti R
Ti 1T f  Ti 1Ti R
R  Ti 1T f

Introduction to Robotics: Analysis, Control,


Applications, Third Edition. Saeed B. Niku. ©
2020 John Wiley & Sons Ltd. Published 2020 by
Straight-Line Trajectory: Cont.

 At least three different alternatives may be used to


convert this transformation into small segments:
 1. Use large number of segments for smooth motion. This, in
reality, creates a large number of differential motions [3]. Using
the equations developed for differential motions in Chapter 3,
we can relate the position and orientation of the hand frame at
each new segment to the differential motions, the Jacobian, and
joint velocities by:
D  JD and D  J 1D
dT    T
Tnew  Told  dT

Introduction to Robotics: Analysis, Control,


Applications, Third Edition. Saeed B. Niku. ©
2020 John Wiley & Sons Ltd. Published 2020 by
Straight-Line Trajectory: Cont.

 2. The transformation between the initial and final locations R can be


decomposed into a translation and two rotations. The translation
involves moving the origin of the frame from the initial position to the
final position. The first rotation is to align the hand frame to the desired
orientation, and the second rotation is to rotate the hand frame about its
own axis to the final orientation. All three transformations are executed
simultaneously.

Introduction to Robotics: Analysis, Control,


Applications, Third Edition. Saeed B. Niku. ©
2020 John Wiley & Sons Ltd. Published 2020 by
Straight-Line Trajectory: Cont.
 3. The transformation between the initial and final locations R can be
decomposed into a translation and one rotation about an axis q. The
translation involves moving the origin of the frame from the initial position
to the final position. The rotation is to align the hand frame to the final
desired orientation. Both transformations are executed simultaneously

o'
q
a'
o n
a n'
o n
a

y
x
Introduction to Robotics: Analysis, Control,
Applications, Third Edition. Saeed B. Niku. ©
2020 John Wiley & Sons Ltd. Published 2020 by
Continuous path example
 The result of successive motions with continuous-path
on and off
Starting point
Starting point

Without blending Without blending

With blending With blending

Introduction to Robotics: Analysis, Control,


Applications, Third Edition. Saeed B. Niku. ©
2020 John Wiley & Sons Ltd. Published 2020 by
Continuous Trajectory Recording
 Some operations are too complicated or too intricate to be generated by straight
lines or other higher-order polynomials.
 It is possible to teach the robot how to move, record the motions, and later replay
the motions and execute them.
 An operator may move the robot in the same fashion required to accomplish a
task in real time by either releasing the joint-brakes and physically moving the
robot, or by moving the joints of a robot model.
 In either case, the joint values are continuously sampled in time and recorded.
 Later, the robot is operated by playing back the sampled data.
 This technique is simple and requires little programming or calculations.
 All motions must be accurately performed, sampled, and recorded for accurate
playback.
 Every time a part of the motion needs to be changed, the robot must be
programmed again.
 This technique is difficult for large, heavy robots.

Introduction to Robotics: Analysis, Control,


Applications, Third Edition. Saeed B. Niku. ©
2020 John Wiley & Sons Ltd. Published 2020 by

You might also like