Simulating Nonholonomic Dynamics

Simulating Nonholonomic Dynamics

Marin Kobilarov M. Kobilarov: California Institute of Technology, Control and Dynamical Systems, Pasadena, CA 91125, USA marin@cds.caltech.edu David Martín de Diego D. Martín de Diego: Instituto de Ciencias Matemáticas, CSIC-UAM-UC3M-UCM, Serrano 123, 28006, Madrid, Spain david.martin@icmat.es  and  Sebastián Ferraro S. Ferraro: Departamento de Matemática e Instituto de Matemática, Universidad Nacional del Sur, Av. Alem 1253, 8000 Bahía Blanca, Argentina sferraro@uns.edu.ar
Abstract.

This paper develops different discretization schemes for nonholonomic mechanical systems through a discrete geometric approach. The proposed methods are designed to account for the special geometric structure of the nonholonomic motion. Two different families of nonholonomic integrators are developed and examined numerically: the geometric nonholonomic integrator (GNI) and the reduced d’Alembert-Pontryagin integrator (RDP). As a result, the paper provides a general tool for engineering applications, i.e. for automatic derivation of numerically accurate and stable dynamics integration schemes applicable to a variety of robotic vehicle models.

1. Introduction

Nonholonomic constraints have been the subject of deep analysis since the dawn of Analytical Mechanics. Hertz, in 1894, was the first to use the term “nonholonomic system”, but we can even find older references in the work by Euler in 1734, who studied the dynamics of a rolling rigid body moving without slipping on a horizontal plane. Many authors have recently shown a new interest in that theory and also in its relation to the new developments in control theory, subriemannian geometry, robotics, etc (see, for instance, [24]). The main characteristic of this period is that Geometry was used in a systematic way (see L.D. Fadeev and A.M. Vershik [28] as an advanced and fundamental reference, and also, [1, 2, 5, 9, 18, 20] and references therein).

In the case of nonholonomic mechanics, these constraint functions are, roughly speaking, functions on the velocities that are not derivable from position constraints. Traditionally, the equations of motion for nonholonomic mechanics are derived from the Lagrange-d’Alembert principle which restricts the set of infinitesimal variations (or constrained forces) in terms of the constraint functions.

Recent works, such as [8, 10, 14, 23], have introduced numerical integrators for nonholonomic systems with very good energy behavior and properties such as the preservation of the discrete nonholonomic momentum map. In this paper, we will review and compare two new methods for nonholonomic mechanics, the Geometric Nonholonomic Integrator (GNI) [12] and the Reduced d’Alembert-Pontryagin Integrator (RDP) [17], examining their behavior in the numerical simulation of some of the most typical examples in nonholonomic mechanics: the Chaplygin sleigh and the snakeboard.

Finally, the developed algorithms are packaged as a general computational tool for automatic derivation of nonholonomic integrators given the system constraints and Lagrangian. It is available for download from
http://www.cds.caltech.edu/~marin/index.php?n=nhi

2. Introduction to Discrete Mechanics

Discrete variational integrators appear as a special kind of geometric integrators (see [13, 27]). These integrators have their roots in the optimal control literature in the 1960’s and 1970’s. In the sequel we will review the construction of this specific type of geometric integrators (see [22] for an excellent survey about this topic).

A discrete Lagrangian is a map , where is a finite-dimensional configuration manifold. For the construction of numerical integrators for a continuous Lagrangian system given by a Lagrangian , the discrete Lagrangian may be considered as an approximation of the integral action

where is a solution of the Euler-Lagrange equations corresponding to , that is,

(1)

additionally satisfying and , where is the time step. Observe that this solution always exists if the Lagrangian is regular and is small enough (see [25]).

Define the action sum corresponding to the Lagrangian by

where for . For any covector , we have a decomposition where . Therefore,

The discrete variational principle states that the solutions of the discrete system determined by must extremize the action sum given fixed points and .

Extremizing over , , we obtain the following system of difference equations

(2)

These equations are usually called the discrete Euler-Lagrange equations.

The geometrical properties corresponding to this numerical method are obtained defining two discrete Legendre transformations associated to by

and the 2-form , where is the canonical symplectic form on . We will say that the discrete Lagrangian is regular if is a local diffeomorphism. We will have that:

is a local diffeomorphism is a local diffeomorphism
is symplectic

Under this regularity condition, this implicit system of difference equations (2) defines a local discrete flow , by . The discrete algorithm determined by preserves the symplectic form , i.e., . Moreover, if the discrete Lagrangian is invariant under the diagonal action of a Lie group , then the discrete momentum map defined by is preserved by the discrete flow. Here, denotes the fundamental vector field determined by :

Therefore, these integrators are symplectic-momentum preserving integrators.

In [21] we have obtained a geometric derivation of variational integrators that is also valid for reduced systems (on Lie algebras, quotient of tangent bundles by a Lie group action, etc.)

3. Description of the nonholonomic dynamics

The presence of nonholonomic (or holonomic) constraints gives rise to forces. Nonholonomic systems are described by the Lagrange-D’Alembert’s principle which prescribes the constraint forces induced by the given nonholonomic constraints. In the following we will describe the equations of motion of a nonholonomic system in terms of Riemannian geometric tools (see [5]).

Let be an -dimensional differentiable manifold, with local coordinates , . Consider a mechanical Lagrangian system defined by , or, locally

(3)

Here is a Riemannian metric on (locally defined by the symmetric, positive definite matrix ) and represents a potential function. We know that the equations of motion for a Lagrangian system are (1) which, in the case of a mechanical Lagrangian system of the form (3), admits a nice expression in terms of standard Riemmanian geometric tools:

where is the Levi–Civita connection associated to and, in coordinates, where is the inverse matrix of .

Assume that the system is subjected to nonholonomic constraints, defined by a regular distribution on , with . Locally the nonholonomic constraints are described by the vanishing of independent functions

The Lagrange–d’Alembert principle states that the equations of motion for a nonholonomic system determined by the two data are:

(4)

where , are Lagrange multipliers to be determined. Using the Levi-Civita connection we find an intrinsic equation for the nonholonomic equations:

where is a section of along . Here stands for the orthogonal complement of with respect to the metric .

In coordinates, defining the functions (Christoffel symbols for ) by

we may rewrite the nonholonomic equations of motion as

4. Geometric Nonholonomic Integrator – Gni

Given a nonholonomic system where is a Lagrangian system of mechanical type (3), using the metric , we may consider the complementary projectors

and their duals considered as mappings from to .

The Geometric Nonholonomic integrator (GNI, in the sequel) for a nonholonomic system only needs to fix a discrete Lagrangian to derive a numerical scheme, that is, it is not necessary to discretize the nonholonomic constraints for this type of integrator. The discrete nonholonomic equations proposed in [12] are

(5a)
(5b)

The first equation is the projection of the discrete Euler–Lagrange equations to the dual of the constraint distribution , while the second one can be interpreted as an elastic impact of the system against . This defines a unique discrete evolution operator if and only if the Lagrangian is regular, in the sense of Section 2.

Define the pre- and post-momenta using the discrete Legendre transformations:

In these terms, equation (5b) can be rewritten as

which means that the average of post- and pre-momenta satisfies the nonholonomic constraints.

We can also rewrite the discrete nonholonomic equations as a jump of momenta:

(6)

Reversibility.

Note that the map is an involution, that is . Therefore, it acts equivalently in both directions, i.e. it creates a reversible and symmetric flow. Furthermore, it can be expressed as

where is a diagonal matrix with elements corresponding to the eigenvalues of while is an invertible matrix with columns the eigenvectors of . Thus, the update (6) can be written as

(7)

based on which one can regard the momentum as either remaining unchanged (corresponding to eigenvalues) or being reflected (corresponding to eigenvalues) with respect to the basis defined by the mapping .

Preservation Properties.

Suppose that is a manifold on which a Lie group acts. Define for each

(8)

where is the infinitesimal generator vector field corresponding to at the point . The bundle over whose fiber at is is denoted by . Define the discrete nonholonomic momentum map as in [8] by

For any smooth section of we have a function , defined as .

If is -invariant and is a horizontal symmetry (that is, for all ), then the GNI preserves (see [12] for a proof).

In some cases of interest, it is possible to obtain an integrator preserving energy applying the following theorem (see [12]):

Theorem 1.

