0% found this document useful (0 votes)
3 views9 pages

Impulse Based Control of Joints

The document presents a novel approach to proportional derivative (PD) control for joint and muscle management in animation, focusing on achieving desired joint behavior despite global influences like gravity and external forces. The proposed method utilizes an analytical solution to PD equations, allowing for effective decoupling of stiffness from control and improving stability without requiring extensive tuning. The authors illustrate their technique through various examples, demonstrating its advantages over traditional PD control methods.

Uploaded by

forrest666
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views9 pages

Impulse Based Control of Joints

The document presents a novel approach to proportional derivative (PD) control for joint and muscle management in animation, focusing on achieving desired joint behavior despite global influences like gravity and external forces. The proposed method utilizes an analytical solution to PD equations, allowing for effective decoupling of stiffness from control and improving stability without requiring extensive tuning. The authors illustrate their technique through various examples, demonstrating its advantages over traditional PD control methods.

Uploaded by

forrest666
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

IEEE TRANSACTIONS ON VISUALIZATION AND COMPUTER GRAPHICS 1

Impulse Based Control of Joints and Muscles


Rachel Weinstein, Eran Guendelman, and Ron Fedkiw, Member, IEEE

Abstract— We propose a novel approach to proportional motions are tracked too closely. This is especially problematic
derivative (PD) control exploiting the fact that these equations when the input motion is of low quality or violates physical
can be solved analytically for a single degree of freedom. The constraints. PD control works well because it smooths out the
analytic solution indicates what the PD controller would accom-
plish in isolation without interference from neighboring joints, input motion in a desirable, physically realistic fashion.
gravity and external forces, outboard limbs, etc. Our approach to The problem with PD control stems from locality. Anima-
time integration includes an inverse dynamics formulation that tors understand how to choose gains for individual joints, but
automatically incorporates global feedback so that the per joint are then frustrated when the behavior of the joint in question
predictions are achieved. This effectively decouples stiffness from is affected by global factors such as other joints, gravity and
control so that we obtain the desired target regardless of the
stiffness of the joint, which merely determines when we get there. external forces, etc. Techniques have been proposed to allevi-
We start with simple examples to illustrate our method, and then ate these problems to some degree, e.g. [14], [15] scaled the
move on to more complex examples including PD control of line stiffness of the gains by the moments of inertia of the outboard
segment muscle actuators. body, [16] recommended tuning the stiffness parameters so
Index Terms— proportional derivative control, torque control, that the character can stand up under gravity, and [17] used
muscle control, animation inverse dynamics to calibrate gains.
We propose a new PD control technique that achieves the
desired per joint behavior regardless of global effects. The
I. I NTRODUCTION
key idea is to realize that the PD equations can be solved
VER 20 years ago, [1], [2] used torques to control
O joint angles, and the notion of combining dynamics with
character animation has remained exciting ever since. For
analytically to find out what the PD controller aims to achieve
during the time step, and then to exactly target that state.
That is, instead of targeting the input motion, we target
example, consider the spacetime constraints animation of Luxo what the individual joint controllers would do if they were
Jr. [3], the physics based athlete animations just before the working as designed without interference from global effects
1996 Summer Olympics in Atlanta [4], and the composable and external forces. This gives us many of the properties
controllers used to make a virtual stuntman [5]. that make other algorithms attractive in comparison to PD,
With few exceptions, most systems use linear or while still maintaining the PD framework. For example, our
nonlinear springs to target a desired angle. The most method decouples stiffness from control, and accounts for
popular of these is proportional derivative control global feedback via the inverse dynamics without the need
τ = −k1 (θ − θo ) − k2 (θ̇ − θ̇o ). Many authors omit θ̇o for prediction models as in [9] or the need to include extra
instead targeting a zero velocity, although there are notable terms as in proportional integral derivative (PID) control. With
exceptions, e.g. [4]. In spite of its popularity, PD control has regards to the compensation provided by the integral term of
many agreed upon drawbacks. For example, [6] pointed out PID control, our method achieves the same result but in a
how applying torques at one joint adversely effects others, memoryless fashion without the need for tunable parameters.
[7], [8] criticized the large amount of tuning necessary to Our method decouples stiffness from control similar to [10].
achieve proper gains, [9] noted the lack of system wide However, [10] requires estimates of the external forces which
feedback, and [10] discussed how gravity and external forces our method does not need. Also, we enjoy additional benefits
cause errors even at equilibrium and how increasing gains to such as unconditional stability. We can critically damp the
alleviate this results in overly stiff characters. errors as in model reference adaptive control [7], but our
In a simple setting with no closed loops, contact or collision, critically damped path is based on the physical second order
etc., [6], [11] proposed using τ = m((θo − θ)/∆t − ω)/∆t system given by the PD equations. Moreover, we obtain the
which yields θo exactly at the end of a forward Euler step in desired target regardless of the stiffness of the joint, which
generalized coordinates. However, they noted that this tracks merely determines when we get there. As pointed out in
the kinematic motion too closely making the character too stiff. section III, our method can be generalized to other controllers.
More generally, inverse dynamics ( [12], [13]) can be used to Also, we could include other parameterizations including the
find the torques that give any acceleration desired, although ones given by [10]. Finally, our method can be summarized
inverse dynamics does not account for the time integration as inverse dynamics tracking of PD smoothed input motion,
scheme and methods for combating drift are required. The which is similar in spirit to using non-physical Ferguson curves
problem is not that we cannot track motion, but that the to smooth between extremal target angles [8].
The PD generated torques are typically integrated via time
R. Weinstein is with the Stanford University Department of Computer integration, which results in drift. Thus, we take an impulse
Science and Industrial Light + Magic. E. Guendelman is with the Stanford
University Department of Bioengineering. R. Fedkiw is with the Stanford based approach to the dynamics as in [18]–[21] working with
University Department of Computer Science and Industrial Light + Magic. impulse and velocity as opposed to force and acceleration. This
IEEE TRANSACTIONS ON VISUALIZATION AND COMPUTER GRAPHICS 2

Fig. 1. (Left) At the beginning of the simulation, the block’s weight


