automating symbolic computation of dynamics on manifolds

8
Automating Symbolic Computation of Dynamics on Manifolds Brian Bittner, Koushil Sreenath Abstract— Computing the equations of motion for robotic systems that evolve on manifolds is hard. Current approaches use local parametrization of manifolds, resulting in equations that are not globally-valid and possess singularities. Coordinate- free methods that employ variations on manifolds result in compact, singularity-free and globally-valid equations of mo- tion. However, this involves laborious and error-prone manual computations. Traditional symbolic tools are incapable of au- tomating this computation, as they are predominantly based on scalar symbolic variables. We present a symbolic algorithm to compute the equations of motions for systems varying on manifolds. Our approach uses Scala to capture scalar, vector and matrix symbolic variables, as well as their properties, along with mathematical rules and identities. We present results of using our algorithm to efficiently compute the equations of motion for several systems whose dynamics evolve on R, R 3 , S 2 , and SO(3). I. I NTRODUCTION Robotic systems have become increasingly complex, with their dynamics evolving on complex nonlinear manifolds. Figure 1 illustrates a few systems whose dynamics evolve on combinations of S 2 (the unit-sphere), and SO(3) (the space of rotations). However, present mathematical models of these systems are based on local parametrizations of nonlinear manifolds, limiting us from analyzing and controlling the rich dynamical capability of such systems. For instance, with current models, the analysis and control of global maneuvers of such systems require careful and elaborate handling of the singularities and non-uniqueness that arise as a result of the local parametrization. Introducing local parametrizations of manifolds enables the use of well-established analytical methods and corre- sponding software algorithms for deriving the equations of motion. For instance, the Newton-Euler method is im- plemented in Neweul [1] and SD/FAST [2]. The Recur- sive Newton-Euler Algorithm has been used to efficiently compute dynamics on serial chain manipulators, [3], [4]. The Lagrangian method has been implemented on various multibody systems [5]. Additionally, the Piogram Method [6], the Composite Rigid Body Algorithm [7], and the Ar- ticulated Body Algorithm [7] all provide efficient algorithmic approaches for solving the dynamical equations of long kinematic chains. Commercial systems such as ADAMS [8], SimMechanics, MapleSim, LMS Dads [9], etc., not only solve the equations of motion, but also offer efficient simulations. Although there are several efficient methods and B. Bittner is with the Dept. of Mechanical Engineering, Carnegie Mellon University, Pittsburgh, PA 15213, email: [email protected]. K. Sreenath is with the Depts. of Mechanical Engineering, Robotics Insti- tute, and Electrical and Computer Engineering, Carnegie Mellon University, Pittsburgh, PA 15213, email: [email protected]. Fig. 1: Spherical Pendulum, Quadrotor with Load, and Three Link Walker. The dynamics for each are derived by symbolic computation despite their manifold complexity. corresponding software tools that automate the computation of equations of motion, every single one of them is based on local parametrizations that employ scalar symbolic variables. An alternate approach is to compute the dynamical equa- tions of motion by directly taking variations on manifolds [10], without requiring local parametrization. This results in coordinate-free, unique, globally-valid, singularity-free and compact sets of equations. For instance, the equations of motion for an unactuated spherical pendulum computed through either Newton-Euler or Lagrange methods are, ¨ θ + g l sin(θ) - sin(θ)cos(θ) ˙ φ =0, ¨ φ +2cos(θ) ˙ θ ˙ φ =0, whereas, the variation-based method produces, ˙ q = ω × q, ml ˙ ω = q × mge 3 , which is globally-valid, singularity-free and compact. Here q is a unit vector in R 3 that uniquely specifies a point on the unit-sphere, while ω is the angular velocity. As the mechan- ical complexity of the system increases, this difference in compactness of the equations further widens. However, the primary drawback of the variation-based method is that it requires manual, laborious, error-prone, and time consuming computations, as there exist no software tools that can au- tomate solving for the equations of motion. Automating the variation-based method requires treating vectors and matrices as single-entity symbolic variables with operations defined directly on them. The primary contribution of this paper is to introduce a generalized computational algorithm for deriving the equa- tions of motion for robotic systems that evolve on a variety of complex manifolds. We do this by directly creating symbolic

