+ All Categories
Home > Documents > Control of industrial robots Motion planning

Control of industrial robots Motion planning

Date post: 01-Nov-2021
Category:
Upload: others
View: 2 times
Download: 0 times
Share this document with a friend
97
Control of industrial robots Motion planning Prof. Paolo Rocco ([email protected]) Politecnico di Milano, Dipartimento di Elettronica, Informazione e Bioingegneria
Transcript
Page 1: Control of industrial robots Motion planning

Control of industrial robots

Motion planning

Prof. Paolo Rocco ([email protected])Politecnico di Milano, Dipartimento di Elettronica, Informazione e Bioingegneria

Page 2: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

With the motion planning we want to assign the way the robot evolves from an initial posture to a final one.

Motion planning is one of the essential problems in robotics. Most of the success on the market of a robot depends on the quality of motion planning.

We will address the following issues related to motion planning:• introductory definitions (path vs. trajectory)• motion programming• path planning with obstacle avoidance• trajectories in joint space (point-to-point and with intermediate points)• kinematic and dynamic scaling of trajectories• trajectories in Cartesian space (position and orientation trajectories)

Motion planning

Page 3: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

We need to introduce some terminology concerning concepts which are often confused:

Path: it is a geometric concept and stands for a line in a certain space (the space of Cartesian positions, the space of the orientations, the joint space,..) to be followed by the object whose motion has to be planned

Timing law: it is the time dependence with which we want the robot to travel along the assigned path

Trajectory: it is a path over which a timing law has been assigned

The final result of a motion planning problem is thus a trajectory that will then serve as an input to the real-time position/velocity controllers.

Definitions

Page 4: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

Trajectories in the operational space: the path (position and orientation) of the robot end effector is specified in the common Cartesian space

task description is natural constraints on the path can be accounted for singular points or redundant degrees of

freedom generate problems online kinematic inversion is needed

Trajectories in the operational space

Page 5: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

Trajectories in joint space: the desired joint positions are directly specified

problems related to kinematic singularities and redundant degrees of freedom are solved directly

it is a mode of interest when we just want that the axes move from an initial to a final pose (and we are not interested in the resulting motion of the end effector)

online kinematic inversion is not needed

Trajectories in joint space

Page 6: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

InverseKinematicstarget

stateINSTRUCTION

STACK

TrajGen

Axiscontroller

state update

Instruction stack: list of instructions to be executed, specified using the proprietary programming language

Trajectory generation: converts an instruction into a trajectory to be executed Inverse kinematics: maps the trajectory from the Cartesian space to the joint space (if needed) Axis controllers & drives: closes the control loop ensuring tracking performance

Elements of a motion planning and control system

Page 7: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

InverseKinematicstarget

stateINSTRUCTION

STACK

TrajGen

Axiscontroller

state update

Instruction stack: list of instructions to be executed, specified using the proprietary programming language

Trajectory generation: converts an instruction into a trajectory to be executed Inverse kinematics: maps the trajectory from the Cartesian space to the joint space (if needed) Axis controllers & drives: closes the control loop ensuring tracking performance

Elements of a motion planning and control system

Page 8: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

A first mode for motion programming is the so called teaching-by-showing (also known as lead-through programming).

Using the teach-pendant, the operator moves the manipulator along the desired path. Position transducers memorize the positions the robot has to reach, which will be then jointed by a software for trajectory generation, possibly using some of the intermediate points as via points.The robot will be then able to autonomously repeat the motion.

COMAU SpA

No particular programming skills are requested to the operator. On the other hand the method has limitations, since making a program requires that the programmer has the robot at his/her disposal (and then the robot is not productive), there is no possibility to execute logical functions or wait cycles and in general it is not possible to program complex activities.

Teaching by showing

Page 9: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

The generation of the robot program can also be done in a robot programming environment. The robot programmer can move the robot in a virtual environment with high fidelity rendering of the robot motion in the robotic cell.

There are tools to record positions and to make the robot move along a path formed by such positions.

At the end the robot programming environment produces the code ready to be downloaded into the robot controller.

ABB RobotStudio

Programming environments

Page 10: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

The robot programmer can also write the robot program directly using a robotic programming language.

With a robotic programming language the operator can program the motion of the robot as well as complex operations where the robot, inside a work-cell, interacts with other machines and devices. With respect to a general purpose programming language, the language provides specific robot oriented functionalities.

In the following, we will discuss some elements of the PDL2 programming language by COMAU Robotics.

Programming languages

Page 11: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

The program moves pieces from a feeder to a table or to a discard bin, depending on digital input signals:

PROGRAM packVAR

home, feeder, table, discard : POSITIONBEGIN CYCLE

MOVE TO homeOPEN HAND 1WAIT FOR $DIN[1] = ON

-- signals feeder readyMOVE TO feederCLOSE HAND 1IF $DIN[2] = OFF THEN

-- determines if good partMOVE TO table

ELSEMOVE TO discard

ENDIFOPEN HAND 1

-- drop part on table or in binEND pack

1. Feeder2. Robot3. Discard Bin4. Table

Program example

Page 12: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

Besides data types typical of any programming language (integer, real, boolean, string, array), some types specific to robotic applications are defined in PDL2. Among them:

VECTOR: representation of a vector through three components

POSITION: three components of Cartesian position, three orientation components (Euler angles) and a configuration string (which indicates whether it is a shoulder/elbow/wrist upper/lower configuration)

JOINTPOS: positions of the joints, measured in degrees

Data types

Page 13: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

In PDL2 for each manipulator a world reference frame is defined. The operator might redefine the base frame ($BASE) relative to the world frame. This is useful when the robot has to be repositioned in the work area, since it avoids re-computation of all the positions of objects in the cell.

Reference frames

Similarly the programmer can define a frame ($TOOL) relative to the tool frame of the manipulator, which is useful whenever the tool mounted on the end effector is changed.

Page 14: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

With the instruction MOVE, motion commands of the arms are given. The format of the instruction is as follows:

MOVE <ARM[n]> <trajectory> dest_clause <opt_clauses> <sync_clause>

(note that a single controller can manage several arms).

The trajectory clause can take one of the following values:

LINEARCIRCULARJOINT

(linear motion in Cartesian space)(circular motion in Cartesian space)(motion in joint space)

The default is a motion in joint space.

The instruction MOVE

Page 15: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

There are several destination clauses for the instruction MOVE. Main ones are:

MOVE TOIt moves the arm towards the specified destination, which might be a variable of type POSITION or JOINTPOS. For example:

MOVE LINEAR TO POS(x,y,z,e1,e2,e3,config)MOVE TO home

The optional VIA clause can be used with the MOVE TO destination clause to specify a position through which the arm passes between the initial position and the destination. The VIA clause is used most commonly to define an arc for circular moves. For example:

MOVE TO initialMOVE CIRCULAR TO destination VIA arc

MOVE: destination clauses

Page 16: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

MOVE NEARWith this clause it is possible to specify a destination which is located along the approach vector of the tool, within a certain distance (expressed in mm) from a certain position. Example:

MOVE NEAR destination BY 250.0

MOVE AWAYA destination can be specified along the approach vector of the tool, at a specified distance from the current position. Example:MOVE AWAY 250.0

MOVE: destination clauses

Page 17: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

MOVE RELATIVEA destination relative to the current position of the frame can be specified. Example:MOVE RELATIVE VEC(100,0,100) IN frame

MOVE ABOUTIt defines the destination that the tool has to reach after a rotation around the specified vector, with respect to the current position. Example:

MOVE ABOUT VEC(0,100,0) BY 90 IN frame

frame can be either TOOL or BASE

MOVE: destination clauses

Page 18: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

MOVE BYAllows the programmer to specify a destination as a list of REAL expressions, with each item corresponding to an incremental move for the joint of an arm. Example:

MOVE BY {alpha, beta, gamma, delta, omega}

MOVE FORAllows the programmer to specify a partial move along the trajectory towards a theoretical destination. The orientation of the tool changes in proportion to the distance. Example:

MOVE: destination clauses

Page 19: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

Using the optional clause WITH it is possible to assign values to some predefined temporary variables. In particular we can operate over the following variables:

$PROG_SPD_OVRIt is a percentage by which we can modify the default speed value used by the controller for joint space motions.

$LIN_SPD

It is the value of linear speed for a Cartesian motion, expressed in m/s:

$PROG_ACC_OVR, $PROG_DEC_OVR

They are percentages by which we can modify the default values of acceleration and deceleration used by the controller for joint space motions.

Examples: MOVE TO p1 WITH $PROG_SPD_OVR=50MOVE LINEAR TO p2 WITH $LIN_SPD=0.6

Setting the speed and the acceleration

Page 20: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

If we use the instruction MOVEFLY and the motion is followed by another motion, the arm will not stop at the first destination, but will move from the starting point of the first motion to the end point of the second motion, without stopping in the common point of the two motions. Example:

MOVE TO aMOVEFLY TO b ADVANCEMOVE TO c

(the ADVANCE clause allows the interpretation of the next MOVE instruction as soon as the first motion begins)

Continuous motion (MOVEFLY)

Page 21: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

If the robot moves in a cluttered environment, the definition of the path might be troublesome In fact we need a path which is collision free: such path, at the current stage of robotics practice, is

generated manually by the programmer as a sequence of MOVE commands

An active research line consists in automatic path planning, i.e. in finding an algorithm that autonomously generate the geometric path, given the kinematics of the robot and the known positions and shapes of the obstacles

Path planning with obstacle avoidance

Page 22: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

Usually the path planning problem is addressed in the configuration space (C-space), where the robot is at each time instant represented as a mobile point

For an articulated robot, the common choice of the configuration space is the space of the joint variables (joint space)

Obstacles are mapped from the workspace to the configuration space: in case of an articulated manipulator they take complicated shapes

Workspace C-space

We call Cfree the subset of C-space that does not cause collisions with the obstacles.A path in C-space is free if it is entirely contained in Cfree

Configuration space

Page 23: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

The path planning problem can be set as follows in general:

WorkspaceC-space

Assume that the initial and final posture of the robot in the Workspace are mapped into corresponding configurations in C-space, respectively a start configuration 𝐪𝐪S and a goal configuration 𝐪𝐪G.

Planning a collision-free motion for the robot means to generate a path from 𝐪𝐪S to 𝐪𝐪G if they belong to the same connected component of Cfree, and to report a failure otherwise.

Setting the problem

Page 24: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

The exact planning algorithms that are based on the a priori knowledge of the complete C-space are exponential in the dimensionality of the C-space and thus hardly applicable in practice

Probabilistic planners are instead a class of methods of remarkable efficiency, especially for high-dimension configuration spaces

