Accelerating the pace of engineering and science

# Documentation Center

• 평가판
• 제품 업데이트

## Represent Binary Link Frame Tree

### Model Overview

In this example, you model the frame tree for a binary link subsystem. This frame tree contains one Reference frame and two end frames for the joints. The Reference frame identifies the main body of the link. It is labeled main. The end frames identify the peg and hole sections of the link. They are labeled, peg and hole, respectively.

### Modeling Approach

Modeling a complete binary link is a twofold task in which you specify:

1. Frames

2. Solids

This example guides you through step 1 — modeling the frame tree for a binary link. The figure shows the resulting block diagram for this step.

Once you have completed this example, you can complete step 2 — adding to the frame tree the solids that comprise the binary link. The figure shows the final block diagram for the binary link subsystem.

### Dimensions and Transforms

You can promote subsystem reusability by parameterizing link dimensions in terms of MATLAB® variables. In this example, you initialize the variables in a subsystem mask. You can then specify their numerical values in the subsystem dialog box. Refer to the table for the dimensions needed to model the binary link frame tree.

DimensionMATLAB Variable

A Reference Frame block identifies the location of the Reference frame. Two Rigid Transform blocks define the position of the end frames with respect to the Reference frame. In this example, you label these blocks to_peg and to_hole. Refer to the table for the associated transforms.

End FrameRigid Transform BlockTranslation [X Y Z]

### Build Model

Having defined the transforms required to add the end frames, you can now build the model:

1. Start a new model.

2. Drag the following blocks to the model.

BlockQuantityLibrary
Reference Frame1Frames and Transforms
Rigid Transform2Frames and Transforms
Solver Configuration1Simscape™ Utilities

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

 Note:   Pay close attention to Rigid Transform port orientation. Both base (B) port frames should connect to the Reference Frame port. This ensures the rigid transform applies to the Reference frame, and not the end frames.

4. In the Rigid Transform block dialog boxes, expand Translation.

5. In Method, select Cartesian.

6. In Offset, enter the parameters in the table and press OK.

Rigid Transform BlockOffset

### Generate Binary Link Subsystem

To initialize the MATLAB dimension variables used to specify the frame transforms, convert the binary link block diagram into a subsystem and use the subsystem mask:

1. Select the Reference Frame and Rigid Transform blocks.

2. Press Ctrl+G to enclose the blocks in a subsystem.

3. Click the Subsystem block and press Ctrl+M to create a subsystem mask.

4. In the Parameters & Dialog tab, add the following text boxes to a Parameters group and click OK.

PromptName

5. In the subsystem dialog box, specify these parameters.

ParameterValue
Length0.2
Width0.02
Thickness0.008

 Note:   Parameter values use the default length unit of meter (m).

### Visualize Model

Update the model to visualize the frame tree in Mechanics Explorer.

1. Press Ctrl+D to update the diagram.

2. In the Mechanics Explorer toolstrip, click the frame button .

The three frames appear in the visualization pane of Mechanics Explorer. The default view convention is Z Up (XY Top), which differs from the Y Up convention used in the example schematics. To change the Mechanics Explorer view convention to Y Up (XY Front):

• In the Mechanics Explorer toolstrip, select Y Up (XY Front) from the View Convention drop-down list.

Compare the resulting frame tree to the example schematics to confirm the validity of the transforms specified.

### Save Custom Block

So that you can use it in later examples, save the binary_link subsystem as a custom library block. If you have not done so, create a new library to save the block in:

1. In the Simulink® menu bar, click File > New > Library.

2. Drag the binary_link subsystem block to the new library.

3. Save the library with a convenient name (e.g. linkage_elements) in an accessible folder.