You are on page 1of 65

Dynamic model of robot manipulators

Claudio Melchiorri
Dipartimento di Ingegneria dellEnergia Elettrica e dellInformazione (DEI)
Universit`
a di Bologna
email: claudio.melchiorri@unibo.it

C. Melchiorri (DEI)

Dynamic Model

1 / 65

Summary

Dynamic models
Introduction
Euler-Lagrange model

C. Melchiorri (DEI)

Dynamic Model

2 / 65

Dynamic models

Introduction

Dynamic model of manipulators


Robot Dynamics = Study of the relation between the applied forces/torques
and the resulting motion of an industrial manipulator.
Similarly to kinematics, also for the dynamics it is possible to define two models:
Direct model: once the forces/torques applied to the joints, as well as the
joint positions and velocities are known, compute the joint accelerations
= f (q, q,
)
q
and then
q =

dt,
q

q=

q dt

Inverse model: once the joint accelerations, velocities and positions are
known, compute the corresponding forces/torques
q) = g (
q)
= f 1 (
q, q,
q, q,
C. Melchiorri (DEI)

Dynamic Model

3 / 65

Dynamic models

Introduction

Dynamic model of manipulators


Normally, a manipulator is composed by an open kinematic chain, and its dynamic
model is affected by several drawbacks:
low rigidity (elasticity in the structure and in the joints)
potentially unknown parameters (dimensions, inertia, mass,. . . )
dynamic coupling among links.
Other non linear effects are usually introduced by the actuation system:
friction
dead zones
...

In any case, in the derivation of the dynamic model, an ideal case of a series of
connected rigid bodies is made.
C. Melchiorri (DEI)

Dynamic Model

4 / 65

Dynamic models

Introduction

Dynamic model of manipulators


Two problems may be defined for the study of the dynamic model:
(t) (and
Direct dynamic model: computation of the time evolution of q

then of q(t), q(t)),


given the vector of generalized forces (torques and/or
forces) (t) applied to the joints and, in case, the external forces applied to
= t0 ).
the end-effector, and the initial conditions q(t = t0 ), q(t
(t)

(t)
q

( q(t),
q(t) )

Inverse dynamic problem: computation of the vector (t) necessary to


(t), q(t),

obtain a desired trajectory q


q(t), once the forces applied of the
end-effector are known.
(t), q(t),

q
q(t)

C. Melchiorri (DEI)

Dynamic Model

(t)

5 / 65

Dynamic models

Introduction

Dynamic model of manipulators


There are several reasons for studying the dynamics of a manipulator:
simulation: test desired motions without resorting to real experimentation
analysis and synthesis of suitable control algorithms
analysis of the structural properties of the manipulator since the design phase.
Two approaches for the definition of the dynamic model:
EULER-LAGRANGE approach.
First approach to be developed. The dynamic model obtained in this manner is simpler and
more intuitive, and also more suitable to understand the effects of changes in the
mechanical parameters. The links are considered altogether, and the model is obtained
analytically. Drawbacks: the model is obtained starting from the kinetic and potential
energies (non intuitive); the model is not computationally efficient.

NEWTON-EULER approach.
Based on a computationally efficient recursive technique that exploits the serial structure of
an industrial manipulator. On the other hand, the mathematical model is not expressed in
closed form.

Obviously, the two techniques are equivalent (provide the same results).
C. Melchiorri (DEI)

Dynamic Model

6 / 65

Dynamic models

Euler-Lagrange model

Euler-Lagrange model
Generalized variables, or Lagrange coordinates:
Independent variables used to describe the position of rigid bodies in the space.
For the same physical system, more choices for the Lagrangian coordinates are
usually possible.

In robotics = joint variables q1 , q2 , . . . qn .


C. Melchiorri (DEI)

Dynamic Model

7 / 65

Dynamic models

Euler-Lagrange model

Euler-Lagrange model
From physics, we know that it is possible to define:
The Kinetic Energy function
The Potential Energy function
and therefore the Lagrangian function
1
2

K (q, q)

P(q)
L(q, q)
= K (q, q)
P(q)

The Euler-Lagrange equations are




L
L
d

i =
dt q i
qi

i = 1, . . . , n

being i the non-conservative (external or dissipative) generalized forces


performing work on qi . In robotics, we consider:
i
 T 
J Fc i
dii q i

Therefore:

joint actuator torque


term due to external (contact) forces
joint friction torque



i = i + JT Fc i dii q i .

C. Melchiorri (DEI)

Dynamic Model

8 / 65

Dynamic models

Euler-Lagrange model

Euler-Lagrange model
Since the potential energy does not depend on the velocity, the Euler-Lagrange
equations can be rewritten as


K
K
P
d

+
i = 1, . . . , n
(1)
i =
dt q i
qi
qi
This formulation is more convenient since in robotics it is possible to compute
quite easily the terms K and P from the geometric properties of the manipulator.
Then, by applying (1), the dynamic model is obtained.
Note that
K=

n
X

Ki

P=

i =1

C. Melchiorri (DEI)

n
X

Pi

i =1

Dynamic Model

9 / 65

Dynamic models

Euler-Lagrange model

Euler-Lagrange model
Computation of the Kinetic Energy. For a rigid body B:
The mass can be computed by
m=

(x, y , z) dx dy dz

where (x, y , z) is the mass density (assumed constant): (x, y , z) = .


The center of mass (CoM) is
Z
Z
1
1
p(x, y , z) dx dy dz =
p(x, y , z) dm
pC =
m B
m B
The kinetic energy results as
Z
1
vT (x, y , z)v(x, y , z) dx dy dz
K =
2 B
Z
1
=
vT (x, y , z)v(x, y , z) dm
2 B
C. Melchiorri (DEI)

Dynamic Model

10 / 65

Dynamic models

Euler-Lagrange model

Euler-Lagrange model

Let assume that vC and , i.e. the translational and rotational velocities of the
center of mass, are known with respect
to an inertial frame F0 .

The velocity of a generic point p of the body is


v = vC + (p pC ) = vC + r

(2)

The velocity expressed in a frame F fixed to the rigid body may be computed by
introducing the rotation matrix R betweeen F and F0
RT v = RT (vC + r) = RT vC + (RT ) (RT r)
Therefore
v = vC + r
C. Melchiorri (DEI)

Dynamic Model

11 / 65

Dynamic models

Euler-Lagrange model

Euler-Lagrange model
Since the product r in (2) can be expressed as S() r, we have:
Z
1
K =
vT (x, y , z)v(x, y , z) dm
2 B
Z
1
(vC + Sr)T (vC + Sr) dm
=
2 B
Z
Z
Z
1
1
T
T T
=
v vC dm +
r S Sr dm +
vCT Sr dm
2 B C
2 B
B
Z
Z
1
1
=
vCT vC dm +
rT ST Sr dm
2 B
2 B
R
R
As a matter of fact, from the definition of CoM ( B r dm = B (pC p)dm = 0):
Z
Z
vCT Sr dm = vCT S r dm = 0
B

C. Melchiorri (DEI)

Dynamic Model

12 / 65

Dynamic models

Euler-Lagrange model

Euler-Lagrange model
In conclusion

1
K =
2

vCT vC

1
dm +
2

rT ST Sr dm
B

The first term depends on the linear velocity vC of the center of mass
Z
1
1
vCT vC dm = m vCT vC
2 B
2
For the second term, considering that aT b = Tr (a bT ) and the particular
structure of matrix S, we have
Z
Z
Z
1
1
1
rT ST Sr dm =
Tr (Sr rT ST ) dm = Tr (S rrT dm ST )
2 B
2 B
2
B
1
1
T
T
=
Tr (S J S ) = I I : body inertia matrix
2
2
Also this term depends on the velocity of the center of mass (in this case ).
C. Melchiorri (DEI)

Dynamic Model

13 / 65

Dynamic models

Euler-Lagrange model

Euler-Lagrange model
Matrix J, Euler matrix, and matrix I, body inertia matrix, are symmetric, and have
the following general expressions:
R 2
R rx dm
J = R rx ry dm
rx rz dm
I

R
Rrx r2y dm
R ry dm
ry rz dm

(ryR2 + rz2 ) dm
R rx ry dm
rx rz dm

R rx rz dm

Rry 2rz dm
rz dm

R
R 2 rx ry2 dm
(rxR + rz ) dm
ry rz dm

R rx rz dm

R 2 ry rz2 dm
(rx + ry ) dm

The elements of both matrices J ed I depend on vector r, i.e. on the position of


the generic point of the i-th link with respect to its center of mass, defined in the
base frame.
Since the position of the i-th link depends on the configuration of the
manipulator, matrices J and I are in general functions of the joint variables q!
C. Melchiorri (DEI)

Dynamic Model

14 / 65

Dynamic models

Euler-Lagrange model

Examples of body inertia matrices


Homogeneous bodies of mass m, with axes of symmetry.
Parallelepiped with sides a (length/height), b, c (base)

Ixx

I =

Iyy
Izz

1
m(b2
12

+ c2)
1
m(a2
12

c2)
1
m(a2
12

+ b2 )

Empty cylinder with length h, and external/internal radii a, b


1

Izz = Iyy
m(a2 + b2 )
 2
2


1
2
2
2

Izz
= Izz + m h2
I =
,
m
3(a
+
b
)
+
h
12
Izz
single axis translation theorem
y0
c

y0

h/2

b
x0

x0
z0

z0

z0

Steiner theorem:
changes of body inertia due
to translation p of the frame
of computation:
I = Ic + m(pT p E33 ppT )
Ic body inertia matrix wrt the
center of mass
E33 (3 3) identity matrix

C. Melchiorri (DEI)

Dynamic Model

15 / 65

Dynamic models

Euler-Lagrange model

Euler-Lagrange model
In conclusion, the kinetic energy of a rigid body is defined as (Konig Theorem)
K =

1
1
m vCT vC + T I
2
2

(3)

Both terms depend only on the velocity of the rigid body.


The first term, being related to the magnitude of a vector (kvC k = vCT vC ), is invariant with
respect to the reference frame used to express the velocity:
vCT vC = (RvC )T (RvC ) = vCT (RT R)vC ,

T I

This property holds also for the second term: the product
is invariant with respect to the
reference frame. As a matter of fact, the body inertia matrix is transformed according to the
following relation:
I = R I R T
Then:

T I = T I = (R )T (RIRT )(R) = T (RT R)I(RT R).

Therefore, being (3) invariant with respect to the reference frame, F can be chosen in order to
simplify the computations required for the evaluation of K .

C. Melchiorri (DEI)

Dynamic Model

16 / 65

Dynamic models

Euler-Lagrange model

Euler-Lagrange model
Since the kinetic energy Ki of the generic i-th link is invariant with respect to the
reference frame (used to express vC , , I), it is convenient to chose a frame
Fi fixed to the link itself, with origin in the center of mass.
In this manner matrix I is constant and simple to be computed on the basis of the
geometric properties of the link.
On the other hand, normally the rotational velocity is defined in the base frame
F0 , and therefore it is needed to transform it according to RT , being R the
rotation matrix between Fi and F0 (known from the kinematic model of the
manipulator).

C. Melchiorri (DEI)

Dynamic Model

17 / 65

Dynamic models

Euler-Lagrange model

Euler-Lagrange model
In conclusion, the kinetic energy of a manipulator can be determined when, for
each link, the following quantities are known:
the link mass mi ;
the inertia matrix Ii , computed wrt a frame Fi fixed to the center of mass in
which it has a constant expression Ii ;
the linear velocity vCi of the center of mass, and the rotational velocity i of
the link (both expressed in F0 );
the rotation matrix Ri between the frame fixed to the link and F0 .
The kinetic energy Ki of the i-th link has the form:
1
1
T
mi vCi
vCi + iT Ri Ii RT
i i
2
2
It is now necessary to compute the linear and rotational velocities (vCi and i ) as
functions of the Lagrangian coordinates (i.e. the joint variables q).
Ki =

C. Melchiorri (DEI)

Dynamic Model

18 / 65

Dynamic models

Euler-Lagrange model

Euler-Lagrange model
The end-effector velocity may be computed as a function of the joint velocities q 1 , . . . , q n
through the Jacobian matrix J. The same methodology can be used to compute the
velocity of a generic point of the manipulator, and in particular the velocity vCi = p Ci of
the center of mass pCi , that results function of the joint velocities q 1 , . . . , q i only:
p Ci

Jiv1 q 1 + Jiv2 q 2 + . . . + Jivi q i = Jiv q

Ji1 q 1 + Ji2 q 2 + . . . + Jii q i = Ji q

where
Jiv

Ji

with

Jiv1

...

Jivi

...

Ji1

...

Jii

...


Jivj
i

 Jj
Jivj
Jij


=
=

zj1 (pCi pj1 )



 zj1
zj1
0

rotational joint
linear joint

being pj1 the position of the origin of the frame associated to the j-th link.
C. Melchiorri (DEI)

Dynamic Model

19 / 65

Dynamic models

Euler-Lagrange model

Euler-Lagrange model
In conclusion, for a n dof manipulator we have:
n

1X
1X T T
T
mi vCi
vCi +
i Ri Ii Ri
2
2
i =1

=
=
=

1 T
q
2

i =1

n h
X
i =1

i
i

mi Jiv T (q)Jiv (q) + Ji T (q)Ri Ii RT


i J (q) q

1 T
q M(q)q
2
n
n
1 XX
Mij (q)q i q j
2
i =1 j=1

where M(q) is a n n, symmetric and positive definite matrix, function of the


manipulator configuration q.
Matrix M(q) is called the Inertia Matrix of the manipulator.
C. Melchiorri (DEI)

Dynamic Model

20 / 65

Dynamic models

Euler-Lagrange model

Euler-Lagrange model
Computation of the Potential Energy. For rigid bodies, the only potential
energy taken into account in the dynamics is due to the gravitational field g. For
the generic i-th link
Z
Z
p dm = gT pCi mi
gT p dm = gT
Pi =
Li

Li

and may be
The potential energy does not depend on the joint velocities q,
expressed as a function of the position of the centers of mass. For the whole
manipulator:
P=

n
X

gT pCi mi

i =1

In case of flexible link, one should consider also terms due to elastic forces.
K e P are computed (once mi and I are known) with a procedure similar to the one
adopted for the forward kinematic model:
K matrices Ji e Ri ,
C. Melchiorri (DEI)

P pCi position of the centers of mass


Dynamic Model

21 / 65

Dynamic models

Euler-Lagrange model

Euler-Lagrange model
Once K and P are known, it is possible to compute the dynamic model of the
manipulator. The dynamics is expressed by
k =

d
dt

L
q k

The Lagrangian function is

L=K P =

Then

L
qk

k = 1, . . . , n

n
n
n
X
1 XX
gT pCi mi
Mij q i q j
2 i =1 j=1
i =1
n

X
L
K
Mkj q j
=
=
q k
q k
j=1

and
d L
dt q k

Moreover
C. Melchiorri (DEI)

n
X
j=1

Mkj q
j +

n
n X
n
n
X
X
X
d Mkj
Mkj
Mkj q
j +
q i q j
q j =
dt
qi
j=1
i =1 j=1
j=1

n
n
L
1 X X Mij
P
=
q i q j
qk
2 i =1 j=1 qk
qk
Dynamic Model

22 / 65

Dynamic models

Euler-Lagrange model

Euler-Lagrange model
The Lagrangian equations have the following formulation
n
X

Mkj q
j +

n X
n 
X
Mkj
i =1 j=1

j=1

qi


1 Mij
P
q i q j +
= k
2 qk
qk

k = 1, . . . , n

By defining the term hkji (q) as


hkji (q) =

1 Mij (q)
Mkj (q)

qi
2 qk

and gk (q) as
gk (q) =

P(q)
qk

the following equations are finally obtained


n
X

Mkj (q)
qj +

j=1

C. Melchiorri (DEI)

n X
n
X

hkji (q)q i q j + gk (q) = k

k = 1, . . . , n

i =1 j=1

Dynamic Model

23 / 65

Dynamic models

Euler-Lagrange model

Euler-Lagrange model
The elements Mkj (q), hijk (q), gk (q) are function of the joint position only, and
therefore their computation is relatively simple once the manipulators configuration is
known. They have the following physical meaning:
For the acceleration terms:
Mkk is the moment of inertia about the k-th joint axis, in a given configuration and
considering blocked all the other joints
Mkj is the inertia coupling, accounting the effect of acceleration of joint j on joint k
For the quadratic velocity terms:
hkjj q j2 represents the centrifugal effect induced on joint k by the velocity of joint j
kk
(notice that hkkk = M
= 0)
q
k

hkji q i q j represents the Coriolis effect induced on joint k by the velocities of joints i
and j
For the configuration-dependent terms:
gk represents the torque generated on joint k by the gravity force acting on the
manipulator in the current configuration.
C. Melchiorri (DEI)

Dynamic Model

24 / 65

Dynamic models

Euler-Lagrange model

Euler-Lagrange model
Recalling that the non-conservative forces k are in general composed by
k
 T 
J Fc k

dkk q k

joint actuator torque


external (contact) forces
joint friction torque

the Lagrangian equations


n
X

Mkj (q)
qj +

n X
n
X

hkji (q)q i q j + gk (q) = k

k = 1, . . . , n

i =1 j=1

j=1

can be written in matrix form as


q + Dq + g(q) = + JT (q)Fc
M(q)
q + C(q, q)
This matrix equation is known as the dynamic model of the manipulator.

C. Melchiorri (DEI)

Dynamic Model

25 / 65

Dynamic models

Euler-Lagrange model

Euler-Lagrange model - Some considerations


P P
q = ni=1 nj=1 hkji (q)q i q j is a (n 1) vector v whose
The product C(q, q)
elements are quadratic functions of the joint velocities q j .
The k-th element vk of this vector is:
vk =

n
X

Ckj q j

j=1

where the elements Ckj are computed as


Ckj =

n
X

cijk q i

i =1

with
cijk



Mki
Mij
1 Mkj
+

=
2 qi
qj
qk

C. Melchiorri (DEI)

Dynamic Model

Christoffel Symbols

(4)

26 / 65

Dynamic models

Euler-Lagrange model

Euler-Lagrange model - Some considerations


are computed as follows. From
The elements of matrix C(q, q)

n
n
n X
n 
XX
X
1 Mij
Mkj
q i q j

hkji q i q j =
qi
2 qk
i =1 j=1
i =1 j=1
by exchanging the sum (i, j) and exploiting the symmetry one obtains

n
n 
n X
n
X
Mkj
1 X X Mkj
Mki
+
=
qi
2 i =1 j=1 qi
qj
i =1 j=1
and then
n X
n 
X
Mkj
qi

i =1 j=1

where cijk =

1
2

Mkj
qi

 X

n X
n X
n
n
X
Mki
Mij
1 Mkj
cijk
+

=
2 qi
qj
qk
i =1 j=1
i =1 j=1
i
M
qkij
are the so-called Christoffel Symbols.

1 Mij
2 qk

Mki
qj

Since matrix M(q) is symmetric, for a given k then cijk = cjik .

The elements of matrix C(q, q)are


then computed as
n
X
k,j =
[C(q, q)]
cijk q i

(5)

i =1

C. Melchiorri (DEI)

Dynamic Model

27 / 65

Dynamic models

Euler-Lagrange model

Euler-Lagrange model - Some considerations


In general, any matrix
This is not the only possible expression for matrix C(q, q).
such that
n
n X
n
X
X
cij q j =
hijk q k q j
j=1

j=1 k=1

can be considered. The choice (4) is preferred since in this case the following
property is verified.
defined as
Property. Matrix N(q, q),

= M(q,
2C(q, q)

N(q, q)
q)

(6)

are defined as
in which the elements of C(q, q)
cijk



1 Mkj
Mki
Mij
=
+

2 qi
qj
qk

results skew-symmetric, i.e.


C. Melchiorri (DEI)

k,j =
[C(q, q)]

n
X

cijk q i

i =1

nkj = njk , nkk = 0.


Dynamic Model

28 / 65

Dynamic models

Euler-Lagrange model

Euler-Lagrange model - Some considerations


In fact, by considering the generic element nkj , one obtains
nkj

d Mkj
2[C]kj
dt


n
X Mkj
Mkj
Mki
Mij
(
+

) q i
=
qi
qi
qj
qk
i =1


n
X
Mij
Mki
=
q i

qk
qj

i =1

from which it follows (if indices k and j are exchanged, because of the symmetry
of M(q)) that nkj = njk .
Since matrix N is skew-symmetrix, then
x = 0,
xT N(q, q)

C. Melchiorri (DEI)

Dynamic Model

29 / 65

Dynamic models

Euler-Lagrange model

Euler-Lagrange model - Some considerations


The condition
x = 0,
xT N(q, q)

is skew-symmetric, due to the particular choice of the elements of


holds since N(q, q)
On the other hand, the condition
matrix C(q, q).
q = 0
q T N(q, q)
(from the energy conservation principle).
holds for any choice of matrix C(q, q)
The evolution over time of the kinetic energy K must be equal to the work generated by
the forces acting at joints:

d K
1d  T
q Mq = q T ( Dq g(q) JT F)
=
dt
2 dt
The first element is (from the dynamic model

M
q = Cq Dq g(q) + JT F):


1d  T
1
1
q + q T M
q Mq = q T M
q = q T Mq + q T (Cq Dq g(q) + JT F)
2 dt
2
2
C. Melchiorri (DEI)

Dynamic Model

30 / 65

Dynamic models

Euler-Lagrange model

Euler-Lagrange model - Some considerations


Then
1 T
q Mq + q T (Cq Dq g(q) + JT F) = q T ( Dq g(q) JT F)
2
from which
1 T
q Mq = q T Cq
2

2C)q = 0
q T (M

q) (it holds
This equation holds q and without any assumption on matrix C(q,
also if C is not based on the Cristoffel symbols).

C. Melchiorri (DEI)

Dynamic Model

31 / 65

Dynamic models

Euler-Lagrange model

Euler-Lagrange model - Some considerations


In deriving the dynamic model, the actuation system has not been taken into
account. This is normally composed by:
motors
reduction gears
trasmission system.
The actuation system has several effects on the dynamics:
if motors are installed on the links, then masses and inertia are changed
it introduces its own dynamics (electromechanical, pneumatic, hydraulic, ...)
that may be non negligible (e.g. in case of lightweight manipulators)
it introduces additional nonlinear effects such as backslash, friction, elasticity,
...
Notice that these effects could be considered by introducing suitable terms in the
dynamic model derived on the basis of the Euler-Lagrangian formulation.
C. Melchiorri (DEI)

Dynamic Model

32 / 65

Dynamic models

Euler-Lagrange model

Example - 1
Dynamic model of a pendulum (one dof manipulator).
Consider
joint variable,
joint torque,
m mass,
L distance between center of mass and joint,
d viscous friction coefficient,
I inertia seen at the rotation axis.

Kinetic energy:

K = 12 I 2

Potenzial energy:

P = mgL(1 cos )

Lagrangian function L:

L = 12 I 2 mgL(1 cos )

C. Melchiorri (DEI)

Dynamic Model

33 / 65

Dynamic models

Euler-Lagrange model

Example - 1
Lagrangian function:

L = 12 I 2 mgL(1 cos )

from which
L

= I ,

d L

= I ,
dt

L
= mgL sin

The generalized Lagrangian force in this case must account for the torque applied
to the joint and for the friction effect:
= d
From the general expression
d
=
dt

we have the following second order differential equation


I + d + mgL sin =
C. Melchiorri (DEI)

Dynamic Model

34 / 65

Dynamic models

Euler-Lagrange model

Example - 2
Dynamic model of a 2 dof manipulator. Consider:
i i-th joint variable;
mi i-th link mass ;
Ii i-th link inertia, about an axis through
the CoM and parallel to z;
ai i-th link length;
aCi distance between joint i and the CoM
of the i-th link;
i torque on joint i;
g gravity force along y;
Pi , Ki potential and kinetic energy of the
i-th link.
The dynamic equations will be obtained in two manners:
a) with the classic approach, deriving the Lagrangian function (based on the kinetic
and potential energy K , P)
b) exploiting the particular structure of a manipulator (Jacobian, ...).
C. Melchiorri (DEI)

Dynamic Model

35 / 65

Dynamic models

Euler-Lagrange model

Example - 2 (classic approach)


We chose as generalized coordinates the joint variables q1 = 1 ; q2 = 2 . The
kinetic and potential energies Ki and Pi are:
link 1:
K1 =

2
2
1
1
m1 aC2 1 1 + I1 1 ,
2
2

P1 = m1 gaC 1 S1

link 2: in this case, the position and velocity of the CoM are

pC 2x
p
C 2y

a1 C1 + aC 2 C12

a1 S1 + aC 2 S12

p C 2x

then

K2 =

p C 2y

1
1
m2 p TC 2 p C 2 + I2 (1 + 2 )2 ,
2
2

where

C. Melchiorri (DEI)

a1 S1 1 aC 2 S12 (1 + 2 )

a1 C1 1 + aC 2 C12 (1 + 2 )

P2 = m2 g (a1 S1 + aC 2 S12 )

2
p TC 2 p C 2 = a12 1 + aC2 2 (1 + 2 )2 + 2a1 aC 2 C2 (12 + 1 2 )

Dynamic Model

36 / 65

Dynamic models

Euler-Lagrange model

Example - 2 (classic approach)


Therefore, L = K1 + K2 P1 P2
1

and

[m1 aC2 1 + I1 + m2 (a12 + aC2 2 + 2a1 aC 2 C2 ) + I2 ]1 +


+[m2 (aC2 2 + a1 aC 2 C2 ) + I2 ]2 m2 a1 aC 2 S2 (21 2 + 22 ) +
+m1 gaC 1 C1 + m2 g (a1 C1 + aC 2 C12 )

[m2 (aC2 2 + a1 aC 2 C2 ) + I2 ]1 + (m2 aC2 2 + I2 )2 +


m2 a1 aC 2 S2 12 + m2 gaC 2 C12

C. Melchiorri (DEI)

Dynamic Model

37 / 65

Dynamic models

Euler-Lagrange model

Example - 2 (robotics approach)


The structural properties of the manipulator are exploited for the computation of
the kinematic and potential energies. For the computation of the velocities of the
CoM, one obtains:

aC 1 S1 0
a1 S1 aC 2 S12 aC 2 S12
aC 2 C12
J1v = aC 1 C1 0
J2v = a1 C1 + aC 2 C12
0
0
0
0
and

0 0
J1 = 0 0
1 0

0 0
J2 = 0 0
1 1

In this particular case, the frames associated to link 1 and 2 have z axes parallel to
the same axis of F0 , and therefore it is not necessary to consider the rotation
matrices R1 , R2 ( = z ).
C. Melchiorri (DEI)

Dynamic Model

38 / 65

Dynamic models

Euler-Lagrange model

Example - 2 (robotics approach)


The kinetic energy is computed as
K =

i
1 Th
q m1 J1v T J1v + m2 J2v T J2v + J1 T I1 J1 + J2 T I2 J2 q
2

being
J1 T I1 J1

J1 T I2 J2

I1 + I2
I2

I2
I2

The elements of the inertia matrix M(q) are


M11

= m1 aC2 1 + m2 (a12 + aC2 2 + 2a1 aC 2 C2 ) + I1 + I2

M12

= m2 (aC2 2 + a1 aC 2 C2 ) + I2

M22

= m2 aC2 2 + I2

C. Melchiorri (DEI)

Dynamic Model

39 / 65

Dynamic models

Euler-Lagrange model

Example - 2 (robotics approach)


From

M11

M12

M22

The Christoffel symbols


c111

c121

c221

c112

c122

c222

m1 aC2 1 + m2 (a12 + aC2 2 + 2a1 aC 2 C2 ) + I1 + I2


m2 (aC2 2 + a1 aC 2 C2 ) + I2
m2 aC2 2 + I2
h
M
cijk = 21 qkji +

Mki
qj

1 M11
=0
2 q1
1 M11
= m2 a1 aC 2 S2 = h
c211 =
2 q2
M12
1 M22

=h
q2
2 q1
1 M11
M21

= h
q1
2 q2
M22
=0
c212 =
q1
M22
=0
q2

C. Melchiorri (DEI)

Dynamic Model

Mij
qk

are

is
= Matrix C(q, q)

=
C(q, q)

h2
h1

h(1 + 2 )
0


40 / 65

Dynamic models

Euler-Lagrange model

Example - 2 (robotics approach)


Matrix N(q) is
N(q) =

M(q)
2C(q, q)

2h2
h2

h2
0

0
2h1 + h2

h2
h1

2h1 h2
0

h(1 + 2 )
0

As expected, it results skew-symmetric.

C. Melchiorri (DEI)

Dynamic Model

41 / 65

Dynamic models

Euler-Lagrange model

Example - 2 (robotics approach)


For the potential energy, we have:
P1
P2

=
=

m1 gaC 1 S1
m2 g (a1 S1 + aC 2 S12 )

Then
P

= P1 + P2 = (m1 aC 1 + m2 a1 )gS1 + m2 gaC 2 S12

g1

P
= (m1 aC 1 + m2 a1 )gC1 + m2 gaC 2 C12
1

g2

P
= m2 gaC 2 C12
2

C. Melchiorri (DEI)

Dynamic Model

42 / 65

Dynamic models

Euler-Lagrange model

Example - 2 (robotics approach)


q + Dq + g(q) = we have
Summarizing, from M(q)
q + C(q, q)
M11 1 + M12 2 + c121 1 2 + c211 2 1 + c221 22 + g1

M21 1 + M22 2 + c112 12 + g2

or
[m1 aC2 1 + m2 (a12 + aC2 2 + 2a1 aC 2 C2 ) + I1 + I2 ]1 + [m2 (aC2 2 + a1 aC 2 C2 ) + I2 ]2
m2 a1 aC 2 S2 22 2m2 a1 aC 2 S2 1 2
+(m1 aC 1 + m2 a1 )gC1 + m2 gaC 2 C12

[m2 (aC2 2 + a1 aC 2 C2 ) + I2 ]1 + [m2 aC2 2 + I2 ]2


+m2 a1 aC 2 S2 12
+m2 gaC 2 C12

=
C. Melchiorri (DEI)

Same result!
Dynamic Model

43 / 65

Dynamic models

Euler-Lagrange model

Properties of the Euler-Lagrangian dynamic model


The Euler-Lagrange dynamic model is characterized by some structural properties,
concerning in particular:
1
2
3
4

The inertia matrix M(q);


= C(q, q)q;

The vector c(q, q)

The vectors g(q) and D q;


Linearity with respect to the geometric/mechanical parameters.

C. Melchiorri (DEI)

Dynamic Model

44 / 65

Dynamic models

Euler-Lagrange model

Properties of the Euler-Lagrangian dynamic model


1. Properties of matrix M(q)
1
M(q) IRnn is symmetric, positive definite and depends on the manipulator
configuration q
2
M(q) is upper and lower bounded:
1 I M(q) 2 I
that is
xT (M(q) 1 I)x 0
3

5
6

xT (2 I M(q))x 0

also M1 (q) is bounded


1
1
I M1 (q)
I
2
1
in case of revolute joints, then 1 , 2 are constant (not function of q) since the
elements of M(q) are functions of sin(qi ) or cos(qi )
in case of prismatic joints, 1 , 2 may result scalar functions of q
since M(q) is bounded, then
M1 ||M(q)|| M2
for some properly defined norm (1, 2, p, )
C. Melchiorri (DEI)

Dynamic Model

45 / 65

Dynamic models

Euler-Lagrange model

Properties of the Euler-Lagrangian dynamic model


= C(q, q)
q
2. Properties of vector c(q, q)
1
q is a quadratic function of q
C(q, q)
2
= C(q, q)
q can also be witten as
the generic k-th element of vector c(q, q)

ck (q, q)
Sk (q)
3

5
6

q T Sk (q)q

1
2

mk
+
q

mk
q

T

qk

mk = k-th col. of M

it results that

q||
vb ||q||
2
||C(q, q)
in case of rotative joints, then vb is constant (not function of q) since we have only
transcendental functions (sin(qi ) or cos(qi ))
in case of prismatic joints, then vb may result a scalar function of q

then matrix N(q, q)


= M(q,
2C(q, q)
verifies:
for any choice of C(q, q),
q)
q = 0
q T N(q, q)

(Christoffel symbols), matrix


with a proper choice of the elements of C(q, q)

= M(q,
2C(q, q)
is skew-symmetric, i.e.
N(q, q)
q)
=0
xT N(q, q)x
C. Melchiorri (DEI)

Dynamic Model

x
46 / 65

Dynamic models

Euler-Lagrange model

Properties of the Euler-Lagrangian dynamic model


3. Properties of vectors g(q) and Dq
1

the friction term Dq is bounded:


dmax ||q||

||Dq||

the gravity term g(q) is bounded


||g(q)|| gb (q)

in case of revolute joints, gb is constant (does not depend on q) since qi depends


on sinusoidal functions (sin(qi ) or cos(qi ))

in case of prismatic joints, then gb may result function of q.

C. Melchiorri (DEI)

Dynamic Model

47 / 65

Dynamic models

Euler-Lagrange model

Properties of the Euler-Lagrangian dynamic model


4. Linearity properties (in the geometrical/mechanical parameters)
The dynamic model of a manipulator:
q
and with dynamic coupling effects
in general is a non linear function of q, q,
among the joints,
is a linear function of the geometrical/mechanical parameters of the links (i.e.
masses, inertia, friction, ...)
q + Dq + g(q) =
M(q)
q + C(q, q)
q
) =
Y(q, q,

C. Melchiorri (DEI)

Dynamic Model

48 / 65

Dynamic models

Euler-Lagrange model

Example

Properties of the dynamic model of a


2 dof manipulator.

Neglecting friction effects we have:



m1 aC2 1 + m2 (a12 + aC2 2 + 2a1 aC 2 C2 ) + I1 + I2
M(q) =
m2 (aC2 2 + a1 aC 2 C2 ) + I2
q = m2 a1 aC 2 S2
C(q, q)

21 2 + 22
12

g(q) =

m2 (aC2 2 + a1 aC 2 C2 ) + I2
m2 aC2 2 + I2

(m1 aC 1 + m2 a1 )gC1 + m2 gaC 2 C12


m2 gaC 2 C12

Consider (for the sake of simplicity) the 1-norm || ||1 , and 1 , 2 [/2, /2].
C. Melchiorri (DEI)

Dynamic Model

49 / 65

Dynamic models

Euler-Lagrange model

Example
1. Bounds on the inertia matrix.
The scalar quantities 1 , 2 can be defined as the minimum and maximum
eigenvalues (min , max ) of M(q), q. Computationally, it is easier to define the
scalars M1 , M2 .
The 1norm of M(q) is alway defined on the basis of the first column:
||M(q)||1 = |m1 aC2 1 + m2 (a12 + aC2 2 + 2a1 aC 2 C2 ) + I1 + I2 | + |m2 (aC2 2 + a1 aC 2 C2 ) + I2 |
which is bounded by
M1

= m1 aC2 1 + m2 (a12 + 2aC2 2 ) + I1 + 2I2

M2

= m1 aC2 1 + m2 (a12 + 2aC2 2 + 3a1 aC 2 ) + I1 + 2I2

C. Melchiorri (DEI)

Dynamic Model

50 / 65

Dynamic models

Euler-Lagrange model

Example
q
2. Bounds on vector C(q, q)
It results that
q||
1
||C(q, q)

= |m2 a1 aC 2 S2 (21 2 + 22 )| + |m2 a1 aC 2 S2 12 |


m2 a1 aC 2 |21 2 + 22 + 12 |
m2 a1 aC 2 (|1 | + |2 |)2
2
= vb ||q||

= M(q,
2C(q, q),

Moreover N(q, q)
q)
(h = m2 a1 aC 2 S2 ):
N(q)

=
=

=
C. Melchiorri (DEI)

M(q)
2C(q, q)



2h2 h2
h2

2
h1
h2
0


0
2h1 + h2

2h1 h2
0

Dynamic Model

h(1 + 2 )
0


51 / 65

Dynamic models

Euler-Lagrange model

Example
3. Bounds on the gravity vector g(q)
||g(q)||1

|(m1 aC 1 + m2 a1 )gC1 + m2 gaC 2 C12 | + |m2 gaC 2 C12 |

(m1 aC 1 + m2 a1 )g + 2m2 gaC 2

gb

Notice that if one of the joints is prismatic (and therefore ai , aCi may vary in
time), then vb , gb are functions of q.

C. Melchiorri (DEI)

Dynamic Model

52 / 65

Dynamic models

Euler-Lagrange model

Example
Plots of the eigenvalues of M(q) for the 2 dof planar manipulator
Andamento autovalori minimo e massimo di M(q)

180
160
lmax = 161.2601

140
120

min = 6.2399

100
80
60
40

lmin = 6.2399

max = 161.2601

20
0
400
350

300
300
250

200

200
150

100

100
0

q2 [deg]

50
0

q1 [deg]

In this case, the eigenvalues depend only on q2 ! These results have been obtained
with:
m1 = m2 = 50kg ;

I1 = I2 = 10;

a1 = a2 = 1;

ac1 = ac2 = 0.5

One obtains
M1 = 117, 5,

M2 = 192.5

C. Melchiorri (DEI)

kMk1 = 192.5,
Dynamic Model

kMk2 = 161.26,

kMk = 192.5
53 / 65

Dynamic models

Euler-Lagrange model

Example
3. Linearity of the dynamic model

q
) =
Y(q, q,

[m1 aC2 1 + m2 (a12 + aC2 2 + 2a1 aC 2 C2 ) + I1 + I2 ]1 + [m2 (aC2 2 + a1 aC2 2 C2 ) + I2 ]2


m2 a1 aC 2 S2 22 2m2 a1 aC 2 S2 1 2
+(m1 aC 1 + m2 a1 )gC1 + m2 gaC 2 C12

[m2 (aC2 2 + a1 aC 2 C2 ) + I2 ]1 + [m2 aC2 2 + I2 ]2


+m2 a1 aC 2 S2 12
+m2 gaC 2 C12

By inspection, one can define the parameters vector


= [1 , 2 , 3 , 4 , 5 ]T
with
1 = m1 aC 1 ,

2 = m1 aC2 1 + I1 ,

C. Melchiorri (DEI)

3 = m2 ,

Dynamic Model

4 = m2 aC 2 ,

5 = m2 aC2 2 + I2

54 / 65

Dynamic models

Euler-Lagrange model

Example
Then
q
) =
Y(q, q,

with
y11

y12

y13

y14

y15

y24

y25

y11
0

y12
0

y13
0

y14
y24

y15
y25

gC1
1
a12 1 + a1 gC1
2a1 C2 1 + a1 C2 2 2a1 S2 1 2 a1 S2 12 + gC12
1 + 2
a1 C2 1 + a1 S2 12 + gC12
1 + 2

q
, g and on a1 .
The elements yij depend on q, q,

C. Melchiorri (DEI)

Dynamic Model

55 / 65

Dynamic models

Euler-Lagrange model

Example
Identification of the dynamic parameters
From:
q
) =
Y(q, q,
by measuring along a proper trajectory the quantities

Being

q
,
q, q,

0 = Y0

Y0T 0 = Y0T Y0
= (Y0T Y0 )1 Y0T 0 = Y0+ 0

Y0+ = (Y0T Y0 )1 Y0T

one obtains:

the (left) pseudo-inverse of Y0 .

Note that some of the parameters may result non identifiable!

C. Melchiorri (DEI)

Dynamic Model

56 / 65

Dynamic models

Euler-Lagrange model

A Simulink dynamic model


sc_d2dof.m

Mux

tau
Mux

Coppie

Mux1

Demux

MATLAB
Function
dir2yn

Demux
Demux2

1/s
dq1

1/s
q1

1/s
dq2

1/s
q2

q
Mux

Mux
Mux3

Disturbo

Mux
Mux2

tau
Tau

Clock

Inizializzazione con
esed2dof.m

dq

q
Posizioni

dq
Velocita`