They belong to the general family of sampling-based methods, where the basic idea is to randomlyselect a finite-set of collision-free configurations that adequately represent how Cfree is connected, and using these configurations to build a roadmap

At each iteration a sample configuration is chosen and it is checked whether it entails a collision between the robot and the obstacles: if yes, the configuration is discarded, otherwise it is added to the current roadmap

Two versions of such randomized sampling-based approach are: PRM (Probabilistic Roadmap) RRT (Rapidly-exploring Random Tree)

Probabilistic planning

Page 25: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

a random sample 𝐪𝐪rand of the C-space is selected using a uniform probability distribution and tested for collision

if 𝐪𝐪rand does not cause collisions it is added to a roadmap which is progressively being formed and connected (if possible) through free local paths to sufficiently “near” configurations already in the roadmap

the generation of a free local path between 𝐪𝐪rand and a near configuration 𝐪𝐪near is made by a procedure called local planner

the iterations terminate when either a maximum number of iterations has been reached or the number of connected components in the roadmap becomes smaller than a given threshold

then we try to verify whether the path panning problem can be satisfied by connecting 𝐪𝐪Sand 𝐪𝐪G to the same connected component of the PRM by free local paths

PRM (Probabilistic roadmap)

Page 26: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

This picture is taken from the textbook:

B. Siciliano, L. Sciavicco, L. Villani, G. Oriolo: Robotics: Modelling, Planning and Control, 3rd Ed. Springer, 2009

PRM (Probabilistic roadmap)

Page 27: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

Advantages of PRM: it is remarkably fast in finding solutions to motion planning problems unlike other methods, there is no need to generate the obstacles in C-space

Disadvantages of PRM: it is only probabilistically complete: the probability to find a solution to the planning

problem, if it exists, tends to 1 as the execution time tends to infinity

PRM (Probabilistic roadmap)

Page 28: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

the method makes use of a data structure called tree a random sample 𝐪𝐪rand of the C-space is selected using a uniform probability distribution the configuration 𝐪𝐪near in the tree T (which is progressively formed) that is the closest one to 𝐪𝐪rand is found and a new candidate configuration 𝐪𝐪new is produced on the segment joining 𝐪𝐪near to 𝐪𝐪rand at a predefined distance δ from 𝐪𝐪near

it is checked that both 𝐪𝐪new and the segment joining 𝐪𝐪near to 𝐪𝐪new belong to Cfree

if this is true, the tree T is expanded by incorporating 𝐪𝐪new and the said segment to speed up the search, two trees are expanded, rooted at 𝐪𝐪S and 𝐪𝐪G, respectively at each iteration, both trees are expanded with the randomized procedure after a certain number of expansion steps, the algorithm tries to connect the two trees and

thus to complete the path

RRT (Rapidly-exploring random trees)

Page 29: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

This picture is taken from the textbook:

B. Siciliano, L. Sciavicco, L. Villani, G. Oriolo: Robotics: Modelling, Planning and Control, 3rd Ed. Springer, 2009

RRT (Rapidly-exploring random trees)

Page 30: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

the RRT expansion technique, though simple, results in a very efficient exploration of the C-space, since the procedure for generating new candidate configurations is intrinsically biased towards regions in Cfree that have not been visited yet

as in the PRM method, there is no need to generate the obstacles in C-space like the PRM method, it is only probabilistically complete

Example of path generated with a RRT algorithm

RRT (Rapidly-exploring random trees)

Page 31: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

Ample free space Cluttered space Narrow passages

RRT (Rapidly-exploring random trees)

Page 32: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

RRT (Rapidly-exploring random trees)

Page 33: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

in the artificial potential method, the motion of the point that represents the robot in C-space is influenced by a potential field 𝑈𝑈

this field is obtained as the superposition of an attractive potential to the goal and a repulsive potential from the obstacles.

at each configuration 𝐪𝐪 the artificial force generated by the potential is defined as the negative gradient −∇𝑈𝑈 𝐪𝐪 of the potential

paraboloid potential conic potential

The method is particularly used in online path planning

This picture is taken from the textbook:

B. Siciliano, L. Sciavicco, L. Villani, G. Oriolo: Robotics: Modelling, Planning and Control, 3rd Ed. Springer, 2009

local minima!

Artificial potentials

Page 34: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

InverseKinematicstarget

stateINSTRUCTION

STACK

TrajGen

Axiscontroller

state update

Instruction stack: list of instructions to be executed, specified using the proprietary programming language

Trajectory generation: converts an instruction into a trajectory to be executed Inverse kinematics: maps the trajectory from the Cartesian space to the joint space (if needed) Axis controllers & drives: closes the control loop ensuring tracking performance

Elements of a motion planning and control system

Page 35: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

As we have seen, in general the user, when assigning a motion command, specifies a restricted number of parameters as inputs:

Space of definition: joint space or Cartesian space

For the path: endpoints, possible intermediate points, path geometry (segment, circular arc, etc..)

For the timing law: overall travelling time, maximum velocity and/or acceleration (or percentages thereof)

Based on this information the trajectory planner generates a dense sequence of intermediate points in the relevant space (joint space or Cartesian space) at a fixed rate (e.g. 10 ms).In case of Cartesian space trajectories these points are additionally converted into points in joint space through kinematic inversion.These values can the be interpolated in order to match the rate of the motion controller (e.g 1ms or 500µs): this is also called micro-interpolation

Inputs and outputs of a trajectory planner

Page 36: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

Some criteria for the selection of the trajectories might be:

computational efficiency and memory space

continuity of positions, velocities (and possibly of accelerations and jerks)

minimization of undesired effects (oscillations, irregular curvature)

accuracy (no overshoot on final position)

Criteria for trajectory selection

Page 37: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

When we plan the trajectory in joint space we want to generate a function 𝐪𝐪 𝑡𝑡 which interpolates the values assigned for the joint variables at the initial and final points.It is sufficient to work component-wise (i.e. we consider a single joint variable 𝑞𝑞𝑖𝑖 𝑡𝑡 ): in the following we will then consider planning of a scalar variable.

Two situations are of interest:

Point-to-point motion:we just specify the endpoints

Interpolation of points:we also specify some intermediate points

When planning in joint space, the definition of the path as a geometric entity is not an issue, since we are not interested in a coordinated motion of the joints (apart from having all the joints complete their motion at the same instant).

Trajectories in joint space

Page 38: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

The simplest case of trajectory planning for point-to-point motion is when some initial and final conditions are assigned on positions, velocities and possibly on acceleration and jerk and the travel time.

Polynomial functions of the following kind can be considered:

𝑞𝑞 𝑡𝑡 = 𝑎𝑎0 + 𝑎𝑎1𝑡𝑡 + 𝑎𝑎2𝑡𝑡2 + ⋯+ 𝑎𝑎𝑛𝑛𝑡𝑡𝑛𝑛

The higher the degree 𝑛𝑛 of the polynomial, the larger the number of boundary conditions that can be satisfied and the smoother the trajectory will be.

t

q

ti

qi

?tf

qf

Polynomial trajectories

Page 39: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

Suppose that the following boundary conditions are assigned: an initial and a final instants 𝑡𝑡𝑖𝑖 and 𝑡𝑡𝑓𝑓 initial position and velocity 𝑞𝑞𝑖𝑖 and �̇�𝑞𝑖𝑖 final position and velocity 𝑞𝑞𝑓𝑓 and �̇�𝑞𝑓𝑓

We then have four boundary conditions. In order to satisfy them we need a polynomial of order at least equal to three (cubic polynomial):

If we impose the boundary conditions:

𝑞𝑞 𝑡𝑡𝑖𝑖 = 𝑞𝑞𝑖𝑖�̇�𝑞 𝑡𝑡𝑖𝑖 = �̇�𝑞𝑖𝑖𝑞𝑞 𝑡𝑡𝑓𝑓 = 𝑞𝑞𝑓𝑓�̇�𝑞 𝑡𝑡𝑓𝑓 = �̇�𝑞𝑓𝑓

𝑞𝑞 𝑡𝑡 = 𝑎𝑎0 + 𝑎𝑎1 𝑡𝑡 − 𝑡𝑡𝑖𝑖 + 𝑎𝑎2 𝑡𝑡 − 𝑡𝑡𝑖𝑖 2 + 𝑎𝑎3 𝑡𝑡 − 𝑡𝑡𝑖𝑖 3

we obtain:

𝑎𝑎0 = 𝑞𝑞𝑖𝑖𝑎𝑎1 = �̇�𝑞𝑖𝑖

𝑎𝑎2 =−3 𝑞𝑞𝑖𝑖 − 𝑞𝑞𝑓𝑓 − 2�̇�𝑞𝑖𝑖 + �̇�𝑞𝑓𝑓 𝑇𝑇

𝑇𝑇2

𝑎𝑎3 =2 𝑞𝑞𝑖𝑖 − 𝑞𝑞𝑓𝑓 + �̇�𝑞𝑖𝑖 + �̇�𝑞𝑓𝑓 𝑇𝑇

𝑇𝑇3 𝑇𝑇 = 𝑡𝑡𝑓𝑓 − 𝑡𝑡𝑖𝑖

Cubic polynomials

Page 40: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

𝑡𝑡𝑖𝑖 = 0, 𝑡𝑡𝑓𝑓 = 1 𝑠𝑠,

𝑞𝑞𝑖𝑖 = 10°, 𝑞𝑞𝑓𝑓 = 30°,

�̇�𝑞𝑖𝑖 = �̇�𝑞𝑓𝑓 = 0°/𝑠𝑠

-0.2 0 0.2 0.4 0.6 0.8 10

10

20

30

40

deg

Position

-0.2 0 0.2 0.4 0.6 0.8 1-10

0

10

20

30

40

t(s)

deg/

s

Velocity

-0.2 0 0.2 0.4 0.6 0.8 1-150

-100

-50

0

50

100

150

t(s)

deg/

s2

Acceleration

Cubic polynomials: example

Page 41: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

In order to assign conditions also on the accelerations, we need to consider polynomials of degree 5:

𝑞𝑞 𝑡𝑡 = 𝑎𝑎0 + 𝑎𝑎1 𝑡𝑡 − 𝑡𝑡𝑖𝑖 + 𝑎𝑎2 𝑡𝑡 − 𝑡𝑡𝑖𝑖 2 + 𝑎𝑎3 𝑡𝑡 − 𝑡𝑡𝑖𝑖 3 + 𝑎𝑎4 𝑡𝑡 − 𝑡𝑡𝑖𝑖 4 + 𝑎𝑎5 𝑡𝑡 − 𝑡𝑡𝑖𝑖 5

Imposing boundary conditions:

𝑞𝑞 𝑡𝑡𝑖𝑖 = 𝑞𝑞𝑖𝑖 𝑞𝑞 𝑡𝑡𝑓𝑓 = 𝑞𝑞𝑓𝑓�̇�𝑞 𝑡𝑡𝑖𝑖 = �̇�𝑞𝑖𝑖 �̇�𝑞 𝑡𝑡𝑓𝑓 = �̇�𝑞𝑓𝑓�̈�𝑞 𝑡𝑡𝑖𝑖 = �̈�𝑞𝑖𝑖 �̈�𝑞 𝑡𝑡𝑓𝑓 = �̈�𝑞𝑓𝑓

we obtain:

𝑎𝑎0 = 𝑞𝑞𝑖𝑖𝑎𝑎1 = �̇�𝑞𝑖𝑖𝑎𝑎2 =

12 �̈�𝑞𝑖𝑖

𝑎𝑎3 =20 𝑞𝑞𝑓𝑓 − 𝑞𝑞𝑖𝑖 − 8�̇�𝑞𝑓𝑓 + 12�̇�𝑞𝑖𝑖 𝑇𝑇 − 3�̈�𝑞𝑓𝑓 − �̈�𝑞𝑖𝑖 𝑇𝑇2

2𝑇𝑇3

𝑎𝑎4 =30 𝑞𝑞𝑖𝑖 − 𝑞𝑞𝑓𝑓 + 14�̇�𝑞𝑓𝑓 + 16�̇�𝑞𝑖𝑖 𝑇𝑇 + 3�̈�𝑞𝑓𝑓 − 2�̈�𝑞𝑖𝑖 𝑇𝑇2

2𝑇𝑇4

𝑎𝑎5 =12 𝑞𝑞𝑓𝑓 − 𝑞𝑞𝑖𝑖 − 6 �̇�𝑞𝑓𝑓 + �̇�𝑞𝑖𝑖 𝑇𝑇 − �̈�𝑞𝑓𝑓 − �̈�𝑞𝑖𝑖 𝑇𝑇2

2𝑇𝑇5 𝑇𝑇 = 𝑡𝑡𝑓𝑓 − 𝑡𝑡𝑖𝑖

Polynomials of degree five

Page 42: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

𝑡𝑡𝑖𝑖 = 0, 𝑡𝑡𝑓𝑓 = 1 𝑠𝑠,

𝑞𝑞𝑖𝑖 = 10°, 𝑞𝑞𝑓𝑓 = 30°,

�̇�𝑞𝑖𝑖 = �̇�𝑞𝑓𝑓 = 0,

�̈�𝑞𝑖𝑖 = �̈�𝑞𝑓𝑓 = 0

-0.2 0 0.2 0.4 0.6 0.8 10

10

20

30

40

deg

Position

-0.2 0 0.2 0.4 0.6 0.8 1-10

0

10

20

30

40

t(s)

deg/

s

Velocity

-0.2 0 0.2 0.4 0.6 0.8 1-150

-100

-50

0

50

100

150

t(s)

deg/

s2Acceleration

Polynomials of degree five: example

Page 43: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

The harmonic trajectory generalizes the equation of a harmonic motion, where the acceleration is proportional to the position, with opposite sign. A harmonic trajectory has continuous derivatives of all orders in all the internal points of the trajectory.

The equations are:

𝑞𝑞 𝑡𝑡 =𝑞𝑞𝑓𝑓 − 𝑞𝑞𝑖𝑖

2 1 − cos𝜋𝜋 𝑡𝑡 − 𝑡𝑡𝑖𝑖𝑡𝑡𝑓𝑓 − 𝑡𝑡𝑖𝑖

+ 𝑞𝑞𝑖𝑖

�̇�𝑞 𝑡𝑡 =𝜋𝜋 𝑞𝑞𝑓𝑓 − 𝑞𝑞𝑖𝑖2 𝑡𝑡𝑓𝑓 − 𝑡𝑡𝑖𝑖

sin𝜋𝜋 𝑡𝑡 − 𝑡𝑡𝑖𝑖𝑡𝑡𝑓𝑓 − 𝑡𝑡𝑖𝑖

�̈�𝑞 𝑡𝑡 =𝜋𝜋2 𝑞𝑞𝑓𝑓 − 𝑞𝑞𝑖𝑖2 𝑡𝑡𝑓𝑓 − 𝑡𝑡𝑖𝑖

2 cos𝜋𝜋 𝑡𝑡 − 𝑡𝑡𝑖𝑖𝑡𝑡𝑓𝑓 − 𝑡𝑡𝑖𝑖

𝑞𝑞 𝑡𝑡𝑖𝑖 = 𝑞𝑞𝑖𝑖 , 𝑞𝑞 𝑡𝑡𝑓𝑓 = 𝑞𝑞𝑓𝑓

�̇�𝑞 𝑡𝑡𝑖𝑖 = 0, �̇�𝑞 𝑡𝑡𝑓𝑓 = 0

Harmonic trajectory

Page 44: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

𝑡𝑡𝑖𝑖 = 0, 𝑡𝑡𝑓𝑓 = 1 𝑠𝑠,

𝑞𝑞𝑖𝑖 = 10°, 𝑞𝑞𝑓𝑓 = 30°

-0.2 0 0.2 0.4 0.6 0.8 10

10

20

30

40

deg

Position

-0.2 0 0.2 0.4 0.6 0.8 1-10

0

10

20

30

40

t(s)

deg/

s

Velocity

-0.2 0 0.2 0.4 0.6 0.8 1-150

-100

-50

0

50

100

150

t(s)

deg/

s2Acceleration

Harmonic trajectory (example)

Page 45: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

The harmonic trajectory has discontinuities in the acceleration in the initial and final instants, and then undefined (or infinite) values of jerk. An alternative is the cycloidal trajectory, which is continuous in the acceleration, too.

Here are the equations:

𝑞𝑞 𝑡𝑡 = 𝑞𝑞𝑓𝑓 − 𝑞𝑞𝑖𝑖𝑡𝑡 − 𝑡𝑡𝑖𝑖𝑡𝑡𝑓𝑓 − 𝑡𝑡𝑖𝑖

−12𝜋𝜋 sin

2𝜋𝜋 𝑡𝑡 − 𝑡𝑡𝑖𝑖𝑡𝑡𝑓𝑓 − 𝑡𝑡𝑖𝑖

+ 𝑞𝑞𝑖𝑖

�̇�𝑞 𝑡𝑡 =𝑞𝑞𝑓𝑓 − 𝑞𝑞𝑖𝑖𝑡𝑡𝑓𝑓 − 𝑡𝑡𝑖𝑖

1 − cos2𝜋𝜋 𝑡𝑡 − 𝑡𝑡𝑖𝑖𝑡𝑡𝑓𝑓 − 𝑡𝑡𝑖𝑖

�̈�𝑞 𝑡𝑡 =2𝜋𝜋 𝑞𝑞𝑓𝑓 − 𝑞𝑞𝑖𝑖𝑡𝑡𝑓𝑓 − 𝑡𝑡𝑖𝑖

2 sin2𝜋𝜋 𝑡𝑡 − 𝑡𝑡𝑖𝑖𝑡𝑡𝑓𝑓 − 𝑡𝑡𝑖𝑖

𝑞𝑞 𝑡𝑡𝑖𝑖 = 𝑞𝑞𝑖𝑖 , 𝑞𝑞 𝑡𝑡𝑓𝑓 = 𝑞𝑞𝑓𝑓

�̇�𝑞 𝑡𝑡𝑖𝑖 = 0, �̇�𝑞 𝑡𝑡𝑓𝑓 = 0

�̈�𝑞 𝑡𝑡𝑖𝑖 = 0, �̈�𝑞 𝑡𝑡𝑓𝑓 = 0

Cycloidal trajectory

Page 46: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

𝑡𝑡𝑖𝑖 = 0, 𝑡𝑡𝑓𝑓 = 1 𝑠𝑠,

𝑞𝑞𝑖𝑖 = 10°, 𝑞𝑞𝑓𝑓 = 30°

-0.2 0 0.2 0.4 0.6 0.8 10

10

20

30

40

deg

Position

-0.2 0 0.2 0.4 0.6 0.8 1-10

0

10

20

30

40

t(s)

deg/

s

Velocity

-0.2 0 0.2 0.4 0.6 0.8 1-150

-100

-50

0

50

100

150

t(s)

deg/

s2

Acceleration

Cycloidal trajectory (example)

Page 47: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

A quite common industrial practice to generate the trajectory consists in planning a linear position profile adjusted at the beginning and at the end of the trajectory with parabolic bends. The resulting velocity profile has the typical trapezoidal shape.

The trajectory is then composed of three parts:

1. Constant accel., linear velocity, parabolic position;2. Zero acceleration, constant velocity, linear position;3. Constant deceleration, linear velocity, parabolic position.

Often the duration 𝑇𝑇𝑎𝑎 of the acceleration phase (phase 1) is set equal to the duration of the deceleration phase (phase 3): this way a trajectory is obtained, which is symmetric with respect to the central time instant. Of course it has to be 𝑇𝑇𝑎𝑎 ≤ ⁄𝑡𝑡𝑓𝑓 − 𝑡𝑡𝑖𝑖 2 .

tti+Ta

qv.q.

tf−Ta tfti

1 2 3

Trapezoidal velocity profile (TVP)

Page 48: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

Acceleration: Constant velocity:

Deceleration:

𝑡𝑡 ∈ 𝑡𝑡𝑖𝑖 , 𝑡𝑡𝑖𝑖 + 𝑇𝑇𝑎𝑎

�̈�𝑞 𝑡𝑡 =�̇�𝑞𝑣𝑣𝑇𝑇𝑎𝑎

�̇�𝑞 𝑡𝑡 =�̇�𝑞𝑣𝑣𝑇𝑇𝑎𝑎

𝑡𝑡 − 𝑡𝑡𝑖𝑖

𝑞𝑞 𝑡𝑡 = 𝑞𝑞𝑖𝑖 +�̇�𝑞𝑣𝑣

2𝑇𝑇𝑎𝑎𝑡𝑡 − 𝑡𝑡𝑖𝑖 2

𝑡𝑡 ∈ 𝑡𝑡𝑖𝑖 + 𝑇𝑇𝑎𝑎 , 𝑡𝑡𝑓𝑓 − 𝑇𝑇𝑎𝑎

�̈�𝑞 𝑡𝑡 = 0�̇�𝑞 𝑡𝑡 = �̇�𝑞𝑣𝑣

𝑞𝑞 𝑡𝑡 = 𝑞𝑞𝑖𝑖 + �̇�𝑞𝑣𝑣 𝑡𝑡 − 𝑡𝑡𝑖𝑖 −𝑇𝑇𝑎𝑎2

