06 NewtonEulerDynamics

Download as pdf or txt
Download as pdf or txt
You are on page 1of 18

Robotics 2

Dynamic model of robots:


Newton-Euler approach

Prof. Alessandro De Luca


Approaches to dynamic modeling
(reprise)

energy-based approach Newton-Euler method


(Euler-Lagrange) (balance of forces/torques)
n multi-body robot seen as a whole n dynamic equations written
separately for each link/body
n constraint (internal) reaction forces
between the links are automatically n inverse dynamics in real time
eliminated: in fact, they do not n equations are evaluated in a
perform work numeric and recursive way
n closed-form (symbolic) equations n best for synthesis
are directly obtained (=implementation) of model-
based control schemes
n best suited for study of dynamic
properties and analysis of control n by elimination of reaction forces and
schemes back-substitution of expressions, we
still get closed-form dynamic
equations (identical to those of Euler-
Lagrange!)
Robotics 2 2
Derivative of a vector in a moving frame
… from velocity to acceleration
! !
𝑣$ = 0𝑅$ 𝑖 𝑣$ 𝑅̇ $ = 𝑆 0𝜔$ 0𝑅
$

!
𝑣̇ $ = 0𝑎$ = 0𝑅$ 𝑖 𝑎$ = 0𝑅$ $𝑣̇ $ + 0𝑅̇ $ 𝑖 𝑣$
= 0𝑅$ $𝑣̇ $ + 0𝜔$ × 0𝑅$ 𝑖 𝑣$ = 0𝑅$ $
𝑣̇ $ + $ 𝜔$ × 𝑖 𝑣$

$ $ $ derivative of “unit” vector


𝑎$ = 𝑣̇ $ + 𝜔$ × 𝑖𝑣
$
𝜔𝑖 𝑑𝑒$
= 𝜔$ × 𝑒$
𝑑𝑡

𝑒$

Robotics 2 3
Dynamics of a rigid body
n Newton dynamic equation
n balance: sum of forces = variation of linear momentum
𝑑
3 𝑓$ = 𝑚𝑣6 = 𝑚𝑣̇6
𝑑𝑡
n Euler dynamic equation
n balance: sum of torques = variation of angular momentum
𝑑 𝑑
3 𝜇$ = 𝐼𝜔 = 𝐼 𝜔̇ + ̅ : 𝜔 = 𝐼 𝜔̇ + 𝑅̇ 𝐼𝑅
𝑅 𝐼𝑅 ̅ : + 𝑅𝐼𝑅
̅ ̇: 𝜔
𝑑𝑡 𝑑𝑡
= 𝐼 𝜔̇ + 𝑆 𝜔 𝑅 𝐼𝑅̅ : 𝜔 + 𝑅 𝐼𝑅̅ : 𝑆 : 𝜔 𝜔 = 𝐼 𝜔̇ + 𝜔 × 𝐼𝜔

n principle of action and reaction


n forces/torques: applied by body 𝑖 to body 𝑖 + 1
= − applied by body 𝑖 + 1 to body 𝑖
Robotics 2 4
Newton-Euler equations -1
link 𝑖
FORCES

center 𝒗𝒄𝒊 𝑓$ force applied


of mass from link 𝑖 − 1 on link 𝑖
𝑧$C@ 𝑪𝒊 𝑧$
𝑓$?@ force applied
. from link 𝑖 on link 𝑖 + 1
.𝑂$C@ 𝑂$ 𝑓$?@
𝑓$ 𝑚$ 𝑔 gravity force
axis 𝑖 𝑚$ 𝑔 axis 𝑖 + 1
(𝑞$ ) (𝑞$?@ ) all vectors expressed in the
same RF (better RF𝑖 )

Newton equation 𝑓$ − 𝑓$?@ + 𝑚$ 𝑔 = 𝑚$ 𝑎6$ N

linear acceleration of 𝐶$
Robotics 2 5
Newton-Euler equations -2
link 𝑖
TORQUES 𝜔$

𝜏$ torque applied 𝑧$C@ 𝑧$


