30
Dynamics Kris Hauser I400/B659, Spring 2014

Dynamics Kris Hauser I400/B659, Spring 2014. Agenda Ordinary differential equations Open and closed loop controls Integration of ordinary differential

Embed Size (px)

Citation preview

Page 1: Dynamics Kris Hauser I400/B659, Spring 2014. Agenda Ordinary differential equations Open and closed loop controls Integration of ordinary differential

DynamicsKris HauserI400/B659, Spring 2014

Page 2: Dynamics Kris Hauser I400/B659, Spring 2014. Agenda Ordinary differential equations Open and closed loop controls Integration of ordinary differential

Agenda• Ordinary differential equations• Open and closed loop controls• Integration of ordinary differential equations• Dynamics of a particle under force field• Rigid body dynamics

Page 3: Dynamics Kris Hauser I400/B659, Spring 2014. Agenda Ordinary differential equations Open and closed loop controls Integration of ordinary differential

Dynamics• How a system moves over time as a reaction to forces and

torques• Distinguished from kinematics, which purely describes states

and geometric paths• Uncontrolled dynamics:

• From initial conditions that include state x0 and time t0, the system evolves to produce a trajectory x(t).

• Controlled dynamics:• From initial conditions x0, time t0, and given controls u(t), the

system evolves to produce a trajectory x(t)

Page 4: Dynamics Kris Hauser I400/B659, Spring 2014. Agenda Ordinary differential equations Open and closed loop controls Integration of ordinary differential

Dynamic equations• x(t): state trajectory

• (a function from real numbers to vectors)• Uncontrolled dynamic equation:

• An ordinary differential equation (ODE)

Page 5: Dynamics Kris Hauser I400/B659, Spring 2014. Agenda Ordinary differential equations Open and closed loop controls Integration of ordinary differential

Dynamic equations• x(t): state trajectory

• (a function from real numbers to vectors)• Uncontrolled dynamic equation:

• An ordinary differential equation (ODE)• Example: point mass with gravity g

• Position is • Acceleration (f=ma) is

Page 6: Dynamics Kris Hauser I400/B659, Spring 2014. Agenda Ordinary differential equations Open and closed loop controls Integration of ordinary differential

Dynamic equations• x(t): state trajectory

• (a function from real numbers to vectors)• Uncontrolled dynamic equation:

• An ordinary differential equation (ODE)• Example: point mass with gravity g

• Position is • Acceleration (f=ma) is • Uh… how do we work with this?• Second-order differential equation

Page 7: Dynamics Kris Hauser I400/B659, Spring 2014. Agenda Ordinary differential equations Open and closed loop controls Integration of ordinary differential

From second-order ODEs to first-order ODEs• Let with • Then

Page 8: Dynamics Kris Hauser I400/B659, Spring 2014. Agenda Ordinary differential equations Open and closed loop controls Integration of ordinary differential

From second-order ODEs to first-order ODEs• Let with • Then

• Here G is the gravity vector • If p is d dimensional, x is 2d-dimensional

Page 9: Dynamics Kris Hauser I400/B659, Spring 2014. Agenda Ordinary differential equations Open and closed loop controls Integration of ordinary differential

From time-dependent to time-independent dynamics• If • Let • Then

Page 10: Dynamics Kris Hauser I400/B659, Spring 2014. Agenda Ordinary differential equations Open and closed loop controls Integration of ordinary differential

Dynamic equation as a vector field• Can ask:

• From some initial condition, on what trajectory does the state evolve?

• Where will states from some set of initial conditions end up?• Point (convergence), a cycle (limit cycle), or infinity (divergence)?

Page 11: Dynamics Kris Hauser I400/B659, Spring 2014. Agenda Ordinary differential equations Open and closed loop controls Integration of ordinary differential

Numerical integration of ODEs• If and x(0) are known, then given a step size h,

• gives an approximate trajectory for k 1• Provided f is smooth• Accuracy depends on h

• Known as Euler’s method

Page 12: Dynamics Kris Hauser I400/B659, Spring 2014. Agenda Ordinary differential equations Open and closed loop controls Integration of ordinary differential

Integration errors• Lower error with smaller step size• Consider system whose limit cycle is a circle

• Euler integrator diverges for all step sizes!• Better integration schemes are available

• (e.g., Runge-Kutta methods, implicit integration, adaptive step sizes, energy conservation methods, etc)

• Beyond the scope of this course

Page 13: Dynamics Kris Hauser I400/B659, Spring 2014. Agenda Ordinary differential equations Open and closed loop controls Integration of ordinary differential

Open vs. Closed loop• Open loop control:

• The controls u(t) only depend on time, not x(t)• E.g., a planned path, sent to the robot• No ability to correct for unexpected errors

• Closed loop control :• The controls u(x(t),t) depend both on time and x(t)• Feedback control• Requires the ability to measure x(t) (to some extent)

• In either case we have an ODE, once we have chosen the control function

Page 14: Dynamics Kris Hauser I400/B659, Spring 2014. Agenda Ordinary differential equations Open and closed loop controls Integration of ordinary differential

Controlled Dynamics -> 1st order time-independent ODE• Open loop case:

• If , then let y(t)=(x(t),t)

Page 15: Dynamics Kris Hauser I400/B659, Spring 2014. Agenda Ordinary differential equations Open and closed loop controls Integration of ordinary differential

Controlled Dynamics -> 1st order time-independent ODE• Open loop case:

• If , then let y(t)=(x(t),t)

• Closed loop case:• If , then let y(t)=(x(t),t)

Page 16: Dynamics Kris Hauser I400/B659, Spring 2014. Agenda Ordinary differential equations Open and closed loop controls Integration of ordinary differential

Controlled Dynamics -> 1st order time-independent ODE• Open loop case:

• If , then let y(t)=(x(t),t)

• Closed loop case:• If , then let y(t)=(x(t),t)

• How do we choose u? A subject for future classes

Page 17: Dynamics Kris Hauser I400/B659, Spring 2014. Agenda Ordinary differential equations Open and closed loop controls Integration of ordinary differential

DYNAMICS OF RIGID BODIES

Page 18: Dynamics Kris Hauser I400/B659, Spring 2014. Agenda Ordinary differential equations Open and closed loop controls Integration of ordinary differential

Rigid Body Dynamics

• The following can be derived from first principles using Newton’s laws + rigidity assumption

• Parameters• CM translation c(t)• CM velocity v(t)• Rotation R(t)• Angular velocity w(t)• Mass m, local inertia tensor HL

Page 19: Dynamics Kris Hauser I400/B659, Spring 2014. Agenda Ordinary differential equations Open and closed loop controls Integration of ordinary differential

Rigid body ordinary differential equations• We will express forces and torques in terms of terms of H (a

function of R), , and

• Rearrange…

• So knowing f(t) and τ(t), we can derive c(t), v(t), R(t), and w(t) by solving an ordinary differential equation (ODE)• dx/dt = f(x)• x(0) = x0

• With x=(c,v,R,w) the state of the rigid body

Page 20: Dynamics Kris Hauser I400/B659, Spring 2014. Agenda Ordinary differential equations Open and closed loop controls Integration of ordinary differential

Kinetic energy for rigid body

• Rigid body with velocity v, angular velocity w• KE = ½ (m vTv + wT H w)

• World-space inertia tensor H = R HL RT

wv

T

wv

H 0 0 m I

1/2

Page 21: Dynamics Kris Hauser I400/B659, Spring 2014. Agenda Ordinary differential equations Open and closed loop controls Integration of ordinary differential

Kinetic energy derivatives

• Force (@CM)

• H = [w]H – H[w]• Torque t = = [w] H w + H

Page 22: Dynamics Kris Hauser I400/B659, Spring 2014. Agenda Ordinary differential equations Open and closed loop controls Integration of ordinary differential

Summary

Gyroscopic “force”

Page 23: Dynamics Kris Hauser I400/B659, Spring 2014. Agenda Ordinary differential equations Open and closed loop controls Integration of ordinary differential

Force off of COM

x

F

Page 24: Dynamics Kris Hauser I400/B659, Spring 2014. Agenda Ordinary differential equations Open and closed loop controls Integration of ordinary differential

Force off of COM

x

F

Consider infinitesimal virtual displacement generated by F. (we don’t know what this is, exactly)The virtual work performed by this displacement is FT

𝛿𝑥

Page 25: Dynamics Kris Hauser I400/B659, Spring 2014. Agenda Ordinary differential equations Open and closed loop controls Integration of ordinary differential

Generalized torque

f

Now consider the equivalent force f, torque τ at COM

Page 26: Dynamics Kris Hauser I400/B659, Spring 2014. Agenda Ordinary differential equations Open and closed loop controls Integration of ordinary differential

Generalized torque

f

Now consider the equivalent force f, torque τ at COMAnd an infinitesimal virtual displacement of R.B. coordinates

𝛿𝑥

𝛿𝑞

Page 27: Dynamics Kris Hauser I400/B659, Spring 2014. Agenda Ordinary differential equations Open and closed loop controls Integration of ordinary differential

Generalized torque

f𝛿𝑥

𝛿𝑞

Now consider the equivalent force f, torque τ at COMAnd an infinitesimal virtual displacement of R.B. coordinates Virtual work in configuration space is [fT,τT]

Page 28: Dynamics Kris Hauser I400/B659, Spring 2014. Agenda Ordinary differential equations Open and closed loop controls Integration of ordinary differential

Principle of virtual work

f𝛿𝑥

𝛿𝑞

[fT,τT] = FT

Since we have [fT,τT] = FT

F

Page 29: Dynamics Kris Hauser I400/B659, Spring 2014. Agenda Ordinary differential equations Open and closed loop controls Integration of ordinary differential

Principle of virtual work

f𝛿𝑥

𝛿𝑞

[fT,τT] = FT

Since we have [fT,τT] = FT

Since this holds no matter what is, we have [fT,τT] = FTJ(q),

Or JT(q) F =

F

Page 30: Dynamics Kris Hauser I400/B659, Spring 2014. Agenda Ordinary differential equations Open and closed loop controls Integration of ordinary differential

Next class• Feedback control

• Principles App J