Upload: others

Post on 21-Mar-2022

9 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Automating Symbolic Computation of Dynamics on Manifolds

Automating Symbolic Computation of Dynamics on Manifolds

Brian Bittner, Koushil Sreenath

Abstract— Computing the equations of motion for roboticsystems that evolve on manifolds is hard. Current approachesuse local parametrization of manifolds, resulting in equationsthat are not globally-valid and possess singularities. Coordinate-free methods that employ variations on manifolds result incompact, singularity-free and globally-valid equations of mo-tion. However, this involves laborious and error-prone manualcomputations. Traditional symbolic tools are incapable of au-tomating this computation, as they are predominantly basedon scalar symbolic variables. We present a symbolic algorithmto compute the equations of motions for systems varying onmanifolds. Our approach uses Scala to capture scalar, vectorand matrix symbolic variables, as well as their properties, alongwith mathematical rules and identities. We present results ofusing our algorithm to efficiently compute the equations ofmotion for several systems whose dynamics evolve on R, R3,S2, and SO(3).

I. INTRODUCTION

Robotic systems have become increasingly complex, withtheir dynamics evolving on complex nonlinear manifolds.Figure 1 illustrates a few systems whose dynamics evolve oncombinations of S2 (the unit-sphere), and SO(3) (the spaceof rotations). However, present mathematical models of thesesystems are based on local parametrizations of nonlinearmanifolds, limiting us from analyzing and controlling therich dynamical capability of such systems. For instance, withcurrent models, the analysis and control of global maneuversof such systems require careful and elaborate handling of thesingularities and non-uniqueness that arise as a result of thelocal parametrization.

Introducing local parametrizations of manifolds enablesthe use of well-established analytical methods and corre-sponding software algorithms for deriving the equationsof motion. For instance, the Newton-Euler method is im-plemented in Neweul [1] and SD/FAST [2]. The Recur-sive Newton-Euler Algorithm has been used to efficientlycompute dynamics on serial chain manipulators, [3], [4].The Lagrangian method has been implemented on variousmultibody systems [5]. Additionally, the Piogram Method[6], the Composite Rigid Body Algorithm [7], and the Ar-ticulated Body Algorithm [7] all provide efficient algorithmicapproaches for solving the dynamical equations of longkinematic chains. Commercial systems such as ADAMS[8], SimMechanics, MapleSim, LMS Dads [9], etc., notonly solve the equations of motion, but also offer efficientsimulations. Although there are several efficient methods and

B. Bittner is with the Dept. of Mechanical Engineering, Carnegie MellonUniversity, Pittsburgh, PA 15213, email: [email protected].

K. Sreenath is with the Depts. of Mechanical Engineering, Robotics Insti-tute, and Electrical and Computer Engineering, Carnegie Mellon University,Pittsburgh, PA 15213, email: [email protected].

Fig. 1: Spherical Pendulum, Quadrotor with Load, andThree Link Walker. The dynamics for each are derived bysymbolic computation despite their manifold complexity.

corresponding software tools that automate the computationof equations of motion, every single one of them is based onlocal parametrizations that employ scalar symbolic variables.

An alternate approach is to compute the dynamical equa-tions of motion by directly taking variations on manifolds[10], without requiring local parametrization. This resultsin coordinate-free, unique, globally-valid, singularity-freeand compact sets of equations. For instance, the equationsof motion for an unactuated spherical pendulum computedthrough either Newton-Euler or Lagrange methods are,

θ +g

lsin(θ) − sin(θ)cos(θ)φ = 0,

φ+ 2cos(θ)θφ = 0,

whereas, the variation-based method produces,

q = ω × q,

mlω = q ×mge3,