from link (𝑖 − 1) on link 𝑖 𝜏$?@
𝜏$ 𝑟$C@,6$ 𝑟$,6$
𝜏$?@ torque applied .
from link 𝑖 on link (𝑖 + 1) .𝑂 𝑪𝒊 𝑂$ 𝑓$?@
𝑓$ $C@

𝑓$ × 𝑟$C@,6$ torque due to 𝑓$ w.r.t. 𝐶$ axis 𝑖 axis 𝑖 + 1


(𝑞$ ) (𝑞$?@ )
−𝑓$?@ × 𝑟$,6$ torque due to −𝑓$?@ w.r.t. 𝐶$
all vectors expressed in
gravity force gives the same RF (RF𝑖 !!)
Euler equation no torque at 𝐶$

𝜏$ − 𝜏$?@ + 𝑓$ × 𝑟$C@,6$ −𝑓$?@ × 𝑟$,6$ = 𝐼$ 𝜔̇ $ + 𝜔$ × 𝐼$ 𝜔$ E

angular acceleration of body 𝑖


Robotics 2 6
Forward recursion
Computing velocities and accelerations
§ “moving frames” algorithm (as for velocities in Lagrange)
§ for simplicity, only revolute joints here
(see textbook for the more general treatment)
initializations
$ $C@ : $C@
𝜔$ = 𝑅$ 𝜔$C@ + 𝑞̇ $ $C@𝑧$C@ !
𝜔!
$ $C@ : $C@
𝜔̇ $ = 𝑅$ 𝜔̇ $C@ + 𝑞̈ $ $C@𝑧$C@ + $C@𝑅̇ $: $C@
𝜔$C@ + 𝑞̇ $ $C@𝑧$C@
!
AR = $C@ : $C@
𝑅$ 𝜔̇ $C@ + 𝑞̈ $ $C@
𝑧$C@ + 𝑞̇ $ $C@
𝜔$C@ × $C@
𝑧$C@ 𝜔̇ !
!
$ $C@ : $C@
𝑎! − 0𝑔
𝑎$ = 𝑅$ 𝑎$C@ + $𝜔̇ $ × $𝑟$C@,$ + $𝜔$ × $
𝜔$ × $𝑟$C@,$
$ $
𝑎6$ = 𝑎$ + $𝜔̇ $ × $𝑟$,6$ + $𝜔$ × $
𝜔$ × $𝑟$,6$

the gravity force term can be skipped in Newton equation, if added here
Robotics 2 7
Backward recursion
Computing forces and torques

eliminated, if inserted
from 𝑁$ to 𝑁$C@ in forward recursion (𝑖 =0) initializations
$ $
𝑓$ = 𝑅$?@ $?@𝑓$?@ + 𝑚$ $
𝑎6$ − $𝑔 𝑓R?@ 𝜏R?@
F/TR
$ $
𝜏$ = 𝑅$?@ $?@𝜏$?@ + $
𝑅$?@ $?@𝑓$?@ × $𝑟$,6$ − $𝑓$ × $
𝑟$C@,$ + $𝑟$,6$

from 𝐸$ to 𝐸$C@ + $𝐼$ $𝜔̇ $ + $𝜔$ × $𝐼$ $𝜔$

at each step of this recursion, we have two vector equations (𝑁𝑖 + 𝐸𝑖 ) at the
joint providing 𝑓$ and 𝜏$ : these contain ALSO the reaction forces/torques
at the joint axis ⇒ they should be “projected” next along/around this axis
$ : $
𝑓$ 𝑧$C@ + 𝐹N$ 𝑞̇ $ for prismatic joint 𝑁 scalar
FP 𝑢$ = L $ : $
𝜏$ 𝑧$C@ + 𝐹N$ 𝑞̇ $ for revolute joint equations
at the end
generalized forces add any dissipative term
(in rhs of Euler-Lagrange eqs) (here, viscous friction only)
Robotics 2 8
Comments on Newton-Euler method
n the previous forward/backward recursive formulas can
be evaluated in symbolic or numeric form
n symbolic
n substituting expressions in a recursive way

n at the end, a closed-form dynamic model is obtained, which

is identical to the one obtained using Euler-Lagrange (or any


other) method
n there is no special convenience in using N-E in this way

n numeric
n substituting numeric values (numbers!) at each step

