simulation of constrained - vanderbilt university€¦ · of which can be found in refs. [1]–[6]....

6
David J. Braun 1 School of Informatics, University of Edinburgh, 10 Crichton Street, Edinburgh EH8 9AB,UK e-mail: [email protected]; [email protected] Michael Goldfarb Department of Mechanical Engineering, Vanderbilt University, VU Station B 351592, Nashville, TN 37235 e-mail: [email protected] Simulation of Constrained Mechanical Systems—Part II: Explicit Numerical Integration This paper presents an explicit to integrate differential algebraic equations (DAEs) method for simulations of constrained mechanical systems modeled with holonomic and nonholo- nomic constraints. The proposed DAE integrator is based on the equation of constrained motion developed in Part I of this work, which is discretized here using explicit ordinary dif- ferential equation schemes and applied to solve two nontrivial examples. The obtained results show that this integrator allows one to precisely solve constrained mechanical systems through long time periods. Unlike many other implicit DAE solvers which utilize iterative constraint correction, the presented DAE integrator is explicit, and it does not use any itera- tion. As a direct consequence, the present formulation is simple to implement, and is also well suited for real-time applications. [DOI: 10.1115/1.4005573] 1 Introduction Precise numerical integration of constrained dynamical systems, are usually performed with specifically developed implicit integra- tion methods enhanced with iterative constraint corrections, a review of which can be found in Refs. [1]–[6]. Such an implicit differential algebraic equation (DAE) integrator is nontrivial to implement but can perform stable and precise integration regardless of whether the original dynamical system is stiff or nonstiff by nature. Compared to explicit integrators, implicit integrators are computationally more ex- pensive but also more stable and are usually required if the equation of motion is stiff. Unlike for ordinary differential equations, explicit numerical methods have not been proven as efficient alternatives for DAEs. This is however not because DAEs are mainly stiff by nature, but rather because usual reformulations of the original DAE problem (utilized to prevent error accumulation) make stable DAE integration require a stiff (iterative) solver, Gear [7]. In this paper, we employ the equation of motion derived in Part I of this work [8] which does not require an implicit integrator or iterative correction to provide a precise long time solution for DAEs. As derived, the equation can be directly discretized using explicit ODE schemes (forward Euler, Runge-Kutta, etc.) and integrated in the same fashion as one would integrate ordinary dif- ferential equations. As frequently argued by numerous authors, ten Dam [9], Ascher et al. [10], Burgermeister et al. [11], an explicit integration (as the one offered here) is preferred for real- time DAE integration, see Petzold [12]: “For real-time simula- tion, it is essential to be able to make use of explicit methods wherever possible; if the solution is not computed in the allotted time, it will be useless.” Beyond this targeted feature, the DAE solver employed here can be used to simulate systems with nonholonomic constraints [13], and to perform energy conserving DAE integration where enforcement of the energy conservation law does not interfere with the constraint enforcement, (see Ref. [14] for an alternative formulation). Furthermore, the proposed equation can also be used to treat systems modeled with redundant constraints, and to predict motion through kinematic singularities [15]. In the remainder of this paper, a numerical implementation of the equation of motion derived in Part I of this work is presented. Application of the proposed explicit DAE integrator is then dem- onstrated on two nontrivial examples. 2 Explicit Numerical Integration of DAEs The model of the constrained dynamical system considered here is defined by: (a) the differential equation of the uncon- strained dynamical system: Mðt; qÞq ¼ Qðt; q; _ qÞ, (where t denotes the time, q; _ q; q are the generalized coordinates, veloc- ities and acceleration of the unconstrained system, M is a mass matrix while Q represents the inertial and applied forces); (b) the holonomic constraint set: U q ðt; qÞ¼ 0; (c) the nonholonomic constraint set: U v ðt; q; _ qÞ¼ 0; and, (d) the energy-type conserva- tion law: U e ðt; q; _ qÞ¼ 0. The equation of motion for explicit numerical integration for such constrained dynamical system, proposed in Part I of this work [8], is given as: _ q ¼ v þ R 1 C þ q ðb q A q v U q =dtÞ (1) and _ v ¼ a þ R 1 C þ v ðb v A v a ð _ U T q ; U T v Þ T =dtÞ þ R 1 N v ðC e N v Þ þ ðb ev A ev a U ev =dtÞ (2) where q and v are the coordinates and the velocities of the con- strained system, while the definition of the other terms is provided in Ref. [8]. Now instead of utilizing a special numerical algorithm to integrate (a)–(d), one can apply traditional ODE integrators to solve the reformulated Eqs. (1) and (2), without having problems of constraint and energy drift. 2.1 Discretization. By choosing a small time step dt, the do- main of integration t 0; T can be equidistantly discretized as t n ¼ nT=N where n 2f0; 1; :::; Ng. By means of numerical solu- tion, we seek the discrete values of all positions fq n g and veloc- ities fv n g which are (numerically) constraint consistent. Let us assume that approximately constraint consistent initial conditions q 0 ¼ qð0Þ and v 0 ¼ vð0Þ, U q ð0; q 0 Þ 0, _ U q ð0; q 0 ; v 0 Þ 0, U v ð0; q 0 ; v 0 Þ 0 are provided. In this case, a precise solution can be obtained by integrating the system dynamics successively between discrete time instants. To illustrate a concrete implemen- tation, a numerical integration of Eqs. (1) and (2) is presented here based on a forward Euler method. (1) Based on q n ¼ qðt n Þ and v n ¼ vðt n Þ, known from the previ- ous integration step (or defined by initial conditions for the starting step), one can evaluate: Q ¼ Qðt n ; q n ; v n Þ, M ¼ Mðt n ; q n Þ, A q ¼ A q ðt n ; q n Þ, A v ¼ A v ðt n ; q n ; v n Þ, 1 Corresponding author. Manuscript received February 11, 2010; final manuscript received October 21, 2011; accepted manuscript posted February 1, 2012; published online May 16, 2012. Assoc. Editor: Wei-Chau Xie. Journal of Applied Mechanics JULY 2012, Vol. 79 / 041018-1 Copyright V C 2012 by ASME Downloaded From: http://appliedmechanics.asmedigitalcollection.asme.org on 10/20/2018 Terms of Use: http://www.asme.org/about-asme/terms-of-use