ddq
ddq
Accelerazioni

t
Tempo

The model takes into account the dynamics of a planar 2 dof arm, with gravity (arm in a
vertical plane). The dynamic model, described by the Matlab block
dir2dyn.m
is obtained with the Euler-Lagrange approach:
q + Dq + g(q) = + JT (q)Fa
M(q)
q + C(q, q)
C. Melchiorri (DEI)

Dynamic Model

57 / 65

Dynamic models

Euler-Lagrange model

Dynamic model in Simulink


The elements of the inertia matrix M(q) are
M11

= m1 aC2 1 + m2 (a12 + aC2 2 + 2a1 aC 2 C2 ) + I1 + I2

M12

= m2 (aC2 2 + a1 aC 2 C2 ) + I2

M22

= m2 aC2 2 + I2

is
Matrix C(q, q)

h2
=
C(q, q)
h1

h(1 + 2 )
0

h = m2 a1 aC 2 S2

The terms in the gravity vector are:

C. Melchiorri (DEI)

g1

= (m1 aC 1 + m2 a1 )gC1 + m2 gaC 2 C12

g2

= m2 gaC 2 C12
Dynamic Model

58 / 65

Dynamic models

Euler-Lagrange model

Dynamic model in Simulink


function ddq = dir2dyn(u);
% function ddq = dir2dyn(q,dq,tau,tauint);
% Dynamic model of a planar 2 dof manipulator
% Input:
%
dq -->> joint velocity vector
%
q -->> joint position vector
%
tau -->> joint torques
%
tauint -->> interaction forces
% Output:
%
ddq -->> joint acceleration vector
global I1z I2z
q1 = u(1);
dq = u(3:4);
tau = u(5:6);

