|On this page…|
In this example, you model a simple pivot mount. This mount is a compound rigid body with a hexagonal shape and a protruding cylindrical peg. You represent the hexagonal shape using solid shape Regular Extrusion. You then offset the protruding peg from the hexagonal shape using a Rigid Transform block. In later examples, you use this mount to support mechanical linkages like the double pendulum and the four bar system.
To model the pivot mount, you use two Solid blocks. Because the pivot mount has a hexagonal shape, you can model it using the Regular Extrusion shape. To represent the cylindrical peg, you use the Cylinder shape.
Each shape has a reference frame with origin at the geometry center. To offset the cylindrical peg with respect to the hexagonal mount, you apply a rigid transform between the two reference frames. You do this using the Rigid Transform block.
The Z axes of the two reference frames align with the cylindrical and extrusion axes of the peg and mount, respectively. Assuming the two solids both have thickness T, the rigid transform between the two reference frames is a translation T along the common Z axis.
In later examples, you connect the pivot mount to a binary link using a revolute joint. One example is a double pendulum that moves due to gravity. In this example, it helps to rotate the Z axis of the mount so that it is orthogonal to the world frame Z axis. This task, which involves a Rigid Transform block, makes the pivot rotation axis orthogonal to the gravity vector, [0 0 -9.81] m/s^2.
Drag these blocks into a new model.
|Solid||SimMechanics > Second Generation > Body Elements||2|
|Rigid Transform||SimMechanics > Second Generation > Frames and Transforms||2|
|Reference Frame||SimMechanics > Second Generation > Frames and Transforms||1|
|Solver Configuration||Simscape > Utilities||1|
Connect and name the blocks as shown in the figure.
Note: Include the disconnected frame line. This line becomes important when you generate a subsystem for the pivot mount. To add this line, right-click on the solid frame line and drag to the right.
In the Hexagon block dialog box, specify these parameters.
|Geometry > Shape||Select Regular Extrusion.|
|Geometry > Number of Sides||Enter 6.|
|Geometry > Outer Radius||Enter HexagonR. Select units of cm.|
|Geometry > Length||Enter T. Select units of cm.|
|Inertia > Density||Enter Rho.|
|Graphic > Color||Enter HexagonRGB.|
In the Peg block dialog box, specify these parameters.
|Geometry > Shape||Select Cylinder|
|Geometry > Radius||Enter PegR. Select units of cm.|
|Geometry > Length||Enter 2*T.|
|Inertia > Density||Enter Rho.|
|Graphic > Color||Enter PegRGB.|
In the To Peg block dialog box, specify these parameters.
|Translation > Method||Select Standard Axis.|
|Translation > Axis||Select +Z.|
|Translation > Offset||Enter 3/2*T. Select units of cm.|
In the To World block dialog box, specify these parameters.
|Rotation > Method||Select Standard Axis.|
|Rotation > Axis||Select –Y.|
|Rotation > Angle||Enter 90.|
You can now generate a subsystem to encapsulate the pivot mount block diagram. The subsystem mask provides a convenient place to initialize the MATLAB® variables that you defined the block parameters with. To generate the subsystem:
Select all the blocks excluding Solver Configuration.
Press Ctrl+G to enclose the blocks in a subsystem. Name the subsystem block Pivot Mount.
Select the Pivot Mount block and create a subsystem mask, e.g., by pressing Ctrl+M.
In the Parameters & Dialog tab of the Mask Editor, drag six edit boxes into the Parameters group and specify their properties. Click OK.
|Hexagon Outer Radius||HexagonR|
In the Pivot Mount block dialog box, specify these parameters.
|Hexagon Outer Radius (m):||4|
|Hexagon Thickness (m):||0.8|
|Mass Density (kg/m^3):||2700|
|Hexagon Color [R G B]:||[0.25 0.4 0.7]|
|Peg Radius (m):||0.4|
|Peg Color [R G B]:||[1 0.6 0.25]|
Update the block diagram. You can do this by pressing Ctrl+D. Mechanics Explorer opens with a 3-D static display of the pivot mount rigid body.
To view a completed version of the pivot mount model, at the MATLAB command prompt enter smdoc_pivot_mount.