physics-based simulation: graphics and robotics
DESCRIPTION
Physics-Based Simulation: Graphics and Robotics. Chand T. John. Forward Dynamic Simulation. Problem: Determine the motion of a mechanical system generated by a set of forces or control values. Challenges: Contact/collision Large number of bodies Drift Control of end result - PowerPoint PPT PresentationTRANSCRIPT
Physics-Based Simulation: Graphics and Robotics
Chand T. John
Forward Dynamic SimulationProblem:Determine the motion of a mechanical system generated by a set of forces or control values.
Challenges:- Contact/collision- Large number of bodies- Drift- Control of end result- Creating natural motion- High-level motion control- Being efficient and accurate
UpdateState
TimeStep
Forward Dynamic Simulation
Forward dynamic simulation is needed in:• Computer graphics• Robotics• Biomechanics
Bridging Biomechanics & Graphics
Graphics has:- Fast algorithms for making visually realistic movies of complicated scenes
Biomechanics has:- A need for physically realistic simulations- Real science to back up dynamic models
Biomechanics goals:• Physically realistic• Make clinically relevant conclusions• Meaningfulness > accuracy > efficiency
Graphics goals:• Visually realistic• Make cool SIGGRAPH movies• Accuracy > efficiency > meaningfulness
Constraining Mechanical Systems
• Use fewer coordinates
• Add constraint forces
• Enforce constraints after each time step
• Optimization
• Control
Robot Controller Simulation
2 3
(x1, y1, z1)
(x2, y2, z2)
(x3, y3, z3)
Reduced/generalized/joint-space/link coordinates
Maximal/redundant/operational-space/task-space/absolute coordinates
Recursive Newton-Euler Algorithm
v0
a0v1
a1
v2
a2
v3
a3
Propagate velocities outward
Propagate accelerations outward
Recursive Newton-Euler Algorithm
f0
f1
f2
f3
Propagate forces inward
O(N) algorithm for inverse dynamics!
Composite Rigid-Body Algorithm
Link i
This part of the robot is in static equilibrium.
This part of the robot is a (composite) rigid body.
Ci
When all velocity and acceleration-independent forces are zero, Mi is the force causing unit acceleration i to the robot.
Composite Rigid-Body Algorithm
Ci
If the robot is given an acceleration of i:
• all of Ci will act like a single rigid body with acceleration hi,• and the rest of the robot stays in static equilibrium.
Let fiC = force needed to induce
acceleration hi on Ci.
Composite Rigid-Body Algorithm
Mji = hjTfi
C for parents j of iMji = 0 for other j not in Ci
Fill in symmetric values Mij
Inertia IiC of Ci = sum of inertias Ij
fiC = Ii
Chj
fiC(j) = fi
C for all j in Ci
fiC = 0 for all other j
Implement in joint space
Each parent of link i has force fi
C
hjTIi
Chi if i in Cj
hjTIj
Chi if j in Ci
0 otherwise
Mji =
O(N3), fast for small N
IiC
Articulated-Body Algorithm
a = f + b Invert f = IAa + pA
IA = -1
pA = -IAbInvertible if body unconstrained
Key observation:Acceleration a of a body is alwaysan affine function of applied force f.
Articulated-Body Algorithm
Propagate IiA, pi
A inward.
3 equations, 3 unknowns:ai = a(i) + hi’qi’ + hiqi’’fi
J = IiAai + pi
A
i = hiTfi
J
Solve for qi’’Evaluate ai
Propagate ai outward.O(N), faster than CRBA for N > 9
IiA
piA
ai
Adaptive Dynamics Simplification
• Based on:– Featherstone’s O(log N) divide-and-conquer algorithm
– For forward dynamics on O(N) parallel processors
• Closed loops not supported yet• Algorithm:
– User picks number of DOFs desired
– In each time step:• Algorithm picks active joints
• Forward dynamics steps forward in time
http://gamma.cs.unc.edu/AD/
Dealing with Closed Loops
Closed loop!
Dealing with Closed Loops
Compute spanning tree
Compute dynamics for tree
Mimic loop with constraint forces
M
L
LT
0
q’’
-
– C + a
c=
Equation of motion
Constraint forces
Lagrange Multiplier Constraints
• Reduced-coordinate methods are fast• Multiplier methods (with maximal coordinates):
– Have a drift problem– Involve solving a matrix equation
• But multiplier methods:– Do not require parameterization– Allow use of nonholonomic constraints
• Limited branching sparse matrix• Baraff gives O(N) multiplier method for computing
constraint forces for dynamics
Lagrange Multiplier Constraints
This is a system with 127 constraints.
Each sphere is a 3 DOF constraint between two rigid bodies.
There are 381 Lagrange multipliers.
Post-Stabilization with DAEs
http://www.cs.ubc.ca/nest/scv/demos/Slider/slider.html
Constraint manifold
State at time t
State at time t + 1
After projection
Spacetime Constraints
• Given:– Equation of motion– Objective function to minimize– Spatial constraints to meet
• Computes:– Actuation force function by constrained optimization– Position function by integrating equation of motion
• High-energy motions modeled well• Low-energy motions require finer physics model
http://www.cs.cmu.edu/~aw/
Motion Transformation
• First physics-based mocap editing method• Steps:
– Map input motion onto simplified character– Find spacetime optimization problem most closely
matching simplified character motion– Alter parameters, constraints, etc.– Map new motion onto original to get final animation
• High-energy works well; low-energy not so well• No comparison to real actor’s motion physics
http://www.cs.washington.edu/homes/zoran/sigg99/
Physics-Based Motion Style
• Tasks represented as constraints C• E(X; ) = total torque from muscle forces• X describes a motion sequence is a vector of style parameters• Given motion capture XT and C, minimize
E(XT; ) to compute style • With new constraints C’, minimize E(X; )
to compute new motion X
http://grail.cs.washington.edu/projects/charanim/phys-style.html
Neuromuscular Perturbation
Proportional-Derivative Control
Rachel will talk about her work on PD control and human motionnext week.
m
kv
kp
mx’’ + kvx’ + kpx = 0
Derivative Proportional
Examples: Cruise control, CMC
Task-Level Control
Vince will talk about task-level control of shoulder models twoweeks from now.
Summary
• Reduced coordinates– Composite rigid-body algorithm, O(N3)– Articulated-body algorithm, O(N)– Adaptive dynamics simplification
• Constraint force application– Closed-loop systems– Lagrange multiplier constraints
• Projection onto constraint manifold– Post-stabilization with DAEs
• Optimization– Spacetime constraints– Motion transformation– Physics-based motion style
• Control– Neuromuscular perturbation– Proportional-derivative control– Task-level control