# Multibody simulation - Dynamics of a multibody system (Newton-Euler...

date post

30-Jul-2021Category

## Documents

view

0download

0

Embed Size (px)

### Transcript of Multibody simulation - Dynamics of a multibody system (Newton-Euler...

Multibody simulation - Dynamics of a multibody system (Newton-Euler formulation)Dimitar Dimitrov

Orebro University

Newton-Euler formulation

forward dynamics

inverse dynamics

1 / 17

Euler-Lagrange formulation

We derived the equations of motion for a multibody system by treating the multibody system as a whole and performing analysis using the Lagrangian (the difference between the kinetic and potential energy) of the system.

Newton-Euler formulation

In this lecture, we describe an alternative formulation which treats each link in turn by forming the equations that govern its linear and angular motion. The forces f and torques t acting on a particular link are computed by analyzing its interaction with its neighboring links.

Our starting point are the Newton-Euler equations for a single rigid body

f = mvc

2 / 17

Let us express the equations of motion for link i as

[ f i

]

vi denotes the linear velocity of the center of mass (CoM) of link i

ωi denotes the angular velocity of link i

Ii denotes the 3× 3 inertia matrix of link i, calculated about its CoM and expressed in the world frame.

all vectors are expressed with respect to the world frame

We can write the above equations as

ue i = M iξi + un

i ,

where

ue = Mξ + un (1)

The fact that M is a block-diagonal matrix implies that there is no coupling between the rigid bodies in the system. Or in other words, the motion of body i is independent of all other bodies.

4 / 17

Constraints due to joints

When the bodies are interconnected using joints, we have to introduce constraints on their motion. There are alternative ways to do so

form the constraint equations of each pair of bodies, and impose them explicitly

since we are dealing only with open-loop systems, we could use the joint variables q as generalized coordinates, and impose the constraints implicitly by expressing ξ in (1) as a function of the generalized coordinates and their derivatives

We adopt the second approach

Recall that when using the Euler-Lagrange formulation, we expressed the Lagrangian of the system as a function of the generalized coordinates, and then substituted it in the Euler-Lagrange equations. Because of that, no constraints appeared explicitly in the equations of motion.

5 / 17

Implicit constraints

The relation between the velocity of link i and q can be expressed as

ξi =

[ Jvi

Jωi

ξ = Jcq

ue = M(Jcq + Jcq) + un

= MJcq + uc, (3)

where uc = MJcq+un is the sum of all velocity dependent inertial forces (and torques) acting on the CoM of the links.

Multiply (3) by JT c from the left

JT c MJc

.

τ e are the generalized forces/torques acting on the generalized coordinates as a result of ue. Recall that τ e = JT

c u e is

c u n

The only term of the above equation that we have not computed yet is Jc. Forming it explicitly is not usually done because we can compute directly the product Jcq as follows.

If we set q = 0 in ξ = Jcq + Jcq, we obtain

Jcq = ξ 0 .

We use ξ 0 to denote the Cartesian accelerations of the links computed

with zero joint accelerations q. Hence, c can be computed using

c = JT c (Mξ

Computing the vector ξ 0 ∈ R

6n can be done in a recursive fashion (as we show next).

7 / 17

Link velocity ξ

ξ can be computed using ξ = Jcq, which corresponds to the following recursion for i = 1, . . . , n (we will assume fixed base v0 = 0, ω0 = 0). All vectors are expressed in the world frame.

Revolute joint

= vi−1 + ωi−1 × (ri − ri−1) + ki × diqi

Prismatic joint

= vi−1 + ωi−1 × (hi + di) + kiqi

= vi−1 + ωi−1 × (ri − ri−1) + kiqi

where di = di + kiqi

Link acceleration ξ

The following computation for i = 1, . . . , n is called forward recursion. A fixed base is assumed, i.e., v0 = 0, v0 = 0, ω0 = 0, ω0 = 0.

revolute joint

vi = vi−1 + ωi−1 × (ri − ri−1) + ki × diqi

vi = vi−1 + ωi−1 × (ri − ri−1) + ωi−1 × (vi − vi−1) + ωi × (ki × di)qi

+ ki × diqi

prismatic joint

vi = vi−1 + ωi−1 × (ri − ri−1) + kiqi

vi = vi−1 + ωi−1 × (ri − ri−1) + ωi−1 × (vi − vi−1 + kiqi) + kiqi

9 / 17

Some notes

d

dt ki = ωi × ki = (ωi−1 + kiqi)× ki = ωi−1 × ki.

d

dt (ki × di) = (ωi−1 × ki)× di + ki × (ωi × di)

= (ωi−1 × ki)× di + ki × [(ωi−1 + kiqi)× di]

= (ωi−1 × ki)× di + ki × (ωi−1 × di) + ki × (ki × di)qi

= ωi × (ki × di).

The last equality is obtained by adding the following term to the equation

ωi−1 × (ki × di) + ki × (di × ωi−1) + di × (ωi−1 × ki) = 0.

Note that any three vectors a, b, c ∈ R 3 satisfy the Jacobi identity

a× (b× c) + b× (c× a) + c× (a× b) = 0.

10 / 17

Given

τ - torque delivered by joint motors

Do

form the manipulator inertia matrix H = JT c MJc

compute link accelerations ξ 0 (forward recursion using q = 0)

form uc = Mξ 0 + un

compute c = JT c u

c (backward recursion)

e (backward recursion)

The above steps lead to the following equation of motion

Hq + c = τ e + τ

11 / 17

e − uc)

f ec i ∈ R

3 is a force acting at the CoM of link i

teci ∈ R 3 is a torque acting on link i.

see figure on next slide

The following computation for i = n, . . . , 1 is called backward recursion. It is computationally more efficient compared to using JT

c (u e − uc).

fJi+1 , tJi+1

- forces and torques acting on link i through joint i+ 1

fJi , tJi

- forces and torques acting on link i− 1 through joint i

fJn+1 = 0, tJn+1

= 0 is assumed

fJi = fec

13 / 17

Define

e − uc).