provides contact and collision forces which fight with PD resulting in the
depression of the planks beneath. (Right) When the block is included
in the global post-stabilization, the articulated structure automatically Fig. 2. Given current data and the size of a time step, our method (blue
generates the forces required to achieve the target position. Thus, the arrow) exactly achieves the desired angle whereas traditional PD control
animator can choose whether foreign objects should be heavy or effortless (red arrow) overshoots. The red arrow is drawn tangent to the curve,
to lift. For example, while characters should struggle to lift a large stone, which is the result for forward Euler time integration. Other explicit
one might want them to brandish a sword with ease. integration schemes such as Runge-Kutta overshoot differently, but the
overshoots still cause inaccuracy and time step restrictions.

also allows for more robust incorporation of external forces included a muscle smoothness term in the objective function
such as collisions and contact, giving us a hybrid between what along with a term that measures deviation from an input
the character is trying to do and its reaction to its environment. motion. [37] improved the approximation of muscle forces
Figure 1 demonstrates the tradeoff between reaction to external incorporating effects such as relative strengths and passive
forces and incorporation of external forces. forces.
We use the articulated rigid body framework of [22], which After torque actuators, the next logical step (before full-
maintains articulation constraints using a combination of pre- blown three-dimensional finite element analysis) are the line
stabilization and post-stabilization. Pre-stabilization computes segment muscle actuators which control joints via lines of
linear and angular impulses needed to maintain joint con- action as in [38], [39]. Examples include building models of
straints at the end of a time step. In [22], the linear and angular the legs [40]–[42], arms [43], [44], hands [45], [46], neck [47],
impulses were determined by solving two independent systems and body [48], [49]. There is also the musculoskeletal strand
of equations, whereas in our work we have improved upon this model of [50].
by solving a single, fully coupled system of equations (see
section IV and appendix A). Post-stabilization uses impulses III. PD C ONTROL
to project the joint velocities to satisfy the constraints (see
We begin by discussing PD control in a generalized (re-
also e.g. [23]). Whereas [22] treated the joints sequentially,
duced) coordinate formulation, where each coordinate repre-
in our work we solve for all joints simultaneously in order to
sents a degree of freedom. Given a sufficiently smooth target
incorporate global effects during inverse dynamics (see section
trajectory θo (t) (splines, etc. can be used for smoothing if
V). Furthermore, significant generalizations of [22] would be
required) along with first and second derivatives of this trajec-
required to address the issues of motion control and muscle
tory, the PD control law specifies the generalized acceleration
actuation.
as

II. OTHER P REVIOUS W ORK θ̈ = θ̈o − kp (θ − θo ) − kv (θ̇ − θ̇o )


[24] proposed a method for slowing down a limb as it where kp and kv are the proportional (position) and derivative
reaches the target angle, [25] merged many segments into one (velocity) gains, respectively. Note that the definition of these
fixed block for efficiency (see also [26]), [27], [28] mixed constants differs from that of k1 and k2 given in section I
high level control strategies with low level dynamics, [29]– where torque was computed rather than acceleration. These
[31] proposed interesting control strategies that work with PD quantities are related via kp = k1 /m and kv = k2 /m where
control, [32] used inverse dynamics for balance and comfort, m is a generalized moment of inertia. Many authors ignore
[33] showed examples of ladder climbing and push-ups (closed θ̇o and θ̈o , instead targeting a zero velocity and acceleration.
loops), and [15] reduced gains during contact so that characters However, including these allows us to formulate a second order
can react. equation for the error,
[3] introduced spacetime constraints which impose con-
straints for the entire course of the animation relying on large-
Ë + kv Ė + kp E = 0
scale constrained optimization and sparse matrix methods.
Typical objective functions minimize internal actuation, de- where E = θ − θo . Given errors in both velocity and position,
fined via an undamped spring targeting a rest angle that varies PD control drives those errors to zero while fitting naturally
in time (as does the spring constant). These were improved by into a second order physics system. Moreover, similar to
considering smaller windows with boundary conditions [34] Baumgarte stabilization [51], the error is reduced most quickly
and a hierarchical approach [35]. [36] incorporated generalized via critical damping which drives E to zero with p at most one
muscle forces based on PD control with the θ̇ term, and overshoot. This is achieved by setting kv = 2 kp reducing
IEEE TRANSACTIONS ON VISUALIZATION AND COMPUTER GRAPHICS 3

Fig. 3. The red curve shows the results obtained using our method Fig. 4. Comparison of our method (blue), traditional PD control (red)
for kp and kv along with forward Euler time integration. The method and the analytic solution (black) for a medium size time step where errors
converges to the analytic solution of the PD equations with kp0 = kp /2 can be seen. Note that for smaller time steps, all three curves lie on top
and kv0 = kv /2 depicted in black circles. The blue curve shows our of each other. We also show the results of our method for an extremely
method with k̂p = 2kp and k̂v = 2kv , which converges to the solution large time step (dotted blue) where the standard force based PD control
of the PD equations with kp and kv as desired (black x’s). method becomes unstable and diverges. Our method removes almost all
the error in one (rather big) time step as it targets the analytic solution.

the choice of gains to a one-dimensional family parameterized


by kp . Increasing kp causes the trajectory to be tracked more straightforward to use central time differencing (e.g. see [52]),
strongly. A key point here is that the trajectory is followed 1 ∆t n
using a second order system compatible with the physics, in ω n+ 2 = ω n + α
2
contrast to Ferguson curves or other interpolation schemes. 1
θn+1 = θn + ∆tω n+ 2
We exploit the fact that we can integrate analytically to
obtain closed form expressions for both the error and its 1 ∆t n+1
ω n+1 = ω n+ 2 + α
derivatives. In the critically damped case, the roots ofpthe 2
quadratic equation r2 + kv r + kp = 0 are r1 = r2 = − kp , 1
by replacing ω n+ 2 with ω̂ obviating the need for the first of
and we obtain 1
these three equations (i.e., the one that determines ω n+ 2 ).
√ However, we use the method of [20] (that robustly treats
E(t) = (c1 + c2 t)e− kp t
 p  √ contact and collision, e.g. removing contact chatter) which