𝑡𝑡 ∈ 𝑡𝑡𝑓𝑓 − 𝑇𝑇𝑎𝑎 , 𝑡𝑡𝑓𝑓

�̈�𝑞 𝑡𝑡 = −�̇�𝑞𝑣𝑣𝑇𝑇𝑎𝑎

�̇�𝑞 𝑡𝑡 =�̇�𝑞𝑣𝑣𝑇𝑇𝑎𝑎

𝑡𝑡𝑓𝑓 − 𝑡𝑡

𝑞𝑞 𝑡𝑡 = 𝑞𝑞𝑓𝑓 −�̇�𝑞𝑣𝑣

2𝑇𝑇𝑎𝑎𝑡𝑡𝑓𝑓 − 𝑡𝑡 2

TVP: equations

Page 49: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

𝑡𝑡𝑖𝑖 = 0, 𝑡𝑡𝑓𝑓 = 4𝑠𝑠, 𝑇𝑇𝑎𝑎 = 1𝑠𝑠,

𝑞𝑞𝑖𝑖 = 0°, 𝑞𝑞𝑓𝑓 = 30°, �̇�𝑞𝑣𝑣 = 10°/𝑠𝑠

-1 0 1 2 3 4 50

10

20

30

deg

Position

-1 0 1 2 3 4 5

0

5

10

t(s)

deg/

s

Velocity

-1 0 1 2 3 4 5

-10

-5

0

5

10

t(s)

deg/

s2Acceleration

TVP: example

Page 50: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

Once a trajectory has been planned, it is often necessary to scale it in order to satisfy the constraints on the actuation system, which emerge in terms of saturations.In particular we will consider:

Kinematic scaling of the trajectory is relevant for those trajectory profiles (cubic, harmonic, …) for which such values are not assigned in the planning itself.

For kinematic scaling we can proceed joint by joint (no coupling effects) For dynamic scaling we will need to consider the whole coupled model of the robot

1. Kinematic scaling: the trajectory needs satisfy the constraints on the maximum velocity and acceleration;

2. Dynamic scaling: the trajectory needs satisfy the constraints on the maximum achievable torques/forces by the actuators.

Trajectory scaling

Page 51: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

In order to kinematically scale the trajectory it is convenient to express it in a parametric form, as a function of a suitably normalized parameter 𝜎𝜎 = 𝜎𝜎 𝑡𝑡 .Given the trajectory 𝑞𝑞 𝑡𝑡 , defined between points 𝑞𝑞𝑖𝑖 and 𝑞𝑞𝑓𝑓 with a travel time of 𝑇𝑇 = 𝑡𝑡𝑓𝑓 − 𝑡𝑡𝑖𝑖 , its expression in normalized form is as follows:

𝑞𝑞 𝑡𝑡 = 𝑞𝑞𝑖𝑖 + ℎ𝜎𝜎 𝜏𝜏 with ℎ = 𝑞𝑞𝑓𝑓 − 𝑞𝑞𝑖𝑖 , 0 ≤ 𝜎𝜎 𝜏𝜏 ≤ 1, 𝜏𝜏 = 𝑡𝑡−𝑡𝑡𝑖𝑖𝑇𝑇

, 0 ≤ 𝜏𝜏 ≤ 1

It follows:Maximum values of velocity, acceleration, etc., are obtained in correspondence to the maximum values of functions 𝜎𝜎 𝑖𝑖 𝜏𝜏 : by modifying the travel time 𝑻𝑻 of the trajectory it is possible to satisfy the constraints on the kinematic saturations.

(normalized time)

Trajectory normalization

𝑑𝑑𝑞𝑞 𝑡𝑡𝑑𝑑𝑡𝑡 =

ℎ𝑇𝑇 𝜎𝜎

′ 𝜏𝜏

𝑑𝑑2𝑞𝑞 𝑡𝑡𝑑𝑑𝑡𝑡2 =

ℎ𝑇𝑇2 𝜎𝜎

′′ 𝜏𝜏⋮

𝑑𝑑𝑛𝑛𝑞𝑞 𝑡𝑡𝑑𝑑𝑡𝑡𝑛𝑛 =

ℎ𝑇𝑇𝑛𝑛 𝜎𝜎

𝑛𝑛 𝜏𝜏

Page 52: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

This trajectory can be parameterized with the polynomial:

𝜎𝜎 𝜏𝜏 = 𝑎𝑎0 + 𝑎𝑎1𝜏𝜏 + 𝑎𝑎2𝜏𝜏2 + 𝑎𝑎3𝜏𝜏3

from which:

Assigning the boundary conditions 𝜎𝜎′ 0 = 0,𝜎𝜎′ 1 = 0 (besides 𝜎𝜎 0 = 0,𝜎𝜎 1 = 1):

𝑎𝑎0 = 0, 𝑎𝑎1 = 0, 𝑎𝑎2 = 3, 𝑎𝑎3 = −2

𝜎𝜎 𝜏𝜏 = 3𝜏𝜏2 − 2𝜏𝜏3 𝜎𝜎″ 𝜏𝜏 = 6 − 12𝜏𝜏𝜎𝜎′ 𝜏𝜏 = 6𝜏𝜏 − 6𝜏𝜏2 𝜎𝜎‴ 𝜏𝜏 = −12

Maximum values of velocity and acceleration are then:

𝜎𝜎′max = 𝜎𝜎′ 0.5 =32

⇒ �̇�𝑞max =3ℎ2𝑇𝑇

𝜎𝜎″max = 𝜎𝜎″ 0 = 6 ⇒ �̈�𝑞max =6ℎ𝑇𝑇2

Polynomial trajectory of degree 3

Page 53: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

𝜎𝜎 𝜏𝜏 = 𝑎𝑎0 + 𝑎𝑎1𝜏𝜏 + 𝑎𝑎2𝜏𝜏2 + 𝑎𝑎3𝜏𝜏3 + 𝑎𝑎4𝜏𝜏4 + 𝑎𝑎5𝜏𝜏5

from which:

Assigning boundary conditions 𝜎𝜎 0 = 0,𝜎𝜎 1 = 1, 𝜎𝜎′ 0 = 0,𝜎𝜎′ 1 = 0, 𝜎𝜎″ 0 = 0,𝜎𝜎″ 1 = 0

𝑎𝑎0 = 0, 𝑎𝑎1 = 0, 𝑎𝑎2 = 0, 𝑎𝑎3 = 10, 𝑎𝑎4 = −15, 𝑎𝑎5 = 6

𝜎𝜎 𝜏𝜏 = 10𝜏𝜏3 − 15𝜏𝜏4 + 6𝜏𝜏5 𝜎𝜎″ 𝜏𝜏 = 60𝜏𝜏 − 180𝜏𝜏2 + 120𝜏𝜏3

𝜎𝜎′ 𝜏𝜏 = 30𝜏𝜏2 − 60𝜏𝜏3 + 30𝜏𝜏4 𝜎𝜎‴ 𝜏𝜏 = 60 − 360𝜏𝜏 + 360𝜏𝜏2

𝜎𝜎′max = 𝜎𝜎′ 0.5 =158

⇒ �̇�𝑞max =15ℎ8𝑇𝑇

𝜎𝜎″max = 𝜎𝜎″ 0.2123 =10 3

3⇒ �̈�𝑞max =

10 3ℎ3𝑇𝑇2

This trajectory can be parameterized with the polynomial:

Maximum values of velocity and acceleration are then:

Polynomial trajectory of degree 5

Page 54: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

𝜎𝜎 𝜏𝜏 =12

1 − cos 𝜋𝜋𝜏𝜏

from which: 𝜎𝜎′ 𝜏𝜏 =𝜋𝜋2

sin 𝜋𝜋𝜏𝜏

𝜎𝜎″ 𝜏𝜏 =𝜋𝜋2

2cos 𝜋𝜋𝜏𝜏

𝜎𝜎‴ 𝜏𝜏 =𝜋𝜋3

2sin 𝜋𝜋𝜏𝜏

𝜎𝜎′max = 𝜎𝜎′ 0.5 =𝜋𝜋2

⇒ �̇�𝑞max =𝜋𝜋ℎ2𝑇𝑇

𝜎𝜎″max = 𝜎𝜎″ 0 =𝜋𝜋2

2⇒ �̈�𝑞max =

𝜋𝜋2ℎ2𝑇𝑇2

This trajectory can be parameterized with the function:

Maximum values of velocity and acceleration are then:

Harmonic trajectory

Page 55: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

𝜎𝜎 𝜏𝜏 = 𝜏𝜏 −12𝜋𝜋

sin 2𝜋𝜋𝜏𝜏from which:

𝜎𝜎′ 𝜏𝜏 = 1 − cos 2𝜋𝜋𝜏𝜏𝜎𝜎″ 𝜏𝜏 = 2𝜋𝜋 sin 2𝜋𝜋𝜏𝜏𝜎𝜎‴ 𝜏𝜏 = 4𝜋𝜋2 cos 2𝜋𝜋𝜏𝜏

𝜎𝜎′max = 𝜎𝜎′ 0.5 = 2 ⇒ �̇�𝑞max = 2ℎ𝑇𝑇

𝜎𝜎″max = 𝜎𝜎″ 0.25 = 2𝜋𝜋 ⇒ �̈�𝑞max = 2𝜋𝜋ℎ𝑇𝑇2

This trajectory can be parameterized with the function:

Maximum values of velocity and acceleration are then:

Cycloidal trajectory

Page 56: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

We want to design a trajectory with 𝑞𝑞𝑖𝑖 = 10°, 𝑞𝑞𝑓𝑓 = 50°,

for an actuator characterized by �̇�𝑞𝑚𝑚𝑎𝑎𝑚𝑚 = 30 ⁄° 𝑠𝑠 , �̈�𝑞𝑚𝑚𝑎𝑎𝑚𝑚 = 80 ⁄° 𝑠𝑠2.

The following results can be obtained (ℎ = 40°):

667.2772.1

802

667.2302

2

2Cycloidal

094.2571.1

160

094.260

2

2Harmonic

5.2699.1

240310

5.224015

3310

815

degree 5th Polin.

2732.1

806

2603

623

degree 3rd Polin.

sConstraintFormulasTrajectory

2max

max

2

2

2

max

max

2max

max

2max

max

min

=

==

π=

=

=

=

π=

π=

==

==

=

=

==

==

=

=

hT

hT

Thq

Thq

hT

hT

Thq

Thq

hT

hT

Thq

Thq

hT

hT

ThqThq

T

fast

fast

Kinematic scaling: an example

Page 57: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

We will discuss the dynamic scaling technique making reference directly to the model of the robotic manipulator (neglecting friction effects):

