Johnson Michael Su - Computer Sciencegamma.cs.unc.edu/courses/robotics-f08/LEC/RBDynamics.pdf ·...

27
Tim Johnson & Michael Su

Transcript of Johnson Michael Su - Computer Sciencegamma.cs.unc.edu/courses/robotics-f08/LEC/RBDynamics.pdf ·...

Page 1: Johnson Michael Su - Computer Sciencegamma.cs.unc.edu/courses/robotics-f08/LEC/RBDynamics.pdf · 2008-09-29 · Introduction! tiNo tations Particle!dy namics!(basics)! Rigid! body!

Tim!Johnson!&!Michael!Su

Page 2: Johnson Michael Su - Computer Sciencegamma.cs.unc.edu/courses/robotics-f08/LEC/RBDynamics.pdf · 2008-09-29 · Introduction! tiNo tations Particle!dy namics!(basics)! Rigid! body!

! IntroductionN t ti! Notations

! Particle!dynamics!(basics)y! Rigid!body!dynamics! Numerical!integration! Numerical!integration! Simulation!loop! Collision!response

Page 3: Johnson Michael Su - Computer Sciencegamma.cs.unc.edu/courses/robotics-f08/LEC/RBDynamics.pdf · 2008-09-29 · Introduction! tiNo tations Particle!dy namics!(basics)! Rigid! body!

! Why!do!we!need!to!study!the!rigid!body!for!robotics?robotics?

Page 4: Johnson Michael Su - Computer Sciencegamma.cs.unc.edu/courses/robotics-f08/LEC/RBDynamics.pdf · 2008-09-29 · Introduction! tiNo tations Particle!dy namics!(basics)! Rigid! body!

! The!study!of!bodies!in!motion! Comprises!kinematics!and!kinetics! Comprises!kinematics!and!kinetics

! Kinematics:!describing!the!motion! Kinetics:!explaining!the!motion

! Used!to!model!many!different!objectsy j! Particles! Rigid!bodies! Rigid!bodies! Fluids

Page 5: Johnson Michael Su - Computer Sciencegamma.cs.unc.edu/courses/robotics-f08/LEC/RBDynamics.pdf · 2008-09-29 · Introduction! tiNo tations Particle!dy namics!(basics)! Rigid! body!

! To!model!and!understand!the!world!around!usus! Simulation! Animation

! To!make!predictionsp! Weather! Traffic! Traffic

! To!control!robots

Page 6: Johnson Michael Su - Computer Sciencegamma.cs.unc.edu/courses/robotics-f08/LEC/RBDynamics.pdf · 2008-09-29 · Introduction! tiNo tations Particle!dy namics!(basics)! Rigid! body!

! http://www.youtube.com/watch?v=W1czBcnX1WwX1Ww

Page 7: Johnson Michael Su - Computer Sciencegamma.cs.unc.edu/courses/robotics-f08/LEC/RBDynamics.pdf · 2008-09-29 · Introduction! tiNo tations Particle!dy namics!(basics)! Rigid! body!

! Goal:!develop!equations!for!motion!of!rigid!bodiesbodies

! Derive!equations!for!particles!firstSi l ! h i ! h ! i id!b di! Simpler!physics!than!rigid!bodies

! Less!degrees!of!freedom! Generalize!to!rigid!bodies

! Rigid!body!=!collection!of!many!particlesRigid!body! !collection!of!many!particles

Page 8: Johnson Michael Su - Computer Sciencegamma.cs.unc.edu/courses/robotics-f08/LEC/RBDynamics.pdf · 2008-09-29 · Introduction! tiNo tations Particle!dy namics!(basics)! Rigid! body!

!" !"! Vector!representation:!

###!

$$$"

%&

2

1

xx

x###!

$$$"

%&

2

1

vv

v

d

#'$( 3x #'$( 3v

)dx ))d 2! Time!derivative:! %* xdtdx ))

%* xtdxd2

2

! Phase!space!(Spatial!vector):

###!

$$$"

!"2

1

xx

!"!" ) v

####

$$$$

%#'

