Previous section-----Next section

11.1.5 Space-Crank Example Mechanism

To demonstrate the use of generalized coordinate constraints in a Modeler3D model, a 3D model of a spatial slider-crank mechanism is developed. The model consists of three moving bodies; a slider, crank, and connecting rod. A geometrically similar model is presented in Section 3.2. The model presented here differs in that it uses a separate body to represent the connecting rod, instead of simply replacing it with a relative-distance constraint.

This loads the Modeler3D packages.

Here is the complete space-crank graphic.

Bodies

Four body objects are defined for the space-crank model. Note the use of the zeroth point to avoid having to define {0, 0, 0}.

  • The ground (body 1) has one point defined in its body object.
    P1 is a point to locate the rotational axis of the crank.
  • The crank (body 2) has one point defined in its body object.
    P1 is the attachment point of the connecting rod. The center of the crank is at the local origin.
  • The connecting rod (body 3) has one point defined in its body object.
    P1 is the attachment point of the connecting rod to the slider, while the connecting rod is attached to the crank at P0.
  • The slider (body 4) has no points in its body object, only an initial guess, because only the local origin P0 is used.
  • Here are the body objects for the space-crank model.

    The body properties are incorporated into the model.

    Constraints

    Five constraints, one of which is a driving constraint, are used to model the space-crank mechanism. These constraints are simply standard Mech constraints that will be replaced with generalized coordinate constraints shortly.

  • A ProjectedAngle1 constraint specifies the angular relationship between a line on the ground body and a line on the crank. This driving constraint is used to rotate the crank.
  • A Revolute5 constraint forces the axis of the crank to be coincident with its pivot axis on the ground.
  • A Spherical3 constraint between the crank and the connecting rod models a ball joint.
  • An OrthoRevolute4 constraint between the slider and the connecting rod models a universal joint. This is used instead of a Spherical3 constraint so as to constrain the spin of the connecting rod about its own longitudinal axis.
  • A Translate5 constraint between the slider and the ground allows translation of the slider.
  • Here are the constraint objects for the space-crank mechanism.

    The constraints are incorporated into the model.

    Runtime

    The model can now be run through its range of motion by varying T with the SolveMech command. The numerical value of T specifies the angle of rotation of the crank in revolutions.

    The model is run at T = 0.05.

    Here is the slider-crank model at T = 0.05.

    Generalized Coordinate Constraints

    Now one of the standard constraints is replaced with a generalized coordinate constraint. Constraint 2, the revolute joint that models the rotational axis of the crank, is replaced first, and body 2 becomes a slave to the ground body, represented by the single coordinate alpha. Note that the arguments to the GenRevolute5 constraint are exactly the same as the arguments to the Revolute5 constraint, with the addition of the new symbol alpha and its initial guess.

    Here is the new constraint.

    The modified model is run again at T = 0.05.

    Note that all of the symbols associated with body 2 are no longer included in the solution rules returned by SolveMech. The location of body 2 is represented entirely by alpha, which is the rotation angle of the crank in full revolutions. The definition (and hence the numerical value) of alpha is dependent on the relative reference directions of the two axis objects passed to GenRevolute5. Since the reference directions were not explicitly specified in the axis objects, default reference directions were assumed by Mech (the local y axes of each body, in this case).
    Only two more of the standard Mech constraints in this model can be replaced with generalized coordinate constraints. This is because each generalized coordinate constraint creates a slave body, and a slave body can be a slave to only one master body. Thus, there is no way to use more than three generalized coordinate constraints in a model with only three bodies.

    Here are two more new constraints.

    The modified model is run again at T = 0.05.

    Now the 21 Cartesian and Euler coordinates have been replaced with the four generalized coordinates alpha, beta, gamma, and delta. A quick degree of freedom count shows that this all makes sense: the three generalized coordinate constraints add a total of four degrees of freedom to the model, while the two remaining standard constraints Spherical3 and ProjectedAngle1 constrain a total of four degrees of freedom.
    The physical meaning of the new coordinates is somewhat confusing: alpha is simply the angle between the global Y axis and the local y axis of the crank, and delta is the X direction distance from the global origin to the origin of the slider. beta and gamma are two angles that represent the rotation of the connecting rod with respect to the slider: beta is the altitude angle, the angle between a horizontal plane and a vector down the axis of the connecting rod, and gamma is the azimuth angle, the rotation of the connecting rod axis about the global Z axis.
    Finally, to reduce the mathematical model of the space-crank mechanism to the absolute minimum size, constraint 1 (the ProjectedAngle1 constraint) must be reexamined. This constraint uses a rather complicated expression relating the directions of three vectors to specify the rotation of the crank, but it is known that the rotation of the crank can be directly specified by alpha. While Mech attempts to simplify constraint expressions to some extent, the algebraic expression generated by constraint 1 is more complicated than it could be.

    Here is the expression that results from constraint 1.

    Constraint 1 really just sets alpha equal to 2 Pi T, which can be done more directly with the all-purpose constraint function Constraint.

    Here is a simplified functional replacement for constraint 1.

    Output and Graphics Functions

    Now that we have a solution in terms of generalized coordinates, all of the standard Mech output and graphics functions allow it to be used in the same manner as a solution in terms of Cartesian and Euler coordinates. For example, the location of a point is still found with the Location function and the spatial orientation of a body is found with Rotation. The symbolic expressions returned by these functions reflect the new coordinate system being used, but the numerical results are equivalent.

    Here are the Cartesian coordinates of a point at the center of the connecting rod.

    The location of the point on the connecting rod is a function of beta, gamma, and delta, but not alpha. This is because of the master-slave relationship of the generalized coordinate bodies; the connecting rod is a slave to the slider, which is a slave to the ground. Thus, the location of any point on the connecting rod is a function of the generalized coordinates of the slider and the connecting rod, while the location of any point on the crank is a function of only alpha.

    Here is the global rotation angle of the crank.

    Mech graphics functions also operate without regard to the use of generalized coordinates. The following graphics object will generate the same image with any of the three constraint formulations used in the preceding example.

    Here is the graphics object representing the space-crank model.

    This shows the graphic at T = 0.15.