|On this page…|
Mechanical links are common building blocks in linkages, mechanisms, and machines. The simple pendulum is an example with one link. In this tutorial, you model a simple link with two end frames that you can later connect to joints. Rigid Transform blocks provide the end frames, while a Solid block provides geometry, inertia, and color. For simplicity, the model assumes the link has a brick shape.
At the MATLAB® command line, enter smnew. The SimMechanics™ block library and a new model open up.
In the model, copy the Rigid Transform block and paste a copy in the model.
Delete these blocks: Simulink-PS Converter, PS-Simulink Converter, and Scope.
Connect the blocks as shown in the figure.
In the dialog box for the Solid block, specify these parameters.
|Geometry > Dimensions||[L W H] (in units of cm)|
|Inertia > Density||rho|
|Graphic > Visual Properties > Color||rgb|
In the dialog boxes for the Rigid Transform blocks, specify these parameters.
|Parameter||Rigid Transform1||Rigid Transform|
|Translation > Method||Standard Axis||Standard Axis|
|Translation > Axis||-X||+X|
|Translation > Offset||L/2 (in units of cm)||L/2 (in units of cm)|
Select the Solid block and the two Rigid Transform blocks.
Press Ctrl+G to enclose the blocks in a subsystem.
Click the Subsystem block and press Ctrl+M to create a subsystem mask.
In the Parameters & Dialog tab of the Mask Editor, drag five edit boxes into the Parameters folder. You can find this folder in the Dialog box pane. In the edit fields, specify these parameters and click OK.
|Color [R G B]||rgb|
Open the Subsystem block dialog box and specify these parameters.
|Color [R G B]||[0.25 0.40 0.70]|
In the model window, press Ctrl+D. Mechanics Explorer opens with a 3-D display of the simple link. In the Mechanics Explorer toolstrip, click the isometric view button to see the 3-D view. To view the frames present in the model, in the Mechanics Explorer menu bar, select View > Show Frames.
Save the link subsystem with the name Link in a custom block library. Then, see Model Pendulum for a basic tutorial on multibody assembly using the Link block you just created.