Ė(t) = − kp (c1 + c2 t) + c2 e− kp t requires a time discretization of the form
p ω n+1 = ω n + ∆tαn
where c1 = E(0) and c2 = Ė(0) + kp E(0). Thus, the
exact solution at the end of the time step is obtained by θn+1 = θn + ∆tω n+1
evaluating E and Ė at ∆t, i.e. E(∆t) and Ė(∆t). The analytic
solution to the PD equations at end of the time step is therefore where our modification is to replace ω n+1 with ω̂. Since
1
θE = θo (∆t) + E(∆t) and θ̇E = θ̇o (∆t) + Ė(∆t). Note that ω̂ naturally lives at tn+ 2 , the resulting position update,
n+1 n
in our impulse based approach the target acceleration θ̈o is θ = θ + ∆tω̂, resembles the second of the three central
never used or required, even though it is accounted for in the differencing equations. Whereas central differencing has a
1
equations. We use simple Euler time integration, which for a third equation to integrate ω n+ 2 to ω n+1 , it is not clear how
single degree of freedom is θn+1 = θn +∆tω n+1 . Thus, if the to incorporate this into the method of [20] (which we use),
analytically determined exact solution at the end of the time and we therefore omit it. As a result, in the limit as ∆t → 0,
step is given by θE , then setting our angular velocity based only half of the acceleration −kp E − kv Ė is accounted for,
0
on the secant to the curve (blue arrow in Figure 2) gives which is equivalent to using PD control with
0 0
p 0gains kp = kp /2
and kv = kv /2 implying that kv 6= 2 kp (the system is
θE − θ n underdamped, not critically damped).
ω̂ = This problem is trivially corrected by applying our method
∆t
to a set of PD equations with twice the acceleration. That is,
which guarantees that we achieve the exact position at the end
we apply our secant time integration method to the modified
of the Euler integration step.
system,
Since θE is the exact solution at tn+1 , we can Taylor expand Ë + k̂v Ė + k̂p E = 0
θE about tn and substitute it into our equation for ω̂ to obtain
with k̂v = 2kv and k̂pq
= 2kp . This is an overdamped system
(∆t)2 n with roots r = (−k̂v ± k̂v2 − 4k̂p )/2, and an analytic solution
(θn + ∆tω n + 2 α + O(∆t3 )) − θn of
ω̂ =
∆t
∆t n
n
E(t) = c1 er1 t + c2 er2 t
= ω + α + O(∆t2 )
2 Ė(t) = r1 c1 er1 t + r2 c2 er2 t
where α is angular acceleration. The ∆t 2 illustrates that our where c1 = (r2 E(0) − Ė(0))/(r2 − r1 ) and
1
angular velocity ω̂ lives most naturally at tn+ 2 , i.e. it is the c2 = (Ė(0) − r1 E(0))/(r2 − r1 ). The solution of this
1
velocity at the half time step, ω n+ 2 , up to O(∆t2 ). Thus, it is overdamped system at the end of the time step, E(∆t),
IEEE TRANSACTIONS ON VISUALIZATION AND COMPUTER GRAPHICS 4

Fig. 5. In the first two images, our method (first image) and traditional
PD control (second image) perform equally well in zero gravity. However,
the next two images show the results with gravity where our method
(third image) still exactly reaches the desired position while traditional
PD control (fourth image) fails to achieve it.

is used to find θE = θo (∆t) + E(∆t) which is used as Fig. 6. Plots of the angle for the examples shown in Figure 5 as compared
the exact solution in ω̂ = (θE − θn )/∆t. Incorporating to the analytic solution (black x’s). Our method matches the analytic
this ω̂ into our time integration scheme yields a solution solution without gravity (blue dashed) and with gravity (blue), whereas
traditional PD control matches it without gravity (red dashed) but fails
with half the acceleration, i.e. it yields the solution to the to with gravity (red).
PD equations with gains of kp0 = k̂p /2 and kv0 = k̂v /2 as
desired. Figure 3 illustrates this approach. Note that the allows us to compactly write the post-stabilization equations
correct critically damped formulation reaches zero quicker given in [20], [22] as
than the underdamped case. Moreover, Figure 4 shows that    
j ∆urel
our scheme remains unconditionally stable driving the error (Kp + Kc ) = (1)
jτ ∆ωrel
to zero as desired even for large time steps.
Finally, note that the results of this section are not restricted where p and c refer to the joint’s parent and child, and ∆urel
to PD control. Our secant based approach can be applied to and ∆ωrel are the changes in relative (parent minus child)
one’s favorite control method as long as that method satisfies linear and angular velocities at the joint caused by the given
a few basic principles, such as being able to determine (or impulses. Given desired velocity changes, the impulses are
even sketch by hand) the desired behavior for a single degree found by inverting the symmetric positive definite Kp + Kc .
of freedom. The desired control curve would be targeted using The desired values for ∆urel and ∆ωrel are determined
inverse dynamics and extended to situations such as multiple by a combination of joint constraints and PD control. For
joints just as we do for PD control. example, for a hinge joint with one rotational degree of
freedom, in the PD controlled direction we want the secant-
IV. DYNAMICS based ω̂ computed as described above, while a zero velocity
is targeted in the other two angular dimensions as well as for
Following [22] we process collisions, post-stabilize veloci- the fully constrained positional degrees of freedom (projecting
ties by projecting them onto a constraint satisfying manifold, onto the constraint manifold as in standard post-stabilization).
integrate velocity forward in time (add gravity, etc.), and PD actuation of a 3 degree of freedom point joint is only
post-stabilize again. Then we apply their combined contact slightly more involved. In this case, our target trajectory θo is
processing and pre-stabilization method that evolves the rigid an orientation and θ̇o is an angular velocity. A joint consists
body positions and orientations in a manner that satisfies of joint frames attached to both the parent and child. If we
both contact conditions and articulation constraints. Notably, let Jp and Jc represent the orientation of the parent and child
we improve pre-stabilization by solving a single nonlinear attached joint frame, then we define the joint’s orientation to
equation f (j, jτ ) = 0 (with a 7 × 6 Jacobian) for the linear be Jc−1 Jp (parent joint orientation with respect to the child).
and angular impulses, j and jτ , that satisfy both positional Define vn to be the rotation vector corresponding to the
and angular articulation constraints simultaneously, rather than rotation Jc θon Jp−1 , i.e. a rotation of |vn | radians about the unit
using two separate equations (see appendix A). This improves vector v̂n . This is a world space representation of the rotation
pre-stabilization, since it allows for quicker convergence by error between the current joint orientation and the current
accounting for the cross-coupling between linear and angular target orientation (analogous to θn − θon ). Setting E(0) = |vn |
impulses. Then post-stabilization is applied to the velocities and Ė(0) = (θ̇n − θ̇on ) · v̂n , we solve for the scalar quantity
once again. E(∆t) as usual and set the desired joint angular velocity to
Since PD control is typically integrated into velocity as a
force, we incorporate our method into the post-stabilization E(∆t) − |vn+1 | n+1
ω̂ = v̂
step that immediately follows the velocity update. Post- ∆t
stabilization solves for the impulses j and jτ that maintain where vn+1 = Jc θon+1 Jp−1 represents the error between the
the constraints on a joint by joint basis. We define the 6 × 6 joint’s current orientation and the updated trajectory orien-
matrix tation (i.e. where it wants to be). This formula matches our