Upload: others

Post on 30-Apr-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

David J. Braun1

School of Informatics,

University of Edinburgh,

10 Crichton Street,

Edinburgh EH8 9AB,UK

e-mail: [email protected];

[email protected]

Michael GoldfarbDepartment of Mechanical Engineering,

Vanderbilt University,

VU Station B 351592,

Nashville, TN 37235

e-mail: [email protected]

Simulation of ConstrainedMechanical Systems—Part II:Explicit Numerical IntegrationThis paper presents an explicit to integrate differential algebraic equations (DAEs) methodfor simulations of constrained mechanical systems modeled with holonomic and nonholo-nomic constraints. The proposed DAE integrator is based on the equation of constrainedmotion developed in Part I of this work, which is discretized here using explicit ordinary dif-ferential equation schemes and applied to solve two nontrivial examples. The obtained resultsshow that this integrator allows one to precisely solve constrained mechanical systemsthrough long time periods. Unlike many other implicit DAE solvers which utilize iterativeconstraint correction, the presented DAE integrator is explicit, and it does not use any itera-tion. As a direct consequence, the present formulation is simple to implement, and is alsowell suited for real-time applications. [DOI: 10.1115/1.4005573]

1 Introduction

Precise numerical integration of constrained dynamical systems,are usually performed with specifically developed implicit integra-tion methods enhanced with iterative constraint corrections, a reviewof which can be found in Refs. [1]–[6]. Such an implicit differentialalgebraic equation (DAE) integrator is nontrivial to implement butcan perform stable and precise integration regardless of whether theoriginal dynamical system is stiff or nonstiff by nature. Compared toexplicit integrators, implicit integrators are computationally more ex-pensive but also more stable and are usually required if the equationof motion is stiff. Unlike for ordinary differential equations, explicitnumerical methods have not been proven as efficient alternativesfor DAEs. This is however not because DAEs are mainly stiff bynature, but rather because usual reformulations of the original DAEproblem (utilized to prevent error accumulation) make stable DAEintegration require a stiff (iterative) solver, Gear [7].

In this paper, we employ the equation of motion derived in PartI of this work [8] which does not require an implicit integrator oriterative correction to provide a precise long time solution forDAEs. As derived, the equation can be directly discretized usingexplicit ODE schemes (forward Euler, Runge-Kutta, etc.) andintegrated in the same fashion as one would integrate ordinary dif-ferential equations. As frequently argued by numerous authors,ten Dam [9], Ascher et al. [10], Burgermeister et al. [11], anexplicit integration (as the one offered here) is preferred for real-time DAE integration, see Petzold [12]: “For real-time simula-tion, it is essential to be able to make use of explicit methodswherever possible; if the solution is not computed in the allottedtime, it will be useless.”

Beyond this targeted feature, the DAE solver employed herecan be used to simulate systems with nonholonomic constraints[13], and to perform energy conserving DAE integration whereenforcement of the energy conservation law does not interferewith the constraint enforcement, (see Ref. [14] for an alternativeformulation). Furthermore, the proposed equation can also beused to treat systems modeled with redundant constraints, and topredict motion through kinematic singularities [15].

In the remainder of this paper, a numerical implementation ofthe equation of motion derived in Part I of this work is presented.Application of the proposed explicit DAE integrator is then dem-onstrated on two nontrivial examples.