Let the configuration manifold be a Lie group with a bi-invariant Lagrangian and with an arbitrary distribution , and take a discrete Lagrangian that is left-invariant. Then the GNI (5) is energy-preserving.

4.1. Nonholonomic version of the RATTLE and SHAKE methods

Consider a continuous nonholonomic system determined by the mechanical Lagrangian :

(with a constant, invertible matrix) and the constraints determined by where is a matrix with .

Consider now the symmetric discretization

After some straightforward computations we obtain that equations (5a) and (5a) for the proposed nonholonomic discrete system are

(9a)
(9b)

where are Lagrange multipliers. We recognize this set of equations as an obvious extension of the SHAKE method proposed by [26] to the case of nonholonomic constraints.

The momentum is approximated by . Denoting , equations (9a) and (9b) are now rewritten in the form

The definition of requires the knowledge of and, therefore, it is is natural to apply another step of the algorithm (9a) and (9b) to avoid this difficulty. Then, we obtain the new equations:

The interesting result is that we obtain a natural extension of the RATTLE algorithm for holonomic systems to the case of nonholonomic systems. Unifying the equations above we obtain the following numerical scheme

(10a)
(10b)
(10c)
(10d)
(10e)

These equations allow us to take a triple satisfying the constraint equations (10c), compute using (10a) and then using (10b). Then, equations (10d) and (10e) are used to compute the remaining components of the triple . It is clear, applying Theorem 1 that, in the case , the numerical method is energy preserving.

Remark 1.

From this Hamiltonian point of view, we have shown that the initial conditions for this numerical scheme are constrained in a natural way ( with ), that is, the initial conditions are exactly the same as those for the continuous system. Additionally, we select (see [12]).

In [11], the following theorem is proven.

Theorem 2.

The nonholonomic RATTLE method is globally second-order convergent.

4.2. Projected Version of the Nonholonomic RATTLE

The proposed nonholonomic RATTLE method can be expressed without the use Lagrangian multipliers by projecting the equations of motion onto the constraint distribution through the projection defined in §4.

Assuming that the Lagrangian is regular and that matrix is full rank (i.e. rank ) (9) can be reformulated as

(11a)
(11b)

where the matrices and represent both orthogonal projectors and have rank and , respectively, and are defined by

(12a)
(12b)

where is the identity matrix.

Eqs. (11) correspond to (5) for the case and furthermore can be put in the “momentum jump” form by adding (11a) and (11b) to get

(13)

For a more realistic example, we can add control inputs acting in the basis defined by the matrix to obtain the following discrete equations:

where the forces are given by .

In terms of momentum variables the integrator can be equivalently expressed as

(14a)
(14b)

providing an update scheme .

A remaining critical step in completing the algorithm is to establish the link between the discrete variables for used in (14) and the continuous curve . In that respect one can regard as an approximation to the continuous momentum at time , i.e. . The pair satisfies the nonholonomic constraint by definition and is related, following from (14), to the “midpoint” momenta through

(15a)
(15b)

These expressions can be used to determine proper variables to initialize the update (14) given continuous initial conditions . Since there is a set of solutions satisfying (15) for a given the most natural choice is to pick satisfying the constraints at . Therefore, the condition becomes

In summary, given initial conditions satisfying the constraints, the dynamics is evolved forwards to reach the final state , also in the constraint submanifold, after time steps through

(16)

for .

5. Reduced d’Alembert-Pontryagin integrator-(RDP)

In this section we consider a class of mechanical systems which, in addition to nonholonomic constraints, also possess symmetries of motion arising from conservation laws. The interplay between the constraints and symmetries is linked to an intrinsic structure of the state space associated with important properties of the dynamics. Our goal in this section is to develop integrators that respect this structure and lead to more faithful numerical representation.

In §4 we introduced the action of a symmetry group and its relation the evolution of the system momentum. Additional structure arises whenever the dynamics and constraints are -invariant that permits the construction of reduced nonholonomic integrators [14, 17].

Following [1], define the subspaces and according to

Practically speaking, the vertical space represents the space of tangent vectors parallel to symmetry directions while is the space of symmetry directions that satisfy the constraints. Equivalently, can be regarded as the space generated by elements in , as defined in (8). The group is chosen so that the Lagrangian and distribution are -invariant. In addition, we make the standard assumption (see [1, 7]) that , for each .

