SimMechanics    

Open-Topology Example: Double Pendulum

Consider a double pendulum consisting of two thin rods each one meter long and weighing one kilogram. Suppose that the upper rod is initially rotated 15 degrees from the perpendicular.

How much torque is required to keep the pendulum stationary? Solving this problem entails building a kinematic model of the stationary pendulum. The model must represent the geometry of the double pendulum and specify that it remains stationary throughout the simulation.

The kinematic model can take different approaches to specifying the initial state of the pendulum. One approach uses Body block parameters to specify the initial states. Another approach uses Actuator block parameters.

Using Body Block Parameters to Specify Initial Conditions

The following diagram illustrates the Body block approach to modeling initial states. The model is a demo, mech_dpend_invdyn1.

This model represents the pendulum by two Body blocks and two Revolute Joint blocks. The CS1 axis of the upper body (B1) of the pendulum is rotated 15 degrees from the perpendicular (see annotation for block B1). The coordinate systems for the lower block (B2) are aligned with CS1 of the upper block. The CS1 of B2 is rotated -15 degrees relative to CS1 of B1; i.e., it is perpendicular to the world coordinate system. Actuator blocks connected to the joint blocks specify that the pendulum should not move from its initial position. The model uses sensor blocks connected to To Workspace blocks to output the torques on the upper and lower joints as MATLAB workspace variables torque_upper and torque_lower, respectively.

Using Actuator Blocks to Specify the Initial States

The following diagram shows the use of Actuator blocks to specify the initial state of the kinematic model. The system is modeled in the demo mech_dpend_invdyn2.

Using the actuators to specify the displacement slightly simplifies the configuration of the body blocks.

Simulating either model in Inverse Dynamics mode (required for open-loop models; see Choosing an Analysis Mode) causes Simulink to compute the joint torques required to maintain the pendulum in its initial position. The torques are 3.8085 and 0 newton-meters, respectively. You can verify that these are the correct answers by creating a version of the model that applies the computed torques to the joints and simulating the model in Forward Dynamics mode. For example, the following diagram illustrates a forward dynamics version of the kinematic model that uses the joint actuators to specify the initial angular displacement of the pendulum bodies. You can find the model in a demo, mech_dpend_stat.

Note that this body uses Initial Condition blocks to specify the initial 15 degree displacement of the upper body from the vertical in the world coordinate system and the corresponding initial -15 degree displacement of the lower body from the vertical in the coordinate system of the upper body. The negative displacement of the lower body is equivalent to positioning it as vertical in the world coordinate system.

Simulating this model in Forward Dynamics mode results in the following display on the upper joint scope.

The scope reveals that the upper joint never moves from its initial 15 degree displacement, thus confirming that the computed torque is correct.


  Finding Forces from Motions Trimming Mechanical Systems