14
Comput. & Graphics. Vol. 21. No. 4. pp. 483496, 1997 I(” 1997 Elsevier Science Ltd. All rights reserved Printed in &eat Britain 0097~8493197 s17.00+0.00 PII: SOO97-8493(97)00024-1 Computer Graphics in Korea FORWARD DYNAMICS BASED REALISTIC ANIMATION OF RIGID BODIES JIHUN PARK’+ and DONALD S. FUSSELL’ ‘Hongik University, 72-l Sangsu, Mapo, Seoul, South Korea e-mail: [email protected] ‘The University of Texas at Austin, Austin, TX 78712. U.S.A. Abstract--This paper presents a new methodology for model and control of the motion of an (articulated) rigid body for the purposes of animation. The technique uses a parameter optimization method for forward dynamic simulation to obtain a good set of values for the control variables of the system. We model articulated rigid bodies using a moderate number of control nodes, and we linearly interpolate control values between adjacent pairs of these nodes. The interpolated control values are used to determine the forces/torques for the body actuators. We can control total motion duration time, and the control is more flexible than in any other dynamics based animation techniques. We employ a parameter optimization (or nonlinear programming) method to find a good set of values for the control nodes. We extend this method by using a musculotendon skeletal model for the human body instead of the more commonly used robot model to provide more accurate human motion simulations. Skeletal and musculotendon dynamics enable us to do the human body animation more accurately than ever because the muscle force depends on the geometry of a human as well as on differential kinematic parameters. We show various levels of motion control for forward dynamics animation: ranging from piecewise linear forces/torques control for joints to muscle activation signal control for muscles to generate highly nonlinear forces/torques. This spectrum of control levels provides various nonlinear resulting motions to animators to allow them to achieve effective motion control and physically realistic motion simultaneously. Because our algorithms are heavily dependent on parameter optimization, and since the optimization technique may have difficulty finding a glob4 optimum. we provide a modified optimization method along with various techniques to reduce the search space size. Our parameter optimization based forward dynamic animation and musculotendon dynamics based animation present the first use of such techniques in animation research to date. :T 1997 Elsevier Science Ltd 1. INTRODUCTION This paper deals with dynamics based animation. Henceforth we use ‘animation’ from the physically based modeling point of view. We define animation to be nzotiorl with motion control. We require motion to satisfy physical laws. This motion can be computed via physically based simulation. It is necessary for every physically based motion to satisfy physical laws to have realism. We require motion control to satisfy kinematic goals; usually for animation this involves satisfying the configuration goals of a body. If we want to do animation rather than simulation, we must be able to do motion control. Basically we need a tool which will consider the entire motion (from the beginning of a motion simulation until the end). This tool will help us to find a best motion that suits our animation purpose. In order to do this, we convert our animation problem into a single non- linear cost function of (control) vnriuhles with nonlinear equality and inequality constraints. By finding the best values of these variables, we can find the best motion we need for the animation. The technique of finding local optimum values for a nonlinear cost function with nonlinear equality and ’ Author for correspondence inequality constraints is called parameter optimix- tion or nonlinear programming (NLP). Probably the simplest form of computer-based animation IS a technique called keyfrnrne animation. In the key frame technique, the animator denotes key positions of the body, at both initial and goal configuration of the animation. to be animated. The animation system will then smoothly interpolate between key positions. In this case kinematic constraints between each segment of the body can be violated between the initial and goal configura- tions of the body. In order to solve this problem, animation systems based on kinematics are widely used. In such methods, inverse kinematics is used to compute joint angles. Inverse kinematics involves solving for joint angles, given the Cartesian position, for both initial and goal configuration of the body. By smoothly interpolating joint angles, a better motion, which is guaranteed to satisfy kinematic constraints” throughout the animation, can be Z By geometric ronstvaints we mean the constraints related to the feasibility of the body configuration; joint limit constraints and environmental constraints, for example. By &namic conirrainfs we mean constraints related to physical laws. One erample of dynamic constraints is: body center acceleration should equal negative gravity in air. By kinemutic constraints we mean the constraints related to ptrre configuration of the body. 483

Forward dynamics based realistic animation of rigid bodies

Embed Size (px)

Citation preview

Page 1: Forward dynamics based realistic animation of rigid bodies

Comput. & Graphics. Vol. 21. No. 4. pp. 483496, 1997 I(” 1997 Elsevier Science Ltd. All rights reserved

Printed in &eat Britain 0097~8493197 s17.00+0.00

PII: SOO97-8493(97)00024-1 Computer Graphics in Korea

FORWARD DYNAMICS BASED REALISTIC ANIMATION OF RIGID BODIES

JIHUN PARK’+ and DONALD S. FUSSELL’

‘Hongik University, 72-l Sangsu, Mapo, Seoul, South Korea e-mail: [email protected]

‘The University of Texas at Austin, Austin, TX 78712. U.S.A.

Abstract--This paper presents a new methodology for model and control of the motion of an (articulated) rigid body for the purposes of animation. The technique uses a parameter optimization method for forward dynamic simulation to obtain a good set of values for the control variables of the system. We model articulated rigid bodies using a moderate number of control nodes, and we linearly interpolate control values between adjacent pairs of these nodes. The interpolated control values are used to determine the forces/torques for the body actuators. We can control total motion duration time, and the control is more flexible than in any other dynamics based animation techniques. We employ a parameter optimization (or nonlinear programming) method to find a good set of values for the control nodes. We extend this method by using a musculotendon skeletal model for the human body instead of the more commonly used robot model to provide more accurate human motion simulations. Skeletal and musculotendon dynamics enable us to do the human body animation more accurately than ever because the muscle force depends on the geometry of a human as well as on differential kinematic parameters. We show various levels of motion control for forward dynamics animation: ranging from piecewise linear forces/torques control for joints to muscle activation signal control for muscles to generate highly nonlinear forces/torques. This spectrum of control levels provides various nonlinear resulting motions to animators to allow them to achieve effective motion control and physically realistic motion simultaneously. Because our algorithms are heavily dependent on parameter optimization, and since the optimization technique may have difficulty finding a glob4 optimum. we provide a modified optimization method along with various techniques to reduce the search space size. Our parameter optimization based forward dynamic animation and musculotendon dynamics based animation present the first use of such techniques in animation research to date. :T 1997 Elsevier Science Ltd

1. INTRODUCTION

This paper deals with dynamics based animation. Henceforth we use ‘animation’ from the physically based modeling point of view. We define animation to be nzotiorl with motion control. We require motion to satisfy physical laws. This motion can be computed via physically based simulation. It is necessary for every physically based motion to satisfy physical laws

to have realism. We require motion control to satisfy kinematic goals; usually for animation this involves satisfying the configuration goals of a body.

If we want to do animation rather than simulation, we must be able to do motion control. Basically we need a tool which will consider the entire motion (from the beginning of a motion simulation until the end). This tool will help us to find a best motion that

suits our animation purpose. In order to do this, we convert our animation problem into a single non- linear cost function of (control) vnriuhles with nonlinear equality and inequality constraints. By finding the best values of these variables, we can find the best motion we need for the animation. The

technique of finding local optimum values for a nonlinear cost function with nonlinear equality and

’ Author for correspondence

inequality constraints is called parameter optimix- tion or nonlinear programming (NLP).

Probably the simplest form of computer-based animation IS a technique called keyfrnrne animation. In the key frame technique, the animator denotes key positions of the body, at both initial and goal configuration of the animation. to be animated. The animation system will then smoothly interpolate

between key positions. In this case kinematic constraints between each segment of the body can be violated between the initial and goal configura- tions of the body. In order to solve this problem, animation systems based on kinematics are widely used. In such methods, inverse kinematics is used to compute joint angles. Inverse kinematics involves solving for joint angles, given the Cartesian position, for both initial and goal configuration of the body. By smoothly interpolating joint angles, a better motion, which is guaranteed to satisfy kinematic constraints” throughout the animation, can be

Z By geometric ronstvaints we mean the constraints related to the feasibility of the body configuration; joint limit constraints and environmental constraints, for example. By &namic conirrainfs we mean constraints related to physical laws. One erample of dynamic constraints is: body center acceleration should equal negative gravity in air. By kinemutic constraints we mean the constraints related to ptrre configuration of the body.

483

Page 2: Forward dynamics based realistic animation of rigid bodies

484 J. Park and D. S. Fussell

obtained. However, kinematic methods can violate geometric constraints as well as dynamic constraints. In the middle of an animation, there is no guarantee that the body has false contact with the environment. These constraints can be violated easily by kinematic level animation alone.

Kinematic level animation is oriented only toward motion control. The quality of motion should be supported by the dynamics. By using forward dynamics, we can improve realism because forward dynamics does a very faithful physical simulation. In this method, we actuate joints by applying some amount of torque to see if a kinematic goal is achieved. If not, we modify the previous torque amounts and try again until the kinematic goal is satisfied.

Let us assume that we do a forward dynamic simulation of a particle dropped in air. Then we can come up with differential equations which need to be integrated to get a trajectory of the particle motion. But if we want to do an animation rather than a simulation, we need to be able to control the motion of the particle. One of the approaches is presented in [I]. The method uses parameter optimization to get the animated motion desired. In a forward dynamic simulation, we control torques/forces to control the motion. But the effect of applied torques/forces is not direct. Applied torques/forces cause accelerations to change. Then the accelerations cause velocities to change. Velocities finally cause displacements to change. In order to change the direction of velocity, we need to generate a big force if the current velocity is large. else it would take a longer time to change the direction of velocity by applying smaller counter forces. In forward dynamic simulation, we usually need to deal with continuous force. Continuous force is the force which exists for a duration of time. Whenever continuous force exists, we need to integrate forward dynamic differential equations carefully, which is computationally very expensive.

Using inverse dynamics, the animator plans motion and then calculates the joint torques and other forces needed to produce the motion. The major problem of inverse dynamics is that the motion planned by the animator usually lacks realism. especially for violent motions [2]. I f a body is in the air, motion planning becomes very difficult because it needs to satisfy physical constraints as compared to that with fixed base.

Up to now, only rotary actuators were used for almost all physically based articulated rigid body animations. But real human bodies (or animals) have linear actuators (muscles) which have limits in the maximum forces they can generate. When using rotary actuators, most animators restrict the max- imum torque generated by the actuator. But this is different from a real human body because the joint torque generated by the human body is also conjiguration dependent. The maximum torque which can be generated at each joint changes with the configuration of the body because there is an

important factor which determines the torque of the joini. It is called the moment arm [3]. which is the perpendicular distance from the joint axis to the line where the muscle is acting.

There are two kinds of motion; voluntary and non- voluntary. Voluntary motion is the motion generated by articulated rigid bodies with joint actuators. Non- voluntary motion is motion which is independent of joint actuators. All of these motions can be animated using either key-frame or kinematic level animation, but they require great animator skills. Dynamic models allow us to assure good motion quality without requiring excessive effort and skill on the part of the animator.

Non-voluntary motion is the motion generated independent of any joint actuators. The motion cannot be imitated using inverse dynamics at all because inverse dynamics cannot handle collisions. After collision, all objects involved in the collision experience impact forces. Inverse dynamics cannot handle impact forces. For non-voluntary motion with joints but no actuators, e.g. a pin-pointed chain. it is extremely difficult to plan motion for inverse dynamics, because the motion is completely depen- dent on the previous kinematic/dynamic status. Non- voluntary motions can be generated only by forward dynamic simulation.

Recall that the forward dynamic simulation is expensive whenever continuous forces are involved. But we have to use forward dynamics for non- voluntary motions. For voluntary motion, because the motion is generated voluntarily by joint actua- tors, we can use inverse dynamics and kinematic motion planning to imitate the motion. We can also use forward dynamics to animate voluntary motion, but forward dynamics lacks control in achieving kinematic goals.

We want to develop an animation system which will provide realism in motion. We need to handle non-voluntary and voluntary motions separately. The major issue in physically based animation is motion quality vs motion controllability. I f we use forward dynamics to improve the quality of ani- mated motion, then we lose motion controllability. I f we care too much about motion controllability, we lose motion realism. For non-voluntary motion animation, some work has been done which provides realism 14, 51, but the realism was not controllable. That is to say, their work was simulation, not animation. In this paper, we present a brand new method to do non-voluntary motion animation.

2. RELATED WORK

In this section we review the major animation techniques for articulated rigid bodies. These meth- ods fall into two categories: those based on forward dynamics [l, 4. 6-91 and those using inverse dynamics [2, l&l 51. Sometimes inverse dynamics based methods also need forward dynamics for simulation [ 10, 151. Optimal control based techniques [16, 171 uses forward dynamics. The Spacetime

Page 3: Forward dynamics based realistic animation of rigid bodies

Forward dynamics based animation of rigid bodies 485

cotutraints method [ 13, 141 and Fotlowitzg Footprints qf Reality [2] are based upon inverse dynamics.

We can also classify the methods in terms of controllers. In fact, parameter optimization tries to find a controller or a best motion trajectory for us rather than force us to implement a controller for the motion. The methods which use parameter optimiza- tion techniques are Spacetime constraints [13, 141 and following ,footprinrs of reality [2]. Some researchers directly implemented controllers by analyzing the natural motions of animals [S, 9, 1%201. In controller based methods [7, 8, 19,201, the animation system is a feedback control system in that it decides the next move considering the current status as well as the kinematic goal. With motion controllers, the animated subject has an autonomous capability to achieve some motion. The major difficulty with this approach is that we need a separate controller to be implemented for each kind of motion and possibly for each dilferent kind of subject. This method lacks the capability to consider the entire animated motion since it cannot satisfy constraints related to global motion such as, for example, final time constraint.

Motion control is one of the most difficult problems in dynamics based animation. It is usually impossible to construct exact models, and it is difficult to measure exact forces and torques. There- fore. a great deal of attention has recently been devoted to heuristic based methods for control of joints [6]. But using parameter optimization instead of heuristic methods can save a lot of time for users [I]. Another approach is to discretize continuous time dynamic systems to create nonlinear program- ming problems. This approach is a variant of the finite difference method for solving two point boundary value problems [13, 141. Inverse dynamics methods have been used to calculate joint torques given kinematic motion planning [ 10-12, 151. Pure inverse dynamic methods typically lack reality because the motion has been preplanned, and we need a special tool which will work as a motion planner. Motion planning becomes difficult, espe- cially when ,fkee base motion is involved?

The method of Spacetime Constraints [13, 141 works on displacement and joint angle level control, which makes it easy to do initial guessing for motion planning. But because they use finite differences, their velocity and acceleration have significant computational errors. They need a large number of control nodes to do better motion generation. Also they need to use many constraints in order to achieve realism.

Zhao and Badler [21] present an iterative method

’ When the body is in the air. there exists a new dynamic constraint which requires that body center acceleration must equal negative gravity. Simple motion planning cannot satisfy this constraint and planning the physically correct motion becomes very difficult. We need a dynamic tool to handle this problem.

to solve in-verse kinematics with a given set of constraints, while Lee et al. [22] define an iterative method to find a path satisfying both kinematic and dynamic constraints. Basically these local optimta- tion techniques are for kinematic level motion planning with possibly dynamics related constraints. Due to local optimization, they work for slow/mild motions only; not for violent or free base motions like jumping. In Strength Guided Motion [22], users assign motion goals to be achieved. In order to achieve a goal which is usually in Cartesian coordinates, it is necessary to solve an inverse kinematics problem. By solving this inverse kine- matics problem, a configuration of the subject is obtained. In this process, a parameter optimization technique which does local optimization while satisfying kinematic, geometric and dynamic con- straints is needed. By assuming that the velocity and accelerations needed to achieve a slow/mild motion are relatively small, we can get a set of key frame configurations of a subject. The kinematic para- meters (joint velocity, acceleration) for a planned motion may lose accuracy in this method because their motion planning is local, and this method is not for violent motion. Figure 1 summarizes the above discussion.

3. CONTROL FOR FORWARD DYNAMIC ANIMATION

Let us assume that we use n+ 1 control nodes, ranging from 0 to II. Now consider the i-th state. The differential equation (system dynamic equation)

s =.f (s, t, u)

holds everywhere. Here s denotes a state variable vector, u denotes a set of controls. Note that the final time, tf, is not fixed. Free final time is necessary because we do not know the exact time it takes to simulate a correct motion.

Consider rhe parameter vector (vector of control variables)

z= (tf,Ug,u ,,... ~ . . . . UJT

Initially, b and the vectors u,, O<i<n, make up a set of control variables and are given guessed values. These u,‘s are used to calculate u(t). To make this clear: ui is a vector of control variables which resides at control node i. Control nodes are allocated in terms of time. Here we have IE time intervals (for simplicity assume that all control nodes are equally spaced)

where ui represents a vector of control variables on the control nodes at time itf/n. I f time t belongs to

Page 4: Forward dynamics based realistic animation of rigid bodies

486 J. Park and D. S. Fussell

Advantage

Dis- advantaos

-- Tools needed -__

Controller-based Forward Dynamics

Realistic Motion Controller can adjust to environment

- Difficult to make controllers

- Controller needed for each motion

- no global motion planning

Forward dynamic simulation

Following Footprints

Spacetime Constraints

Realistic Motion Realistic Motion

- guess Initial - swoy;n~nl~al

motion - very rough - long simulation

computation - long - not for corn utatlon

non-voluntary P -not or motion non-voluntary

motion- - NLP -’ NLP

- - Inverse dynamics _ Inverse dynamics - i .

Fig. 1. Comparison of various animation methods.

then u(t) is calculated by a linear interpolation (for simplicity) of ujP1 and u,. Also we convert the final time, tf, into a parameter, such that rr = t/tf. We thus fix the interval of integration O<cr< 1, and the system differential equation S =,f(s, t, u) becomes

ds z = trf(s(a), tfg>u(a)) (1)

This equation is integrated in terms of c. using the pre-specified boundary condition s(0) to compute the values of the states at the final time s( 1). In the case of human jumping, the initial conditions are the start configuration of the human body, joint velocities, and muscle forces and their activation levels. Constraint functions are given in terms of the final configurations of the body. At the final time these should satisfy the system equality constraints and inequality constraints. In summary, we replace the infinite number of control nodes in true optimal control by a modest number of control nodes and linear interpolation of adjacent nodes.

Let us take an example for the case of a human body which was used for our animation. In our example of human jumping, we used six degrees of freedom, two for the tip of the foot and four for the body (Fig. 8), but we can easily generalize to higher DOF’s in three dimensions. Simply let the cost function J = Tr and assume we have m = 6 degrees of freedom. 1 controls for the body, and II + 1 control nodes (we used 21 control nodes); x and y denote displacements in the X and Y direction respectively, di denotes the i-th joint angle. Then the state variables become

and the control variables become

z= (tfrUo,U, ,...I wdT

Because we worked on a muscle model as well as a plain joint torque actuation model, the control variables change for each simulation. The system

- Fast computation - Good for mildlslo

motion

- no global motion planning

- not for violent motlon

- not for non-voluntary motion

- NLP - Inverse dynamics

dynamics equations are

d+ - = tf& do

+ external force/moments

+ gravitational force

+ damping force + spring force)

(3)

where Iis is a generalized mass matrix and Pi4b is a centripetal/Coriolis term. A basic control algorithm for forward dynamic simulation based animation is shown in Fig. 2.

4. SEARCHING FOR OPTIMAL SOLUTIONS

In the process of doing an animation from a simulation, we need to find an optimal set of control values for a highly nonlinear cost function+ (objec- tive function or performance index) with nonlinear constraints. Also the cost function can easily have hundreds of variables. The large number of variables along with the nonlinearity makes the problem very difficult. For forward dynamic animation, a single function evaluation takes a long time due to continuous forces~. Even the cost function is highly unconstrained since there are so many solutions for an animation problem.

In (order to solve these problems, we used a nonlinear programming (NLP) method. But NLP

’ This is the function to determine the quality of the planned motion. The cost function includes, for example, whether the motion satisfies physical laws.

t A continuous force is a force which exists for a duration of time. An example of continuous force is a ground reaction force. To accurately simulate a continuous force, we need to make the integration step size very small because the fame exists for a duration of time.

Page 5: Forward dynamics based realistic animation of rigid bodies

Forward dynamics based animation of rigid bodies 487

r l- For every control variables

. Perturb i-th vmc]

t 1 Linearly interpolateI

Compute New 2 such ‘hatJnew< JoId

Evaluate a cost function and constraints. Compute the derivatives of constraints and of a cost function.

Fig. 2. Control flow for forward dynamics based animation.

has a weakness in solving problems with many local minima. Also, it cannot handle ridges+. Furthermore, the cost function can be discrete. While NLP has its problems with local minima, simufated annealing%

[23] can find solutions of functions with even a huge number of local minima. Simulated annealing statistically guarantees finding a globally optimal solution by allowing the search to climb uphill sometimes, but the price paid is long computation time. This computational problem becomes serious when we deal with a large number of control variables and a long function evaluation time. To find a global optimum effectively, we modified the NLP method so that the search can continue by adding an escapes capability whenever the search ends up at a local optimum. The best search method is a method which can find the optimal solution

’ A ridge is an area of a function where the gradient of the function is zero.

: A tool which finds the global optimum. B This method tries jumps in different directions whenever

it is stuck at a local optimum.

without any user interference. Because this is almost impossible, the strategies presented in this section can find a solution with relatively little user interac- tion.

We believe the search space for forward dynamic based animation has more local minima because the control for forward dynamic simulation is at the force level and forward dynamic simulation deals with non-voluntary motions which come from collisions. Motion with collisions is pretty unpre- dictable, and this is why we feel that for realism, a small difference in the initial orientation of a simulated object can make the resulting motion very different.

For a huge search space problem, the strategy is to reduce the search space size. We try to reduce it by reducing the number of control variables. We use a control window to activate selected variables only. We also use an hierarchical problem solving and divide- and-conquer strategy if the original problem is too big.

4.1. Nonlinear programming (NLP)

The NLP problem is of the following form:

Page 6: Forward dynamics based realistic animation of rigid bodies

J. Park and D. S. Fwsell 488

Minimize cost function h(z) subject to gj = 0

qj60

where 16 i< 1, 1 <j<m, 1 is the number of equality constraints, m is the number of inequality con- straints. and h, g, and q are nonlinear constraint functions. The NLP problem solvers we used are GRG2 [24] and VFOZAD [25]. GRG2 stays on the constraints until it finds a local minimum. The advantage of using an NLP solver is that it finds local optima very efficiently by computing the gradients of a cost function and constraints. But a major problem of using an NLP package is that it cannot find a global minimum, and there is no tool which will find a global optimum efictivelMv. Due to problems with the NLP method, we modified the NLP method by adding a junrp capability to escape whenever it is stuck at a local optimum. If a control variable set with better cost is found, then use a greec& strategy. To accelerate total computation time, we can use parallel computation both in the nonlinear programming algorithm itself and for jumps. NLP needs to compute gradients of a cost function as well as constraints. which are indepen- dent computations in terms of control variable values. Also jumps for each variables can be done independently.

4.2. Simulated annealing In simulated annealing, the package constructs a

new control variable value set at random and evaluates a cost function. If the cost is at least as good as that of the current control variable set, then the old control variables are discarded and the new control variables are accepted. If the new cost is worse, then a probability function is used to determine whether or not to accept the current control variable set. This effect is to allow the system to escape itself from local optima by letting the search climb uphill sometimes. Simulated annealing can be shown to find a global optimum statistically. The simulated annealing package we used was introduced by Ingber [23].

The problem with simulated annealing is that it takes a great deal of computation time to find a global optimum. Also it is very dependent on the search variable domain. Our modification of the simulated annealing terminates whenever an accep- table solution is found. This is possible because the cost function is provided by the user, and he/she can specify acceptable optimum values. In animation, we generally do not need a global optimum value but an acceptable close-to-optimum value.

4.3. Reducing search space size We usually deal with a large number of control

variables which are needed to control highly redundant/complex motion coordination. But the more variables we have for control, the more difficult

it is to find a global solution. In this subsection. we provide several strategies to find solutions effectively.

4.3.1. Control window. The control window is very similar to the Spacetime Window of [14] but is more general. In this method we selectively turn on/off control variables. The variables which are turned off act as constants and the cost function has fewer variables, which means it is easier to find a solution. This method is very effective when certain variables are more sensitive than other ones. If so, we just turn on the sensitive variables first, and then work with other variables later. This approach is very closely related to hierarchical problem solving.

4.3.2. Hierarchical problem solving. The basic idea is to make the problem easier so that it becomes manageable. Again, easier means that the original problem is turned into the same problem with a smaller set of variables.

4..3.2.1. Affkctive variables. In this method, we first work with variables which affect the motion greatly. By working with these variables first, we can get a gross motion. Then we work with other variables. To find out which variables are affective or sensitive, find variables which are essential in the mation. One example of this is an animation of human walking. When humans walk, they swing their arms. But this does not affect walking much. So we can work with only lower extremities first by disabling the upper extremity control variables using the control window. Another example involves the lower extremities. Note that only toe and thigh angles change heavily in human walking. We can barely produce a walking motion by using only these angles. We can work with these angles first and find a motion, and then proceed to include the rest of the control variables.

4.13.2.2. Divide and conquer. In this method, we divide dn original animation task into several smaller tasks. Note that these sub-tasks should not affect each other heavily. We solve each sub-task one by one and then combine the work to solve the original task. A good example of this is human jumping. In jumping, there is a phase to prepare for the jump (counter movement, for example). The actual jump happens later, followed by a phase where the body is stabilized. In this example, we can divide the original task into two small tasks; ‘jump up’ and ‘stabilize’.

5. WORKING WITH MUSCLES

The human body is a mechanically redundant actuator system because we have more muscles than degrees of freedom. Muscles are linear actuators, which means that the control of a body is config- uration dependent. In this section, we try to better model the human body (or any animal subject) by including linear actuators rather than robotic rotary joint actuators.

5.1. Arknation with muscle dynamics This and the next subsection is adopted from [I]

and is originally due to Pandy [26]. A forward

Page 7: Forward dynamics based realistic animation of rigid bodies

Forward dynamics based animation of rigid bodies 489

Fig. 3. Schematic representation of musculoskeletal model for human jumping. Symbols appearing in the diagram are: soleus (SOL), gastrocnemius (GAS), other plantarllexors (OPF), tibialis anterior (TA), vasti

(VAS), rectus femoris (RF), hamstrings (HAMS), and gluteus maximus (GMAX).

dynamic simulation can easily include muscle dy- namics since body dynamic equations can readily be numerically integrated (this process is called muscle forward dynamic simulation). This means inverse dynamics cannot be incorporated with muscle dynamics+. As an example, consider the human leg with the eight muscles and their characteristics shown in Fig. 3.

Figure 4 shows the control flow of an algorithm for a controller that generates a desired motion using a muscle model. I f we have full muscle dynamics and its activation dynamics, we can control eight neural excitation signals, w(t), as control variables. (This level of control is the most nonlinear control we can have for forward dynamic simulation. Because we have several layers of nonlinear functions, the resulting motion derived by forward dynamics is guaranteed to be a highly nonlinear smooth motion. We can also control at the muscle activation level, the muscle force level, and finally at the joint torque level.) Neural excitation signals will give eight muscle activation levels, a(t), with muscle activation dy- namics simulation. This process allows muscle response time control which becomes meaningful especially for an old person. By using muscle activation levels, we get eight muscle forces, FM, with muscle dynamics simulation. With muscle forces, we compute the joint geometry and get the

’ In muscle dynamics, the activated muscles generate force. Muscle force determines joint torque. Because joint torque is known, we must use forward dynamics.

joint torques generated by the eight muscle forces. From the joint torque we can do a forward dynamic simulation. To get the best motion, we need a parameter optimization (or NLP) package. A user initially guesses a neural excitation signal through a user interface, which is then fed to a parameter optimization package. As a result, the package will find us a locally optimum control/motion.

As described above, when the controlling motion appears in terms of neural excitation signal levels, we get muscle activation levels, and from these, we get muscle forces. Because an activation dynamic equa- tion is involved here, we need two other levels of numerical integration before we get force level motion control. From the muscle forces, we can obtain a set of joint torques.

5.2. Muscuhtendon and its activation dynamics 5.2.1. Activation dynamics. The activation dy-

namics becomes important if we model an old person. Because the latency time for an old person is longer and the activation rate is smaller than that of a young person, the resulting motion is heavily affected. This is why an old person responds slower than a young person. Also, more importantly, the activation dynamics equation, which is a first order differential equation, guarantees to eliminate robotic jerky motion because the activation level, a(t), is continuous and nonlinear even though the input neural signal, w(t), is not continuous. This shows why the resulting control for the musculotendon model is a nonlinear control.

Page 8: Forward dynamics based realistic animation of rigid bodies

J. Park and D. S. FusselI

Muscle Activation

-wj Joint Geometry j

II

Fig. 4. Control flow of human body animation ‘Nith musculotendon dynamics

5.2.2. Musculotendon dynamics. The muscle-and- tendon (musculotendon) dynamics equation was derived from the experiments. The study by Zajac

[27] is a good reference for the musculotendon dynamics. A musculotendon is modeled using springs and a damper as shown in Fig. 5. Using the experimental results, this muscle model is designed to act very similarly to that of a real creature. Before going on. we want to explain the meaning of the symbols. F means force. I length; superscript M means muscle, T tendon. MT muscu- lotendon; lMT t is the length. of a musculotendon actuator. Most muscle models of animals have pretty similar characteristics, so we can use our muscle model for almost all animals by changing several parameters.

Figure 6(b) shows a muscle-forceevelocity char- acteristic. An active muscle contains a damped element in series with an undamped elastic element. The damped element, if allowed to shorten, exerts a force which is smaller, the faster the shortening. Compare, e.g. the human finger, which can move very fast but cannot generate a larger force. Imagine a pianist playing the piano. If he moves his fingers slowly, then he can generate a bigger force with his fingers. In order to measure this characteristic, a quick release experiment [28] was done. The curve can be approximated by an arctan function. Figure 6(a) shows a force-length curve which can be also

obtained from experiment. The passive properties of a muscle are easy to measure. We get the curve by varying the force and measuring the corresponding length of the muscle. In order to measure the active properties, we need to activate the muscle and measure the length according to the force. The value we get contains both active and passive components. In order to calculate the active part, we just need to subtract the passive curve from the passive + active curve. Because we need to deal with so many different kinds of muscles, it is better to work with a normalized version of musculotendon dynamics. Then we multiply by the appropriate magnitude at the computation result. Muscle force is a first order differential function. The musculotendon equation

MUSCLE

Fig. 5. Musculotendon dynamics modeling.

Page 9: Forward dynamics based realistic animation of rigid bodies

Forward dynamics based animation of .-igid bodies 491

0 3 FM

(a) Muscle force-length Curve

(b) !A;: force-velocity

Fig. 6. Muscle-force-length curve and force -velocity curve

can be derived from the muscle-forceevelocity curve and the force-length curve.

5.3. Working with nmsde and joint grornety’ The next computational segment in the control

flow for a musculotendon dynamic model is joint geometry. We have a muscle force which is acting linearly. In order to calculate the joint torque actuated by the musculotendon actuators. we need to CakUkttC the nzoment arm, r, of a muscle at some perpendicular distance from a center of a joint to a line where the muscle force is acting.

Finally we get a set of joint torques which is actuated by a set of musculotendon actuators. The multi-joint dynamics part is pretty similar to usual robotic dynamic equation computation, except that the joint torque is computed from one or more linear actuators rather than rotary joint actuators. Because the current body configuration affects the joint geometry, the moment arm changes according to the current configuration, and the musculotendon actuator length is determined by the current joint angles. we need a feedback of joint angles as can be seen from Fig. 4. Also, the current joint angular velocities affect the linear musculotendon actuator velocities so that we need feedback of the angular velocities.

6. CONTROL SPECTRUM FOR FORWARD DYNAMIC SIMULATION

Because we can employ muscle and skeletal geometry, muscle dynamics, and its activation dynamics along with robotic rotary joint articulated rigid body simulation, we have several layers of motion control.

The first is controlling with pure joint torque. We do not employ any muscle related modeling. This is the exactly the same as other forward dynamics based simulation packages do. Using our optimiza- tion system (NLP package) for motion control, we input a piecewise linear joint torque function for

each joint. Then we do a forward dynamic simula- tion and check the results to find out whether or not the motion is the best we want. I f not, our optimization system will modify the piecewise linear input functions until we get the best motion. In this case, even though we input a non-differentiable function as a joint input, we get a nonlinear function as motion output for the joint because rigid body dynamics is described by a second order differential equation. .But the resulting joint angle motion function is the least nonlinear one compared to the functions in the following control methods.

Secondly. we can control with muscle force only. In this modeling, we employ only muscle geometry. There is no other dynamics modeling except pure articulated rigid body simulation. Because muscle force is converted to joint torque using a moment arm, and t;le moment arm makes the inputs non- linear. we have more nonlinear joint torque input functions. We input a piecewise linear muscle force function for muscle input. Then it is converted into a nonlinear torque function (but not differentiable), and it is then fed into a rigid body dynamics simulation. After forward dynamic simulation, the output joint motion function becomes more non- linear than that of the first method.

The third method uses muscle dynamics and muscle geornetry. We control with a set of piecewise linear muscle activation levels. Then, after going through the muscle dynamics, we get a nonlinear muscle force function. The nonlinear muscle force is converted into a more nonlinear joint torque function by the muscle geometry. A set of nonlinear joint torque functions gives us a set of joint angle functions after forward dynamic simulation.

The last and most nonlinear control is done with muscle activation dynamics. This method also employs muscle and skeletal geometry. and muscle dynamics. .We control with a muscle activation signal. Then, after going through the muscle activa- tion dynamics. we get a nonlinear muscle activation

Page 10: Forward dynamics based realistic animation of rigid bodies

492 J. Park and D. S. FusselI

Fig. 7. Animation of a die: game

level function. The rest of the simulation is exactly the same as that of the third method.

We have four different levels of motion control in forward dynamic simulation. If we want a very nonlinear smooth joint angle function, we should use control at the muscle activation signal. But most nonlinear joint angle motion means we may have a most nonlinear cost function which is not desirable for a solution search. If we control with the joint torque level, the resulting motion is the least nonlinear, and less smooth than those generated by the other methods.

7. EXAMPLES

I. 1. Forward dynamic animation In order to do forward dynamic animation, we

add motion control to the forward dynamic simula- tion. The forward dynamic simulation is rather expensive due to the continuous force, but it does produce realistic non-voluntary motion which can- not be achieved by inverse dynamics based methods.

7.1.1. Dice magic. The search space of the dice magic animation shown in Fig. 7 may have ridges and is discrete. It has these characteristics because the die has a fixed number of faces. The goal of this animation is to throw a die into a glass cup with the constraints that the die should hit the walls twice and that the final face of the die should be the same as that before throwing. The control of this animation was done using simulated annealing. But this animation can be done also by mod$ed nonlinear programming. The control variables for the simula- tion are the linear momentum values in the X, Y and Z direction. An MPEG movie entitled dice-ma- gic.mpg’ was made.

7.2. Human jumping 7.2.1. Jumping human model. A recursive Newton-

Euler formulation [29] or any other dynamic formulation can also easily be modified to apply to the free base (body in the air) case. The equations are derived for the planar case, and we obtain additional equations from the ground reaction force relations. Collection of similar terms and simplification leads

+ This movie can be anonymously ftped from /pub/mist/ dice-magic.tar of avalon.viewpoint.com or any other ftp sites.

to Equation (3). Figure 8 shows a schematic representation of the four-segment model of a jumping human. Note that the generalized mass matrix is positive definite and symmetric so that we can easily recover the form of Equation (3) with some manipulations.

We implemented two kinds of forward dynamic human jump. One is the rotary joint actuated version and the other is the eight muscle actuated human jumping. Figure 9 shows a jumping human.

7.X 1.1. Plain forward dynamics based human jumping. In this animation, the human dynamic equation changes according to ground reaction forces. Because we modeled the human body as a jumping robotic body, we can control the rotary joint actuators. That is to say, the control variables are joint torques. Also, the algorithm to find optimal control is explained in Section 3.

The cost function (performance index) set is meaningless, and is only used to satisfy the final time configuration goal for the body. We use four controls for the body and 21 control nodes. Then the state vector is

the control variables are

z = (If> WI, UI: . ..> wx>

and the resulting joint torque vector is

(4)

Ui = (W&Ti3J,d (5)

where srj, O<i<20, 1 <j<4, represents the torque value for the (i+ 1)st control nodes and thej-th body joint.

7.2.1.2. Muscle dynamics based human anima- tion. We also experimented with the use of muscle dynamics. As was discussed before, only forward dynamic simulation can include the muscle dynamic model. Section 5.1 gives an idea of using muscle dynamics. The major difference from a plain joint torque actuated simulation is that the joint torque computed from muscle dynamics is a nonlinear function while that of a plain joint torque actuated simulation is a piecewise linear function. Nonlinear control guarantees a smooth motion as an output, but the control is more difficult because the cost functi#Dn will have more local optima so that finding the global optimum becomes more difficult.

Page 11: Forward dynamics based realistic animation of rigid bodies

Forward dynamics based animation of ri,;id bodies 493

Fig. 8. Schematic representation of the four-segment model of a jumping human. ml. nrz, mj, ?n4 are the lumped masses of the foot, shank. thigh, and HAT (head. arms, and truck) respectively; I,, Iz, 13, I, are the moments of inertia of the foot, shank, thigh and HAT respectively: I,, i2. 6, I4 are the lengths of the foot. shank. thigh and HAT respectively: and I<,. ICI. I<J, I,., are the lengths from the local base to the

center of the foot. shank. thigh and HAT respectively.

We worked on the jumping-up phase and on human stand-up from a chair. The cost function minimized final time tf for both animations, making the ground reaction force as close to human stand- still as possible for the stand-up animation. The constraints caused the ground reaction force to be zero at the end of the simulation for the case of jumping up. and to be as close to that of a human standing still for the stand-up animation. The motion in Fig. 10 is generated automatically without the animator’s intention to make the subject move forward its upper body. The state variables are the same as in the plain torque actuation model. and the control variables are

z== (tr,uo,u I,..., “2f))T (6)

Uj = (lt’il, M’j?, M’i3: . . . . Wi*)T (7)

and the wii, 0~ i<20, 1 <j< 8, represent the neural excitation signal values (ranging from 0 to 1) of thej- th muscle for the (i+ 1)st control nodes.

7.3. User interface Because the cost function and the constraints are

highly nonlinear due to the complicated trigono- metric equations in the dynamic equations and the second order differential equations involved, we believe that It is not possible to find a best set of motion trajectories without any control variable initialization. In order to initialize our control variables to help accelerate the dynamic (global) parameter optimization process, we have implemen- ted an X window based user interface where we can guess our motion at the control level. By selecting a node and varying the values by moving a mouse, we can make a continuous control function of our choice. Then by pressing the ‘RUN’ button, the single time function evaluation as well as motion display is done on the screen. By playing on the screen and getting a crude motion, we then input the motion to thse system and the optimization process will run and generate a high quality motion. Figure 11 shows a user interface for human jumping animation. We use the generalized concept of Spacetime W+rdorr [14]. In our system, we can turn

Page 12: Forward dynamics based realistic animation of rigid bodies

on/off arbitrary variables so that we can reduce the number of control variables. Sometimes working with a small number of control variables makes the optimization task easier.

8. DISCUSSION OF RESULTS

Kinematic level animation is oriented only toward motion control. The qualirsv of the motion mdst be supported by dynamics for it to be realistic motion. Dynamics based algorithms can be classified as forward dynamics based algorithms or inverse dynamics based algorithms. By using forward dynamics, we can improve realism because forward dynamics does a very accurate physical simulation. In this method, we actuate joints by applying some amount of torque to see if a kinematic goal is achieved. If not, we modify the previous torque amounts and try again until the kinematic goal is satisfied. But the price paid is computation time due to the need for small integration time steps to do accurate forward dynamic simulations with contin- uous forces. The most difficult problem with forward dynamic animation, however, is that motion control becomes very difficult because the control is at the force/torque level, so the effect of the control does not show up directly at the displacement level, and animation goals are usually at the displacement level. I f we want to go for realistic motion by using forward dynamics. achieving kinematic goals be- comes difficult. but if we care about satisfying

Fig. 1 I. User interface for human jumping up animation.

kinematic goals, like kinematic level animation. then physical laws can easily be violated resulting in degraded quality of motion.

We now present the reasons for the necessity of parameter optimization techniques. In forward dynamic animation, the force/torque level control needs to satisfy kinematic goals. In order to achieve this, we need a special tool which will check whether or not the control achieves kine- matic goals. I f the goal is not achieved, then we need to try with a new control. This is done by the parameter optimization technique. The parameter optim:.zation method is general enough that it can consider the entire animation. Because the para- meter optimization method helps us to consider the entire animated motion, we can find the best motion while other methods like controller based methods cannot.

Then, for what kind of animation do we need to use forward dynamic animation? Forward dynamic animation does a very accurate simulation and its controls are at the force/torque. Remember that non- volurnary motion implies that the force/torque needs to be handled and so only forward dynamic animation can be used for non-voluntary motion. But forward dynamic animation is more computa- tionally expensive due to continuous forces. For volun.ary motion, both forward and inverse dy- namics can be used for an animation. Because

forward dynamic animation is computationally expensive, there are few reasons to use it for a voluntary motion animation.

We will now discuss why forward dynamic motion control is more difficult* than that of inverse dynamics. Our forward dynamics based algorithms either use muscle dynamics to generate force control indirectly or control plain joint torques directly. Invers,e dynamics based algorithms presented up to date work on joint displacements or joint accelera- tions. Overall, these algorithms can be seen as points on a continuum, ranging from displacement level

’ By difficult we mean more nonlinear. A more nonlinear cost fimction has more local optima. which makes the search for the solution difficult.

Page 13: Forward dynamics based realistic animation of rigid bodies

Forward dynamics based animation of rigid bodies

1 More nonlinear control, Faithlul Simulation

495

Eseier Control, Rough Simuletion

(LL,Fii3

motion planning

dynamics based motion control Joint dieplecement

motion planning

Muscle dynamics (SpacetIme conetrsinte)

based motion control Muecle iorce based motion control

Fig. 12. Various levels of animation.

maximum control and minimum realism+ for the inverse dynamics based approa’ch to maximum realism with minimum control for the forward dynamic simulation. This is depicted in Fig. 12. If control is done at the muscle excitation level using muscle dynamics, then the muscle excitation func- tion is piecewise linear. I f this function goes through muscle dynamics, which implies a first order differential equation, the resulting muscle force is a nonlinear function. Nonlinear muscle forces become nonlinear joint torques after com- puting the skeletal geometry. Nonlinear joint torques can generate more nonlinear joint accelera- tions. velocities. and displacements because rigid body forward dynamic equations are second order differential equations. Because kinematic para- meters are very nonlinear, a cost function contain- ing these nonlinear kinematic parameters will be highly nonlinear (refer to Section 5.1). But our human jumping-up phase animation becomes very realistic because of the nonlinear joint angle func- tions resulting from a pipeline of nonlinear comput- ing algorithms. Another possible control is at the joint torque level. That is to say, we can have piecewise linear joint torques. In this case, the resulting joint acceleration, velocity, and displace- ment are less nonlinear than the ones at the muscle excitation level control. A more nonlinear cost function means more local optima, which makes the search for the global optimum more difficult.

In Fig. 12. we find that the control becomes more nonlinear and more difficult as we move to the left side. Also, a more nonlinear control leads to more local optima in the search. As we add a more sophisticated forward dynamic simulation, the con- trol becomes more difficult. Also the change in muscle excitation signal goes through at least two

’ We mean the motion interpolation is not C2 continuous. If we use a C“ function for motion control. than we should interprete the control is done at the acceleration level.

levels of numerical integration and so the control effect is less immediate. But most importantly, the resulting motion gives us the highest degree of realism.

The conclusion is that there are animations which need forward dynamic simulation while there are some which can be done efficiently by using other methods as inverse dynamic animation. For the animations ,which contain non-voluntary motion, we must use forward dynamic animation. We can also use forward dynamic simulation which takes rela- tively short computation time for a cost function evaluation, and have a small number of control variables. The inverse dynamic animation is used only for voluntary motion animation whose subjects have actuators.

In this paper. we reviewed several animation techniques. Spucetime Comtvaints is for voluntary motion only. In terms of controller based methods, a specific controller is needed for every motion to be animated. Also, these methods cannot consider the entire motion of an animation.

We conclude that the way to go for non-voluntary motion animation is our forward dynamics and parameter optimization based approach. There is no other way to do animation such as dice-magic presented in this paper.

Acknolcledgenlents-This work was supported in part by KOSEF under KOSEF grant number 961-0910-056-2. We thank J. C. Browne for his support.

REFERENCES

I. Park, J., Fussell, D., Pandy, M. and Browne, J. C., Realistic animation using musculotendon skeletal dynamics and suboptimal control. TR 92-26, Computer Science Department, University of Texas at Austin (also at l’hird Eurographic Workshop on Animation and Simulation. Sept. 1992. Cambridge. UK). 1992.

2. Park, J., Fussell, D. and Pandy, M.. Following footprints of reality. In Pa@ Graphics ‘93. World Scientific Publishing Co.. 1993.

3. Pandy, M.. Anderson, F. and Hull. D., A parameter

Page 14: Forward dynamics based realistic animation of rigid bodies

496 J. Park and D. S Fussell

4

5

6

7

8.

9

10

II.

12.

13.

14.

15.

optimization approach for the optimal control of large- scale musculoskeletal systems. Submitted to Journal of Biomechanieal Engineering. Hahn, J. K., Realistic animation of rigid bodies. Computer Graphics (SIGGRAPH ‘88 Proceedings), 1988, 22(4), 299-308. Baraff, D., Rigid body simulation. In SIGGRAPH ‘93 Course Notes, Vol. 60. ACM, New York, 1993. Wilhelms, J.. Using dynamic analysis for realistic animation of articulated bodies, IEEE Computer Graphics cmd Applications, 1987, 7(6), 12-27. Hodgins, J. K., Wooten, W. L.. Brogan, D. C. and O’Brien, J. F., Interactive spacetime control for animation. Computer Graphics. 1995, 29, 2. Rdibert, M. and Hodgins, J. Animation of dynamic legged locomotion. Computer Graphics, 1991. 25(4), 3499358. Miller, G. S., The motion dynamics of snakes and worms. Computer Graphics, 1988, 22(4). 169-178. Park. J., Fussell, D. and Browne, J. C., Motion control using extended generalized coordinate transformations, TR 92-25, Computer Science Department, University of Texas at Austin (also at Third Eurographic Work- shop on Animation and Simulation, Sept. 1992, Cam- bridge, U.K.), 1992. lsaacs, P. and Cohen. M., Controlling dynamic simulation with kinematic constraints, behavior func- tions and inverse dynamics. Computer Graphics. 1987, 21(4). 215-224. lsaacs, P. and Cohen, M.. Mixed methods for complex kinematic constraints in dynamic figure animation. Visual Computer, 1988, 4, 29&305. Witkin, A. and Kass, M., Spacetime constraints. Computer Graphics, 1988. 22(4), 1599168. Cohen, M., Interactive spacetime control for anima- tion. Computer Graphics, 1992. 26(2), 293-302. Stewart. J. and Cremer. J., Animation of human

16.

17.

18.

19.

20.

21.

22.

23.

24.

25.

26.

21.

28.

Brotman, L. and Netravali, A. Motion interpolation by optimal control. Computer Graphics, 1988. 22(4), 309- 315. Pandy, M., Zajac, F., Sim, E. and Levine, W.. An optimal control model for maximum-height human jumping. Journal of Biomechanics, 1988. 23(12), 1185- 1198. McKenna, M. and Zeltzer, D.. Dynamic simulation of autonomous legged locomotion. Computer Graphics. 1990, 24(4), 29938. van de Panne, M., Fiume, E. and Vranesic, 2.. Reusable motion synthesis using state-space control- lers Computer Graphics, 1990, 24(4). 225-234. van de Panne, M., Fiume. E. and Vranesic. Z., Control techniques for physically-based animation. In Third Eurographic Workshop on Animation und Simulation, Eurographics, 1992. Zhao, J. and Badler, N., Real time inverse kinematics with joint limits and spatial constraints. MS-CIS 89-09, University of Pennsylvania. 1989. Lee, P.. Wei, S., Zhao, J. and Badler, N., Strength guided motion. Computer Graphics. 1990. 24(4). 253% 263. lngber, L., Simulated annealing: practice versus theory. Muthematical and Computer Modelling. 1993, 18(1 I), 29-58. Lasdon, L. and Waren, A., GRG2 User’s Guide. University of Texas at Austin. 1989. Powell, M., VF02AD User’s Guide, Harwell Subroutine Library, 1978. Pandy, M., Lectures in Musculoskeletal Biomechanics. University of Texas at Austin, 1992. Zajac, F.. Muscle’ and tendon: properties, models, scaling, and application to biomechanics and motor control. Critical Review in Biomedical Engineering, 1989, 17, 4. McMahon, T., Muscles. Reflexes. and Locomotion. Princeton University Press, Princeton, NJ, 1984. locomotion climbing stairs and descending stairs. In

Third Eurographic Workshop on Animation and Simula- 29. Craig, J.. Introduction to Robotics Mechanics and /ion, Eurographics. 1992. Control. Addison-Wesley, Reading, MA, 1986.