2 Explicit Numerical Integration of DAEs

The model of the constrained dynamical system consideredhere is defined by: (a) the differential equation of the uncon-strained dynamical system: Mðt; qÞ€q ¼ Qðt; q; _qÞ, (where tdenotes the time, q; _q; €q are the generalized coordinates, veloc-ities and acceleration of the unconstrained system, M is a massmatrix while Q represents the inertial and applied forces); (b) theholonomic constraint set: Uqðt; qÞ ¼ 0; (c) the nonholonomicconstraint set: Uvðt; q; _qÞ ¼ 0; and, (d) the energy-type conserva-tion law: Ueðt; q; _qÞ ¼ 0.

The equation of motion for explicit numerical integration forsuch constrained dynamical system, proposed in Part I of thiswork [8], is given as:

_q ¼ vþ R�1Cþq ðbq � Aqv� Uq=dtÞ (1)

and

_v ¼ aþ R�1Cþv ðbv � Ava� ð _UTq ; UT

v ÞT=dtÞ

þ R�1NvðCeNvÞþðbev � Aeva� Uev=dtÞ(2)

where q and v are the coordinates and the velocities of the con-strained system, while the definition of the other terms is providedin Ref. [8]. Now instead of utilizing a special numerical algorithmto integrate (a)–(d), one can apply traditional ODE integrators tosolve the reformulated Eqs. (1) and (2), without having problemsof constraint and energy drift.

2.1 Discretization. By choosing a small time step dt, the do-main of integration t 2 ½0; T� can be equidistantly discretized astn ¼ nT=N where n 2 f0; 1; :::; Ng. By means of numerical solu-tion, we seek the discrete values of all positions fqng and veloc-ities fvng which are (numerically) constraint consistent. Let usassume that approximately constraint consistent initial conditionsq0 ¼ qð0Þ and v0 ¼ vð0Þ, Uqð0; q0Þ � 0, _Uqð0; q0; v0Þ � 0,Uvð0; q0; v0Þ � 0 are provided. In this case, a precise solutioncan be obtained by integrating the system dynamics successivelybetween discrete time instants. To illustrate a concrete implemen-tation, a numerical integration of Eqs. (1) and (2) is presentedhere based on a forward Euler method.

(1) Based on qn ¼ qðtnÞ and vn ¼ vðtnÞ, known from the previ-ous integration step (or defined by initial conditions for thestarting step), one can evaluate: Q ¼ Qðtn; qn; vnÞ,M ¼Mðtn; qnÞ, Aq ¼ Aqðtn; qnÞ, Av ¼ Avðtn; qn; vnÞ,

1Corresponding author.Manuscript received February 11, 2010; final manuscript received October 21,

2011; accepted manuscript posted February 1, 2012; published online May 16, 2012.Assoc. Editor: Wei-Chau Xie.

Journal of Applied Mechanics JULY 2012, Vol. 79 / 041018-1Copyright VC 2012 by ASME

Downloaded From: http://appliedmechanics.asmedigitalcollection.asme.org on 10/20/2018 Terms of Use: http://www.asme.org/about-asme/terms-of-use

bq ¼ bqðtn; qnÞ, bv ¼ bvðtn; qn; vnÞ, Uq ¼ Uqðtn; qnÞ,_Uq ¼ Uqðtn; qn; vnÞ and Uv ¼ Uvðtn; qn; vnÞ. The upper

triangular Cholesky factor of the mass matrix R is com-puted, where M ¼ RTR, and the pseudoinverse Cþq=v iscomputed based on Cq=v ¼ Aq=vR

�1.(2) By exploiting the Cholesky factorization one can solve the

unconstrained acceleration an from RTRan ¼ Q with a suc-cessive forward and backward substitution.

(3) In order to perform energy correction, one needs toevaluate: Ue ¼ Ueðtn; qn; vnÞ, Ae ¼ Aeðtn; qn; vnÞ, be

¼ beðtn; qn; vnÞ, Ce ¼ AeR�1, Nv ¼ I� Cþv Cv, ðCeNvÞþand ððbev � AevanÞdt� UevÞ, where ð�Þev ¼ ð�Þe�CeCþv ð�Þv.

(4) The endpoint position is computed from:

qnþ1 ¼ qn þ vndtþ R�1Cþq ððbq � AqvnÞdt� UqÞ (3)

and the endpoint velocity from:

vnþ1 ¼ vn þ andtþ R�1Cþv ððbv � AvanÞdt� ð _UTq ; UT

v ÞTÞ

þ R�1NvðCeNvÞþððbev � AevanÞdt� UevÞ (4)

At the end of an integration step, the new position and velocityðqnþ1; vnþ1Þ is obtained. These values are used to initialize thenext integration cycle.

2.2 Comments on Application and Implementation. In thefollowing, we discuss specific details related to the numericalimplementation of Eqs. (3) and (4).