m1 m2

g D

q2 = u(2);
dq1 = u(3);
dq2 = u(4);
tauint = u(7:8);

% Kinematic functions
s1 = sin(q1);
s2
c1 = cos(q1);
c2
C. Melchiorri (DEI)

L1 L2 Lg1 Lg2

= sin(q2);
= cos(q2);

s12 = sin(q1+q2);
c12 = cos(q1+q2);

Dynamic Model

59 / 65

Dynamic models

Euler-Lagrange model

Dynamic model in Simulink


%%%%% Elements of the Inertia Matrix M
M11 = I1z+I2z+Lg1^2*m1+m2*(L1^2+Lg2^2+2*L1*Lg2*c2);
M12 = I2z+m2*(Lg2^2+L1*Lg2*c2);
M22 = I2z+Lg2^2*m2;
M = [M11, M12; M12, M22];
%%%%% Coriolis and centrifugal elements
C11 = -(L1*dq2*s2*(Lg2*m2));
C12 = -(L1*dq12*s2*(Lg2*m2));
C21 = m2*L1*Lg2*s2*dq1;
C22 = 0;
C = [C11 C12; C21 C22];
%%%%% Gravity :
g1 = m1*Lg1*c1+m2*(Lg2*c12 + L1*c1);
G = g*[g1; g2];

