Previous section-----Next section

11.3 Dynamic Modeling

This section covers topics related to generalized coordinate modeling of dynamic systems. Dynamic motion synthesis is often where generalized coordinates have their greatest payoff. Using a coordinate system that is closer to being a minimal and independent set can drastically reduce the size of the mass matrix and centrifugal force vector, resulting in reduced runtimes for the numerical integration routine.
The reduced mass matrix, in terms of generalized coordinates, is often useful in its own right for certain types of analysis. Examples of various mass matrix manipulations are presented in this section, including the conversion of an open-loop mass matrix to endpoint coordinates, and the reduction of a closed loop mass matrix to minimal coordinates.

11.3.1 Two-Link Manipulator Example

It is often useful to find the mass matrix of a model with respect to an alternative coordinate system. When generalized coordinates are used, Mech automatically generates the model's mass matrix in terms of the specified coordinates, and converting the mass matrix to another consistent coordinate system is a straightforward process.
An open-loop two-link manipulator model is developed to demonstrate the conversion of a mass matrix from one coordinate system to another. The model has two moving bodies, link 1 and link 2, which are represented by two generalized coordinates, alpha and beta. The alpha coordinate represents the rotation angle of link 1 relative to the ground and beta represents the rotation of link 2 relative to link 1.

This loads the Modeler2D packages and defines some useful constants.

Here is a graphic of the two-link manipulator model.

Bodies

Two body objects are used in the manipulator model. Each body object is used only to define inertia properties for the body, no local point definitions are made. Thus the ground (body 1) needs no body object because its inertia is immaterial. Note that the lengths of the links are left as parameters L1 and L2, causing the resulting mass matrix to be completely general.

Here are the body objects for the manipulator model.

The inertia properties are incorporated into the model.

Constraints

