26
Physics-Based Simulation: Graphics and Robotics Chand T. John

Physics-Based Simulation: Graphics and Robotics

Embed Size (px)

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 Presentation

Citation preview

Page 1: Physics-Based Simulation: Graphics and Robotics

Physics-Based Simulation: Graphics and Robotics

Chand T. John

Page 2: Physics-Based Simulation: Graphics and Robotics

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

Page 3: Physics-Based Simulation: Graphics and Robotics

Forward Dynamic Simulation

Forward dynamic simulation is needed in:• Computer graphics• Robotics• Biomechanics

Page 4: Physics-Based Simulation: Graphics and Robotics

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

Page 5: Physics-Based Simulation: Graphics and Robotics

Constraining Mechanical Systems

• Use fewer coordinates

• Add constraint forces

• Enforce constraints after each time step

• Optimization

• Control

Page 6: Physics-Based Simulation: Graphics and Robotics

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

Page 7: Physics-Based Simulation: Graphics and Robotics

Recursive Newton-Euler Algorithm

v0

a0v1

a1

v2

a2

v3

a3

Propagate velocities outward

Propagate accelerations outward

Page 8: Physics-Based Simulation: Graphics and Robotics

Recursive Newton-Euler Algorithm

f0

f1

f2

f3

Propagate forces inward

O(N) algorithm for inverse dynamics!

Page 9: Physics-Based Simulation: Graphics and Robotics

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.

Page 10: Physics-Based Simulation: Graphics and Robotics

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.

Page 11: Physics-Based Simulation: Graphics and Robotics

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

Page 12: Physics-Based Simulation: Graphics and Robotics

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.

Page 13: Physics-Based Simulation: Graphics and Robotics

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

Page 14: Physics-Based Simulation: Graphics and Robotics

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/

Page 15: Physics-Based Simulation: Graphics and Robotics

Dealing with Closed Loops

Closed loop!

Page 16: Physics-Based Simulation: Graphics and Robotics

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

Page 17: Physics-Based Simulation: Graphics and Robotics

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

Page 18: Physics-Based Simulation: Graphics and Robotics

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.

Page 19: Physics-Based Simulation: Graphics and Robotics

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

Page 20: Physics-Based Simulation: Graphics and Robotics

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/

Page 21: Physics-Based Simulation: Graphics and Robotics

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/

Page 22: Physics-Based Simulation: Graphics and Robotics

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

Page 23: Physics-Based Simulation: Graphics and Robotics

Neuromuscular Perturbation

Page 24: Physics-Based Simulation: Graphics and Robotics

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

Page 25: Physics-Based Simulation: Graphics and Robotics

Task-Level Control

Vince will talk about task-level control of shoulder models twoweeks from now.

Page 26: Physics-Based Simulation: Graphics and Robotics

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