Main Content

Model a Closed-Loop Kinematic Chain

This example shows how to model a four bar system, which is a closed kinematic chain that comprise four links through revolute joints. One of the links connects to the World Frame block and acts as a ground. Here, use two rigidly connected pivots to replace the link. The custom DocCompoundRigidBodiesLibrary library provides the body subsystem blocks used in the example.

Use Revolute Joint blocks to model the joints that connect adjacent links and set the initial states of the joints. You can satisfy a joint state target precisely if the target is kinematically valid and not in conflict with other state targets. Note that in the Z Revolute Primitive (Rz) > State Targets section, you can use the Priority parameter to specify the priority level of a target.

Build Model

To model the four-bar linkage:

  1. Start a new model.

  2. Drag these blocks to the model. The Rigid Transform blocks specify the distance between the two pivot mounts. This distance is the length of the implicit ground link.

    LibraryBlockQuantity
    Simscape > UtilitiesSolver Configuration1
    Simscape > Multibody > UtilitiesMechanism Configuration1
    Simscape > Multibody > Frames and TransformsWorld Frame1
    Simscape > Multibody > Frames and TransformsRigid Transform2
  3. Connect and name the blocks as shown in the figure. Make sure that the base frame ports of the Rigid Transform blocks connect to the World Frame block.

  4. From the Simscape > Multibody > Joints library, drag four Revolute Joint blocks into the model.

  5. At the MATLAB® command prompt, enter openExample('sm/DocDoublePendulumModelExample','supportingFile','DocCompoundRigidBodiesLibrary.slx'). A custom library with compound body subsystem blocks opens up.

  6. From the DocCompoundRigidBodiesLibrary library, drag the following blocks.

    BlockQuantity
    Pivot Mount2
    Binary Link A2
    Binary Link B1

  7. Connect and name the blocks as shown in the figure. Make sure that you position the frame ports of the custom body subsystem blocks exactly as shown.

Specify Block Parameters

  1. In the Rigid Transform block dialog boxes, specify the offset between the pivot mounts and the world frame. The pivot mounts are assumed to be symmetrically positioned about this frame.

    ParameterCrank-Base TransformRocker-Base Transform
    Translation > MethodStandard AxisStandard Axis
    Translation > Axis-Y+Y
    Translation > Offset15 in units of cm15 in units of cm

  2. In each binary link block dialog box, specify the length parameter.

    BlockLength (cm)
    Binary Link A10
    Binary Link B35
    Binary Link A120

Guide Assembly and Visualize Model

Guide model assembly by specifying the desired initial angle for one or more joints in the model. To specify an initial angle of 30° for the Base-Crank joint:

  1. In the Base-Crank Revolute Joint block dialog box, expand State Targets and select Specify Position Target.

  2. Specify the Value parameter as -30 deg.

  3. For the Coupler-Rocker Revolute Joint block, in the Z Revolute Primitive (Rz) > State Targets section, select the Specify Position Target parameter, and specify the Value parameter as 0 deg and Priority parameter as Low (approximate).

  4. On the Modeling tab of the Simulink® Toolstrip, click Update Model. Mechanics Explorer opens with a static display of the four-bar linkage in its initial configuration. The image shows the isometric view of the four-bar linkage.

Verify Model Assembly

To check whether and how precisely the state targets were met, you can use the Simscape™ Variable Viewer or the Simscape Multibody™ Model Report.

To open the Simscape Variable Viewer, on the Debug tab of the Simulink Toolstrip, in the Diagnostics section, select Simscape > Variable Viewer. To open the Simscape Multibody Model Report, on the Mechanics Explorer menu bar, select Tools > Model Report.

As shown in the image, the yellow marker indicates that the Base-Rocker Revolute Joint state target was satisfied approximately only. The remaining green marker indicates that the Base-Crank Revolute Joint state target was satisfied precisely.

Simulate Model

Run the simulation. Mechanics Explorer shows a 3-D animation of the four-bar assembly. The assembly moves due to gravity.

To see a complete model of the four–bar assembly, enter openExample("sm/DocFourBarLinkageModelExample")at the MATLAB command prompt.

See Also

|

Related Topics