260 likes | 332 Views
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
E N D
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 • Creating natural motion • High-level motion control • Being efficient and accurate Update State Time Step
Forward Dynamic Simulation • Forward dynamic simulation is needed in: • Computer graphics • Robotics • Biomechanics
Bridging Biomechanics & Graphics • Biomechanics has: • A need for physically realistic simulations • Real science to back up dynamic models • Graphics has: • Fast algorithms for making visually • realistic movies of complicated scenes • 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 Maximal/redundant/operational-space/task-space/absolute coordinates (x2, y2, z2) (x3, y3, z3) (x1, y1, z1) 2 3 Reduced/generalized/joint-space/link coordinates
Recursive Newton-Euler Algorithm Propagate accelerations outward a2 a1 a3 v2 v1 a0 v3 v0 Propagate velocities outward
Recursive Newton-Euler Algorithm O(N) algorithm for inverse dynamics! f2 f1 f3 f0 Propagate forces inward
Composite Rigid-Body Algorithm This part of the robot is in static equilibrium. When all velocity and acceleration-independent forces are zero, Mi is the force causing unit acceleration i to the robot. Link i Ci This part of the robot is a (composite) rigid body.
Composite Rigid-Body Algorithm • 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. Ci
Composite Rigid-Body Algorithm Mji = hjTfiC for parents j of i Mji = 0 for other j not in Ci Fill in symmetric values Mij Inertia IiC of Ci = sum of inertias Ij fiC = IiChj fiC(j) = fiC for all j in Ci fiC = 0 for all other j Implement in joint space IiC Each parent of link i has force fiC hjTIiChi if i in Cj hjTIjChi if j in Ci 0 otherwise Mji = O(N3), fast for small N
Articulated-Body Algorithm a = f + b Invert f = IAa + pA IA = -1 pA = -IAb Invertible if body unconstrained Key observation: Acceleration a of a body is always an affine function of applied force f.
Articulated-Body Algorithm Propagate IiA, piA inward. 3 equations, 3 unknowns: ai = a(i) + hi’qi’ + hiqi’’ fiJ = IiAai + piA i = hiTfiJ Solve for qi’’ Evaluate ai Propagate ai outward. ai IiA piA O(N), faster than CRBA for N > 9
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 Equation of motion M LT q’’ – C + a = L 0 - c 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 State at time t + 1 State at time t After projection Constraint manifold http://www.cs.ubc.ca/nest/scv/demos/Slider/slider.html
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
Proportional-Derivative Control kv mx’’ + kvx’ + kpx = 0 m Derivative Proportional kp Examples: Cruise control, CMC Rachel will talk about her work on PD control and human motion next week.
Task-Level Control Vince will talk about task-level control of shoulder models two weeks 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