δ r∗T
  −1
mb δ 0

δ 0
 usual one since |vn+1 | represents θn − θon+1 so the numerator
Kb = b
0 δ 0 Ib−1 r∗b δ looks like θE − θn . In general, the current angular velocity ω n
may not be parallel to vn+1 (or even to vn ). This means that
where b refers to an arbitrary body, δ is the identity matrix, Ib the above simplification to one dimension does not adequately
is the inertia tensor of body b, and rb is a vector from b’s center address the other two dimensions (perpendicular to v̂n+1 ).
of mass to the joint location (where impulses are applied). This The full multi-dimensional application of PD control should
IEEE TRANSACTIONS ON VISUALIZATION AND COMPUTER GRAPHICS 5

Fig. 7. (Top) Even with multiple joints, our method can attain and hold the desired horizontal state without difficulty. (Bottom) A similar example
with a different target state. We stress that all joints are controlled locally and there is no need for scaling joints based on outboard inertia tensors,
or for estimates of external forces and gravity.

be applied to all three dimensions, although our specific one- the impulses at all joints to the change in velocities at all joints.
dimensional restriction lumps all positional errors into that A is an n×n block matrix (n the number of joints) composed
one dimension leaving positional errors of zero in the other of 6 × 6 blocks. In order to describe the contents of a block in
two dimensions. While there are no positional errors in the A, we generalize the Kb matrix from section IV to Kb (i, k):
remaining two dimensions, velocity errors do exist, similar to    
a one-dimensional case with an overshoot where the positional δ r∗T
b,i m−1
b δ 0 δ 0
Kb (i, k) = χi (b)χk (b)
errors are temporarily zero. We can apply our technique to 0 δ 0 Ib−1 r∗b,k δ
these other two dimensions by adding to ω̂ an extra term
e−k̂v ∆t ω n,⊥ where ω n,⊥ is the component of ω n orthogonal The “connectivity” factor χα (b) is defined to be +1, −1, or
to v̂n+1 . 0 depending on whether b is a parent of, child of, or not
If a joint has degrees of freedom that are not constrained or connected to joint α, respectively. In Kb (i, k), χk (b) is used
actuated, we solve a projected version of equation 1 so that to indicate whether the action or reaction (negated) impulses
the dynamics in those degrees of freedom are not adversely are being applied to b at k, and χi (b) corresponds to the fact
affected, i.e. that we are measuring parent velocity minus child velocity at
  joint i. Block (i, k) of A can then be written succinctly as
∆urel
P T (Kp + Kc )P ĵP = P T X
∆ωrel A(i, k) = Kb (i, k)
b
where P is a matrix whose columns form a basis for the space
of allowable impulses, and ĵP = P T ĵ is the projected linear One can think of A(i, k) as relating the impulses jk and jkτ
and angular impulse (ĵ representing the concatenation of j applied at joint k to the change in relative velocities ∆uirel
and jτ ). The joint velocities (on the right hand side) are also i
and ∆ωrel at joint i. The global system can be written
projected so that the velocity in the free directions does not
influence our system. The full six-dimensional spatial impulse Aĵ = ∆û
is then recovered using P ĵP . where impulses and velocities have been concatenated into
We demonstrate single joint post-stabilization with a few vectors ĵ and ∆û. The values of ∆û come from a combination
simple examples as shown in Figure 5. Given zero gravity, of joint constraints and PD actuation as in the single joint
or no external forces, both our algorithm and traditional PD case (see section IV). Furthermore, projection matrices may be
control reach the desired target angle of zero degrees. How- used to reduce the system if any unconstrained and unactuated
ever, when gravity is introduced, traditional PD control fails degrees of freedom remain.
to bring the joint to its desired state while ours accomplishes Note that A is both symmetric (Kb (i, k) = Kb (k, i)T ) and
this. As the gains are increased, traditional PD performs better sparse (A(i, k) is only non-zero when joints i and k share
(although with a more severe time step restriction), but this is a common body). Symmetry is guaranteed regardless of how
unnecessary for our algorithm which performs well with any parent and child labels are assigned at a joint. Unlike the case
gains allowing gains to be set based on desired stiffness rather for a single joint where A = Kp + Kc is positive definite, A
than for motion tracking purposes. Figure 6 plots the angles may in general be singular. Thus, we first factor A using QR
of the joints with respect to time. factorization. Using column pivoting we can ensure R has the
form  
B S
V. I NVERSE DYNAMICS R=
0 
Extending PD control to multiple joints significantly com-
plicates the situation, because each joint generates forces that where B is an upper triangular square matrix with well-
interfere with neighboring joints. We use inverse dynamics conditioned, non-zero diagonal entries, and  is zero up to
to alleviate this problem solving for the impulses that take some user chosen tolerance. If P is the pivot matrix (AP =
surrounding joints into account. This is accomplished by QR), then our new system is RP T ĵ = QT ∆û. To simplify
extending post-stabilization from a joint by joint approach to notation, let x = P T ĵ and b = QT ∆û. Then these vectors
a global approach for the entire articulated rigid body. While can be decomposed to match the blocks of R, yielding
    
