Documentation Center

  • Trial Software
  • Product Updates

Model Two-Hole Binary Link

Model Overview

In this example, you model a two-hole binary link as a rigid body. Three Solid blocks represent the main body and hole sections of the link. Two Rigid Transform blocks define the spatial relationships between the three solids. This example is a variation of Model Binary Link.

Build Model

  1. Start a new model.

  2. Drag the following blocks to the model.

    Simscape > UtilitiesSolver Configuration1
    SimMechanics > Second Generation > Frames and TransformsRigid Transform2
    SimMechanics > Second Generation > Body ElementsSolid3

  3. Connect and name the blocks as shown in the figure.

    Be sure to flip the Rigid Transform1 block. Its B frame port must face the Main Solid block. Include the broken line extending from the Hole B block (right click the existing connection line and drag).

  4. In the solid block dialog boxes, specify these parameters.

    ParameterHole AMainHole B
    Geometry > ShapeSelect General ExtrusionSelect General ExtrusionSelect General Extrusion
    Geometry > Cross-sectionEnter HoleACS. Select units of cm.Enter MainCS. Select units of cm.Enter HoleBCS. Select units of cm.
    Geometry > LengthEnter T. Select units of cm.Enter T. Select units of cm.Enter T. Select units of cm.
    Inertia > DensityEnter RhoEnter RhoEnter Rho
    Graphic > Visual Properties > ColorEnter LinkRGBEnter LinkRGBEnter LinkRGB

  5. In the rigid transform block dialog boxes, specify these parameters.

    ParameterRigid TransformRigid Transform1
    Translation > MethodStandard AxisStandard Axis
    Translation > Axis+X+X
    Translation > Offset–L_Link/2+L_Link/2

Generate Subsystem

Enclose the binary link blocks in a Subsystem block, define the general extrusion coordinates, and specify the relevant parameter values:

  1. Select all blocks excluding Solver Configuration and press Ctrl+G.. Simulink® encloses the selected blocks in a new subsystem block. Rename the subsystem block as shown in the figure.

  2. Select the subsystem block and press Ctrl+M. Simulink adds a parameter mask to the subsystem block.

  3. In the Parameters & Dialog tab of the Mask Editor, drag six edit boxes into the Parameters group and specify the following parameters.

    Peg Hole RadiusR
    Mass DensityRho
    Link ColorLinkRGB

  4. In the Initialization tab of the Mask Editor, define the extrusion cross sections and click OK:

    % Cross-section of Main:
    Alpha = (pi/2:-0.01:-pi/2)';
    Beta = (3*pi/2:-0.01:pi/2)';
    EndACS = [-L/2 W/2; -L/2+R*cos(Alpha)...
    R*sin(Alpha); -L/2 -W/2];
    EndBCS = [L/2 -W/2; L/2+R*cos(Beta)...
    R*sin(Beta); L/2 W/2];
    MainCS = [End1CS; End2CS];
    % Cross-section of HoleA:
    Alpha = (pi/2:0.01:3*pi/2)';
    Beta = (3*pi/2:-0.01:pi/2)';
    HoleACS = [W/2*cos(Alpha) W/2*sin(Alpha);...
    R*cos(Beta) R*sin(Beta)];
    % Cross-section of HoleB:
    Alpha = (-pi/2:0.01:pi/2)';
    Beta = (pi/2:-0.01:-pi/2)';
    HoleBCS = [W/2*cos(Alpha) W/2*sin(Alpha);...
    R*cos(Beta) R*sin(Beta)];
  5. In the dialog box of the Binary Link B subsystem block, specify these parameters.

    Length (m)30
    Width (m)2
    Thickness (m)0.8
    Peg Hole Radius (m)0.4
    Mass Density (kg/m^3)2700
    Link Color [R G B][0.25 0.4 0.7]

Visualize Model

Update the block diagram. You can do this by pressing Ctrl+D. Mechanics Explorer opens with a static 3-D display of the binary link rigid body.

You can open a copy of the resulting model. At the MATLAB® command line, enter smdoc_binary_link_b.

Open Reference Model

To open a completed version of the two-hole binary link model, at the MATLAB command line enter smdoc_binary_link_b.

Related Examples

Was this topic helpful?