Accelerating the pace of engineering and science

Documentation Center

• Trials

Model Overview

The four-bar linkage is a planar closed-loop linkage used extensively in mechanical machinery. This linkage has four coplanar bars that connect end-to-end with four revolute joints. In this example, you model a four-bar linkage using the Binary Link and Pivot Mount custom blocks that you created in previous examples. For an advanced application of the four-bar linkage, see the bucket actuating mechanism of the Backhoe featured example.

Before continuing, you must complete the following examples:

Modeling Approach

To model the four-bar linkage, you represent each physical component with a SimMechanics™ block. The linkage in this example has five rigid bodies—three binary links and two pivot mounts—that connect in a closed loop through four revolute joints. Two of the binary links have one peg and one hole. The third binary link has two holes. The fourth link is implicit: the fixed distance between the two coplanar pivot mounts represents this link.

You represent the binary links and pivot mounts using the custom library blocks that you created in previous examples. You represent the four revolute joints using four Revolute Joint blocks from the SimMechanics Joints library.

The two pivot mounts connect rigidly to the World frame. For this reason, the fourth (implicit) link acts as the ground link. Two Rigid Transform blocks provide the rigid connection between the two pivot mounts and the World frame. A translation offset in each Rigid Transform block displaces the two pivot mounts symmetrically along the World frame Y axis.

To guide model assembly, you can specify the desired initial state for one or more joints in the model. To do this, you use the State Targets menu of the joint blocks. The state targets that you can specify are the joint position and velocity. These are angular quantities in revolute joints. You can specify state targets for all but one of the joints in a closed loop.

Build Model

1. Start a new model.

2. Drag these blocks to the model.

BlockLibraryQuantity
Rigid TransformSimMechanics > Frames and Transforms2
World FrameSimMechanics > Frames and Transforms1
Mechanism ConfigurationSimMechanics > Utilities1
Solver ConfigurationSimscape > Utilities1

3. Connect and name the blocks as shown in the figure. Be sure to flip the frame ports of the crank_base_transform block.

4. Drag four Revolute Joint blocks from the SimMechanics Second Generation (SM2G) > Joints library into the model.

5. Drag these custom blocks into the model. See the modeling tutorials if you have not created these custom blocks.

BlockQuantityModeling Tutorial

pivot_mount2

Model Pivot Mount

6. Connect the blocks as shown in the figure, paying close attention to the port names. Rotate the blocks as needed.

Specify Block Parameters

Specify the binary link dimensions and the spatial relationships between the pivot_mount blocks and the World frame.

1. In the Rigid Transform block dialog boxes, specify these parameters.

Parametercrank_base_transform rocker_base_transform
Translation > MethodStandard AxisStandard Axis
Translation > Axis-Y+Y
Translation > Offset0.150.15

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

Guide Assembly and Visualize Model

The model is now complete. You can now specify the desired initial state for one or more joints in the model. In this example, you specify an initial angle of 30° for the Base-Crank joint. To do this:

1. Double-click the Base-Crank Revolute Joint block.

2. In the block dialog box, expand State Targets and select Position.

3. In Value, enter -30 and press OK.

4. With the model window active, press Ctrl+D.

Mechanics Explorer opens with a static display of the four-bar linkage in its initial configuration. If the joint state targets that you specified are valid and compatible, the initial configuration matches those state targets. The figure shows the static display that you see in Mechanics Explorer after updating the model.

5. In the Mechanics Explorer toolstrip, click the isometric view button .

You can guide assembly so that the four-bar linkage assembles in an open configuration instead. To do this, you must specify a position state target for at least one more joint. You do not have to specify this target precisely. If you have a general idea of what the target should be, you can enter an approximate value and select a low priority level for that target. The figure shows the open initial configuration that results when you specify an additional position state target of 0 degrees for the Base-Rocker Revolute Joint block.

Closed-loop kinematic chains like the four-bar linkage are especially vulnerable to assembly issues. Even when the model assembles, SimMechanics may fail to meet one or more state targets. You can check the assembly status of the model and of the joints using the Model Report tool:

1. In the Mechanics Explorer menu bar, click Tools > Model Report.

2. Scan the model report for circles that are yellow or red.

These circles identify issues in the assembly or in the joint state targets. A yellow or red circle in the Position > Status column identifies state targets that SimMechanics could not satisfy.

The figure shows the model report for the four bar linkage in the open configuration. A green circle indicates that SimMechanics satisfied the Base-Crank Revolute Joint state target precisely. A yellow circle indicates that SimMechanics satisfied the Base-Rocker Revolute Joint state target only approximately.

Simulate Model

You can now simulate the model. To do this, In the Simulink® tool bar, click the Run button.

Save Model

In a subsequent example, you actuate the four-bar linkage and sense its motion. So that you add the actuation inputs and motion sensors to this model, save it as four_bar_linkage in a convenient folder. Then, see example Prescribe Four-Bar Actuation Torque.