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
smdoc_compound_rigid_bodies 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.
To model the four-bar linkage:
Start a new model.
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.
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.
From the Simscape > Multibody > Joints library, drag four Revolute Joint blocks into the model.
smdoc_compound_rigid_bodiesat the MATLAB® command prompt. A custom library with compound body subsystem blocks opens up.
smdoc_compound_rigid_bodieslibrary, drag the following blocks.
Block Quantity Pivot Mount 2 Binary Link A 2 Binary Link B 1
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
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.
Parameter Crank-Base Transform Rocker-Base Transform Translation > Method
Translation > Axis
Translation > Offset
15in units of
15in units of
In each binary link block dialog box, specify the length parameter.
Block Length (cm) Binary Link A
Binary Link B
Binary Link A1
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
In the Base-Crank Revolute Joint block dialog box, expand State Targets and select Specify Position Target.
Specify the Value parameter as
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
degand Priority parameter as
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.
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
smdoc_four_barat the MATLAB command prompt.