the previous section gives the post-stabilization equation for a B S xB bB
=
single joint, the global framework requires a matrix A relating 0  xS b
IEEE TRANSACTIONS ON VISUALIZATION AND COMPUTER GRAPHICS 6

Fig. 8. (Top) Our PD control method allows for interesting object interaction. Here, the articulated object struggles to reach its target when
obstructed by an immovable foreign object. (Bottom) A collision with a ball disturbs the target position, after which it recovers gracefully. Our
separation of stiffness from control allows the object to be pushed very far from its target by the ball, while still recovering without adverse effects
from gravity.

Since B is non-singular by construction, the first equation, of a disjoint block. This mimics a character easily moving
BxB + SxS = bB has a family of solutions which can be their own limbs around, but struggling to lift a foreign object.
parameterized by xS , i.e. In the right figure, we incorporate the block into the global
post-stabilization to illustrate that our PD control can fully
x = ZxS + b̂
compensate for its weight if desired.
−B −1 S
   −1 
B bB We still iterate for pre-stabilization (as in [22]) but for post-
where Z = , and b̂ = . In order
I 0 stabilization we have a global linear system, which is sparse
to single out a particular solution, we solve a least squares and solved for using a direct method. This may be slower than
problem in xS which aims to minimize both the norm of the [22] for large systems but typically characters are not very
solution x as well as the residual of the remaining equations big, and each character could be solved for independently and
xS = b . That is, we solve then coupled through external contact and collision. We also
 
min kZxS + b̂k22 + kxS − b k22 support iterative post-stabilization as in [22] which can be used
xS in place of a global solve for large systems such as the net as
with corresponding normal equations of seen in Figure 10.

(Z T Z + T )xS = −Z T b̂ + T b .
VI. I NVERSE M USCLE ACTUATION
The first term in the objective function minimizes the norm
Line segment muscles differ from PD actuation in a number
of x, which ensures that we satisfy the first equation, BxB +
of ways. First, while PD actuation impulses may be cho-
SxS = bB , with minimal impulses. In order to account for
sen from a whole subspace of possible directions, muscle
the effect of the second term, we consider two cases. In the
actuation is strictly limited to lie along the muscle’s line
case where  is zero, the original system is singular, and the
of action. Additionally, multiple muscles may cross a given
objective function is simply offset by the constant kb k22 which
joint (redundancy) and multiple joints may be crossed by
is nonzero only if the original target ∆û is unachievable. Thus,
the same muscle (e.g., the sartorius crosses both the hip and
in this case, the least squares problem still yields a solution
knee joints). Finally, bounds on non-dimensionalized muscle
with minimal impulses. In the case where  is nonzero, the
activation (between 0 and 1) induce bounds on the range of
combination of the two terms in the objective function means
muscle force. While our method solves for muscle actuation
that we try to minimize impulses while also minimizing errors
(impulse) directly as proof of concept, musculotendon force is
in the second equation, xS = b . Weights can be added
linear in activation in a Hill-type model making the extension
to the two terms to control the relative importance of these
to this case straightforward.
two objectives, and also to account for different units of
measurement used for the two terms. We also note that the We augment our post-stabilization method to include muscle
above is readily adjusted to minimize x using a weighted norm actuation by writing it in the following form
kW 1/2 xk22 by replacing Z with W 1/2 Z and b̂ with W 1/2 b̂  



in the normal equations. Â1 Â2 = ∆û (2)
ĵm
Figure 7 shows two articulated chains with gravity. Since
global post-stabilization gives global feedback, joints do not where ĵ are the usual joint constraint and actuation impulses,
fight each other and instead move smoothly towards the target while ĵm are the muscle impulses with jm,k the impulse
state. Moreover, we only specified a single final state with no applied by muscle k. Â1 is constructed analogously to matrix
in-betweens, and still achieved characteristically smooth and A from post-stabilization, but will be a tall rather than square
natural PD style motion with our method. Furthermore, we matrix in general. Â2 captures the effect of muscle actuation
can adjust kp without concern for gravity or outboard inertia on joint velocities. In similar style to Kb (i, k), we can write
tensors. Besides obtaining smooth motion, an advantage of the factor relating a muscle actuation impulse jm,k directed
dynamic controllers (versus kinematic) is response to unantic- positively along the line of action l̂m,k and applied at rb on
ipated forces. In the top row of Figure 8, the planks attempt the velocity at joint i as
to curl (as in the bottom of Figure 7) while obstructed by an   −1
δ r∗T
  
immovable object. Figure 1 (left) shows an articulated chain of b,i mb δ 0 l̂m,k
χi (b)
planks targeting a horizontal state while supporting the weight 0 δ 0 Ib−1 rb × l̂m,k
IEEE TRANSACTIONS ON VISUALIZATION AND COMPUTER GRAPHICS 7

This is a 6 × 1 vector which we project to the constrained


and controlled velocity components of joint i. For a given
muscle k, column k of Â2 is formed by concatenating these
vectors for all of the constrained and controlled joint velocities
and summing across all attachments for that muscle. Note
that a single muscle passing through a number of via points
has multiple lines of action, but only the linear segments
connecting via points on different bones result in a net force.
As discussed in the last section, QR with pivoting can be
applied to Â1 to subsequently reduce the size of the system.
However, for the sake of exposition, we assume that Â1 is full
column rank and that its top square block Â1,1 is invertible so Fig. 9. A skeleton swinging a mace demonstrates the ability to mix
that we can reduce the system by multiplying equation 2 with controlled objects with purely dynamic objects.
h i
Z = Â2,1 Â−11,1 −I

where Â2,1 is the bottom block of Â1 . Since Z Â1 = 0 this