Four constraint objects are used to model the manipulator. Two constraints are generalized coordinate constraints that introduce the two degrees of freedom, alpha and beta, and the other two constraints simply constrain these two degrees of freedom.

  • A GenRevolute2 constraint sets up the relationship between link 1 and the ground.
  • A GenRevolute2 constraint sets up the relationship between link 2 and link 1.
  • Two Constraint objects constrain alpha and beta to be equal to the parameters q1 and q2.
  • Note that L1 appears explicitly in constraint 3 to locate the tip of link 1 where it is attached to link 2.

    Here are the constraint objects for the manipulator.

    The constraints are incorporated into the current model.

    Mass Matrix

    The kinematics of this model are truly trivial. The entire constraint set is nothing more than a pair of expressions setting alpha and beta equal to q1 and q2. There is really no point in running the model at all, in the normal sense in which other Mech models are run because the configuration of the model can be specified directly by alpha and beta. The usefulness of the model lies in the other definitions that have been made by Mech for inertia properties and coordinate transformations.

    Here is the constraint vector.

    Here is the global location of the tip of link 2.

    Here is the  system mass matrix.

    Endpoint Mobility

    Now we wish to find the ellipse of mobility of the endpoint of link 2. The ellipse of mobility of an equivalent two-link manipulator model was found in Section 10.3. In that example, a one-unit force was applied to the endpoint of link 2 while varying the direction of the force through 360 degrees, and the resulting free acceleration vector of the endpoint was found with the SetFree and SolveFree functions.
    This section presents a more elegant method of finding the ellipse of mobility directly from the mass matrix. The method presented in Section 10.3 is much more general than this one in that this method (as it is presented here) is restricted to finding the mobility of the endpoint at zero velocity, and is restricted to models that have the same total number of coordinates as the number of physical degrees of freedom of the endpoint.
    The basic trick here is to convert the mass matrix from the generalized (joint angle) coordinates to endpoint coordinates. The mass matrix m, in the context of  , transforms accelerations of the generalized coordinates a, which are the relative angular accelerations of each of the joints, into forces on the generalized coordinates f, which are moments applied at the joints. We need to have a matrix P in  , which transforms a force vector F applied to the endpoint into the linear acceleration vector A of the endpoint. First, we need a transformation matrix J from generalized coordinates to endpoint coordinates such that  . Then  .
    The matrix J is the Jacobian of the global coordinates of the endpoint.

    Here is the transformation matrix J.

    Here is the inverse endpoint mass matrix P, a rather large symbolic matrix.

    We can now find the acceleration of the endpoint that results from any force vector at any particular configuration simply by multiplying P times the force vector.

    Here is the acceleration vector resulting from an applied force {0, 2}.

    Now finding the ellipse of mobility is simply a matter of applying a unit force vector that revolves through a full circle and plotting the components of the resulting acceleration.

    Here is the ellipse of mobility.

    11.3.2 Four-Bar Example

    Another useful manipulation of the mass matrix is to find a minimal mass matrix for a model with a nonminimal coordinate system. While this can theoretically be done with or without generalized coordinates, it often becomes intractable when modeling in Cartesian coordinates because of the need to invert a large symbolic matrix.
    The four-bar model that was developed previously in this section is used again here to demonstrate the formulation of a minimal mass matrix. In this case, the minimal mass matrix is a  matrix because the four-bar model has only one degree of freedom. Since the four-bar mechanism is modeled with three generalized coordinates alpha, beta, and gamma, the default mass matrix generated by Mech is a  matrix; the task at hand is to reduce it to  . Note that inertia properties are included in the body objects of this version of the four-bar.

    This clears all data in the current Mech model.

    Bodies and Constraints

    The entire four-bar model is redefined without explanation here, because its kinematics are completely documented in Section 8.3.2.

    Here are the body objects for the four-bar model.

    Here are the generalized coordinate constraint objects.

    Mass Matrix

    We intend to transform the  system mass matrix M into a  mass matrix m where  and f is the generalized force in the direction of alpha, which is simply a counterclockwise moment applied to the drive bar. This transformation is of the form  .
    The necessary transformation matrix J converts motions in all three generalized coordinates into motions of the single coordinate alpha. This matrix J is created by inverting the part of the model's Jacobian associated with beta and gamma and multiplying it by the part associated with alpha. The resulting 2x1 matrix converts alpha only into beta and gamma, so it must be prepended with a 1 to convert alpha into all three coordinates.
    Only the part of the Jacobian associated with constraint 5 is included in the calculation because the driving constraint (constraint 1) must be dropped for the model to have more than zero degrees of freedom, and the other three generalized coordinate constraints contribute no constraint equations.

    Here is the  transformation matrix J.

    Here is the  system mass matrix.

    Here is the  mass matrix in terms of the coordinate alpha.

    Since m is a  matrix it may as well be a scalar, and the acceleration that results from applying a moment to the drive bar is simply  . Remember that m is still a function of alpha, beta, and gamma, and not just any set of alpha, beta and gamma will do (unlike the two-link manipulator in which any values of the coordinates could be specified). SolveMech must be used to find a set of coordinates that represents a valid configuration of the four-bar model.

    The  matrix m is converted to a scalar.

    Here is the configuration of the four-bar model at 1/8 turn of the drive bar.

    Here is the acceleration that results from a 10-unit moment applied to the drive bar.

    Dynamic Motion

    The constrained dynamic motion profile of the four-bar model can be found with the SetFree and SolveFree functions, as described in Chapter 10. In this example, the drive bar is given an initial angular velocity of 2 pi radians/second, a condition that is inherent in the definition of constraint 1. Constraint 1 is dropped from the model, and the free motion of the underconstrained system is found.

    The model is run at T = 0 to make initial conditions available to SetFree.

    Here is the FreeSystem object that contains the dynamical equations of motion, with constraint 1 dropped.

    The FreeSystem object fsys is integrated in the time domain from T = 0.0 to 2.0 with SolveFree. All initial conditions for the integration are taken from the most recent solution returned by SolveMech.

    Here is the time domain solution.

    Here is a plot of the angular velocity of the drive bar through approximately one full revolution of the drive bar.