which is globally-valid, singularity-free and compact. Hereq is a unit vector in R3 that uniquely specifies a point on theunit-sphere, while ω is the angular velocity. As the mechan-ical complexity of the system increases, this difference incompactness of the equations further widens. However, theprimary drawback of the variation-based method is that itrequires manual, laborious, error-prone, and time consumingcomputations, as there exist no software tools that can au-tomate solving for the equations of motion. Automating thevariation-based method requires treating vectors and matricesas single-entity symbolic variables with operations defineddirectly on them.

The primary contribution of this paper is to introduce ageneralized computational algorithm for deriving the equa-tions of motion for robotic systems that evolve on a variety ofcomplex manifolds. We do this by directly creating symbolic

Page 2: Automating Symbolic Computation of Dynamics on Manifolds

variables that represent either scalars, vectors or matrices,with additional properties such as constants, unit vectors,symmetric matrices, etc. Moreover, using a functional pro-gramming approach, we enable easily capturing mathemati-cal axioms between these variables. The resulting generatedequations are compact, globally-valid, and singularity-free.

Common Computer Algebra Systems (CASs), such asMathematica [11] and Matlab’s Symbolic Math Toolbox[12], only support scalar symbolic variables (vector and ma-trix symbolic variables exist only indirectly through scalars.)SymPy [13] and AXIOM (see [14] for full list of CASs)offer means to capture different kinds of symbolic variables,but easily capturing the mathematical identities and rules thatalter the properties of these symbolic variables is extremelyhard. Our solution is to use Scala, a functional programminglanguage with a vast set of object oriented programmingcapabilities [15]. This enables the design of strong expressionclasses and an intuitive functional programming environmentfor capturing mathematical identities. We extend prior workon scalar expressions in ScalaMathDSL [16] to handle vectorand matrix classes, resulting in a mathematical environmentfor symbolic computation of dynamics on manifolds.

The rest of the paper is structured as follows: Section IIprovides a brief overview of the mathematical derivationfor acquiring the equations of motion for systems whosedynamics evolve on S2. Section III explains the algorithmfor the symbolic solver and the dynamics framework inwhich it operates. Section IV tabulates results of applyingthe dynamics solver on a set of mechanical systems. Finally,Section V provides concluding remarks.

II. MATHEMATICAL BACKGROUND

The motivation for this variation-based computation is toobtain equations of motion that are compact, globally-validand singularity-free. We will demonstrate this on a sphericalpendulum using a unit vector q. The general method is asfollows. Given the Lagrangian of a system, L = T − U,with kinetic energy T , and potential energy U , the dynamicalequations of motion can be computed by minimization of theaction integral S through the Least Action Principle. Theaction integral is defined as

S =

∫ t

0

Ldt+

∫ t

0

W dt, (1)

where W is the virtual work done by the actuators. Theminimization is done by setting the variation of the actionintegral to zero, i.e., δS = 0.

A. Computation on S2 Manifold

The following computational steps allow for derivationof the equations of motion for the spherical pendulum.

Step 1: Supply the Lagrangian and virtual work, providingthe components of the action integral for the sphericalpendulum.

δ

∫ t

0

1

2ml2(q · q) +mgl(q · e3) dt+

∫ t

0

W dt = 0

Fig. 2: The variation-based method is applied to a sphericalpendulum. Section II presents a step-by-step computation

of the equations of motion.

Step 2: Take the variation of the action integral.∫ t

0

ml2(δq · q) +mgl(δq · e3) dt+

∫ t

0

δq · τ dt = 0

Step 3: Replace variations δq and δq with generalized vectorξ.∫ t

0

ml2((ξ×q+ξ×q)·q)+mgl(ξ×q)·e3) dt+∫ t

0

(ξ×q)·τ dt = 0

Step 4: Group equations with respect to ξ and ξ and applysimplifications (e.g.: q × q = 0).∫ t

0

ξ · (ml2q× q)+ξ · (ml2q× q+mglq×e3 +q×τ) dt = 0