2.2.1 Inconsistent Initialization. Unlike in ODE integration,where the generalized coordinates (selected to exactly satisfy thekinematic constraints) eliminate the issue of inconsistent initiali-zation, in DAE integration, inconsistency in initial conditions is acommon issue. Practically, any initial condition q0 and v0 whichdoes not exactly satisfy the constraints, Uqð0; q0Þ ¼ 0,Uvð0; q0; v0Þ ¼ 0, is considered inconsistent. Such an inconsis-tent initialization is a source of error generation in practice[16,17]. However, as derived and implemented, the presentedmethod assures that slightly inconsistent initial conditions whichdo not exactly satisfy the constraints cannot cause constraint orenergy drift along the time integration. This however does notmake inconsistent initialization advisable, namely any integrationstarted with an inconsistent position and velocity will requiresome starting (transient) time to regain its precision as discussedin Sec. 3.2. To avoid this effect, it is recommended to first alge-braically find initial data which is constraint consistent in a nu-merical sense.2

2.2.2 Redundant Constraints. The pseudoinverse notationutilized in Eqs. (3) and (4) is a convenient theoretical tool whichallows an explicit representation of the equation of motion regard-less of whether the constraints are redundant or not. Computationof the right hand side of Eqs. (3) and (4) however, which does notrequire direct computation of the pseudoinverses, is an implemen-tation detail discussed in the following.

If the constraints are nonredundant and the system does notmove through kinematically singular configurations, the pseudoin-verse is explicitly defined Cþ� ¼ CT

� ðC�CT� Þ�1

, otherwise it can becomputed utilizing singular value decomposition (SVD)C� ¼ USVT , Cþ� ¼ VSþUT (since S is a diagonal matrix, compu-tation of its pseudoinverse is trivial). However, instead of definingCþ� , and using it as a multiplier on the right hand side of Eqs. (3)

and (4) directly, it is preferable to use an appropriate matrixdecomposition algorithm and to compute the right hand side inEqs. (3) and (4) by matrix-vector multiplications. Specifically,one can utilize Gram-Schmidt orthogonalization (GSO) [18]; or-thogonal triangular decomposition (QR-decomposition), [19,20];complete orthogonal decomposition (URV-decomposition),[21,22]; or singular value decomposition, [23,24]. From the for-mer to the latter, the algorithms become more numerically stablebut also less computationally efficient [5]. While these two objec-tives need to be negotiated during the implementation, it is alsodesirable to use off-the-shelf, state-of-the-art numerical routinesinstead of custom built codes. An additional objective in the pres-ent context was to implement the approach in real-time. Forthat purpose, the rapid prototyping environment provided byMATLAB=SIMULINK was used.

2.2.3 Nonholonomic Constraints. In numerous DAE ap-proaches, the constraint set is assumed full-rank holonomic. Whileincorporation of rank deficient constraints is a separate issueaddressed in the Sec. 2.2.2, utilization of nonlinear nonholonomicconstraints (instead of only holonomic or linear nonholonomiconce) is an added feature offered here. In order to demonstrate thedifficulty at hand, let us point out that any formulation whichassumes linearity of the holonomic constraints on velocity cannotbe used once nonlinear nonholonomic constraints are applied onthe system. In Part I of this work, we provided a systematic deri-vation which takes care of this practical limitation. This utility hasalso been recognized as beneficial in the implementation ofenergy conserving DAE integration.

2.2.4 Energy Conserving DAE Integration. Preventing erroraccumulation along the motion constraints is often considered as aprimary objective in DAE integration. However, utilizing onlyconstraint correction, one can obtain a solution which preciselysatisfies the constraints, but which for example, can still bedelayed in time with respect to the exact solution of the system.This kind of error, which accumulates on the constraint consistentmotion (also present during ODE integration), cannot be elimi-nated, but can be reduced using kinematic constraint correctionand energy correction together.

Let us now consider the generalized force

Qk ¼ RTNvðCeNvÞþððbev � AevanÞdt� UevÞ (5)

which is embedded in the equation of motion. Eq. (4) (the lastterm in Eq. (4) represents M�1Qk) to perform the energy correc-tion during the simulation. Note that since CeNv is a (row) vector,the pseudoinverse ðCeNvÞþ required for the proposed energy cor-rection can be calculated

ðCeNvÞþ ¼ ðCeNvÞT=ððCeNvÞðCeNvÞTÞ; ifðCeNvÞðCeNvÞT > tol0; otherwise

�(6)