𝐁𝐁 𝐪𝐪 �̈�𝐪 + 𝐂𝐂 𝐪𝐪, �̇�𝐪 �̇�𝐪 + 𝐠𝐠 𝐪𝐪 = τ

For each joint an equation of the following kind holds:

𝐁𝐁𝑖𝑖𝑇𝑇 𝐪𝐪 �̈�𝐪 +12�̇�𝐪𝑇𝑇𝐂𝐂𝑖𝑖 𝐪𝐪 �̇�𝐪 + 𝑔𝑔𝑖𝑖 𝐪𝐪 = 𝜏𝜏𝑖𝑖 𝑖𝑖 = 1, … ,𝑛𝑛

where 𝐂𝐂𝑖𝑖 𝐪𝐪 is a suitable matrix.

Let us consider a parameterization of the trajectory in terms of a scalar function:

𝐪𝐪 = 𝐪𝐪 𝜎𝜎 ,𝜎𝜎 = 𝜎𝜎 𝑡𝑡

Then: �̇�𝐪 =𝑑𝑑𝐪𝐪𝑑𝑑𝜎𝜎

�̇�𝜎, �̈�𝐪 =𝑑𝑑2𝐪𝐪𝑑𝑑𝜎𝜎2

�̇�𝜎2 +𝑑𝑑𝐪𝐪𝑑𝑑𝜎𝜎

�̈�𝜎

(this means that all the joint positions depend on the time in the same way)

Dynamic scaling

Page 58: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

By substituting in the dynamic equation of the 𝑖𝑖𝑡𝑡𝑡 joint we have:

i.e. an equation in the form:

𝐁𝐁𝑖𝑖𝑇𝑇 𝐪𝐪 𝜎𝜎𝑑𝑑𝐪𝐪𝑑𝑑𝜎𝜎

�̈�𝜎 + 𝐁𝐁𝑖𝑖𝑇𝑇 𝐪𝐪 𝜎𝜎𝑑𝑑2𝐪𝐪𝑑𝑑𝜎𝜎2

+12𝑑𝑑𝐪𝐪𝑇𝑇

𝑑𝑑𝜎𝜎𝐂𝐂𝑖𝑖 𝐪𝐪 𝜎𝜎

𝑑𝑑𝐪𝐪𝑑𝑑𝜎𝜎

�̇�𝜎2 + 𝑔𝑔𝑖𝑖 𝐪𝐪 𝜎𝜎 = 𝜏𝜏𝑖𝑖

Observe that γi depends on the position only (and not on the velocity).

𝛼𝛼𝑖𝑖 𝜎𝜎 �̈�𝜎 + 𝛽𝛽𝑖𝑖 𝜎𝜎 �̇�𝜎2 + 𝛾𝛾𝑖𝑖 𝜎𝜎 = 𝜏𝜏𝑖𝑖

Torques needed to execute the motion are thus:

𝜏𝜏𝑖𝑖 𝑡𝑡 = 𝛼𝛼𝑖𝑖 𝜎𝜎 𝑡𝑡 �̈�𝜎 𝑡𝑡 + 𝛽𝛽𝑖𝑖 𝜎𝜎 𝑡𝑡 �̇�𝜎2 𝑡𝑡 + 𝛾𝛾𝑖𝑖 𝜎𝜎 𝑡𝑡 , 𝑖𝑖 = 1, … ,𝑛𝑛, 𝑡𝑡 ∈ 0,𝑇𝑇

Dynamic scaling

Page 59: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

In order to obtain a different parameterization of the trajectory, consider now a time scaling, for instance a linear one:

We obtain:

If 𝑘𝑘 > 1 the scaled trajectory is slower.

If 𝑘𝑘 < 1 the scaled trajectory is faster.

𝜎𝜎 𝑡𝑡 = �𝜎𝜎 𝜃𝜃 , �̇�𝜎 𝑡𝑡 = 𝑘𝑘 �𝜎𝜎′ 𝜃𝜃 , �̈�𝜎 𝑡𝑡 = 𝑘𝑘2 �𝜎𝜎″ 𝜃𝜃

𝜃𝜃 = 𝑘𝑘𝑡𝑡 𝜃𝜃 ∈ 0, 𝑘𝑘𝑇𝑇

where ()′ stands for derivative with respect to 𝜃𝜃.

we change the time scale and consider a new time 𝜃𝜃

t0

0

T

θ kT

Dynamic scaling

Page 60: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

With the new parameterization, the torques become:

𝜏𝜏𝑖𝑖 𝜃𝜃 = 𝛼𝛼𝑖𝑖 �𝜎𝜎 𝜃𝜃 �𝜎𝜎″ 𝜃𝜃 + 𝛽𝛽𝑖𝑖 �𝜎𝜎 𝜃𝜃 �𝜎𝜎′2 𝜃𝜃 + 𝛾𝛾𝑖𝑖 �𝜎𝜎 𝜃𝜃 =

= 𝛼𝛼𝑖𝑖 𝜎𝜎 𝑡𝑡�̈�𝜎 𝑡𝑡𝑘𝑘2

+ 𝛽𝛽𝑖𝑖 𝜎𝜎 𝑡𝑡�̇�𝜎2 𝑡𝑡𝑘𝑘2

+ 𝛾𝛾𝑖𝑖 𝜎𝜎 𝑡𝑡 =

=1𝑘𝑘2

𝛼𝛼𝑖𝑖 𝜎𝜎 𝑡𝑡 �̈�𝜎 𝑡𝑡 + 𝛽𝛽𝑖𝑖 𝜎𝜎 𝑡𝑡 �̇�𝜎2 𝑡𝑡 + 𝛾𝛾𝑖𝑖 𝜎𝜎 𝑡𝑡 =

=1𝑘𝑘2

𝜏𝜏𝑖𝑖 𝑡𝑡 − 𝑔𝑔𝑖𝑖 𝜎𝜎 𝑡𝑡 + 𝑔𝑔𝑖𝑖 𝜎𝜎 𝑡𝑡

Then: 𝜏𝜏𝑖𝑖 𝜃𝜃 − 𝑔𝑔𝑖𝑖 𝜃𝜃 =1𝑘𝑘2

𝜏𝜏𝑖𝑖 𝑡𝑡 − 𝑔𝑔𝑖𝑖 𝑡𝑡

𝜏𝜏𝑖𝑖 𝑡𝑡 = 𝛼𝛼𝑖𝑖 𝜎𝜎 𝑡𝑡 �̈�𝜎 𝑡𝑡 + 𝛽𝛽𝑖𝑖 𝜎𝜎 𝑡𝑡 �̇�𝜎2 𝑡𝑡 + 𝛾𝛾𝑖𝑖 𝜎𝜎 𝑡𝑡 , 𝑖𝑖 = 1, … ,𝑛𝑛, 𝑡𝑡 ∈ 0,𝑇𝑇

Dynamic scaling

Page 61: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

With a new parameterization of the trajectory it is not necessary to compute again the dynamics of the system;

New torques are obtained, apart from the gravitational term (which does not depend on the parameterization), multiplying the torques obtained with the original trajectory by the factor ⁄1 𝑘𝑘2;

The travel time of the new trajectory is 𝑘𝑘𝑇𝑇.

t0

0

T

θ kT0 σ σmax

q

q=q(σ)

𝜏𝜏𝑖𝑖 𝜃𝜃 − 𝑔𝑔𝑖𝑖 𝜃𝜃 =1𝑘𝑘2

𝜏𝜏𝑖𝑖 𝑡𝑡 − 𝑔𝑔𝑖𝑖 𝑡𝑡

Dynamic scaling

Page 62: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

Consider a two d.o.f. manipulator subjected to a trajectory which generates the following torques:

tU1

−U1

tU2

−U2

τ1 τ2 To scale the trajectory we compute the value:

𝑘𝑘2 = max 1,𝜏𝜏1𝑈𝑈1

,𝜏𝜏2𝑈𝑈2

≥ 1

New torques will be realizable (𝜏𝜏 𝜃𝜃 = ⁄𝜏𝜏 𝑡𝑡 𝑘𝑘2) and at least one of them will saturate in one point.Scaling the trajectory in order to avoid that the torque exceeds the maximum value in a given interval may excessively slow down the execution: we can resort in this case to a variable scaling (i.e. applied only in those intervals where there is torque saturation).

Dynamic scaling: example

Page 63: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

So far we have considered conditions only on the initial and final points of the trajectory.We will now consider the more general situation where intermediate points have to be interpolated at given instants:

𝑡𝑡1𝑡𝑡2⋮

𝑡𝑡𝑛𝑛−1𝑡𝑡𝑛𝑛

𝑞𝑞1𝑞𝑞2⋮

𝑞𝑞𝑛𝑛−1𝑞𝑞𝑛𝑛

Interpolation of points

Page 64: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

The problem of finding a trajectory that passes through n points can be solved adopting a polynomial function of degree 𝑛𝑛 − 1:

𝐐𝐐 =

𝑞𝑞1𝑞𝑞2⋮

𝑞𝑞𝑛𝑛−1𝑞𝑞𝑛𝑛

=

1 𝑡𝑡1 ⋯ 𝑡𝑡1𝑛𝑛−1

1 𝑡𝑡2 ⋯ 𝑡𝑡2𝑛𝑛−1

⋮1 𝑡𝑡𝑛𝑛−1 ⋯ 𝑡𝑡𝑛𝑛−1𝑛𝑛−1

1 𝑡𝑡𝑛𝑛 ⋯ 𝑡𝑡𝑛𝑛𝑛𝑛−1

𝑎𝑎0𝑎𝑎1⋮

𝑎𝑎𝑛𝑛−2𝑎𝑎𝑛𝑛−1

= 𝐓𝐓𝐓𝐓

Given the values 𝑡𝑡𝑖𝑖, 𝑞𝑞𝑖𝑖, 𝑖𝑖 = 1,⋯ ,𝑛𝑛 vectors 𝐐𝐐, 𝐓𝐓 and matrix 𝐓𝐓 (Vandermonde matrix) are built as:

It follows: 𝐓𝐓 = 𝐓𝐓−1𝐐𝐐 (matrix 𝐓𝐓 is always invertible if 𝑡𝑡𝑖𝑖 > 𝑡𝑡𝑖𝑖−1, 𝑖𝑖 = 1,⋯ ,𝑛𝑛)

Interpolation with a polynomial

𝑞𝑞 𝑡𝑡 = 𝑎𝑎0 + 𝑎𝑎1𝑡𝑡 + 𝑎𝑎2𝑡𝑡2 + ⋯+ 𝑎𝑎𝑛𝑛−1𝑡𝑡𝑛𝑛−1