g2 =

m2*Lg2*c12;

%%%%% Computation of acceleration


ddq = inv(M) * (tau + tauint - C*dq - D*dq - G);

C. Melchiorri (DEI)

Dynamic Model

60 / 65

Dynamic models

Euler-Lagrange model

Dynamic model in Simulink


% Simulation of the dynamic model of a planar 2 dof manipulator
% Simulink scheme: sc_d2dof.m
% Definition and initialization of global variables
% Run the simulation RK45
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% Robots Coefficients %%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear I1z I2z m1 m2 L1 L2 Lg1 Lg2 g D
global I1z I2z m1 m2 L1 L2 Lg1 Lg2 g D
I1z = 10; I2z = 10;
m1 = 50.0;
m2 = 50.0;
L1 = 1;
L2 = 1;
Lg1=L1/2;
Lg2=L2/2;
g = 9.81;
D = 0.0 * eye(2);
% D = diag([30,30]);
% D = diag([80,80]);
C. Melchiorri (DEI)

% friction
% friction
% friction
Dynamic Model

61 / 65

Dynamic models

Euler-Lagrange model

Dynamic model in Simulink

COPPIA = 0;
DISTURBO = 0;

% joint torques
% joint torques due to interaction with environment

%%%% Iniziatialization and run


TI = 0;
TF = 10;
ERR = 1e-3;
TMIN = 0.002;
TMAX = 10*TMIN;
OPTIONS = [ERR,TMIN,TMAX,0,0,2];
X0 = [0 0 0 0];
[ti,xi,yi]=rk45(sc_d2dof,TF,X0,OPTIONS);

