Upload
others
View
2
Download
0
Embed Size (px)
Citation preview
Rotational Inertia
โข The rotational inertia tensor ๐ is a 3x3 symmetric matrix that is essentially the rotational equivalent of mass
โข It relates the angular momentum ๐ of a rigid body to its angular velocity ๐ by the equation
๐ = ๐ โ ๐
โข This is similar to how mass relates linear momentum to
linear velocity with ๐ฉ = ๐๐ฏ, but adds additional complexity because ๐ is not only a matrix instead of a scalar, but it also changes over time as the object rotates
Principal Axes & Inertias
โข If we diagonalize the ๐ matrix, we get an orientation matrix ๐ and a constant diagonal matrix ๐0
๐ = ๐ โ ๐0 โ ๐๐
โข The matrix ๐ rotates the object from an orientation where the principal axes line up with the x, y, and z axes
โข The three diagonal values in ๐0, (namely ๐ผ๐ฅ, ๐ผ๐ฆ, and ๐ผ๐ง) are the principal inertias. They represent the resistance to torque around the corresponding principal axis (in a similar way that mass represents the resistance to force)
Rigid Body Dynamics
โข The center of mass of a rigid body behaves like a particle: โ Position: ๐ฑ
โ Velocity: ๐ฏ =๐๐ฑ
๐๐ก
โ Acceleration: ๐ =๐๐ฏ
๐๐ก=
๐2๐ฑ
๐๐ก2
โ Mass: ๐
โ Momentum: ๐ฉ = ๐๐ฏ
โ Force: ๐ =๐๐ฉ
๐๐ก= ๐๐
Rigid Body Dynamics
โข Rigid bodies have additional properties for rotation: โ Orientation: ๐
โ Angular velocity: ๐
โ Angular acceleration: ๐ =๐๐
๐๐ก
โ Rotational inertia: ๐ = ๐ โ ๐0 โ ๐๐
โ Angular momentum: ๐ = ๐ โ ๐
โ Torque: ๐ =๐๐
๐๐ก= ๐ร ๐ โ ๐ + ๐ โ ๐
Applied Forces
โข When we apply a force to a rigid body at some position ๐ฑ๐, this is equivalent to applying the same force on the center of mass as well as a torque equal to ๐ซ ร ๐, where ๐ซ = ๐ฑ๐ โ ๐ฑ and ๐ฑ is the position of the center of mass of the rigid body
โข Various forces can apply to a rigid body and they are just summed up as a single total force and torque:
๐๐ก๐๐ก๐๐ = ๐๐
๐๐ก๐๐ก๐๐ = ๐ซ๐ ร ๐๐
Newton-Euler Equations
โข The Newton-Euler equations describe the motion of a rigid body under applied force and torque:
๐ = ๐๐ ๐ = ๐ ร ๐ โ ๐ + ๐ โ ๐ โข Solved for acceleration: ๐ = ๐ ๐ ๐ = ๐โ1 ๐ โ ๐ ร ๐ โ ๐
Kinematics of an Offset Point
โข Kinematic equations for an offset point on a rigid body:
๐ฑ๐ = ๐ฑ + ๐ซ
๐ฏ๐ = ๐ฏ +๐ ร ๐ซ
๐๐ = ๐ +๐ ร ๐ซ +๐ ร ๐ร ๐ซ
๐ฑ ๐ซ
๐ฑ๐ = ๐ฑ + ๐ซ
Offset Forces
โข If we apply a force ๐ to a rigid body at offset ๐ซ1, what is the resulting acceleration ๐ at offset ๐ซ2?
๐
๐ =?
๐ซ๐
๐ซ๐
Inverse Mass Matrix
๐ =1
๐๐ โ ๐ซ2 โ ๐โ1 โ ๐ซ1 โ ๐
๐ =1 ๐ 0 00 1 ๐ 00 0 1 ๐
โ ๐ซ2 โ ๐โ1 โ ๐ซ1 โ ๐
๐ = ๐โ1 โ ๐
๐โ1 =1 ๐ 0 00 1 ๐ 00 0 1 ๐
โ ๐ซ2 โ ๐โ1 โ ๐ซ1
Rigid Pendulum
โข Consider a rigid body pendulum constrained at point ๐ฑ๐ with a ball-and-socket joint (3-DOF rotation)
โข We assume that various known forces ๐๐๐๐๐ค๐ are acting on the rigid body, such as gravity
โข The joint is able to apply whatever force ๐๐๐๐๐๐ก that is necessary to keep the offset point of the rigid body stationary
โข We need to solve for the unknown constraint force ๐๐๐๐๐๐ก
๐ฑ๐
๐ซ
๐ฑ
๐๐๐๐๐ค๐
๐๐๐๐๐๐ก
Rigid Pendulum
โข To evaluate all forces at a particular instant:
โ We first evaluate all known forces on the rigid body (gravity, air friction, joint friction, etc.)
โ Next, we can determine what the acceleration ๐๐ of the offset point ๐ฑ๐ would be with no constraint
โ Then, we can use the inverse mass matrix to solve for the joint force needed to counteract the acceleration and hold the joint together
Offset Acceleration
โข Assuming a known total force ๐๐๐๐๐ค๐ and torque ๐๐๐๐๐ค๐ are acting on the rigid body, we can calculate the acceleration ๐๐ at relative offset ๐ซ as:
๐ = ๐๐๐๐๐ค๐ ๐
๐ = ๐โ1 ๐๐๐๐๐ค๐ โ๐ร ๐ โ ๐
๐๐ = ๐ +๐ ร ๐ซ +๐ ร ๐ร ๐ซ
Joint Force
โข We need a joint force that will be applied at relative offset ๐ซ and must cancel out the acceleration ๐๐ (at the same place)
โข We can construct an inverse mass matrix ๐โ1 using ๐ซ for both offsets
๐โ1 =1 ๐ 0 00 1 ๐ 00 0 1 ๐
โ ๐ซ โ ๐โ1 โ ๐ซ
โข We then invert it to get the mass matrix ๐ โข We can then solve for the joint force needed to cancel out the
acceleration ๐๐
๐๐๐๐๐๐ก = โ๐ โ ๐๐
Joint Force
โข Once we have the joint force, we apply it to the rigid body just as any other force, thus finishing the summation of the total force and torque
โข We can then use the total force and torque to integrate the motion forward
Rigid Pendulum Force Computation 1. Apply known forces
๐๐๐๐๐ค๐ = ๐๐
๐๐๐๐๐ค๐ = ๐ซ๐ ร ๐๐
2. Compute separation acceleration at joint
๐ = ๐๐๐๐๐ค๐ ๐
๐ = ๐โ1 ๐๐๐๐๐ค๐ โ๐ร ๐ โ ๐
๐๐ = ๐ +๐ ร ๐ซ + ๐ร ๐ร ๐ซ
3. Build inverse mass matrix
๐โ1 =1 ๐ 0 00 1 ๐ 00 0 1 ๐
โ ๐ซ โ ๐โ1 โ ๐ซ
4. Solve joint constraint force
๐ = ๐โ1 โ1
๐๐๐๐๐๐ก = โ๐ โ ๐๐
5. Compute total force & torque
๐๐ก๐๐ก๐๐ = ๐๐๐๐๐ค๐ + ๐๐๐๐๐๐ก
๐๐ก๐๐ก๐๐ = ๐๐๐๐๐ค๐ + ๐ซ ร ๐๐๐๐๐๐ก
๐ซ
๐๐๐๐๐ค๐
๐๐๐๐๐๐ก
๐๐ก๐๐ก๐๐
Joint Error
โข Unfortunately, thereโs a catchโฆ
โข The problem is that the joint forces are changing continuously, and so the finite time integration will accumulate a small error on every step
โข An error in the integration of the second derivative means that the first derivative (velocity) and the zeroth derivative (position) will accumulate error
โข This error shows up as a non-zero velocity at the joint and as a gap in position as well
Joint Error
โข There are several options for correcting the error:
โ Penalty forces
โ Impulse to correct velocity
โ โPushโ to correct position
โ Construct as kinematic hierarchy
Double Pendulum
โข Consider the double pendulum
โข Known force ๐๐1 acts on body 1 and known force ๐๐2 acts on body 2
โข We need to simultaneously solve for joint forces ๐๐1 and ๐๐2
that hold both joints together ๐๐1
๐๐1
๐๐2
๐๐2
โ๐๐2
๐๐๐๐ฆ 1
๐๐๐๐ฆ 2
๐๐๐๐๐ก 2
๐๐๐๐๐ก 1
Notation
โข We define ๐ซ๐๐ as the offset from the center of mass of body ๐ to joint ๐
โข We will define ๐๐๐๐โ1 to be
the inverse mass matrix computed for body ๐, that relates the force applied at joint ๐ to the acceleration at joint ๐
๐๐๐๐ฆ 1
๐๐๐๐ฆ 2
๐๐๐๐๐ก 2
๐๐๐๐๐ก 1
๐ซ11
๐ซ12
๐ซ22
Known Accelerations
โข The accelerations of the first body due to known force and torque are:
๐1 = ๐๐1 ๐1
๐ 1 = ๐1โ1 ๐๐1 โ๐1 ร ๐1 โ ๐1
๐๐11 = ๐1 +๐ 1 ร ๐ซ11 +๐1 ร ๐1 ร ๐ซ11 ๐๐12 = ๐1 +๐ 1 ร ๐ซ12 +๐1 ร ๐1 ร ๐ซ12
โข And for the second body: ๐2 = ๐๐2 ๐2
๐ 2 = ๐2โ1 ๐๐2 โ๐2 ร ๐2 โ ๐2
๐๐22 = ๐2 +๐ 2 ร ๐ซ22 +๐2 ร ๐2 ร ๐ซ22
Separation Acceleration
โข For a particular joint, weโre actually interested in the acceleration that the two bodies are potentially separating
โข In other words, we want the difference between the offset accelerations of the two connected bodies at the joint
โข By definition, we will choose the sign such that we subtract the lower numbered bodyโs offset acceleration from the higher numbered bodyโs
โข Also, for weโll assign body 0 as the fixed coordinate system โข Therefore, we get the two joint separation accelerations:
๐๐1 = ๐๐11 ๐๐2 = ๐๐22 โ ๐๐12
Joint Forces
โข The separation acceleration at joint 1 resulting from joint forces will be the sum of accelerations due to ๐๐1 and โ๐๐2
โข The acceleration at joint 1 due to joint forces will be:
๐๐1โฒ = ๐111
โ1 โ ๐๐1 +๐121โ1 โ โ๐๐2
๐๐1โฒ = ๐111
โ1 โ ๐๐1 โ๐121โ1 โ ๐๐2
โข The separation acceleration at joint 2 will be the difference of the accelerations of the offset point on body 2 and the offset point on body 1
๐๐2โฒ = ๐222
โ1 โ ๐๐2 โ ๐112โ1 โ ๐๐1 +๐122
โ1 โ โ๐๐2
๐๐2โฒ = โ๐112
โ1 โ ๐๐1 + ๐122โ1 +๐222
โ1 โ ๐๐2 ๐๐1
๐๐1
๐๐2
๐๐2
โ๐๐2
๐๐๐๐ฆ 1
๐๐๐๐ฆ 2
๐๐๐๐๐ก 2
๐๐๐๐๐ก 1
Joint Forces
๐๐1โฒ = ๐111
โ1 โ ๐๐1 โ๐121โ1 โ ๐๐2
๐๐2โฒ = โ๐112
โ1 โ ๐๐1 + ๐122โ1 +๐222
โ1 โ ๐๐2
๐๐1โฒ
๐๐2โฒ =
๐111โ1 โ๐121
โ1
โ๐112โ1 ๐122
โ1 +๐222โ1 โ
๐๐1๐๐2
๐๐โฒ = ๐โ1 โ ๐๐
Double Pendulum
๐โ1 =๐111
โ1 โ๐121โ1
โ๐112โ1 ๐122
โ1 +๐222โ1
๐๐ = โ๐ โ ๐๐ โข To compute the joint forces for the double pendulum:
โ Apply known forces โ Compute separation acceleration for each joint โ Build 6x6 system inverse mass matrix
โ Invert mass matrix to solve joint forces with ๐๐ = โ๐ โ ๐๐ โ Add joint forces to compute total forces and torques
Articulated Bodies
โข We can extend this method to large systems of constrained rigid bodies
โข We end up producing a large system mass matrix that relates the vector of all joint forces to the vector of all joint accelerations
โข If we assume ๐ 3-DOF ball joints, we would end up with a 3๐ ร 3๐ mass matrix describing the relationship between joint forces and joint separation accelerations
Constraint Types
โข Weโve looked at 3-DOF ball-and-socket joints โข These are nice because they require solving a
straightforward 3D force โข However, other joint types are also possible such
as 1-DOF hinges, 2-DOF universal joints, 1-DOF translational โprismaticโ joints, and more
โข These other joint types can apply a constraint force as well as torques
โข A 1-DOF hinge joint, for example, applied 5 constraints: 3 forces, and 2 torques, leaving 1 DOF free to rotate
Constraint Types
โข To handle different constraint types, we need to compute the individual mass matrices differently
โข We can generalize the force-acceleration relationship to include torques and angular accelerations
โข A 1-DOF rotational joint would require a 5x5 inverse mass matrix that relates 3 forces and 2 torques to 3 accelerations and 2 angular accelerations
โข The overall process is similar to how we derived the inverse mass matrix in the last lecture
System Mass Matrix
โข For a system of articulated rigid bodies, we end up with an ๐ ร๐ mass matrix that relates constraint forces to accelerations, where ๐ is the total number of constrained degrees of freedom
โข We see that a large system of constraints results in a large matrix that must be inverted
โข The matrix will be more sparse for loosely coupled systems and less sparse for tightly coupled systems
โข The matrix will also be positive definite โข There are several approaches to solving this system:
โ Direct matrix solution โ Pairwise solution โ Recursive solution (Featherstoneโs algorithm) โ Lagrangian formulation
Direct Solution
โข If we have a dense mass matrix, we can directly invert with standard matrix inversion or solvers
โข Larger matrices tend to be more sparse, and so can benefit from special purpose sparse solvers
โข There are a variety of special purpose solvers that can take advantage of properties of the system (sparseness, positive-definitenessโฆ)
Pairwise Algorithms
โข One can also use pairwise algorithms to solve large systems of constraints
โข With this method, we group all constraints into a queue, ordered by the magnitude of the separation accelerations
โข We then iteratively solve for the constraint at the top of the queue, and then add it to the known forces, recomputing separation accelerations of connected joints and re-ordering the queue as needed
โข Basically, this method continues to fix the constraint with the largest separation and repeats until it converges and all separations approach zero
Featherstoneโs Algorithm
โข Featherstoneโs algorithm is a recursive method for solving the dynamics of tree structures without kinematic loops
โข It can evaluate systems in linear O(n) time โข It traverses from the fixed base (or an unfixed root) to the
leaf nodes computing joint separation accelerations and accumulating a mass matrix connecting from the base to each leaf
โข Then, it solves the joint forces from the leaves progressing back to the root
โข There are some adaptations to handle kinematic loops, but they compromise the linear time behavior
โข โRobot Dynamics Algorithmsโ, Featherstone, 1987
Lagrangian Dynamics
โข We can also reformulate the equations into the Lagrangian form โข This is fairly different from how weโve done things so far โข Lagrangian methods define the state of the system using
generalized coordinates, only using coordinates for actual DOFs in the system
โข In this approach, the constraints never actually need to be solved, but we do have to solve for the motion of the degrees of freedom
โข If the number of unconstrained DOFs is less than the number of constrained DOFs, then these methods can be faster than the Newtonian methods described so far
โข However, the method can be tricky to work with and doesnโt handle collisions or energy damping easily
Kinematic Loops
โข We often distinguish between articulated bodies with open tree-like structures from bodies with closed kinematic loops
โข Closed loops can add challenges to some of the solution methods, as they may result in over-constrained systems and non-invertible mass matrices
โข Some methods require special handling for these, while other methods (like pairwise solvers) donโt require anything special
Detection and Response
โข Collision handling requires two different technologies: โ Collision detection (geometry) โ Collision response (physics)
โข The collision detection problem is a complex application of 3D geometry and spatial data structures, and will be discussed in more detail in the next lecture
โข Collision response is the physics problem of determining the forces (or impulses) resulting from the collisions
Impact vs. Contact
โข It is useful to distinguish between momentary (instantaneous) impacts and finite time contacts
โข With impacts, the closing velocity is positive before the collision, and with contacts, the closing velocity is zero (or very close)
โข Some rigid body methods handle impacts differently from contacts, while other methods donโt distinguish between the two
Impulse
โข Force is the derivative of momentum, and changes in momentum require forces acting over time
โข An impulse ๐ฃ is a large force applied over a short time, such that it can be treated as an instantaneous change in momentum, rather than a rate of change over time
๐ฃ = ๐๐๐ก
โข Impulses operate in a very similar fashion as forces, except they affect the velocity
instead of the acceleration โข As with forces, impulses obey Newtonโs Third Law (action/reaction) โข An impulse can be applied to a rigid body at relative offset ๐ซ resulting in an
instantaneous change in momentum ๐ฉ and angular momentum ๐ of the body
โ๐ฉ = ๐ฃ โ๐ = ๐ซ ร ๐ฃ
Collision Impulses
โข Most rigid body methods resolve instantaneous impacts with impulses
โข Persistent contacts can be simulated with forces or impulses, but many modern methods use impulses
โข In fact, constraints can be handled through forces or impulses as well, and by using impulses, one can handle impacts, contacts, and constraints through a single process
Single Body Impact
โข We define ๐ฑ๐ as the impact point, ๐ง as the normal of the impact surface, ๐ฏ๐ as the offset velocity before the collision, ๐ฏ๐โฒ as the offset velocity after, and ๐ฃ is the impulse
๐ฏ๐
๐ฏ๐โฒ ๐ง
๐ฑ๐
๐ฃ
Collision Restitution
โข In terms of collisions, restitution refers to the amount of kinetic energy that is conserved, and thus the amount of bounce
โข We can measure it with a coefficient of restitution ๐ that will range from 0 (perfectly inelastic) to 1 (perfectly elastic)
โข For simplicity, we can assume that we have a constant restitution for a rigid body. If two rigid bodies of different restitution collide, it is a reasonable heuristic to use the lower of the two for the impulse computation
โข Note: there are different ways to define the exact meaning of this constant, and it is ultimately just an approximation to a far more complex process that is dependent on the material properties and shape of the object
โข Note: sometimes called coefficient of elasticity
Collision Impulse
โข We need a collision impulse that will be applied at relative offset ๐ซ and must cancel out the velocity ๐ฏ๐ (at the same place)
โข We can construct an inverse mass matrix ๐โ1 using ๐ซ for both offsets
๐โ1 =1 ๐ 0 00 1 ๐ 00 0 1 ๐
โ ๐ซ โ ๐โ1 โ ๐ซ
โข We then invert it to get the mass matrix ๐ โข We can then solve for the impulse needed to cancel out the velocity
๐ฏ๐
๐ฃ๐๐๐๐๐๐ก = โ 1 + ๐ ๐ โ ๐ฏ๐
Coulomb Friction
โข The simple but effective Coulomb friction model says:
๐๐ ๐ก๐๐ก โค ๐๐ ๐๐๐๐๐ ๐๐๐ฆ๐ = ๐๐๐๐๐๐๐
โข Where ๐๐ ๐ก๐๐ก is the force due to static friction, ๐๐๐ฆ๐ is the force due to dynamic friction, ๐๐๐๐๐ is the normal force, and ๐๐ and ๐๐ are the coefficients of static and dynamic friction
โข The direction of the force will be opposite of the tangential velocity at the contact point
โข The coefficients range from 0 (perfectly frictionless) to around 1.5 or so, but there really isnโt a strict maximum, as materials could conceivably have adhesive (sticky) properties
โข ๐๐ is typically a bit larger than ๐๐
Friction Cone
โข Consider a block sliding on a flat surface
โข The ground applies a normal force and a friction force
โข According to the Coulomb friction model, the two forces must add up to a vector that lies within the friction cone
โข The same can be said about impulses resulting from impacts
๐ฃ
๐
1
Tangential Velocity
โข We need to find the tangential velocity of the impact in order to determine the direction the friction will act
โข We start by taking the difference of the two object velocities offset at the collision point
๐ฏ = ๐ฏ1 โ ๐ฏ2 โข If ๐ง is the surface normal if the contact point, we can decompose
the velocity into normal and tangential components:
๐ฏ๐๐๐๐ = ๐ฏ โ ๐ง ๐ง ๐ฏ๐ก๐๐ = ๐ฏ โ ๐ฏ๐๐๐๐
Rolling & Spinning Friction
โข One can also add rolling and spinning friction effects to collisions and contacts
โข We must first find the angular velocity difference at the collision point โข From there, we can decompose it into rolling and spinning components
based on the contact normal ๐ง
๐๐ ๐๐๐ = ๐ โ ๐ง ๐ง
๐๐๐๐๐ = ๐โ๐๐ ๐๐๐ โข We can then apply friction torques proportional to each of those based on
separate constants
๐๐๐๐๐ = โ ๐๐๐๐๐ ๐๐ ๐๐๐๐๐ ๐๐๐ + ๐๐๐๐๐๐๐๐๐๐
Joint Friction
โข We can also add friction on articulated joints โข Usually, these would be based on the angular velocity of the joint, which is
the difference of the angular velocities of the two connected bodies โข For rotational joints, the joint friction will be in the form of a torque
applied equal and opposite to the two connected bodies
๐๐๐๐๐ = โ๐๐๐๐๐๐ก๐๐๐๐๐๐ก
โข Where ๐๐๐๐๐ is the friction torque, ๐๐๐๐๐๐ก is the joint friction, and ๐๐๐๐๐๐ก is the joint angular velocity
โข Static friction can also be modeled for joints. To do this, one must first assume a 6-DOF constraint and solve for the required constraint force. If this is within the static friction limit, it is used, otherwise, it is solved as a regular joint and dynamic friction is added
Collision Impulse with Friction
โข We wish to find a collision impulse ๐ฃ that accounts for the elasticity and friction โข We can compute the velocity of the colliding point at offset ๐ซ as:
๐ฏ๐ = ๐ฏ + ๐ ร ๐ซ
๐ฏ๐๐๐๐ = ๐ฏ๐ โ ๐ง ๐ง ๐ฏ๐ก๐๐ = ๐ฏ๐ โ ๐ฏ๐๐๐๐
โข We also build the inverse mass matrix ๐โ1 for the body using ๐ซ for both offsets โข We start by assuming perfect static friction and solving for the impulse that would result in an
elastic bounce and the tangential velocity going to zero after the collision:
๐ฏ๐๐๐๐โฒ = โ๐๐ฏ๐๐๐๐
๐ฃ0 = ๐ โ ๐ฏ๐๐๐๐โฒ โ ๐ฏ๐๐๐๐
โข This allows us to solve the impulse that produces this result โข If this lies within the friction cone, then weโre done โข Otherwise, we assume sliding (dynamic) friction โข For more details, see section 7 of โNonconvex Rigid Bodies with Stackingโ, Guendelman, Bridson,
Fedkiw, 2003
Multiple Body Collisions
โข We can solve for multiple collisions in the same basic way that we solved for multiple constraint forces
โข We set up a large linear system that includes all of the collision constraints
โข There are two main differences from the articulated body solution: โ For collisions, we work with impulses rather than
forces โ For collisions, we are solving an inequality problem
rather than an equality problem
Linear Complementarity
โข Collisions result in inequality constraints because they will only act to prevent objects from moving towards each other and have no effect on objects moving apart
โข A large system of inequalities can be formed into a linear complementarity problem (LCP) which is a well studied class of problems
โข Various solution methods have been proposed to address these, and some are discussed in the overview paper on the web page
Pairwise Solvers
โข Pairwise solvers iteratively solve one collision at a time until the entire system is satisfied
โข These have proven to be pretty effective in handling of multiple collisions and constraints, as each one can be treated with its own rules and special cases
โข Some other methods may be faster, but pairwise solvers tend to be very general purpose and easy to implement