Page 65: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

-2 0 2 4 6 8 10 12-10

0

10

20

30

40

50

deg

Position

-2 0 2 4 6 8 10 12-20

-10

0

10

20

30

t(s)

deg/

s

Velocity

-2 0 2 4 6 8 10 12-40

-30

-20

-10

0

10

t(s)

deg/

s2

Acceleration

𝑡𝑡1 = 0 𝑡𝑡2 = 2 𝑡𝑡3 = 4 𝑡𝑡4 = 8 𝑡𝑡5 = 10𝑞𝑞1 = 10° 𝑞𝑞2 = 20° 𝑞𝑞3 = 0° 𝑞𝑞4 = 30° 𝑞𝑞5 = 40°

Interpolation with a polynomial

Page 66: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

A clear advantage of the polynomial interpolation is that function 𝑞𝑞 𝑡𝑡 has continuous derivatives of all the orders inside the interval 𝑡𝑡1 𝑡𝑡𝑛𝑛 .

However the method is not efficient from a numerical point of view: as the number n of points increases, the condition number 𝑞𝑞 (ratio between the maximum and minimum eigenvalue) of the Vandermondematrix 𝐓𝐓 increases too, making the inversion problem numerically ill-conditioned.

If, for example, 𝑡𝑡𝑖𝑖 = 𝑖𝑖𝑛𝑛

, 𝑖𝑖 = 1,⋯ ,𝑛𝑛) :

Other, more efficient, methods exist to compute the coefficient of the polynomial, however the numerical difficulties stand for high values of 𝑛𝑛.

16117 10139.110032.410519.137.492443.68687.981.15

2015106543

⋅⋅⋅k

n

Interpolation with a polynomial

Page 67: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

Regardless the numerical difficulties, the interpolation of n points with only one polynomial of degree 𝑛𝑛 − 1 has other disadvantages:

1. the degree of the polynomial depends on 𝑛𝑛 and, for large values of 𝑛𝑛, the amount of computations might be remarkable;

2. changing a single point 𝑡𝑡𝑖𝑖 ,𝑞𝑞𝑖𝑖 implies to compute again the entire polynomial;3. adding a final point 𝑡𝑡𝑛𝑛+1,𝑞𝑞𝑛𝑛+1 implies the use of a higher degree polynomial and thus the

computation of all the coefficients; 4. the obtained solution in general presents undesired oscillations

An alternative, instead of using a single polynomial of degree 𝑛𝑛 − 1, is to use 𝑛𝑛 − 1 polynomials of degree 𝑝𝑝 (typically lower), each of which defined in an interval of the trajectory.The degree 𝑝𝑝 of the polynomials is usually equal to 3 (pieces of cubic trajectories).A first, and obvious, way to proceed is to assign positions and velocities in all the points and then to compute the coefficients of the cubic polynomials between two consecutive points.

Interpolation with a polynomial

Page 68: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

-2 0 2 4 6 8 10 12-10

0

10

20

30

40

50

deg

Position

-2 0 2 4 6 8 10 12-20

-10

0

10

20

t(s)

deg/

s

Velocity

-2 0 2 4 6 8 10 12-40

-20

0

20

40

t(s)

deg/

s2

Acceleration

𝑡𝑡1 = 0 𝑡𝑡2 = 2 𝑡𝑡3 = 4 𝑡𝑡4 = 8 𝑡𝑡5 = 10𝑞𝑞1 = 10° 𝑞𝑞2 = 20° 𝑞𝑞3 = 0° 𝑞𝑞4 = 30° 𝑞𝑞5 = 40°�̇�𝑞1 = 0°/𝑠𝑠 �̇�𝑞2 = −10°/𝑠𝑠 �̇�𝑞3 = 10°/𝑠𝑠 �̇�𝑞4 = 3°/𝑠𝑠 �̇�𝑞5 = 0°/𝑠𝑠

Interpolation with cubics

Page 69: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

If only the intermediate positions are specified, and not the intermediate velocities, these can be assigned with rules like:

�̇�𝑞1 = 0

�̇�𝑞𝑘𝑘 = �0 sign 𝑅𝑅𝑘𝑘 ≠ sign 𝑅𝑅𝑘𝑘+1

𝑅𝑅𝑘𝑘 + 𝑅𝑅𝑘𝑘+12

sign 𝑅𝑅𝑘𝑘 = sign 𝑅𝑅𝑘𝑘+1�̇�𝑞𝑛𝑛 = 0

where:

𝑅𝑅𝑘𝑘 =𝑞𝑞𝑘𝑘 − 𝑞𝑞𝑘𝑘−1𝑡𝑡𝑘𝑘 − 𝑡𝑡𝑘𝑘−1

is the slope in the interval 𝑡𝑡𝑘𝑘−1, 𝑡𝑡𝑘𝑘

Interpolation with cubics

Page 70: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

-2 0 2 4 6 8 10 12-10

0

10

20

30

40

50

deg

Position

-2 0 2 4 6 8 10 12-20

-10

0

10

20

t(s)

deg/

s

Velocity

-2 0 2 4 6 8 10 12-30

-20

-10

0

10

20

30

t(s)

deg/

s2

Acceleration

𝑡𝑡1 = 0 𝑡𝑡2 = 2 𝑡𝑡3 = 4 𝑡𝑡4 = 8 𝑡𝑡5 = 10𝑞𝑞1 = 10° 𝑞𝑞2 = 20° 𝑞𝑞3 = 0° 𝑞𝑞4 = 30° 𝑞𝑞5 = 40°

Interpolation with cubics

Page 71: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

The interpolation with cubic polynomials generates a trajectory which presents a discontinuity in the acceleration in the intermediate points.

In order to avoid this problem, while keeping cubic interpolation, we must avoid to assign specific values of velocity in the intermediate points, assigning just the continuity of velocities and accelerations (and of course positions) in these points.

The trajectory which is obtained this way is called spline (smooth path line).

The spline is the minimum curvature interpolating function, given some conditions on continuity of derivatives.

Spline

Page 72: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

4 𝑛𝑛 − 1 − 2 𝑛𝑛 − 1 − 2 𝑛𝑛 − 2 = 2We thus have:

A (not unique) way to use these 2 degrees of freedom consists in assigning suitable initial and final conditions on the velocity.

2 𝑛𝑛 − 1 conditions of passage through the points (each cubic has to interpolate the points at its boundaries)

𝑛𝑛 − 2 conditions on continuity of velocities in the intermediate points 𝑛𝑛 − 2 conditions on continuity of accelerations in the intermediate points

residual degrees of freedom.

𝑞𝑞 𝑡𝑡 = 𝑎𝑎0 + 𝑎𝑎1𝑡𝑡 + 𝑎𝑎2𝑡𝑡2 + 𝑎𝑎3𝑡𝑡3Since with 𝑛𝑛 points we need 𝑛𝑛 − 1 polynomials like:

each of which has 4 coefficients, the total number of coefficients to be computed is 4 𝑛𝑛 − 1 . The conditions to be imposed are:

Spline: conditions

Page 73: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

We want to determine a function:

𝑞𝑞 𝑡𝑡 = 𝑞𝑞𝑘𝑘 𝑡𝑡 , 𝑡𝑡 ∈ 𝑡𝑡𝑘𝑘 , 𝑡𝑡𝑘𝑘+1 , 𝑘𝑘 = 1, … ,𝑛𝑛 − 1𝑞𝑞𝑘𝑘 𝜏𝜏 = 𝑎𝑎𝑘𝑘0 + 𝑎𝑎𝑘𝑘1𝜏𝜏 + 𝑎𝑎𝑘𝑘2𝜏𝜏2 + 𝑎𝑎𝑘𝑘3𝜏𝜏3, 𝜏𝜏 ∈ 0,𝑇𝑇𝑘𝑘 𝜏𝜏 = 𝑡𝑡 − 𝑡𝑡𝑘𝑘 , 𝑇𝑇𝑘𝑘 = 𝑡𝑡𝑘𝑘+1 − 𝑡𝑡𝑘𝑘

with the conditions:

where the quantities 𝑣𝑣𝑘𝑘 , 𝑘𝑘 = 2, … ,𝑛𝑛 − 1 are not specified.The problem consists in finding the coefficients 𝑎𝑎𝑘𝑘𝑖𝑖.

Spline: analytical position of the problem

𝑞𝑞𝑘𝑘 0 = 𝑞𝑞𝑘𝑘 , 𝑞𝑞𝑘𝑘 𝑇𝑇𝑘𝑘 = 𝑞𝑞𝑘𝑘+1�̇�𝑞𝑘𝑘 𝑇𝑇𝑘𝑘 = �̇�𝑞𝑘𝑘+1 0 = 𝑣𝑣𝑘𝑘+1�̈�𝑞𝑘𝑘 𝑇𝑇𝑘𝑘 = �̈�𝑞𝑘𝑘+1 0�̇�𝑞1 0 = 𝑣𝑣1, �̇�𝑞𝑛𝑛−1 𝑇𝑇𝑛𝑛−1 = 𝑣𝑣𝑛𝑛

𝑘𝑘 = 1, … ,𝑛𝑛 − 1𝑘𝑘 = 1, … ,𝑛𝑛 − 2𝑘𝑘 = 1, … ,𝑛𝑛 − 2

Page 74: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

Assume initially that the velocities 𝑣𝑣𝑘𝑘 ,𝑘𝑘 = 2, … ,𝑛𝑛 − 1 in the intermediate points are known. In this way, for each cubic polynomial we have four boundary conditions on position and velocity, which give rise to the system:

Solving the system yields:

Spline: algorithm

𝑞𝑞𝑘𝑘 0 = 𝑎𝑎𝑘𝑘0 = 𝑞𝑞𝑘𝑘�̇�𝑞𝑘𝑘 0 = 𝑎𝑎𝑘𝑘1 = 𝑣𝑣𝑘𝑘𝑞𝑞𝑘𝑘 𝑇𝑇𝑘𝑘 = 𝑎𝑎𝑘𝑘0 + 𝑎𝑎𝑘𝑘1𝑇𝑇𝑘𝑘 +𝑎𝑎𝑘𝑘2 𝑇𝑇𝑘𝑘2 +𝑎𝑎𝑘𝑘3 𝑇𝑇𝑘𝑘3 = 𝑞𝑞𝑘𝑘+1�̇�𝑞𝑘𝑘 𝑇𝑇𝑘𝑘 = 𝑎𝑎𝑘𝑘1 +2𝑎𝑎𝑘𝑘2 𝑇𝑇𝑘𝑘 +3𝑎𝑎𝑘𝑘3 𝑇𝑇𝑘𝑘2 = 𝑣𝑣𝑘𝑘+1

