Control of industrial robots Motion planning

97
Control of industrial robots Motion planning Prof. Paolo Rocco ([email protected]) Politecnico di Milano, Dipartimento di Elettronica, Informazione e Bioingegneria

Transcript of Control of industrial robots Motion planning

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