τ ec is the generalized force/torque acting on the generalized coordinates q as a result of uc and ue.

The final step of the backward recursion is to determine

the torque τeci around the axis of rotation ki, if joint i is revolute

the force τeci along the axis of translation ki, if joint i is prismatic

τeci =

if joint i is prismatic

14 / 17

ve lo

ci tie

s and

rques (backward recursion)

the two recursions

forward recursion (1, . . . , n) for computing Cartesian velocities and accelerations of the links

backward recursion (n, . . . , 1) for computing the generalized forces τ ec as a result of the external and inertial forces acting on the links

15 / 17

Forward dynamics

Solve the equations of motion for the accelerations q resulting from given generalized forces/torques

q = H−1(τ e + τ − c).

After solving for q, one can obtain q and q by using numerical integration. Forward dynamics is useful for the purpose of simulation.

Inverse dynamics

Find joint forces/torques τ that should be applied by the joint motors, in order to generate system motion specified by q, q, q, (possibly in the presence of external forces). Solving the inverse dynamics problem is equivalent to performing forward and backward recursions. It is useful for

forming the equations of motion

manipulator trajectory planning

control algorithm implementation

Recursive computation of the manipulator inertia matrix

We already know how to compute the manipulator inertia matrix H , however, here we discuss an alternative (and more efficient) approach.

Step 0

set q = 0.

This results in the following equation of motion (satisfied only by q = 0)

Hq = 0.

Recursive computation of H for i = 1, . . . , n

set qi = 1, and qj = 0 for all j 6= i

perform a forward and backward recursion

At the ith iteration, the result from the backward recursion would be a vector of torques/forces that is equivalent to the ith column of H.

See file bMSd/examples/example_ID.m. 17 / 17

Orebro University

Newton-Euler formulation

forward dynamics

inverse dynamics

1 / 17

Euler-Lagrange formulation

We derived the equations of motion for a multibody system by treating the multibody system as a whole and performing analysis using the Lagrangian (the difference between the kinetic and potential energy) of the system.

Newton-Euler formulation

In this lecture, we describe an alternative formulation which treats each link in turn by forming the equations that govern its linear and angular motion. The forces f and torques t acting on a particular link are computed by analyzing its interaction with its neighboring links.

Our starting point are the Newton-Euler equations for a single rigid body

f = mvc

2 / 17

Let us express the equations of motion for link i as

[ f i

]

vi denotes the linear velocity of the center of mass (CoM) of link i

ωi denotes the angular velocity of link i

Ii denotes the 3× 3 inertia matrix of link i, calculated about its CoM and expressed in the world frame.

all vectors are expressed with respect to the world frame

We can write the above equations as

ue i = M iξi + un

i ,

where

ue = Mξ + un (1)

The fact that M is a block-diagonal matrix implies that there is no coupling between the rigid bodies in the system. Or in other words, the motion of body i is independent of all other bodies.

4 / 17

Constraints due to joints

When the bodies are interconnected using joints, we have to introduce constraints on their motion. There are alternative ways to do so

form the constraint equations of each pair of bodies, and impose them explicitly

since we are dealing only with open-loop systems, we could use the joint variables q as generalized coordinates, and impose the constraints implicitly by expressing ξ in (1) as a function of the generalized coordinates and their derivatives

We adopt the second approach

Recall that when using the Euler-Lagrange formulation, we expressed the Lagrangian of the system as a function of the generalized coordinates, and then substituted it in the Euler-Lagrange equations. Because of that, no constraints appeared explicitly in the equations of motion.

5 / 17

Implicit constraints

The relation between the velocity of link i and q can be expressed as

ξi =