𝑎𝑎𝑘𝑘0 = 𝑞𝑞𝑘𝑘𝑎𝑎𝑘𝑘1 = 𝑣𝑣𝑘𝑘

𝑎𝑎𝑘𝑘2 =1𝑇𝑇𝑘𝑘

3 𝑞𝑞𝑘𝑘+1 − 𝑞𝑞𝑘𝑘𝑇𝑇𝑘𝑘

− 2𝑣𝑣𝑘𝑘 − 𝑣𝑣𝑘𝑘+1

𝑎𝑎𝑘𝑘3 =1𝑇𝑇𝑘𝑘2

2 𝑞𝑞𝑘𝑘 − 𝑞𝑞𝑘𝑘+1𝑇𝑇𝑘𝑘

+ 𝑣𝑣𝑘𝑘 + 𝑣𝑣𝑘𝑘+1

Page 75: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

Obviously the velocities 𝑣𝑣𝑘𝑘 , 𝑘𝑘 = 2, … ,𝑛𝑛 − 1 must be computed. Let us impose the continuity of the accelerations in the intermediate points:

�̈�𝑞𝑘𝑘 𝑇𝑇𝑘𝑘 = 2𝑎𝑎𝑘𝑘2 + 6𝑎𝑎𝑘𝑘3𝑇𝑇𝑘𝑘 = 2𝑎𝑎𝑘𝑘+1,2 = �̈�𝑞𝑘𝑘+1 0 , 𝑘𝑘 = 1, … ,𝑛𝑛 − 2

By substituting the expressions for the coefficients 𝑎𝑎𝑘𝑘2, 𝑎𝑎𝑘𝑘3, 𝑎𝑎𝑘𝑘+1,2 and multiplying by ⁄𝑇𝑇𝑘𝑘𝑇𝑇𝑘𝑘+1 2 we obtain:

𝑇𝑇𝑘𝑘+1𝑣𝑣𝑘𝑘 + 2 𝑇𝑇𝑘𝑘+1 + 𝑇𝑇𝑘𝑘 𝑣𝑣𝑘𝑘+1 + 𝑇𝑇𝑘𝑘𝑣𝑣𝑘𝑘+2 =3

𝑇𝑇𝑘𝑘𝑇𝑇𝑘𝑘+1𝑇𝑇𝑘𝑘2 𝑞𝑞𝑘𝑘+2 − 𝑞𝑞𝑘𝑘+1 + 𝑇𝑇𝑘𝑘+12 𝑞𝑞𝑘𝑘+1 − 𝑞𝑞𝑘𝑘

Spline: algorithm

Page 76: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

In matrix form:

𝑇𝑇𝑘𝑘+1𝑣𝑣𝑘𝑘 + 2 𝑇𝑇𝑘𝑘+1 + 𝑇𝑇𝑘𝑘 𝑣𝑣𝑘𝑘+1 + 𝑇𝑇𝑘𝑘𝑣𝑣𝑘𝑘+2 =3

𝑇𝑇𝑘𝑘𝑇𝑇𝑘𝑘+1𝑇𝑇𝑘𝑘2 𝑞𝑞𝑘𝑘+2 − 𝑞𝑞𝑘𝑘+1 + 𝑇𝑇𝑘𝑘+12 𝑞𝑞𝑘𝑘+1 − 𝑞𝑞𝑘𝑘

𝑇𝑇2 2 𝑇𝑇1 + 𝑇𝑇2 𝑇𝑇10 𝑇𝑇3 2 𝑇𝑇2 + 𝑇𝑇3 𝑇𝑇2

⋮𝑇𝑇𝑛𝑛−2 2 𝑇𝑇𝑛𝑛−3 + 𝑇𝑇𝑛𝑛−2 𝑇𝑇𝑛𝑛−3 0

𝑇𝑇𝑛𝑛−1 2 𝑇𝑇𝑛𝑛−2 + 𝑇𝑇𝑛𝑛−1 𝑇𝑇𝑛𝑛−2

𝑣𝑣1𝑣𝑣2⋮

𝑣𝑣𝑛𝑛−1𝑣𝑣𝑛𝑛

=

𝑐𝑐1𝑐𝑐2⋮

𝑐𝑐𝑛𝑛−3𝑐𝑐𝑛𝑛−2

where constants 𝑐𝑐𝑘𝑘 depend only on the intermediate positions and on the lengths of the intervals, all known quantities. Since the velocities 𝑣𝑣1 and 𝑣𝑣𝑛𝑛 are known (they are specified as initial data), by eliminating the related columns we have:

Spline: algorithm

Page 77: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

2 𝑇𝑇1 + 𝑇𝑇2 𝑇𝑇1𝑇𝑇3 2 𝑇𝑇2 + 𝑇𝑇3 𝑇𝑇2

⋮𝑇𝑇𝑛𝑛−2 2 𝑇𝑇𝑛𝑛−3 + 𝑇𝑇𝑛𝑛−2 𝑇𝑇𝑛𝑛−3

𝑇𝑇𝑛𝑛−1 2 𝑇𝑇𝑛𝑛−2 + 𝑇𝑇𝑛𝑛−1

𝑣𝑣2⋮

𝑣𝑣𝑛𝑛−1

=3

𝑇𝑇1𝑇𝑇2𝑇𝑇12 𝑞𝑞3 − 𝑞𝑞2 + 𝑇𝑇22 𝑞𝑞2 − 𝑞𝑞1 − 𝑇𝑇2𝑣𝑣13

𝑇𝑇2𝑇𝑇3𝑇𝑇22 𝑞𝑞4 − 𝑞𝑞3 + 𝑇𝑇32 𝑞𝑞3 − 𝑞𝑞2

⋮3

𝑇𝑇𝑛𝑛−3𝑇𝑇𝑛𝑛−2𝑇𝑇𝑛𝑛−32 𝑞𝑞𝑛𝑛−1 − 𝑞𝑞𝑛𝑛−2 + 𝑇𝑇𝑛𝑛−22 𝑞𝑞𝑛𝑛−2 − 𝑞𝑞𝑛𝑛−3

3𝑇𝑇𝑛𝑛−2𝑇𝑇𝑛𝑛−1

𝑇𝑇𝑛𝑛−22 𝑞𝑞𝑛𝑛 − 𝑞𝑞𝑛𝑛−1 + 𝑇𝑇𝑛𝑛−12 𝑞𝑞𝑛𝑛−1 − 𝑞𝑞𝑛𝑛−2 − 𝑇𝑇𝑛𝑛−2𝑣𝑣𝑛𝑛 i.e an equation in the form 𝐀𝐀𝐀𝐀 = 𝐜𝐜

Spline: algorithm

Page 78: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

Matrix 𝐀𝐀 is a dominant diagonal matrix and is always invertible provided that 𝑇𝑇𝑘𝑘 > 0;

Matrix 𝐀𝐀 has a tridiagonal structure: for these matrices there exist efficient numerical techniques (Gauss-Jordan method) for its inversion;

Once the inverse of 𝐀𝐀 is known we might compute velocities 𝑣𝑣2,⋯ , 𝑣𝑣𝑛𝑛−1as:

which completely solves the problem.

𝐀𝐀 = 𝐀𝐀−1𝐜𝐜

It is also possible to determine the spline with an alternative (yet completely equivalent) algorithm which computes the accelerations instead of the velocities in the intermediate points.

Spline: algorithm

Page 79: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

-2 0 2 4 6 8 10 12-10

0

10

20

30

40

50

deg

Position

-2 0 2 4 6 8 10 12-20

-10

0

10

20

t(s)

deg/

s

Velocity

-2 0 2 4 6 8 10 12-20

-10

0

10

20

t(s)

deg/

s2

Acceleration

𝑡𝑡1 = 0 𝑡𝑡2 = 2 𝑡𝑡3 = 4 𝑡𝑡4 = 8 𝑡𝑡5 = 10𝑞𝑞1 = 10° 𝑞𝑞2 = 20° 𝑞𝑞3 = 0° 𝑞𝑞4 = 30° 𝑞𝑞5 = 40°

Spline: example

Page 80: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

The overall travel time of a spline is given by:

𝑇𝑇 = �𝑘𝑘=1

𝑛𝑛−1

𝑇𝑇𝑘𝑘 = 𝑡𝑡𝑛𝑛 − 𝑡𝑡1

It is possible to conceive an optimization problem which minimizes the overall travel time. The problem is to determine the values 𝑇𝑇𝑘𝑘 so as to minimize 𝑇𝑇, with the constraints on the maximum velocities and accelerations. Formally:

min𝑇𝑇𝑘𝑘

𝑇𝑇 = �𝑘𝑘=1

𝑛𝑛−1

𝑇𝑇𝑘𝑘

such that�̇�𝑞 𝜏𝜏,𝑇𝑇𝑘𝑘 < 𝑣𝑣max 𝜏𝜏 ∈ 0,𝑇𝑇�̈�𝑞 𝜏𝜏,𝑇𝑇𝑘𝑘 < 𝑎𝑎max 𝜏𝜏 ∈ 0,𝑇𝑇

It is then a non linear optimum problem with a linear cost function, which can be solved with operations research techniques.

Spline: travel time

Page 81: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

An alternative, quite simple, way to handle the interpolation problem is to link the points with linear functions (segments). In order to avoid discontinuities in the velocity, the linear segments can be connected through parabolic bends

The resulting trajectory q(t) does not pass through any of the intermediate points, though it is close to them. In this case the intermediate points are called via points.

This picture is taken from the textbook:

B. Siciliano, L. Sciavicco, L. Villani, G. Oriolo: Robotics: Modelling, Planning and Control, 3rd Ed. Springer, 2009

Interpolation with linear segments

Page 82: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

If we use a sequence of trajectories with trapezoidal velocity profile to interpolate points, we would obtain a motion which passes through these points with zero velocity (i.e. stopping).To avoid this we can start the planning of a trajectory before the end of the preceding one:

This picture is taken from the textbook:B. Siciliano, L. Sciavicco, L. Villani, G. Oriolo: Robotics: Modelling, Planning and Control, 3rd Ed., Springer, 2009

TVP and interpolation of points

Page 83: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

Trajectory planning in the joint space yields unpredictable motions of the end-effector. When we want the motion to evolve along a predefined path in the operational space, it is necessary to plan the trajectory directly in this space.

Trajectory planning in the operational space entails both a path planning problem and a timing law planning problem: both the path and the timing law can be expressed analytically, as it will be shown in the following.

We will first address the trajectory planning for the position, and then we will concentrate on the orientation.

Trajectories in the operational space

Page 84: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

Let us consider a parametric representation of a curve in space. The parameterization can be performed with respect to the natural coordinate (length of the arc of trajectory): 𝐩𝐩 = 𝐩𝐩 𝑠𝑠

