Model an Open-Loop Kinematic Chain

Model Overview

This example shows how to model a double pendulum—a simple kinematic chain comprising two moving bodies connected in series via two revolute joints. A third body represents a mechanical ground and is rigidly connected to the inertial World frame. The custom smdoc_compound_rigid_bodies library provides the rigid body subsystem blocks used in the example.

Revolute Joint blocks enable you to model the joints connecting adjacent bodies and help set their initial states. Simscape™ Multibody™ software satisfies a joint state target precisely if it is kinematically valid and not in conflict with other state targets. A Priority parameter lets you specify which targets to attempt to satisfy first.

Build Model

  1. Start a new model.

  2. Drag these blocks into the model. The two Revolute Joint blocks provide the double pendulum two rotational degrees of freedom.

    Simscape > UtilitiesSolver Configuration1
    Simscape > Multibody > UtilitiesMechanism Configuration1
    Simscape > Multibody > Frames and TransformsWorld Frame1
    Simscape > Multibody > JointsRevolute Joint2

  3. At the MATLAB® command prompt, enter smdoc_compound_rigid_bodies. A custom block library with the same name opens up.

  4. Drag these custom blocks into the model. Each block represents a rigid body in the double pendulum.

    Pivot Mount1
    Binary Link A2

  5. Connect the blocks as shown in the figure.

Guide Model Assembly

  1. In the Revolute Joint block dialog boxes, select State Targets > Specify Position Target. You can now specify the desired starting positions of the two joints.

  2. In Value, enter these joint angles.

    Block NameValue (degrees)
    Revolute Joint30
    Revolute Joint1-75

Visualize Model and Check Assembly Status

To visualize the model, update the block diagram. You can do this from the menu bar by selecting Simulation > Update Diagram. Mechanics Explorer opens with a 3-D view of the double pendulum assembly. Click the isometric view button to obtain the perspective in the figure.

To check the assembly status of the revolute joints, use the Model Report utility. You can open this utility from the Mechanics Explorer menu bar by selecting Tools > Model Report. The figure shows the assembly information for the double pendulum.

Simulate Model

Run the simulation, e.g., by selecting Simulation > Run. Mechanics Explorer shows a 3-D animation of the double pendulum assembly. The assembly moves due to gravity, specified in the Mechanism Configuration block.

Open Reference Model

To see a complete model of the double pendulum assembly, at the MATLAB command prompt enter:

  • smdoc_double_pendulum

Was this topic helpful?