[ Jvi

Jωi

ξ = Jcq

ue = M(Jcq + Jcq) + un

= MJcq + uc, (3)

where uc = MJcq+un is the sum of all velocity dependent inertial forces (and torques) acting on the CoM of the links.

Multiply (3) by JT c from the left

JT c MJc

.

τ e are the generalized forces/torques acting on the generalized coordinates as a result of ue. Recall that τ e = JT

c u e is

c u n

The only term of the above equation that we have not computed yet is Jc. Forming it explicitly is not usually done because we can compute directly the product Jcq as follows.

If we set q = 0 in ξ = Jcq + Jcq, we obtain

Jcq = ξ 0 .

We use ξ 0 to denote the Cartesian accelerations of the links computed

with zero joint accelerations q. Hence, c can be computed using

c = JT c (Mξ

Computing the vector ξ 0 ∈ R

6n can be done in a recursive fashion (as we show next).

7 / 17

Link velocity ξ

ξ can be computed using ξ = Jcq, which corresponds to the following recursion for i = 1, . . . , n (we will assume fixed base v0 = 0, ω0 = 0). All vectors are expressed in the world frame.

Revolute joint

= vi−1 + ωi−1 × (ri − ri−1) + ki × diqi

Prismatic joint

= vi−1 + ωi−1 × (hi + di) + kiqi

= vi−1 + ωi−1 × (ri − ri−1) + kiqi

where di = di + kiqi

Link acceleration ξ

The following computation for i = 1, . . . , n is called forward recursion. A fixed base is assumed, i.e., v0 = 0, v0 = 0, ω0 = 0, ω0 = 0.

revolute joint

vi = vi−1 + ωi−1 × (ri − ri−1) + ki × diqi

vi = vi−1 + ωi−1 × (ri − ri−1) + ωi−1 × (vi − vi−1) + ωi × (ki × di)qi

+ ki × diqi

prismatic joint

vi = vi−1 + ωi−1 × (ri − ri−1) + kiqi

vi = vi−1 + ωi−1 × (ri − ri−1) + ωi−1 × (vi − vi−1 + kiqi) + kiqi

9 / 17

Some notes

d

dt ki = ωi × ki = (ωi−1 + kiqi)× ki = ωi−1 × ki.

d

dt (ki × di) = (ωi−1 × ki)× di + ki × (ωi × di)

= (ωi−1 × ki)× di + ki × [(ωi−1 + kiqi)× di]

= (ωi−1 × ki)× di + ki × (ωi−1 × di) + ki × (ki × di)qi

= ωi × (ki × di).

The last equality is obtained by adding the following term to the equation

ωi−1 × (ki × di) + ki × (di × ωi−1) + di × (ωi−1 × ki) = 0.

Note that any three vectors a, b, c ∈ R 3 satisfy the Jacobi identity

a× (b× c) + b× (c× a) + c× (a× b) = 0.

10 / 17

Given

τ - torque delivered by joint motors

Do

form the manipulator inertia matrix H = JT c MJc

compute link accelerations ξ 0 (forward recursion using q = 0)

form uc = Mξ 0 + un

compute c = JT c u

c (backward recursion)

e (backward recursion)

The above steps lead to the following equation of motion

Hq + c = τ e + τ

11 / 17

e − uc)

f ec i ∈ R

3 is a force acting at the CoM of link i

teci ∈ R 3 is a torque acting on link i.

see figure on next slide

The following computation for i = n, . . . , 1 is called backward recursion. It is computationally more efficient compared to using JT

c (u e − uc).

fJi+1 , tJi+1

- forces and torques acting on link i through joint i+ 1

fJi , tJi

- forces and torques acting on link i− 1 through joint i

fJn+1 = 0, tJn+1

= 0 is assumed

fJi = fec

13 / 17

Define

e − uc).

τ ec is the generalized force/torque acting on the generalized coordinates q as a result of uc and ue.

The final step of the backward recursion is to determine

the torque τeci around the axis of rotation ki, if joint i is revolute

the force τeci along the axis of translation ki, if joint i is prismatic

τeci =

if joint i is prismatic

14 / 17

ve lo

ci tie

s and

rques (backward recursion)

the two recursions

forward recursion (1, . . . , n) for computing Cartesian velocities and accelerations of the links

backward recursion (n, . . . , 1) for computing the generalized forces τ ec as a result of the external and inertial forces acting on the links

15 / 17

Forward dynamics

Solve the equations of motion for the accelerations q resulting from given generalized forces/torques

q = H−1(τ e + τ − c).

After solving for q, one can obtain q and q by using numerical integration. Forward dynamics is useful for the purpose of simulation.

Inverse dynamics

Find joint forces/torques τ that should be applied by the joint motors, in order to generate system motion specified by q, q, q, (possibly in the presence of external forces). Solving the inverse dynamics problem is equivalent to performing forward and backward recursions. It is useful for

forming the equations of motion

manipulator trajectory planning

control algorithm implementation

Recursive computation of the manipulator inertia matrix

We already know how to compute the manipulator inertia matrix H , however, here we discuss an alternative (and more efficient) approach.

Step 0

set q = 0.

This results in the following equation of motion (satisfied only by q = 0)

Hq = 0.

Recursive computation of H for i = 1, . . . , n

set qi = 1, and qj = 0 for all j 6= i

perform a forward and backward recursion

At the ith iteration, the result from the backward recursion would be a vector of torques/forces that is equivalent to the ith column of H.

See file bMSd/examples/example_ID.m. 17 / 17