n computational complexity of each step remains constant ⇒

grows in a linear fashion with the number 𝑁 of joints (𝑂(𝑁))


n strongly recommended for real-time use, especially when the

number 𝑁 of joints is large

Robotics 2 9
Newton-Euler algorithm
efficient computational scheme for inverse dynamics
!
𝜔! , !𝜔̇ ! , !𝑎! − !𝑔 (at robot base) numeric steps
at every instant 𝑡
𝑞@
@
𝑞̇ @ AR 𝑓@ , @𝜏@ FP 𝑢@
𝑞̈ @
@
𝜔@ , @𝜔̇ @ , @𝑎@ , @𝑎6@ F/TR

U
inputs 𝑓U , U𝜏U outputs

RC@
𝜔RC@ , RC@𝜔̇ RC@ , RC@𝑎RC@ , RC@𝑎6,RC@
𝑞R
R
𝑞̇ R AR 𝑓R , R𝜏R FP 𝑢R
𝑞̈ R
R
𝜔R , R𝜔̇ R , R𝑎R , R𝑎6R F/TR
(force/torque exchange
R?@ R?@
𝑓R?@ , 𝜏R?@ environment/E-E)
Robotics 2 10
Matlab (or C) script
general routine 𝑁𝐸X (arg1, arg2, arg3)
n data file (of a specific robot)
n number 𝑁 and types σ = 0,1 R of joints (revolute/prismatic)
n table of DH kinematic parameters
n list of ALL dynamic parameters of the links (and of the motors)
n input
n vector parameter 𝛼 = 0𝑔, 0 (presence or absence of gravity)
n three ordered vector arguments
n typically, samples of joint position, velocity, acceleration

taken from a desired trajectory


n output
n generalized force 𝑢 for the complete inverse dynamics
n … or single terms of the dynamic model

Robotics 2 11
Examples of output
n complete inverse dynamics
𝑢 = 𝑁𝐸 !^ (𝑞𝑑, 𝑞̇ b , 𝑞̈ b ) = 𝑀(𝑞b )𝑞̈ b + 𝑐(𝑞b , 𝑞̇ b ) + 𝑔(𝑞b ) = 𝑢b
n gravity term
𝑢 = 𝑁𝐸 !^ (𝑞, 0, 0) = 𝑔(𝑞)
n centrifugal and Coriolis term
𝑢 = 𝑁𝐸! (𝑞, 𝑞,̇ 0) = 𝑐(𝑞, 𝑞)
̇
n 𝑖-th column of the inertia matrix
𝑒$ = 𝑖 -th column
𝑢 = 𝑁𝐸! (𝑞, 0, 𝑒$ ) = 𝑀$ (𝑞) of identity matrix
n generalized momentum
𝑢 = 𝑁𝐸! 𝑞, 0, 𝑞̇ = 𝑀 𝑞 𝑞̇ = 𝑝
Robotics 2 12
A further example of output
n factorization of centrifugal and Coriolis term
𝑢 = 𝑁𝐸! 𝑞, 𝑞,̇ 0 = 𝑐 𝑞, 𝑞̇ = 𝑆(𝑞, 𝑞)
̇ 𝑞̇
n for later use, what about a “mixed” velocity term?
𝑢 = 𝑁𝐸! (𝑞, 𝑞̇ c , 0) = 𝑆(𝑞, 𝑞̇ c )𝑞̇ c
𝑆(𝑞, 𝑞)
̇ 𝑞̇ c ⇎ no good!
𝑢 = 𝑁𝐸! (𝑞, 𝑒$ 𝑞̇ c$ , 0) = 𝑆$ (𝑞, 𝑒$ 𝑞̇ c$ )𝑞̇ c$
a) 𝑆 𝑞, 𝑞̇ 𝑞̇ c = 𝑆 𝑞, 𝑞̇ c 𝑞̇ , when using Christoffel symbols