without a computationally demanding routine. Moreover, the tol-erance tol (small nonzero value) in Eq. (6) prevents ðCeNvÞþ, andalso the correction force, from becoming arbitrarily large. In orderto gain insight into this mechanism, let us consider an unconstrainedconservative autonomous system with a classical energy conservationlaw Ue ¼ Tðq; _qÞ þ VðqÞ � Tðq0; _q0Þ � Vðq0Þ ¼ 03. In thiscase, (Nv ¼ I), Ce ¼ _qTRT while ðCeNvÞþ ¼ R _q=2T if 2T > tol,and ðCeNvÞþ ¼ 0 otherwise. One can recognize that whenever thekinetic energy of the system is close to zero, enforcement of theenergy law may require a large corrective force. Note howeverthat the pseudoinverse solution proposed above automatically

2Practically, accuracy of the initial data depends on the accuracy required on thekinematic constraints.

3Tðq; _qÞ is the kinetic energy while VðqÞ denotes the potential energy of thesystem.

041018-2 / Vol. 79, JULY 2012 Transactions of the ASME

Downloaded From: http://appliedmechanics.asmedigitalcollection.asme.org on 10/20/2018 Terms of Use: http://www.asme.org/about-asme/terms-of-use

resolves this issue, namely it does not perform any correction insuch a case (i.e., ðCeNvÞþ ¼ 0 if 2T � tol). Accordingly, the errorlevel, defined by tol, can be set4 to avoid energy correction withlarge correction forces.

In the next Section (and in Part I of this paper) the proposedenergy correction strategy is demonstrated as an effective meansto perform precise energy conserving DAE integration throughlong time periods.

3 Application

In this Section we demonstrate the utility of the proposed for-mulation, Eqs. (3) and (4) (i.e., equation of motion derived in PartI of this work [8]), on two nontrivial differential-algebraic sys-tems. The examples are solved with a fourth order fixed stepRunge-Kutta method (RK4) [25]. The solver is implemented inMATLAB and compiled to a C-code. Using this code, the simula-tions are performed on a 2.4 MHz Intel Core2 Quad PC computer.All physical quantities used in the simulations have standard SIunits ½kg; m; s�, while g ¼ 9:81 m=s2.

3.1 Ball Rolling in a Bowl. Consider a ball with radius r,and mass m which is rolling without slip in a bowl of radiusR; ðR > rÞ, see Fig. 1(a). The ball in the bowl is modeled as aconstrained system using twelve coordinates, q ¼ ½q; a; b; e1;e2; e3�T where ei, i 2 f1; 2; 3g are orthogonal unit vectors fixedto the ball at its center [14]. These vectors are used to define theorientation of the ball in the fixed Cartesian reference systemði; j; kÞ placed in the center of the bowl.

Using the selected coordinates, the equation of unconstrainedmotion, M€q ¼ Q, is given by

M€q ¼

m 0 0 0 0 0

0 mq2 0 0 0 0

0 0 mq2cosðaÞ2 0 0 0

0 0 01

2I 0 0

0 0 0 01

2I 0

0 0 0 0 01

2I

266666666664

377777777775

€q€a€b€e1

€e2

€e3

26666664

37777775

where I ¼ diagðI; I; IÞ, I ¼ 25mr2, 0 ¼ 03�3 and

Q ¼ �

mgsinðaÞmgqcosðaÞ

0

0

0

0

26666664

37777775�

�mqð _a2 þ _b2cosðaÞ2Þmqð2 _q _aþ q _b2sinðaÞcosðaÞÞ

2mqð _q _bcosðaÞ2 � q _a _bsinðaÞcosðaÞÞ0

0

0

26666664

37777775

where 0 ¼ 03�1. The holonomic kinematic constraints are,

Uq ¼

q� ðR� rÞ1

2ðeT

1 e1 � 1Þ1

2ðeT

2 e2 � 1Þ1

2ðeT

3 e3 � 1Þ

eT1 e2

eT1 e3

eT2 e3

266666666666666664

377777777777777775

¼ 0

In order to incorporate the nonslip constraints between the ball andthe bowl, let us first formally define the velocity at the contact pointP, vP ¼ vC þ vC

P , where vC ¼ 0eq þ ðR� rÞ _aea þ ðR� rÞcosðaÞ _beb is the velocity of the ball center, while vC

P ¼P3

i¼1 rðeTi eqÞ _ei is

Fig. 1 Ball of mass m ¼ 1 kg and r ¼ 1 m rolling in a bowl of radius R ¼ 8 m. (a) Stroboscopic view of the rolling motion. (b)Position of the center of the ball ðqðtÞ; aðtÞ; bðtÞÞ. The simulations are performed with 10�2 s time step, through t ‰ ½0; 100� s.

4In this paper and in Part I of this work [8] we used tol ¼ 10�6 in all examples.Note that computation of ðCeNvÞþ can also be performed with standard routines thatautomatically set tol.

Journal of Applied Mechanics JULY 2012, Vol. 79 / 041018-3

Downloaded From: http://appliedmechanics.asmedigitalcollection.asme.org on 10/20/2018 Terms of Use: http://www.asme.org/about-asme/terms-of-use