C. Melchiorri (DEI)

Dynamic Model

62 / 65

Dynamic models

Euler-Lagrange model

Dynamic model in Simulink

D = diag[0, 0];
Posizioni q1, q2 (dash)

Accelerazioni ddq1, ddq2 (dash)

40

0
20

1
0

20

3
4
0

10

40
0

Velocita dq1, dq2 (dash)


1

0.5

0.5

10
0

C. Melchiorri (DEI)

10

10

Coppie tau1, tau2 (dash)

10

10

1
0

Dynamic Model

63 / 65

Dynamic models

Euler-Lagrange model

Dynamic model in Simulink

D = diag[30, 30];
Posizioni q1, q2 (dash)

Accelerazioni ddq1, ddq2 (dash)

15
10

0
5

10

3
0

10

15
0

Velocita dq1, dq2 (dash)


4

0.5

0.5

4
0

C. Melchiorri (DEI)

10

10

Coppie tau1, tau2 (dash)

10

1
0

Dynamic Model

64 / 65

Dynamic models

Euler-Lagrange model

Dynamic model in Simulink

D = diag[80, 80];
Posizioni q1, q2 (dash)

Accelerazioni ddq1, ddq2 (dash)

15
10

0
5

10

3
0

10

15
0

Velocita dq1, dq2 (dash)

10

10

Coppie tau1, tau2 (dash)

0.5

0
0

1
0.5

2
3
0

C. Melchiorri (DEI)

10

1
0

Dynamic Model

65 / 65

You might also like