!$(

"

1

3

vx

vx

##'

!

$$(

"%

##'

!

$$(

")

mfv

vx

###

'$$$

( 3

2

vv

Page 9: Johnson Michael Su - Computer Sciencegamma.cs.unc.edu/courses/robotics-f08/LEC/RBDynamics.pdf · 2008-09-29 · Introduction! tiNo tations Particle!dy namics!(basics)! Rigid! body!

! The!particle!is!a!point!massP iti ! t !( ! ! )! Position!vector!(x1,!x2,!x3)

! Mass!m! 3!degrees!of!freedom

Page 10: Johnson Michael Su - Computer Sciencegamma.cs.unc.edu/courses/robotics-f08/LEC/RBDynamics.pdf · 2008-09-29 · Introduction! tiNo tations Particle!dy namics!(basics)! Rigid! body!

! Mass! Linear!Velocity! Linear!Velocity! Linear!Acceleration! Linear!momentum! Does!not!have

! Volume! Angular!characteristics! Angular!characteristics

Page 11: Johnson Michael Su - Computer Sciencegamma.cs.unc.edu/courses/robotics-f08/LEC/RBDynamics.pdf · 2008-09-29 · Introduction! tiNo tations Particle!dy namics!(basics)! Rigid! body!

! Force!applied!to!particle!equals!mass!times!accelerationacceleration

Page 12: Johnson Michael Su - Computer Sciencegamma.cs.unc.edu/courses/robotics-f08/LEC/RBDynamics.pdf · 2008-09-29 · Introduction! tiNo tations Particle!dy namics!(basics)! Rigid! body!

=!0

Page 13: Johnson Michael Su - Computer Sciencegamma.cs.unc.edu/courses/robotics-f08/LEC/RBDynamics.pdf · 2008-09-29 · Introduction! tiNo tations Particle!dy namics!(basics)! Rigid! body!

! A!collection!of!many!particles! We!use!the!center!of!mass!for!position!and!! We!use!the!center!of!mass!for!position!and!center!of!rotationd f f d! 6!degrees!of!freedom

! 3!position3 p! 3!angular

Page 14: Johnson Michael Su - Computer Sciencegamma.cs.unc.edu/courses/robotics-f08/LEC/RBDynamics.pdf · 2008-09-29 · Introduction! tiNo tations Particle!dy namics!(basics)! Rigid! body!

! Angular!momentum!is!the!sum!over!all!particles!that!make!up!the!rigid!bodyparticles!that!make!up!the!rigid!body

Page 15: Johnson Michael Su - Computer Sciencegamma.cs.unc.edu/courses/robotics-f08/LEC/RBDynamics.pdf · 2008-09-29 · Introduction! tiNo tations Particle!dy namics!(basics)! Rigid! body!

Integral!is!called!the!inertia!tensor

Page 16: Johnson Michael Su - Computer Sciencegamma.cs.unc.edu/courses/robotics-f08/LEC/RBDynamics.pdf · 2008-09-29 · Introduction! tiNo tations Particle!dy namics!(basics)! Rigid! body!

! Inertia!is!rotation!analog!of!mass! In!2D !every!rotation!axis!is!parallel! In!2D,!every!rotation!axis!is!parallel! In!3D,!objects!can!rotate!about!arbitrary!axes

h d f d f! The!inertia!tensor!is!used!to!find!inertia!for!an!arbitrary!axis:y

Page 17: Johnson Michael Su - Computer Sciencegamma.cs.unc.edu/courses/robotics-f08/LEC/RBDynamics.pdf · 2008-09-29 · Introduction! tiNo tations Particle!dy namics!(basics)! Rigid! body!
Page 18: Johnson Michael Su - Computer Sciencegamma.cs.unc.edu/courses/robotics-f08/LEC/RBDynamics.pdf · 2008-09-29 · Introduction! tiNo tations Particle!dy namics!(basics)! Rigid! body!
Page 19: Johnson Michael Su - Computer Sciencegamma.cs.unc.edu/courses/robotics-f08/LEC/RBDynamics.pdf · 2008-09-29 · Introduction! tiNo tations Particle!dy namics!(basics)! Rigid! body!

x’1x’2x’

x1x2x

Simulator

?dx(t)/dt = v x 3v’1v’2v’3

x3v1v2v3

?dx(t)/dt!=!vdv(t)/dt = a v 3

mv3m dv(t)/dt!=!a

External!Forces,!i.e.! Internal!Forces,!i.e.!gravity,!friction,!damping,!constraint,!…

attraction,!bending,!shear,!…

Page 20: Johnson Michael Su - Computer Sciencegamma.cs.unc.edu/courses/robotics-f08/LEC/RBDynamics.pdf · 2008-09-29 · Introduction! tiNo tations Particle!dy namics!(basics)! Rigid! body!

)&

! Idea: Evaluate!Derivatives

&

xt

&

xt

Increament

&

newx1+t

! Evaluation:!

t t 1+t

! Stability! Error

! Case!study:!! Euler’s!method!!! Euler s!method!!! Mid!point!method! Adaptive!method

Page 21: Johnson Michael Su - Computer Sciencegamma.cs.unc.edu/courses/robotics-f08/LEC/RBDynamics.pdf · 2008-09-29 · Introduction! tiNo tations Particle!dy namics!(basics)! Rigid! body!

! Euler’s!method!(1st!order):!x11

x1 =!x0 +!f(x0!,!t0)*h,!h:!step!size

x0 f(x,!t):!first!derivative!at!x

! Mid!point!method!(Runge"Kutta!2,!2nd!order):)

"x!=!f(x0!,!t0)*hx = x + f(x +"x/2 t +h/2)*hx1 =!x0 +!f(x0+"x/2 ,!t0 +h/2)*h

x0

Page 22: Johnson Michael Su - Computer Sciencegamma.cs.unc.edu/courses/robotics-f08/LEC/RBDynamics.pdf · 2008-09-29 · Introduction! tiNo tations Particle!dy namics!(basics)! Rigid! body!

x’1x’2x’

x1x2x

Simulator

Ti x 3v’1v’2v’3

x3v1v2v3

Evaluate!the!acceleration!(a!=!F/m) Time!integration,i.e.!Euler,!Mid point v 3

mv3m Force!accumulation

Mid!point,!RK4,!…

External!Forces,!i.e.! Internal!Forces,!i.e.!gravity,!friction,!damping,!constraint,!…

attraction,!bending,!shear,!…

Page 23: Johnson Michael Su - Computer Sciencegamma.cs.unc.edu/courses/robotics-f08/LEC/RBDynamics.pdf · 2008-09-29 · Introduction! tiNo tations Particle!dy namics!(basics)! Rigid! body!

! How!to!detect!collisions! Types!of!colliding!contact! Types!of!colliding!contact:

! Separation!(Vrel(A">B)!•!NB >!0)! Resting!contact!(Vrel(A">B)!•!NB =!0)! Colliding!contact!(Vrel(A >B)!•!NB <!0)Co d g co tact ( rel(A">B)! B 0)

! Techniques!to!handle!collisions:I l ! th d N

Vrel(A">B)Vrel(A">B)! Impulse!method! Penalty!method

A PA BPB

Vrel(A">B)

Page 24: Johnson Michael Su - Computer Sciencegamma.cs.unc.edu/courses/robotics-f08/LEC/RBDynamics.pdf · 2008-09-29 · Introduction! tiNo tations Particle!dy namics!(basics)! Rigid! body!

! Impulse!method!(for!colliding!contact)I t t l ! h !th ! l it ! t!th !! Instantaneously!change!the!velocity!at!the!contacting!point.

P l ! h d! Penalty!method! Use!spring!forces!to!pull!penetrated!objects!out.

! How!to!deal!with!resting!contact?! Compute!and!apply!repulsion!forces!for!all!the!Compute!and!apply!repulsion!forces!for!all!the!contacting!point!to!maintain!the!equilibrium.

! Need!to!solve!a!quadratic!programming!problem! Need!to!solve!a!quadratic!programming!problem.

Page 25: Johnson Michael Su - Computer Sciencegamma.cs.unc.edu/courses/robotics-f08/LEC/RBDynamics.pdf · 2008-09-29 · Introduction! tiNo tations Particle!dy namics!(basics)! Rigid! body!

x1x2x

Simulator

Evaluate the acceleration (a = F/m) Time!x3v1v2v3

Evaluate!the!acceleration!(a!=!F/m)integration,i.e.!Euler,!mid!point,!

x’1

v3m Force!accumulation RK4,!…

x 1x’2x’3v’1

Collision!detectionExternal!Forces,!i.e.!

gravity,!friction,!damping constraint

Internal!Forces,!i.e.!attraction,!bending,!shear 1

v’2v’3m

A d ’ h lli i h

Collision!response

damping,!constraint,!…

shear,!…

Assume!we!don’t!have!collisions!at!the!beginning…

Page 26: Johnson Michael Su - Computer Sciencegamma.cs.unc.edu/courses/robotics-f08/LEC/RBDynamics.pdf · 2008-09-29 · Introduction! tiNo tations Particle!dy namics!(basics)! Rigid! body!

! Why!understanding!rigid!body!is!important!for!roboticsfor!robotics

! From!particles!to!rigid!bodiesh f h d b d! The!properties!of!the!rigid!body

! The!motion!of!the!rigid!bodyg y! Numerical!integration! How!to!handle!collisionsHow!to!handle!collisions! Rigid!body!simulation!framework

Page 27: Johnson Michael Su - Computer Sciencegamma.cs.unc.edu/courses/robotics-f08/LEC/RBDynamics.pdf · 2008-09-29 · Introduction! tiNo tations Particle!dy namics!(basics)! Rigid! body!

! Baraff!&!Witkin,!“An!Introduction!to!Physically!Based!Modeling" course!notes!(Rigid!Body!Dynamics!I!and!Modeling course!notes!(Rigid!Body!Dynamics!I!and!II,!Differential!Equation!Basics,!and!Particle!Dynamics) !SIGGRAPH2001Dynamics),!SIGGRAPH2001

! Stanford!Univeristy,!“Lecture!11!Introduction!to!Robotics” !http://www youtube com/watch?v=o3Xx3vi6qzoRobotics ,!http://www.youtube.com/watch?v=o3Xx3vi6qzo

! Professor!Karen!Liu’s!slides!from!the!Computer!Animation!class!at!Georgia!Tech!Animation!class!at!Georgia!Tech!http://web.mac.com/ckarenliu/CS4496/Calendar.html