Step 5: Perform integration by parts on ξ.∫ t

0

−ξ · (ml2(q× q+q× q))+ξ · (mglq×e3 +q×τ) dt = 0

Step 6: Collect for ξ and simplify (e.g.: q × q = 0).∫ t

0

ξ · (−ml2q × q +mglq × e3 + q × τ) dt = 0

Step 7: These equations of motion can be extracted todescribe the system’s dynamics:

q = ω × q

mlω = q × (mge3 − τ)

This variation-based computation returns a set of compact,globally-valid equations of motion that are singularity-free.

Having mathematically derived the equations of motionon S2, we will next describe the computational frameworkfor our dynamics solver that automates the above analyticalcomputation.

III. COMPUTATIONAL DESIGN OF DYNAMICS SOLVER

This section will provide a description of the data struc-tures used to represent mathematical objects and the algorith-mic techniques implemented on them to extract a dynamicalmodel. The algorithmic steps will be laid out at a highlevel, followed by the sample code snippets necessary toimplement the symbolic computation of dynamics of anactuated spherical pendulum.

Page 3: Automating Symbolic Computation of Dynamics on Manifolds

Fig. 3: computeEquationsofMotion function pipleline.Function receives the kinematic contraints, variations,

infinitesimal virtual work and Lagrangian of the system.This pipeline takes the necessary steps to extract the

dynamical model.

A. Class Hierarchies for Mathematical Expressions

In Section II we used symbolic scalars (m, l, g) andvectors (q, q) to compute the dynamics for the sphericalpendulum. These two expression types along with symbolicmatrices make up the base classes used to implement thedynamics solver. The class hierarchy consists of each baseclass (ScalarExp, VectorExp, MatrixExp) and its children,which are comprised of a set of case classes. As we will see,case classes enable pattern matching to encode mathematicalrules (e.g.: chain rule for differentiation, scalar and vectortriple product rules, etc.) Each case class can inherit traits topossess additional properties (e.g.: variables being constant,vectors having unit magnitude, matrices being skew, symmet-ric or both.) Each case class serves as a unique mathematicalentity in the symbolic evaluator, see Figure 4 for the classhierarchy. Next we will discuss how these classes interact tocreate a meaningful data structure for symbolic computation.

Fig. 4: All mathematical expressions inherit from a parentclass corresponding to its identity as a scalar, vector, or

matrix. Class traits are inherited to add additionalproperties to symbolic expressions.

B. Abstract Syntax Trees

An intuitive way to express mathematical expressionswithin a framework is by storing them as abstract syntaxtrees (ASTs). Mathematical operations, such as addition andmultiplication, are represented as nodes which contain aspecified number of leaves appropriate for their respectivefunctionality. Leaves on the other hand represent symbolicscalars, vectors, and matrices. Mathematical algorithms arethen written as functional programs with the ASTs serving asinput and output data structures. Figure 5 provides an ASTrepresentation of the Lagrangian for the spherical pendulum.As we will see next, ASTs are coupled with pattern matchingfunctions to encode mathematical rules.

Page 4: Automating Symbolic Computation of Dynamics on Manifolds

Fig. 5: Abstract Syntax Tree representation of theLagrangian of a spherical pendulum, given by

L = 12ml

2q · q +mgq · e3. ASTs are the data structure usedto represent all symbolic expressions.

C. Pattern Matching

Each mathematical step in the computational pipeline,illustrated in Figure 3, is achieved through specialized patternmatching functions. These functions perform a mathematicalevaluation or restructuring of the AST. Pattern matchingallows for matching and replacing a subexpression in anAST, and is carried out through case classes. This allowsfor brief, yet powerful functions that are intuitive to writeand understand.

To illustrate this, we will walk through the various func-tions implemented to execute each step of the variation-basedmethod dynamics solver for the spherical pendulum system.We will present the (a) input and output mathematicalexpressions for each function, (b) corresponding input andoutput ASTs (with changes highlighted in a darker color),and (c) corresponding code-snippets that achieve this. Whenfinished, the resulting data structure will hold the dynamicalmodel.