the velocity of the contact point with respect to the center.5 Usingthese relations, the two nonholonomic kinematic constraints:eTa vP ¼ 0, eT

bvP ¼ 0 have the following form,

Uv¼ðR�rÞ _aþeT

a rððeT1 eqÞ _e1þðeT

2 eqÞ _e2þðeT3 eqÞ _e3Þ

ðR�rÞcosðaÞ _bþeTbrððeT

1 eqÞ _e1þðeT2 eqÞ _e2þðeT

3 eqÞ _e3Þ

� �¼0;

while the energy conservation law is given as,

Ue ¼1

2_qTM _q� mgqsinðaÞ � E0 ¼ 0

Figure 1(b) depicts the motion of the ball integrated with theproposed explicit DAE solver using constraint consistent initialconditions:6 qð0Þ ¼ R� r, að0Þ ¼ p=4, bð0Þ ¼ 0, _qð0Þ ¼ 0,_að0Þ ¼ 0:5 s�1 and _bð0Þ ¼ 1 s�1. Figures 2(a)–2(c) depict thekinematic constraint error, and the error on the energy conserva-tion law. The results demonstrate that the proposed constraintcorrection is able to precisely satisfy and steadily maintain theholonomic and the nonholonomic constraints, while the additionalenergy correction prevents energy drift. Since, for this example,the exact solution is not provided, the overall precision of thedepicted solutions is assessed through a first integral of this non-holonomic system, reported in Fig. 2(d).

3.2 Biped Robot. In this section, we report a real-time simu-lation with a seven link biped robot modeled as a constrained me-

chanical system. For this purpose, the explicit equation ofconstrained motion, developed in Part I of this work, was imple-mented in SIMULINK and compiled to a C-code. This code wasemployed in the development and experimental realization of acontrol approach to dynamic walking by the authors [26,27] andis used here to simulate an oscillatory motion of the biped robot.

Consider a seven-link planar biped robot depicted in Fig. 3(a).The configuration of the biped is specified with nine absolutecoordinates q ¼ ½x; y; h; h1; h2; h3; h4; h5; h6�T . The uncon-strained equation is defined as M€q ¼ Q where, M 2 R9�9 is apositive definite mass matrix, Q 2 R9 collects the centrifugalforces and the gravitational forces. For the present simulation pur-pose, the constraints are defined to keep the forward heel and thebackward toe on ground, and also to emulate an oscillatory motionof the robot7. The corresponding kinematic constraints are:

Uq ¼

y� lcsinðhÞ� l1sinðh1Þ� l2sinðh2Þ� hcosðh3Þ� bsinðh3Þy� lcsinðhÞ� l1sinðh4Þ� l2sinðh5Þ� hcosðh6Þþ asinðh6Þ

h2� h1þp10ð1� cosðxtÞÞ

h5� h4þp10ð1� cosðxtÞÞ

h� 4p9� p

18ð1� cosðxtÞÞ

� �

h3�p18ð1þ cosðxtÞÞ

h6þp18ð1� cosðxtÞÞ

26666666666666666664

37777777777777777775

¼ 0

Fig. 2 The semilog figures depict the constraint error, energy error, and an overall error measure e¼ _bcosðaÞ2���

þ 2r7ðR�rÞxqsinðaÞ� _bð0Þcosðað0ÞÞ2� 2r

7ðR�r Þxqð0Þsinðað0ÞÞj where xq¼ 12

P3i¼1ðei 3 _ei ÞT eq. Note that, _bcosðaÞ2þ 2r

7ðR�rÞxq sinðaÞ¼const :

is a first integral of the considered nonholonomic system, and accordingly e is identically zero along the exact solution (i.e.,e�0). In the current simulation, Baumgarte’s constrained stabilization is implemented with optimal parameters [10].

5The velocity of the center is expressed in the spherical coordinate system(eq; ea; eb); eq ¼ cosðaÞcosðbÞiþ cosðaÞsinðbÞj� sinðaÞk, ea ¼ �sinðaÞcosðbÞi�sinðaÞsinðbÞj� cosðaÞk, eb ¼ �sinðbÞiþ cosðbÞjþ 0k. The position of P can be

calculated as rP ¼ rC þP3

i¼1 XPi ei ¼ rC þ req where XP

i are the coordinates of the

material point on the ball in contact. By multiplying this last relation (from the left) with

eTi one obtains XP

i ¼ rðeTi eqÞ, and subsequently vC

P ¼P3

i¼1 XPi _ei ¼

P3i¼1 rðeT

i eqÞ _ei.6The initial orientation of the ball is defined as: e1ð0Þ ¼ ½1; 0; 0�T ,

