Professional Documents
Culture Documents
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
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
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
(t)
q
( q(t),
q(t) )
q
q(t)
C. Melchiorri (DEI)
Dynamic Model
(t)
5 / 65
Dynamic models
Introduction
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.
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)
i =
dt q i
qi
i = 1, . . . , n
Therefore:
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
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 .
(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
Dynamic Model
14 / 65
Dynamic models
Euler-Lagrange model
Ixx
I =
Iyy
Izz
1
m(b2
12
+ c2)
1
m(a2
12
c2)
1
m(a2
12
+ b2 )
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)
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:
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
where
Jiv
Ji
with
Jiv1
...
Jivi
...
Ji1
...
Jii
...
Jivj
i
Jj
Jivj
Jij
=
=
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
1 T
q M(q)q
2
n
n
1 XX
Mij (q)q i q j
2
i =1 j=1
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)
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
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
1 Mij (q)
Mkj (q)
qi
2 qk
and gk (q) as
gk (q) =
P(q)
qk
Mkj (q)
qj +
j=1
C. Melchiorri (DEI)
n X
n
X
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
Mkj (q)
qj +
n X
n
X
k = 1, . . . , n
i =1 j=1
j=1
C. Melchiorri (DEI)
Dynamic Model
25 / 65
Dynamic models
Euler-Lagrange model
n
X
Ckj q j
j=1
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
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
(5)
i =1
C. Melchiorri (DEI)
Dynamic Model
27 / 65
Dynamic models
Euler-Lagrange model
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
k,j =
[C(q, q)]
n
X
cijk q i
i =1
28 / 65
Dynamic models
Euler-Lagrange model
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
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
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
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
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
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
and
C. Melchiorri (DEI)
Dynamic Model
37 / 65
Dynamic models
Euler-Lagrange model
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
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
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
M11
M12
M22
c121
c221
c112
c122
c222
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
M(q)
2C(q, q)
2h2
h2
h2
0
0
2h1 + h2
h2
h1
2h1 h2
0
h(1 + 2 )
0
C. Melchiorri (DEI)
Dynamic Model
41 / 65
Dynamic models
Euler-Lagrange model
=
=
m1 gaC 1 S1
m2 g (a1 S1 + aC 2 S12 )
Then
P
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
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
=
C. Melchiorri (DEI)
Same result!
Dynamic Model
43 / 65
Dynamic models
Euler-Lagrange model
C. Melchiorri (DEI)
Dynamic Model
44 / 65
Dynamic models
Euler-Lagrange model
5
6
xT (2 I M(q))x 0
Dynamic Model
45 / 65
Dynamic models
Euler-Lagrange model
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
= 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
||Dq||
C. Melchiorri (DEI)
Dynamic Model
47 / 65
Dynamic models
Euler-Lagrange model
C. Melchiorri (DEI)
Dynamic Model
48 / 65
Dynamic models
Euler-Lagrange model
Example
21 2 + 22
12
g(q) =
m2 (aC2 2 + a1 aC 2 C2 ) + I2
m2 aC2 2 + I2
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
M2
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)
= 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
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;
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,
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
one obtains:
C. Melchiorri (DEI)
Dynamic Model
56 / 65
Dynamic models
Euler-Lagrange model
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
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
C. Melchiorri (DEI)
g1
g2
= m2 gaC 2 C12
Dynamic Model
58 / 65
Dynamic models
Euler-Lagrange model
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
g2 =
m2*Lg2*c12;
C. Melchiorri (DEI)
Dynamic Model
60 / 65
Dynamic models
Euler-Lagrange model
% friction
% friction
% friction
Dynamic Model
61 / 65
Dynamic models
Euler-Lagrange model
COPPIA = 0;
DISTURBO = 0;
% joint torques
% joint torques due to interaction with environment
C. Melchiorri (DEI)
Dynamic Model
62 / 65
Dynamic models
Euler-Lagrange model
D = diag[0, 0];
Posizioni q1, q2 (dash)
40
0
20
1
0
20
3
4
0
10
40
0
0.5
0.5
10
0
C. Melchiorri (DEI)
10
10
10
10
1
0
Dynamic Model
63 / 65
Dynamic models
Euler-Lagrange model
D = diag[30, 30];
Posizioni q1, q2 (dash)
15
10
0
5
10
3
0
10
15
0
0.5
0.5
4
0
C. Melchiorri (DEI)
10
10
10
1
0
Dynamic Model
64 / 65
Dynamic models
Euler-Lagrange model
D = diag[80, 80];
Posizioni q1, q2 (dash)
15
10
0
5
10
3
0
10
15
0
10
10
0.5
0
0
1
0.5
2
3
0
C. Melchiorri (DEI)
10
1
0
Dynamic Model
65 / 65