leaves us with an equation of the form
Ãĵm = b̃ (3)
where à = Z Â2 and b̃ = Z∆û. A common approach is to
minimize kĵm k22 + kÃĵm − b̃k22 where the first term is added
to minimize muscle activation, especially since redundant
muscles can cause à to be rank deficient. However, this
approach will not attain the solution to equation 3 even when
it exists, e.g. if equation 3 was the scalar equation j = 1,
adding j = 0 to minimize j gives a least squares solution
of j = 1/2. This means that the trajectories we worked so
hard to formulate won’t be achieved, even when the impulses
necessary to follow these trajectories are feasible. Instead, our
approach solves equation 3 exactly to the degree possible, Fig. 10. A skeleton caught in a net illustrates the ability to mix our
and minimizes any unattainable equations (over-determined global post-stabilization (for the skeleton) with the iterative method (for
subsets) along with the redundant muscle activations. Thus, the net).
following section V, we use QR with pivoting to convert
equation 3 to the form both equality and inequality constraints) is found by solving
     a linear programming problem with an objective designed to
B S xB bB
= drive the iterates from vertex to vertex on the manifold of
0  xS b
active constraints and towards the feasible region. Once a fea-
yielding the final form of the optimization problem: sible point is found, we minimize the quadratic objective with
quadratic programming. This iterative method moves towards a
minimize kxk22 + kxS − b k22
min max
minimum by taking steps consistent with the constraints while
subject to BxB + SxS = bB and jm,k ≤ jm,k ≤ jm,k always staying within the feasible region.
noting that xB and xS are simply a permutation of the
components of ĵm . VII. E XAMPLES
To summarize our approach, given a target motion (specifi- We created a skeleton from the Visible Human data set.
cally, target joint velocities), it may or may not be achievable Joints for the upper body were created from [53], while the
with the given set of actuators, so we use QR factorization joints for the lower body and individual digits were generated
to instead target the achievable motion closest to it in a by hand. The skeleton contains 74 joints with a total of 118
least squares sense. Then we solve a constrained optimization degrees of freedom including fully articulate fingers, toes and
problem which achieves this target motion while minimizing vertebrae. We generated 228 muscles for the skeleton from
muscle impulses and ensuring they stay within prescribed SIMM data derived from [54], [55]. In order to demonstrate
limits. Visually, the only compromise is in the first part – the ability to mix controlled and purely dynamic joints, we
projecting to an achievable motion. The rest is just a choice animated a skeleton swinging a mace. The arm movement is
among different muscle activations, all of which achieve the defined by an analytic function targeted via our PD control,
same motion, and which can be augmented to prefer some while the mace is a series of purely dynamic, freely rotating
muscles over others using a weighted norm. point joints. The simulation time was about a minute per
We solve this quadratic programming problem using a two- frame. We demonstrate the ability to handle closed loops
phase, active set approach. First, a feasible point (satisfying with our net example (Figure 10), which contains 960 joints
IEEE TRANSACTIONS ON VISUALIZATION AND COMPUTER GRAPHICS 8

inverse muscle actuation framework to skinning (as proposed


by [12]).
As mentioned previously, our method can be extended to
work with more general controllers as long as one has a sense
of an analytic or desired target trajectory. For example, more
interesting human behaviors can be obtained with an approach
similar to [5].

A PPENDIX A
Pre-stabilization
Combining both position and angular constraints, we solve
 
ft (j, jτ )
f (j, jτ ) = =0
fr (j, jτ )

where ft and fr measure the translational and rotational joint


errors after advancing forward in time. Using the notation of
Fig. 11. A skeleton performing push-ups demonstrates how our post- [22], these can be written as
stabilization method can be used to generate muscular impulses to drive
motion. w n
 w n
 ∆t
ft (j, jτ ) = xp + ∆t vp + j
mp
w n
n 
xpj + qpj xtarget
    
+q̂ 4t ωp + 4tI−1
p r∗p j + jτ qw
p
and over 225 closed loops. The skeleton is controlled using n w n ∆t
− (xw
c ) − ∆t (vc ) + j
key framed motion interpolated with B-splines. We achieved mc
  
simple key framing by dragging bones with the mouse and −q̂ 4t (ωcw )n − 4tI−1 ∗
c (rc j + jτ ) (qw
c )
n
xcj =0
applying post-stabilization. The skeleton uses global post-
n n
qpj qtarget

stabilization, while the iterative method from [22] is used fr (j, jτ ) = q̂ 4t ωpw + 4tI−1
p r∗p j + jτ qw
p
on the net. Finally, we demonstrate our optimization-based −q̂ 4t (ωcw )n − 4tI−1 ∗ w n c

c (rc j + jτ ) (qc ) qj = 0
inverse muscle actuation with an example of our skeleton
performing a series of push-ups (Figure 11). The push-up
motion was created using analytic functions, and our opti- with q[r] indicating a quaternion q applied to a vector r. We
mization method determined the muscle actuation required to solve using Newton iteration, and the Jacobian is a 7 × 6
achieve the desired joint angles. The skeleton contains muscles matrix.
spanning multiple joints and antagonistic muscles, which our
method handles trivially. Even with the additional calculation ACKNOWLEDGMENTS
of the muscular impulses, this simulation only required three Research supported in part by an ONR YIP award and
minutes a frame. Simple examples with lower degrees of a PECASE award (ONR N00014-01-1-0620), a Packard
freedom ran in interactive time. Foundation Fellowship, a Sloan Research Fellowship, ARO
Our method makes it easier to create realistic animations DAAD19-03-1-0331 and NIH U54-GM072970. R.W. was
by making PD control easier to use, and that is a primary supported in part by a NIH NIGMS Fellowship.
motivation of our work. Stiffness can be set on a per joint basis
making the damping parameter kp more intuitive. Although we
R EFERENCES
could have incorporated motion capture and other methods
into the motion descriptions to increase the realism of our [1] W. W. Armstrong and M. Green, “The dynamics of articulated rigid
bodies for purposes of animation,” in Graph. Interface ’85, May 1985,
examples, we chose not to and instead focused on highlighting pp. 407–415.
the key points of our algorithm through simpler motions and [2] J. Wilhelms and B. A. Barsky, “Using dynamic analysis to animate
poses. articulated bodies such as humans and robots,” in Graph. Interface ’85,
May 1985, pp. 97–104.
[3] A. Witkin and M. Kass, “Spacetime constraints,” in Comput. Graph.
VIII. C ONCLUSION (Proc. SIGGRAPH ’88), vol. 22, 1988, pp. 159–168.
[4] J. K. Hodgins, W. L. Wooten, D. C. Brogan, and J. F. O’Brien,
We presented a novel approach to PD control that uses the “Animating human athletics,” in Proc. of SIGGRAPH ’95, 1995, pp.
analytic solution on a per joint basis coupled with inverse dy- 71–78.
[5] P. Faloutsos, M. van de Panne, and D. Terzopoulos, “Composable con-
namics to alleviate difficulties with traditional PD control. Our trollers for physics-based character animation,” in ACM Trans. Graph.
method achieves the desired angle regardless of joint stiffness (SIGGRAPH Proc.), 2001, pp. 251–260.
because it globally accounts for cross-coupling between joints [6] J. Wilhelms, “Virya–a motion control editor for kinematic and dynamic
animation,” in Proc. on Graph. Interface ’86/Vision Interface ’86, 1986,
and external forces such as gravity, effectively decoupling pp. 141–146.
stiffness from control. We demonstrated the efficacy of our [7] E. Kokkevis, D. Metaxas, and N. Badler, “User-controlled physics-based
method in various scenarios including contact and collision, animation for articulated figures,” in Proc. Comput. Anim. ’96, 1996.
[8] M. Oshita and A. Makinouchi, “A dynamic motion control technique
as well as on a complex articulated human skeleton with for human-like articulated figures,” Comput. Graph. Forum (Proc. Eu-
actuating muscles. For future work, we plan to apply our rographics), vol. 20, no. 3, pp. 192–202, 2001.
IEEE TRANSACTIONS ON VISUALIZATION AND COMPUTER GRAPHICS 9

[9] J. Laszlo, M. van de Panne, and E. Fiume, “Limit cycle control and [37] C. K. Liu, A. Hertzmann, and Z. Popović, “Learning physics-based
its application to the animation of balancing and walking,” in Proc. of motion style with nonlinear inverse optimization,” ACM Trans. Graph.,
SIGGRAPH ’96, 1996, pp. 155–162. vol. 24, no. 3, pp. 1071–1081, 2005.
[10] M. Neff and E. Fiume, “Modeling tension and relaxation for computer [38] S. Delp and J. Loan, “A graphics based software system to develop and
animation,” in Proc. ACM SIGGRAPH Symp. on Comput. Anim., 2002, analyze models of musculoskeletal structures,” Comput. and Biomed.
pp. 77–80. Research, vol. 25, no. 1, pp. 21–34, 1995.
[11] J. Wilhelms, “Using dynamic analysis for realistic animation of articu- [39] S. Delp and J. Loan, “A computational framework for simulating and
lated bodies,” IEEE Comput. Graph. and Appl., vol. 7, no. 6, pp. 12–27, analyzing human and animal movement,” IEEE Computing In Science
1987. And Eng., vol. 2, no. 5, pp. 46–55, 2000.
[12] P. Isaacs and M. Cohen, “Controlling dynamic simulation with kinematic [40] T. Komura, Y. Shinagawa, and T. Kunii, “A muscle-based feed-forward
constraints, behavior functions and inverse dynamics,” in Proc. of controller for the human body,” Comput. Graph. Forum (Proc. Euro-
SIGGRAPH 1987, 1987, pp. 215–224. graphics), vol. 16, no. 3, pp. C165–C172, September 1997.
[13] P. Isaacs and M. Cohen, “Mixed methods for complex kinematic [41] T. Komura, Y. Shinagawa, and T. L. Kunii, “Calculation and visualiza-
constraints in dynamic figure animation,” The Vis. Comput., vol. 4, no. 6, tion of the dynamic ability of the human body,” J. Vis. Comput. Anim.,
pp. 296–305, 1988. vol. 10, pp. 57–78, 1999.
[14] V. B. Zordan and J. K. Hodgins, “Tracking and modifying upper-body [42] T. Komura, Y. Shinagawa, and T. L. Kunii, “Creating and retargetting
human motion data with dynamic simulation,” in In Proc. of Comput. motion by the musculoskeletal human body model,” The Vis. Comput.,
Anim. and Sim. ’99, September 1999. vol. 16, no. 5, pp. 254–270, June 2000.
[15] V. B. Zordan and J. K. Hodgins, “Motion capture-driven simulations [43] J. Teran, S. Blemker, V. Ng, and R. Fedkiw, “Finite volume methods
that hit and react,” in Proc. ACM SIGGRAPH Symp. on Comput. Anim., for the simulation of skeletal muscle,” in Proc. of the 2003 ACM
2002, pp. 89–96. SIGGRAPH/Eurographics Symp. on Comput. Anim., 2003, pp. 68–74.
[44] J. Teran, E. Sifakis, S. Salinas-Blemker, V. Ng-Thow-Hing, C. Lau, and
[16] M. van de Panne, “Parameterized gait synthesis,” IEEE Comput. Graph.
R. Fedkiw, “Creating and simulating skeletal muscle from the visible
and Appl., vol. 16, no. 2, pp. 40–49, March 1996.
human data set,” IEEE Trans. on Vis. and Comput. Graph., vol. 11,
[17] M. McKenna and D. Zeltzer, “Dynamic simulation of a complex human no. 3, pp. 317–328, 2005.
figure model with low level behavior control,” Presence, vol. 5, no. 4, [45] I. Albrecht, J. Haber, and H. P. Seidel, “Construction and animation of
pp. 431–456, 1996. anatomically based human hand models,” in Proc. of the 2003 ACM
[18] B. Mirtich and J. Canny, “Impulse-based dynamic simulation,” in Alg. SIGGRAPH/Eurographics Symp. on Comput. Anim., 2003, pp. 98–109.
Found. of Robotics, K. Goldberg, D. Halperin, J.-C. Latombe, and [46] W. Tsang, K. Singh, and E. Fiume, “Helping hand: an anatomically
R. Wilson, Eds. A. K. Peters, Boston, MA, 1995, pp. 407–418. accurate inverse dynamics solution for unconstrained hand motion,” in
[19] B. Mirtich and J. Canny, “Impulse-based simulation of rigid bodies,” in Proc. ACM SIGGRAPH Symp. on Comput. Anim., 2005, pp. 319–328.
Proc. of 1995 Symp. on Int. 3D Graph., 1995, pp. 181–188, 217. [47] S.-H. Lee and D. Terzopoulos, “Heads up! Biomechanical modeling and
[20] E. Guendelman, R. Bridson, and R. Fedkiw, “Nonconvex rigid bodies neuromuscular control of the neck,” ACM Trans. Graph. (SIGGRAPH
with stacking,” ACM Trans. Graph. (SIGGRAPH Proc.), vol. 22, no. 3, Proc.), vol. 25, no. 3, pp. 1188–1198, 2006.
pp. 871–878, 2003. [48] T. Komura and Y. Shinagawa, “Motion conversion based on the mus-
[21] D. Kaufman, T. Edmunds, and D. Pai, “Fast frictional dynamics for rigid culoskeletal system,” in Proc. of Graph. Interface 2001, June 2001, pp.
bodies,” ACM Trans. Graph. (SIGGRAPH Proc.), pp. 946–956, 2005. 27–36.
[22] R. Weinstein, J. Teran, and R. Fedkiw, “Dynamic simulation of articu- [49] V. De Sapio, J. Warren, O. Khatib, and S. Delp, “Simulating the task-
lated rigid bodies with contact and collision,” IEEE Trans. on Vis. and level control of human motion: a methodology and framework for
Comput. Graph., vol. 12, no. 3, pp. 365–374, 2006. implementation,” The Vis. Comput., vol. 21, no. 5, pp. 289–302, June
[23] M. Cline and D. Pai, “Post-stabilization for rigid body simulation with 2005.
contact and constraints.” in Proc. of the 2003 IEEE Int. Conf. on Robotics [50] D. K. Pai, S. Sueda, and Q. Wei, “Fast physically based musculoskeletal
and Automation, ICRA 2003, Taipei, Taiwan, September 14-19 2003, pp. simulation,” in SIGGRAPH 2005 Sketches & Appl. ACM Press, 2005.
3744–3751. [51] J. Baumgarte, “Stabilization of constraints and integrals of motion in
[24] W. Armstrong, M. Green, and R. Lake, “Near-real-time control of human dynamical systems,” Comput. Meth. in Appl. Mech. and Eng., vol. 1,
figure models,” IEEE Comp. Graph. and Appl., vol. 7, no. 6, pp. 51–61, pp. 1–16, 1972.
1987. [52] R. Bridson, R. Fedkiw, and J. Anderson, “Robust treatment of colli-
[25] J. Wilhelms, M. Moore, and R. Skinner, “Dynamic animation: Interac- sions, contact and friction for cloth animation,” ACM Trans. Graph.
tion and control,” The Vis. Comput., vol. 4, pp. 283–295, 1988. (SIGGRAPH Proc.), vol. 21, pp. 594–603, 2002.
[26] S. Redon, N. Galoppo, and M. C. Lin, “Adaptive dynamics of articulated [53] B. Garner and M. Pandy, “Musculoskeletal model of the upper limb
bodies,” ACM Trans. Graph., vol. 24, no. 3, pp. 936–945, 2005. based on the visible human male dataset,” Comput. Meth. Biomech.
[27] A. Bruderlin and T. W. Calvert, “Goal-directed, dynamic animation of Biomed. Eng., vol. 4, pp. 93–126, 2001.
human walking,” in Comp. Graph. (SIGGRAPH Proc.), 1989, pp. 233– [54] S. Delp, J. Loan, M. Hoy, F. Zajac, E. Topp, and J. Rosen, “An interactive
242. graphics-based model of the lower extremity to study orthopaedic
[28] M. McKenna and D. Zeltzer, “Dynamic simulation of autonomous surgical procedures,” IEEE Trans. on Biomed. Eng., vol. 37, pp. 757–
legged locomotion,” in Comput. Graph. (Proc. SIGGRAPH ’90), 1990, 767, 1990.
pp. 29–38. [55] K. Holzbaur, W. Murray, and S. Delp, “A model of the upper extremity
for simulating musculoskeletal surgery and analyzing neuromuscular
[29] M. H. Raibert and J. K. Hodgins, “Animation of dynamic legged
control,” Annals of Biomed. Eng., vol. 33, no. 6, pp. 829–840, 2005.
locomotion,” in Comp. Graph. (SIGGRAPH Proc.), 1991, pp. 349–358.
[30] M. van de Panne and E. Fiume, “Sensor-actuator networks,” in Proc. of
SIGGRAPH ’93, 1993, pp. 335–342.
[31] M. van de Panne, R. Kim, and E. Fiume, “Virtual wind-up toys for
animation,” in Proc. of Graph. Interface ’94, Banff, Alberta, Canada,
1994, pp. 208–215.
[32] H. Ko and N. I. Badler, “Animating human locomotion with inverse
dynamics,” IEEE Comput. Graph. and Appl., vol. 16, no. 2, pp. 50–59,
March 1996.
[33] J. Lo and D. Metaxas, “Recursive dynamics and optimal control tech-
niques for human motion planning,” in Proc. of the Comput. Anim.,
1999, p. 220.
[34] M. F. Cohen, “Interactive spacetime control for animation,” in Comp.
Graph. (SIGGRAPH Proc.), 1992, pp. 293–302.
[35] Z. Liu, S. J. Gortler, and M. F. Cohen, “Hierarchical spacetime control,”
in Proc. of SIGGRAPH ’94, 1994, pp. 35–42.
[36] Z. Popović and A. Witkin, “Physically based motion transformation,” in
Comput. Graph. (Proc. SIGGRAPH ’99), 1999, pp. 11–20.

You might also like