e2ð0Þ ¼ ½0; 1; 0�T , e3ð0Þ ¼ ½0; 0; 1�T , while the corresponding consistent initialvelocities are calculated as _eið0Þ ¼ xð0Þ � eið0Þ where xð0Þ ¼ xqð0Þeqð0ÞþððR� rÞ cosðað0ÞÞ=rÞ _bð0Þeað0Þ � ððR� rÞ=rÞ _að0Þebð0Þ and xqð0Þ ¼ 1 s�1.

7The desired motion of the robot is chosen to avoid knee collision and ground col-lision with the feet such that the necessary smoothness condition on constraints isprovided.

041018-4 / Vol. 79, JULY 2012 Transactions of the ASME

Downloaded From: http://appliedmechanics.asmedigitalcollection.asme.org on 10/20/2018 Terms of Use: http://www.asme.org/about-asme/terms-of-use

and

Uv ¼_xþ lcsinðhÞ _hþ l1sinðh1Þ _h1 þ l2sinðh2Þ _h2 þ ðhcosðh3Þ þ bsinðh3ÞÞ _h3

_xþ lcsinðhÞ _hþ l1sinðh4Þ _h4 þ l2sinðh5Þ _h5 þ ðhcosðh6Þ � asinðh6ÞÞ _h6

" #¼ 0

In this example, the constraints in Uv are integrable, and assuch they could be embedded in the holonomic constraint set Uq.In the present case, however, we consider the integration constantsto be unknown, under which condition the velocity level con-straints cannot be used on the position level.

The stroboscopic view of the simulated motion is depicted inFig. 3(a). Figure 3(b) shows that during the 50 motion cycles,t 2 ½0; 100�s, the corresponding configurations of the robot in suc-cessive periods are overlapped. Note that despite the slight incon-sistency in initialization, all constraints are precisely and steadilymaintained, see Fig. 3(c). In order to demonstrate the effective-ness of the kinematic correction approach alone, we have chosennot to perform energy correction in this example. This could bejustified in practice during short time integration (where energycorrection may not have a prominent effect) and also if the energylaw is either not provided or if it cannot be precisely computed.Regardless of whether energy correction is implemented or nothowever, the present formulation provides a physically viableconstraint consistent solution.

4 Conclusion

This paper presents an explicit integration method which allowsprecise simulation of constrained mechanical systems modeled

with holonomic and nonholonomic constraints. Unlike many otherDAE integrators which are implicit and require iterative constraintcorrection, the presented solver is explicit and it does not use anyiteration. This DAE solver is simple to implement and is also wellsuited to real-time applications. Simulation results demonstratethe effectiveness of the proposed explicit DAE integrationmethod.

Acknowledgment

This work was done while D. J. Braun was with VanderbiltUniversity—Center for Intelligent Mechatronics as a researchassociate.

References[1] Schiehlen, W., 1997, “Multibody System Dynamics: Roots and Perspectives,”

Multibody Syst. Dyn., 1(2), pp. 149–188.[2] Shabana, A. A., 1997, “Flexible Multibody Dynamics: Review of Past and

Recent Developments,” Multibody Syst. Dyn., 1(2), pp. 189–222.[3] Brogliato, B., ten Dam, A. A., Paoli, L., Genot, F., and Abadie, M., 2002,

“Numerical Simulation of Finite Dimensional Multibody Nonsmooth Mechani-cal Systems,” Appl. Mech. Rev., 55(2), pp. 107–150.

[4] Eberhard, P., and Schiehlen, W., 2006, “Computational Dynamics of MultibodySystems: History, Formalisms, and Applications,” J. Comput. Nonlinear Dyn.,1(1), pp. 3–12.

Fig. 3 Anthropomorphic biped, with model parameters given in Ref. [28] and x ¼ ps�1. (a) Stroboscopic plot of the oscillatorymotion. (b) Phase plots. The real-time simulation is performed for t ‰ ½0; 100�s with 10�2 s time step, started from (slightly)inconsistent initial conditions: qð0Þ ¼ ½0:056; 1:2; 1:4; 2; 2; 0:35; 1:19; 1:19; 0�T , vð0Þ ¼ 0. (c) The kinematic constraints are pre-cisely satisfied and steadily maintained.

Journal of Applied Mechanics JULY 2012, Vol. 79 / 041018-5

Downloaded From: http://appliedmechanics.asmedigitalcollection.asme.org on 10/20/2018 Terms of Use: http://www.asme.org/about-asme/terms-of-use

[5] Laulusa, A., and Bauchau, O. A., 2008, “Review of Classical Approaches forConstraint Enforcement in Multibody Systems,” J. Comput. Nonlinear Dyn.,3(1), p. 011004.

[6] Bauchau, O. A., and Laulusa, A., 2008, “Review of Contemporary Approachesfor Constraint Enforcement in Multibody Systems,” J. Comput. NonlinearDyn., 3(1), p. 011005.

[7] Gear, C. W., 2006, “Towards Explicit Methods for Differential Algebraic Equa-tions,” BIT, 46(3), pp. 505–514.