Step 1 involves supplying the information of the me-chanical configuration and energy of the system, resultingin the input AST shown in Figure 5. Step 2 takes thevariation of the Lagrangian. To respect space constraints,we display variation of only the kinetic energy componentof the Lagrangian AST in Figure 6a. The root node isinitially matched with a corresponding case class. In thiscase, Mul(u,v) will return the variation by implementing thechain rule and recursively calling the function. Note that thecases listed in figures are not exhaustive, and are only presentfor understanding computation for that specific tree. Thesoftware will be made publicly available for those interestedin the exact code.

Step 3, shown in Figure 6b, performs substitution throughpattern matching. The tree is recursively searched for a nodecontaining the expression to be substituted for. In this case,when δq is found, it is replaced with ξ×q+ξ×q. Substitutionallows for the variations and kinematic constraints of thesystem to be enforced. Additionally, substitution is useful

Fig. 7: The code provides an example of a file a userwould create to derive the equations of motion for a novel

robotic system, in this case for a spherical pendulum.

for expression simplification. For example, if two identicalvectors are crossed with each other, the dot product isreplaced with a zero.

Step 4 is the first step to utilize the collect function,which re-organizes an expression with respect to the dotproduct of a specified vector. Figure 6c illustrates collectingfor the generalized vector ξ. The scalar triple product ruleis enforced when handling sets of vectors to ensure that theexpression’s true mathematical value is maintained.

Step 5 performs integration by parts on the dot productcontaining generalized vector ξ. The mathematical operationis enforced by negating and integrating ξ while differentiat-ing the right hand side of the dot product, see Figure 6d. Theresult leaves the expression entirely in terms of generalizedvector ξ. This allows for the expression to be collected withrespect to ξ which is done in Step 6. This allows for theright hand side of the dot product to be set to zero, resultingin the dynamical model obtained in Step 7.

D. Example with Spherical Pendulum

Figure 7 illustrates the user code for deriving the dynamicsof a spherical pendulum. The user provides base variablesand constants along with the rules that describe the kinematic

Page 5: Automating Symbolic Computation of Dynamics on Manifolds

(a) Function variation(AST) modifies input AST using case classesto produce its mathematical variation.

(b) Function subs(AST,old,new) uses case classes to recursivelysearch an AST, substituting for the variation δq.

(c) ξ is collected using a slightly more extensive set of patternmatching techniques in function collect(AST,z).

(d) Function differentiate(AST) assists with implementing integrationby parts, ibp. It is very similar in structure to variation(AST),

another mathematical evaluation function.

Fig. 6: Illustration of various functions required for implementing the variation-based dynamics solver. For each function,the input and output mathematical expressions, the corresponding input and output ASTs (with changes highlighted in a

darker color), and the corresponding code-snippets that achieve this transformation are shown.

Page 6: Automating Symbolic Computation of Dynamics on Manifolds

System Configuration Manifold DOF Run Time Equations of Motion

Spherical Pendulum

S2 2 0.070 seconds q = ω × qq × (ml2q +mgle3) = q × τ

3D Pendulum

SO(3) 3 0.026 seconds JΩ + Ω× JΩ = mgρ×RT e3 +M

Double SphericalPendulum

S2 × S2 4 0.219 seconds

q1 = ω1 × q1q1 × ((m1 +m2)l21 q1 +m2l1l2q2 + (m1 +

m2)gl1e3) = q1 × τ1q2 = ω2 × q2

q2 × (m2l1l2q1 +m2l22q2 +m2gl2e3) =q2 × τ2

Double 3D Pendulum

SO(3)× SO(3) 6 0.124 seconds

J1Ω1 + Ω1 × J1Ω1 +m2R1Ω1ρ1 +R1Ω1(R1Ω1ρ1 +R2Ω2ρ2)× ρ1 =