x

y

z

t

nb

ppi pf 𝐭𝐭 =𝑑𝑑𝐩𝐩 𝑠𝑠𝑑𝑑𝑠𝑠

𝐧𝐧 =⁄𝑑𝑑2𝐩𝐩 𝑠𝑠 𝑑𝑑𝑠𝑠2

⁄𝑑𝑑2𝐩𝐩 𝑠𝑠 𝑑𝑑𝑠𝑠2

𝐛𝐛 = 𝐭𝐭 × 𝐧𝐧

We can define the tangent, normal and binormal unit vectors:

unit tangent vector

unit normal vector (belongs to the osculating plane)

unit binormal vector

Path parameterization

Page 85: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

As an example of path parameterization we can consider a segment in space (linear Cartesian path):

𝐩𝐩 𝑠𝑠 = 𝐩𝐩𝑖𝑖 +𝑠𝑠

𝐩𝐩𝑓𝑓 − 𝐩𝐩𝑖𝑖𝐩𝐩𝑓𝑓 − 𝐩𝐩𝑖𝑖

𝑑𝑑𝐩𝐩𝑑𝑑𝑠𝑠 =

1𝐩𝐩𝑓𝑓 − 𝐩𝐩𝑖𝑖

𝐩𝐩𝑓𝑓 − 𝐩𝐩𝑖𝑖

𝑑𝑑2𝐩𝐩𝑑𝑑𝑠𝑠2 = 0

In this case it is not possible to define the frame (𝐭𝐭, 𝐧𝐧, 𝐛𝐛) uniquely.

pf

pi

Linear path

Page 86: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

A linear path is completely characterized once two points in Cartesian space are given.

Linear path

Page 87: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

Linear paths can be concatenated in order to obtain more elaborated paths.

The intermediate point between two consecutive segments can be considered as a via point, meaning that there is no need to pass and stop there.

During the over-fly, i.e. the passage near a via point, the path remains always in the plane specified by the two lines intersecting in the via point. This means that the problem of planning the over-fly is planar.

Formulas can be derived to define the blending (typically a parabolic one)

A

B

C

over-fly

Concatenation of linear paths

Page 88: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

A parametric representation of a circumference of radius 𝜌𝜌 laying in a plane 𝑥𝑥′𝑦𝑦′ and having the centre in the origin of such plane is:

𝐩𝐩′ 𝑠𝑠 =𝜌𝜌 cos ⁄𝑠𝑠 𝜌𝜌𝜌𝜌 sin ⁄𝑠𝑠 𝜌𝜌

0

Defining:

𝐜𝐜 the vector that identifies the centre of the circumference in the base frame 𝐑𝐑 the rotation matrix from base frame to frame 𝑥𝑥′𝑦𝑦′𝑧𝑧′

the general parametric representation of a circumference in space is:

𝐩𝐩 𝑠𝑠 = 𝐜𝐜 + 𝐑𝐑𝐩𝐩′ 𝑠𝑠

Circular path

Page 89: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

The circular path can also be defined assigning three points in space belonging to the same plane:

Circular path

Page 90: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

For the position trajectories, taking into account the parameterization of the path with respect to the natural coordinate 𝐩𝐩 = 𝐩𝐩 𝑠𝑠 , we will assign the timing law through the function 𝑠𝑠 𝑡𝑡 .

In order to determine function 𝑠𝑠 𝑡𝑡 we can use any of the timing laws (polynomials, harmonic, trapezoidal velocity profile, spline, etc.) already studied. Also we notice that:

tt0

ss0

px=px(s)py=py(s)pz=pz(s)

�̇�𝐩 = �̇�𝑠𝑑𝑑𝐩𝐩𝑑𝑑𝑠𝑠

= �̇�𝑠𝐭𝐭 �̇�𝑠 is then the norm of the velocity

For the segment: �̇�𝐩 =�̇�𝑠

𝐩𝐩𝑓𝑓 − 𝐩𝐩𝑖𝑖𝐩𝐩𝑓𝑓 − 𝐩𝐩𝑖𝑖 = �̇�𝑠𝐭𝐭

the time law 𝑠𝑠 𝑡𝑡takes then an immediate meaning!

Position trajectories

Page 91: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

For the orientation planning we might interpolate (e.g. linearly) the components of the unit vectors 𝐧𝐧 𝑡𝑡 , 𝐬𝐬 𝑡𝑡 and 𝐓𝐓 𝑡𝑡 .This procedure is however not advisable as the orthonormality of unit vectors cannot be guaranteed at all times.

An alternative way is to interpolate three Euler angles, using the following relations:

φ 𝑠𝑠 = φ𝑖𝑖 +𝑠𝑠

φ𝑓𝑓 − φ𝑖𝑖φ𝑓𝑓 − φ𝑖𝑖

φ̇ =�̇�𝑠

φ𝑓𝑓 − φ𝑖𝑖φ𝑓𝑓 − φ𝑖𝑖

φ̈ =�̈�𝑠

φ𝑓𝑓 − φ𝑖𝑖φ𝑓𝑓 − φ𝑖𝑖

We can use any timing law s(t) on the natural parameter.The angular velocity ω, which is linearly related to �̇�𝜑, has a continuous variation of the amplitude.

Poor predictability and understanding of the intermediate orientation!

Orientation trajectories

Page 92: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

Orientation can also be planned by resorting to the axis/angle representation: if we assign two frames with the same origin but different orientation, it is always possible to determine a unit vector 𝐫𝐫 such that the second frame is obtained from the first one through a rotation of an angle 𝜗𝜗𝑓𝑓 around the axis of such unit vector. Let 𝐑𝐑𝑖𝑖 and 𝐑𝐑𝑓𝑓 the rotation matrices, with respect to the base frame, of the initial frame and of the final frame. The rotation matrix between the two frames, with related axis/angle representation is thus:

𝐑𝐑𝑓𝑓𝑖𝑖 = 𝐑𝐑𝑖𝑖𝑇𝑇𝐑𝐑𝑓𝑓 =𝑟𝑟11 𝑟𝑟12 𝑟𝑟13𝑟𝑟21 𝑟𝑟22 𝑟𝑟23𝑟𝑟31 𝑟𝑟32 𝑟𝑟33

𝜗𝜗𝑓𝑓 = cos−1𝑟𝑟11 + 𝑟𝑟22 + 𝑟𝑟33 − 1

2

𝐫𝐫 =1

2 sin 𝜗𝜗𝑓𝑓

𝑟𝑟32 − 𝑟𝑟23𝑟𝑟13 − 𝑟𝑟31𝑟𝑟21 − 𝑟𝑟12

trace of matrix 𝐑𝐑

Orientation trajectories

Page 93: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

Define with 𝐑𝐑𝑖𝑖 𝑡𝑡 the matrix that describes the transition from 𝐑𝐑𝑖𝑖 to 𝐑𝐑𝑓𝑓.Then:

𝐑𝐑𝑖𝑖 0 = 𝐈𝐈, 𝐑𝐑𝑖𝑖 𝑡𝑡𝑓𝑓 = 𝐑𝐑𝑓𝑓𝑖𝑖

Matrix 𝐑𝐑𝑖𝑖 𝑡𝑡 can be interpreted as 𝐑𝐑𝑖𝑖 𝜗𝜗 𝑡𝑡 , 𝐫𝐫 , where:

𝐫𝐫 is constant and can be computed from the elements of 𝐑𝐑𝑓𝑓𝑖𝑖

𝜗𝜗 𝑡𝑡 can be made variable with time, through a timing law, with 𝜗𝜗 0 = 0, 𝜗𝜗 𝑡𝑡𝑓𝑓 = 𝜗𝜗𝑓𝑓In order to characterize the orientation in the base frame it is then enough to compute: 𝐑𝐑 𝑡𝑡 = 𝐑𝐑𝑖𝑖𝐑𝐑𝑖𝑖 𝑡𝑡

Orientation trajectories

𝐑𝐑𝑖𝑖

𝐑𝐑𝑓𝑓

𝐑𝐑𝑖𝑖

Page 94: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

Alternatively we can use unit quaternions to specify the orientation.They are defined as:

with:

where 𝜗𝜗 and 𝐫𝐫 have the same meaning as with the axis/angle representation, but the representation singularity has been removed:

𝜂𝜂2 + 𝜀𝜀𝑚𝑚2 + 𝜀𝜀𝑦𝑦2 + 𝜀𝜀𝑧𝑧2 = 1

Orientation trajectories

ℚ = 𝜂𝜂, 𝜺𝜺

𝜂𝜂 = cos𝜗𝜗2

𝜺𝜺 = sin𝜗𝜗2𝐫𝐫 𝜂𝜂 =

12

𝑟𝑟11 + 𝑟𝑟22 + 𝑟𝑟33 + 1

𝜺𝜺 =12

sgn 𝑟𝑟32 − 𝑟𝑟23 𝑟𝑟11 − 𝑟𝑟22 − 𝑟𝑟33 + 1sgn 𝑟𝑟13 − 𝑟𝑟31 𝑟𝑟22 − 𝑟𝑟33 − 𝑟𝑟11 + 1sgn 𝑟𝑟21 − 𝑟𝑟12 𝑟𝑟33 − 𝑟𝑟11 − 𝑟𝑟22 + 1

Page 95: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

InverseKinematicstarget

stateINSTRUCTION

STACK

TrajGen

Axiscontroller

state update

Instruction stack: list of instructions to be executed, specified using the proprietary programming language

Trajectory generation: converts an instruction into a trajectory to be executed Inverse kinematics: maps the trajectory from the Cartesian space to the joint space (if needed) Axis controllers & drives: closes the control loop ensuring tracking performance

Elements of a motion planning and control system

Page 96: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

Inverse kinematics has already been discussed with reference to the study of the kinematics of the (possibly redundant) manipulator.

J#(q)K ++−

rd +

rd.

In−J#(q)J(q)

q0.

++ q. q

f(q)r

Options are:

Closed form analytic solution (whenever possible)

Numerical solution through (pseudo) inverse of the Jacobian

Inverse kinematics

Page 97: Control of industrial robots Motion planning

Control of industrial robots – Motion planning – Paolo Rocco

InverseKinematicstarget

stateINSTRUCTION

STACK

TrajGen

Axiscontroller

state update

Instruction stack: list of instructions to be executed, specified using the proprietary programming language

Trajectory generation: converts an instruction into a trajectory to be executed Inverse kinematics: maps the trajectory from the Cartesian space to the joint space (if needed) Axis controllers & drives: closes the control loop ensuring tracking performance (see next set of

slides)

Elements of a motion planning and control system


Recommended