[8] Braun, D., and Goldfarb, M., 2010, “Simulation of Constrained MechanicalSystems—Part I: An Equation of Motion,” J. Appl. Mech., 79(4), p. 041017.

[9] ten Dam, A. A., 1992, “Stable Numerical Integration of Dynamical SystemsSubject to Equality State-Space Constraints,” J. Eng. Math., 26(2), pp.315–337.

[10] Ascher, U. M., Chin, H., and Reich, S., 1994, “Stabilization of DAEs and Invar-iant Manifolds,” Numerische Mathematik, 67(2), pp. 131–149.

[11] Burgermeister, B., Arnold, M., and Esterl, B., 2006, “DAE Time Integration forReal-Time Applications in Multi-Body Dynamics,” Z. Angew. Math. Mech.,86(10), pp. 759–771.

[12] Petzold, L., 1992, “Numerical Solution of Differential-Algebraic Equations inMechanical Systems Simulation,” Physica D, 60(1–4), pp. 269–279.

[13] Blajer, W., 2002, “Elimination of Constraint Violation and Accuracy Aspectsin Numerical Simulation of Multibody Systems,” Multibody Syst. Dyn., 7(3),pp. 265–284.

[14] Betsch, P., 2006, “Energy-Consistent Numerical Integration of Mechanical Sys-tems With Mixed Holonomic and Nonholonomic Constraints,” Comput. Meth-ods Appl. Mech. Eng., 195(50-51), pp. 7020–7035.

[15] Kovecses, J., Piedboeuf, J.-C., and Lange, C., 2003, “Dynamics Modeling andSimulation of Constrained Robotic Systems,” IEEE=ASME Trans. Mechatron.,8(2), pp. 165–177.

[16] Leimkuhler, B., Petzold, L. R., and Gear, C. W., 1991, “Approximation Meth-ods for the Consistent Initialization of Differential-Algebraic Equations,”SIAM J. Numer. Anal., 28(1), pp. 205–226.

[17] Nikravesh, P. E., 2008, “Initial Condition Correction in Multibody Dynamics,”Multibody Syst, Dyn,, 18(1), pp. 107–115.

[18] Udwadia, F. E., Kalaba, R. E., and Phohomsiri, P., 2004, “Mechanical SystemsWith Nonideal Constraints: Explicit Equations Without the Use of GeneralizedInverses,” J. Appl. Mech., 71(5), pp. 618–621.

[19] Kim, S. S., and Vanderploeg, M. J., 1986, “QR Decomposition for State SpaceRepresentation of Constrained Mechanical Dynamical Systems,” ASME J.Mech., Transm., Autom. Des., 108(2), pp. 183–188.

[20] Neto, M. A., and Ambrosio, J., 2003, “Stabilization Methods for the Integrationof DAE in the Presence of Redundant Constraints,” Multibody Syst. Dyn.,10(1), pp. 81–105.

[21] Fierro, R. D., Hansen, P. C., and Hansen, P. S. K., 1999, “UTV Tools: MatlabTemplates for Rank-Revealing UTV Decompositions,” Numer. Algorithms,20(2-3), pp. 165–194.

[22] Stewart, G. W., 1999, “The QLP Approximation to the Singular Value Decom-position,” SIAM J. Comput., 20(4), pp. 1336–1348.

[23] Singh, R. P., and Likins, P. W., 1985, “Singular Value Decomposition for Con-strained Dynamical Systems,” J. Appl. Mech., 52(4), pp. 943–948.

[24] Golub, G., and Loan, C. V., 1996, Matrix Computations, 3rd ed., The John Hop-kins University Press, Baltimore, MD.

[25] Abramowitz, M., and Stegun, I. A., 1972, Handbook of Mathematical Functionswith Formulas, Graphs, and Mathematical Tables, Dover Publications, NewYork.

[26] Braun, D. J., and Goldfarb, M., 2009, “A Control Approach for ActuatedDynamic Walking in Biped Robots,” IEEE Trans. Robot., 25(6), pp.1292–1303.

[27] Braun, D. J., Mitchell, J. E., and Goldfarb, M., 2012, “Actuated Dynamic Walk-ing in a Seven-Link Biped Robot,” IEEE=ASME Trans. Mechatron., 17(1) pp.147–156.

[28] Braun, D. J., and Goldfarb, M., 2009, “Eliminating Constraint Drift in the Nu-merical Simulation of Constrained Dynamical Systems,” Comput. MethodsAppl. Mech. Eng., 198(37–40), pp. 3151–3160.

041018-6 / Vol. 79, JULY 2012 Transactions of the ASME

Downloaded From: http://appliedmechanics.asmedigitalcollection.asme.org on 10/20/2018 Terms of Use: http://www.asme.org/about-asme/terms-of-use