m1gρ1 ×RT1 e3 +m1gρT ×RT

2 e3 +M1

J2Ω2 + Ω2 × J2Ω2 +R2Ω2(R1Ω1ρ1 +R2Ω2ρ2)× ρ2 = m2gρ2 ×RT

2 e3 +M2

TABLE I: The equations of motion were computed on these simplistic systems. For each computation, the kinematicconstraints, variations, and Lagrangian (T-U) were provided for each system.

constraints and variations of the system. Additionally, theuser provides the Lagrangian and infinitesimal virtual workof the system. These are input to the computeEquation-sOfMotion function (which implements the algorithm inFigure 3) to derive the dynamics for the system. Expressionparsing can also be added easily to simplify user input. Thissimple example code will enable users to effortlessly set upproblems for solving the dynamics of new robotic systems.The complete codebase will soon be made available forpublic release.

IV. RESULTS

Having presented an overview of our computational frame-work for the symbolic dynamics solver, we next test thisacross many robotic systems with dynamics evolving onseveral different manifolds. Table 1 provides results on

simple pendulum systems with dynamics on manifolds S2

and SO(3). Table 2, on the other hand, introduces realrobotic systems evolving on highly complex manifolds andpresents results of executing the proposed dynamics solver.For each system the user provided the kinematic constraints,variations, kinetic and potential energy, and infinitesimalvirtual work. The tables provide the equations of motionderived for each system, along with the algorithm’s run time.Next, we briefly describe the systems tabulated in Table 1.

A Spherical Pendulum [17] is the first system displayed,which consists of point mass m, length l, and unit vector q.Torque τ is applied at the attachment point.Configuration Manifold: S2

Kinematic Constraints: q · q = 0Variations: δq = ξ × q, δq = ξ × q + ξ × q

Page 7: Automating Symbolic Computation of Dynamics on Manifolds

System Configuration Manifold DOF Run Time Equations of Motion

3-Link Walker StanceDynamics

S2 × S2 × S2 6 0.233seconds

q1 = ω1 × q1q1 × (( 5

4m+mH +mT )l2q1 + 1

2ml2q2 +

mT lLq3 + ( 32m+mH +mT )gle3) = 0q2 = ω2 × q2