b) 𝑆 𝑞, 𝑞̇ + 𝑞̇ c 𝑞̇ + 𝑞̇ c = 𝑆 𝑞, 𝑞̇ 𝑞̇ + 𝑆 𝑞, 𝑞̇ c 𝑞̇ c + 2𝑆 𝑞, 𝑞̇ 𝑞̇ c
1
⇒ 𝑢 = 𝑁𝐸! 𝑞, 𝑞̇ + 𝑞̇ c , 0 − 𝑁𝐸! 𝑞, 𝑞,̇ 0 − 𝑁𝐸! (𝑞, 𝑞̇ c , 0)
2
= 𝑆 𝑞, 𝑞̇ 𝑞̇ c (i.e., with 3 calls of standard NE algorithm)
[Kawasaki et al., IEEE T-RA 1996]
Robotics 2 13
Modified NE algorithm
e X (arg1, arg2, arg3, arg4) with 4 arguments
modified routine 𝑁𝐸
[De Luca, Ferrajoli, ICRA 2009]
e X 𝑥, 𝑦, 𝑦, 𝑧 = 𝑁𝐸X (𝑥, 𝑦, 𝑧)
𝑁𝐸 consistency property

e !^ 𝑞, 0, 0, 0 = 𝑁𝐸 !^ 𝑞, 0, 0 = 𝑔(𝑞)
e.g., 𝑢 = 𝑁𝐸

e ! 𝑞, 𝑞,̇ 𝑞,̇ 0 = 𝑁𝐸! 𝑞, 𝑞,̇ 0 = 𝑐 𝑞, 𝑞̇ = 𝑆(𝑞, 𝑞)


𝑢 = 𝑁𝐸 ̇ 𝑞̇

e ! 𝑞, 𝑞,̇ 𝑞̇ c , 0 = 𝑆(𝑞, 𝑞)
⇒ 𝑢 = 𝑁𝐸 ̇ 𝑞̇ c with 𝑀̇ − 2𝑆 skew-symmetric
(i.e., with 1 call of modified NE algorithm)

e ! 𝑞, 𝑞,̇ 𝑒$ , 0 = 𝑆$ (𝑞, 𝑞)
⇒ 𝑢 = 𝑁𝐸 ̇
(i.e., the full matrix 𝑆 with 𝑁 calls of modified NE algorithm)

Robotics 2 14
Inverse dynamics of a 2R planar robot

desired (smooth) joint motion:


quintic polynomials for 𝑞@ , 𝑞U with

zero vel/acc boundary conditions
o o o o
from (90 , -180 ) to (0 , 90 ) in 𝑇 = 1 s

Robotics 2 15
Inverse dynamics of a 2R planar robot

zero final torques


initial torques =
𝑢@ ≠ 0, 𝑢U = 0
free equilibrium
balance
configuration
link weights
+ o o
in final (0 , 90 )
zero initial
configuration
accelerations

motion in vertical plane (under gravity)


both links are thin rods of uniform mass 𝑚@ = 10 kg, 𝑚U = 5 kg
Robotics 2 16
Inverse dynamics of a 2R planar robot

torque contributions at the two joints for the desired motion


= total, = inertial
= Coriolis/centrifugal, = gravitational
Robotics 2 17
Use of NE routine for simulation
direct dynamics

n numerical integration, at current state (𝑞, 𝑞̇ ), of


𝑞̈ = 𝑀 C@ (𝑞)[𝑢 – (𝑐(𝑞, 𝑞)
̇ + 𝑔(𝑞))] = 𝑀 C@ (𝑞)[𝑢 – 𝑛(𝑞, 𝑞)]
̇
n Coriolis, centrifugal, and gravity terms
𝑛 = 𝑁𝐸 !^ (𝑞, 𝑞,̇ 0) complexity 𝑂(𝑁)
n 𝑖-th column of the inertia matrix, for 𝑖 = 1, . . , 𝑁
𝑀$ = 𝑁𝐸! (𝑞, 0, 𝑒$ ) 𝑂(𝑁 U )
n numerical inversion of inertia matrix
𝐼𝑛𝑣𝑀 = inv(𝑀) 𝑂(𝑁 u )
but with small coefficient
n given 𝑢, integrate acceleration computed as
new state (𝑞, 𝑞̇ )
𝑞̈ = 𝐼𝑛𝑣𝑀 ∗ [𝑢 – 𝑛]
and repeat over time ...
Robotics 2 18

You might also like