Since our main interest is in a configuration space that is by construction of the form we will restrict any further derivations to the trivial bundle case. Using coordinates a basis for can be chosen as , for . Since is -invariant these elements can be expressed as , where is the body-fixed basis. We denote the space spanned by at each . Lastly, the system is subject to control force restricted to the shape space.

Nonholonomic Connection

With these definitions we can define a principal connection with horizontal distribution that coincides with at the point , where . This connection is called the nonholonomic connection and is constructed according to , where is the kinematic connection enforcing the nonholonomic constraints and is the mechanical connection corresponding to symmetries satisfying the constraints. These maps are defined according to

(17)

where is called the locked angular velocity, i.e. the velocity resulting from instantaneously locking the joints described by the variables . Intuitively, when the joints stop moving the system continues its motion uniformly along a curve (with tangent vectors in ) with body-fixed velocity and a corresponding spatial momentum that is conserved.

By definition the principal connection can be expressed as

where is the local form and the two components in (17) can be added to obtain

Numerical Formulation

Since the Lagrangian is -invariant, we can define the reduced Lagrangian

(18)

In [17] a nonholonomic integrator was derived using a discrete variational d’Alembert-Pontryagin principle based on the reduced Lagrangian , the connection and a chosen trajectory discretization. In particular, a discrete trajectory with points and respective velocities and was constructed so that

where , with for a chosen . The map represents the difference between two configurations in the group by an element in its algebra and can be selected as:

  • Exponential map , defined by , with is the integral curve through the identity of the left invariant vector field associated with (hence, with );

  • Canonical coordinates of the second kind , , where is the Lie algebra basis.

A third choice for , valid only for certain quadratic matrix groups [6] (which include the rigid motion groups , , and ), is the Cayley map , (See App. A for more details).

With these definitions in place the resulting reduced d’Alembert-Pontryagin (RDP) integrator can be stated [17]. For numerical convenience it is given in terms of vector-matrix notation, by treating the Lie algebra variables and as vectors of coordinates with respect to a chosen canonical basis (see App. B for an example).

The discrete flow satisfies the reduced discrete dynamics

(19)

where and . The map is the right-trivialized tangent of defined by and is its inverse (see App. A).

Equation (19) along with the reconstruction equations

(20)

constitute the complete RDP discrete evolution.

6. Examples

6.1. The Chaplygin Sleigh

The Chaplygin Sleigh [1] is a planar rigid body making a contact with the ground through a skate mounted at the central axis of the body at a distance from its center of mass (Fig. 1). The configuration space is the group with coordinates describing the orientation and the position of the center of mass. The body has rotational inertia and mass and, therefore, its Lagrangian is defined by

(21)
Figure 1. Chaplygin Sleigh model.

At the point of the skate contact the body must slide in the direction in which it is pointing. This condition is encoded by the nonholonomic constraint

A structure-preserving integrator was developed in [10] based on the discrete Lagrange-d’Alembert (DLA) principle with discrete momentum and measure preservation properties. Exploring this direction further, in this section we develop two alternative methods based on the GNI and RDP schemes.

GNI Integrator.

From the mass matrix and the constraint , the projector can be computed using (12a) as

(22)

Since the mass matrix is constant, the GNI integrator can be derived according to . In terms of the coordinates , the discrete update becomes

where . It is straightforward to verify that the resulting update rule is energy-preserving, i.e. . This property is inherent to the GNI construction as explained in [12].

RDP Integrator.

The sleigh has no internal joints and therefore no shape space. Since the Lagrangian (21) is left-invariant to group action, the reduced Lagrangian (18) can be expressed as

where describes the angular, forward, and sideways velocities with respect to the body frame fixed at the center of mass. The constrained symmetry space (8) of the sleigh can be identified as

where and form the constant basis in the body-fixed frame with , for . The two components of the nonholonomic momentum become

corresponding to angular and forward momenta, respectively. The group trajectory can be reconstructed from the momentum according to

The momentum components themselves evolve according to (see  [2]), or equivalently

Since the shape space consists of a single point, the discrete dynamics includes only the momentum equations (19) which become

for . A simple form of these equations can be derived by choosing and truncating its tangent to first order, i.e. . Using the notation the update becomes