q2 × ( 12ml2q1 + 1

4ml2q2 + 1

2mgle3 = q2 × τ2

q3 = ω3 × q3q3 × (mT lLq1 +mTL

2q3 +mT gLe3 = q3 × τ3

Quadrotor withSuspended Load

SO(3)× S2 ×R3 8 0.190seconds

xL = vL(mQ +mL)VL +mQl(q · q)q + (mQ +mL)ge3 =

fRe3 + p× (p× fRe3)q = ω × q

q × (ml2q +mgle3) = q × TJΩ + Ω× JΩ = M

3 Link Walker FlightDynamics

S2 × S2 × S2 ×R3 10 27.20seconds

q1 = ω1 × q1q1 × (( 5

4m+mH +mT )l2q1 + 1

2ml2q2 +

mT lLq3 + ( 32m+mH +mT )gle3) = 0q2 = ω2 × q2

q2 × ( 12ml2q1 + 1

4ml2q2 + 1

2mgle3 = q2 × τ2

q3 = ω3 × q3q3 × (mT lLq1 +mTL

2q3 +mT gLe3 = q3 × τ3

Reaction Mass Pendulum

C×SO(3)×SO(3)×S 11 25.58seconds

mρ = −mρΩTL e3

2ΩL +mgeT3 RTLe3

JLΩL = −ΩL × JLΩL + 2mρρe32ΩL +

mgρe3RTLe3 + τL −RT

LRP τDJP ΩP = −ΩP × JP ΩP + 4

∑mpsisiei

2ΩP + τD2mP si = −2mP siΩ

TP ei

2ΩP + Ui

TABLE II: The equations of motion were computed on these robotic configurations.

Energy Terms:

T =1

2ml2(q · q), U = mgl(q · e3).

The 3D Pendulum [10] provides a system which acts onthe S0(3) manifold. The pendulum is represented as a rigidbody of mass m and is pivoted at the point from which vectorρ extends toward the center of mass. The orientation of therigid body is specified by rotation matrix R at the center ofmass.Configuration Manifold: SO(3)Kinematic Constraints: R = RΩVariations: δR = Rη, δΩ = Ωη + ηEnergy Terms:

T =1

2Ω · JΩ, U = mgRρ · e3.

A Double Spherical Pendulum is an extension of thesingular Spherical Pendulum. A second pendulum with pointmass m2 is pivoted from the end of the first pendulumcontaining point mass m1. Each pendulum has a respectivelength li from its pivot to point mass. A qi points along eachli with its origin at the respective pivots.Configuration Manifold: S2 × S2

Kinematic Constraints: qi · qi = 0Variations: δqi = ξi × qi, ˙δqi = ξi × qi + ξi × qiEnergy Terms:

T =1

2(m1 +m2)l21 q1 · q1 +m1l1l2q1 · q2 +

1

2m2l

22 q2 · q2

U = (m1 +m2)gl1q1 · e3 +m2gl2q2 · e3

Similarly the Double 3D Pendulum is an extension of theSingular 3D Pendulum. The rigid body of mass m2 is pivoted

Page 8: Automating Symbolic Computation of Dynamics on Manifolds

from the point that vector ρ points to. The rigid bodys’orientations at point masses mi are specified by rotationmatrices Ri.Configuration Manifold: SO(3) × SO(3)Kinematic Constraints: R = RΩVariations: δRi = Riηi, δΩi = Ωiηi + ηiEnergy Terms:

T =1

2Ω1 · J1Ω1 +

1

2Ω2 · J2Ω2 +

1

2m2x2 · x2

U = m1gR1ρ1 · e3 +m2gR2ρ2 · e3

The Quadrotor with Tethered Load [18] computes thedynamics on three manifold types, SO(3), S2, and R3. Rspecifies the orientation of the quadrotor and unit vector qdescribes the dynamics of the tethered load which hangsbelow at point mass m.Configuration Manifold: SO(3) × S2 ×R3

Kinematic Constraints: qi · qi = 0Variations: δqi = ξi × qi, ˙δqi = ξi × qi + ξi × qiEnergy Terms:

T =1

2(mQ +mL)xL · xL +mQlxL · q +

1

2mQl

2q · q

+1

2ΩTJΩ

U = mQgxq · e3 +mLgxL · e3

The Reaction Mass Pendulum [19] is a more representa-tive configuration of dynamic walkers, as it more accuratelyaccounts for angular momentum.Configuration Manifold: C × SO(3) × SO(3) × SKinematic Constraints: RL = RLΩL, RP = RP ΩP

Variations: δRL = RLηL, δΩL = ΩLηL + ηLδRP = RP ηP , δΩP = ΩP ηP + ˙ηPEnergy Terms:

T =1

2mρ2 +

1

2ΩT

LJLΩL +∑

mpsi2 +

1

2ΩT

PJP ΩP

U = −mgρRTLe3 · e3

The computational results for each system were validatedby a published derivation and hand calculation. These re-sults establish the validity and efficiency of computing thedynamics using the symbolic evaluator on high dimensionalsystems on complex manifolds.

V. DISCUSSION

It must be noted that manually computing the dynamics forseveral of the systems in Table 2 would have taken a noviceone to several weeks. Our proposed method of automatingthe computation of dynamics reduces this to fractions ofseconds to tens of seconds. This work will enable a broaderstudy of novel robotic systems whose dynamics evolve oncomplex manifolds, systems that were previously not broadlyapproachable by the robotics community. The resulting com-pact dynamical equations will also bring new insight into thedynamics of existing robotic systems, enabling novel controldesigns for acheiving highly dynamical maneuvers.

VI. CONCLUSION

We have presented an algorithm which automates thecomputation of dynamical equations for systems evolvingon manifolds. By utilizing strict typing and pattern matchingwithin the Scala framework, we are able to capture symbolicvariables of different types with various properties and alsoare able to encode mathematical rules, to provide a general-ized algorithm that works across a wide variety of manifolds.The time efficient computation allows for the software toprovide near-instantaneous output of dynamical equations.Additionally, the equations generated are compact, globally-valid, and free of singularities.

VII. ACKNOWLEDGEMENTS

B. Bittner would like to thank Carnegie Mellon’s Under-graduate Research Office, who supported him with a SummerUndergraduate Research Fellowship. K. Sreenath would liketo thank R. Ravindran for introducing him to Scala and forseveral discussions that led to the use of Scala for this work.

REFERENCES

[1] E. Kreuzer and W. Schiehlen, “NEWEUL - Software for the Genera-tion of Symbolical Equations of Motion,” 1990.

[2] S. Dynamics and M. A. Sherman, “SD / FAST User s Manual.”[3] E. Dean-leon, S. Nair, and A. Knoll, “User Friendly Matlab-Toolbox

for Symbolic Robot Dynamic Modeling used for Control Design,” pp.2181–2188, 2012.

[4] P. I. Corke, “An Automated Symbolic and Numeric Procedure forManipulator Rigid-Body Dynamic Significance Analysis and Simpli-fication,” no. April, pp. 1018–1023, 1996.

[5] R. Lot and M. D. A. Lio, “A Symbolic Approach for AutomaticGeneration of the Equations of Motion of Multibody Systems,” pp.147–172, 2004.

[6] P.-y. Cheng, C.-i. Weng, and C.-k. Chen, “Symbolic Derivation ofDynamic Equations of Motion for Robot Manipulators Using PiogramSymbolic Method,” vol. 4, no. 6, 1988.

[7] R. Featherstone and D. Orin, “Robot Dynamics : Equations andAlgorithms.”

[8] G. Nonlinearity, “Adams 2014,” pp. 1–5, 2014.[9] D. Services, “LMS Virtual . Lab The Unified Environment for

Functional Performance Engineering,” pp. 1–16, 2007.[10] J. S. J. Shen, a.K. Sanyal, N. Chaturvedi, D. Bernstein, and H. Mc-

Clamroch, “Dynamics and control of a 3D pendulum,” 2004 43rdIEEE Conference on Decision and Control (CDC) (IEEE Cat.No.04CH37601), vol. 1, pp. 323–328, 2004.

[11] I. Wolfram Research, Mathematica Version 10.0, 2014. [Online].Available: http://www.wolfram.com/mathematica/

[12] K. Features, “Symbolic Math Toolbox.”[13] SymPy Development Team, SymPy: Python library for symbolic

mathematics, 2014. [Online]. Available: http://www.sympy.org[14] List of computer algebra systems. http://en.wikipedia.org/wiki/List of

computer algebra systems.[15] M. Odersky and Al., “An Overview of the Scala Programming

Language,” EPFL, Lausanne, Switzerland, Tech. Rep. IC/2004/64,2004.

[16] T. Flaherty, “Scala Math DSL,” 2014.[17] L. Consolini and M. Tosques, “On the exact tracking of the spherical

inverted pendulum via an homotopy method,” pp. 1077–1082, 2008.[18] K. Sreenath, T. Lee, V. Kumar, Q. R, and R. So, “Geometric Control

and Differential Flatness of a Quadrotor UAV with a Cable-SuspendedLoad,” vol. 1243000, no. 3.

[19] A. K. Sanyal and A. Goswami, “Dynamics and Balance Controlof the Reaction Mass Pendulum: A Three-Dimensional MultibodyPendulum With Variable Body Inertia,” Journal of Dynamic Systems,Measurement, and Control, vol. 136, no. 2, p. 021002, Nov. 2013.