Main Content

Creating Connection Frames

Frames as a Connection Points

The frames of bodies provide the connection points for the joints and constraints in your model. They determine also the relative orientations of those joints and constraints, and therefore the directions of motion that are allowed during simulation. To successfully connect bodies through joints and constraints, you must create suitable connection frames, and this is a task that is best done when modeling the bodies themselves.

Creating and Transforming Frames

You can add frames directly to solids using the frame creation interface of the solid blocks. This interface enables you to define the position and orientation of a frame interactively, in terms of key geometry features, such as vertices, edges, and faces, or in terms of key inertia features, such as the center of mass and the principal axes of inertia. Frames that you create are known as custom and appear as frame ports on the solid block to which they belong. The figure shows a Brick Solid block with two custom frame ports labeled F1 and F2.

You can also create frames using the Rigid Transform block. This block enables you to define the position and orientation of a frame numerically, in terms of rotation and translation transforms. You can use a variety of transform parameterizations, including rotation matrices and rotation sequences in the case of rotation transforms, and Cartesian and cylindrical offset coordinates in the case of translation transforms. The figure shows a new frame (F) created using a Rigid Transform block from an existing solid frame.

Frames that you create using Rigid Transform blocks are independent of any specific solid features. You can place them anywhere relative to another frame as long as you can determine the transform required to obtain that placement. When placing a Rigid Transform block between two frame ports, you can more aptly think of the block as a means to offset frames that already exist. The figure shows an offset specified through a Rigid Transform block placed between two existing frames.

For more information about frames and transforms, see Working with Frames.

See It: Frames in a Typical Body

At the MATLAB command prompt, enter sm_cam_flapping_wing. A model of a flapping wing mechanism opens up. Look inside the mask of the body subsystem named RightWing. Note that two of the solid blocks, Peg and WingLink, each have two frame ports. One of the ports identifies a custom frame created using the Cylindrical Solid block. Explore one of the custom frames:

  1. Open the dialog box of the Cylindrical Solid block named Peg.

  2. In the visualization toolstrip, click the frame button. The visualization pane updates to show the reference and custom frames of the solid.

  3. In the Properties section of the dialog box, expand the Frames node and click the Edit button. The frame creation interface opens with the current frame definition:

    • The frame origin has been placed at the center of the bottom surface of the cylinder.

    • The frame axes have been left in alignment with those of the local reference frame.

    • The name of the frame matches the label of the corresponding frame port (B).

Note also that the frame connection lines between some of the solid blocks contain Rigid Transform blocks, named CPXform and WingXForm. These blocks specify the rotational and translational offsets between the solid frames that they connect. Explore the transforms specified in one of the blocks:

  1. Open the dialog box of the Rigid Transform block named WingXForm. Note that the rotation transform is set by aligning two axes of the follower frame relative to two axes of the base frame.

  2. Expand the Translation parameters. Note that the translational offset is specified along the axis (of the base frame). The translational offset is parameterized in terms of a MATLAB variable, Ow, whose value you specify in the WingLink subsystem block.

  3. Update the block diagram. Mechanics Explorer opens with a static visualization of the flapping wing model. In the tree view pane, expand the RightWing node and click the WingXForm node to highlight the frames belonging to the Rigid Transform block.

Planning Connection Frames

You must consider the target of a connection frame—the specific joint or constraint—when defining its placement on a body. Joints and constraints often impose special assembly requirements on the frames that they connect. These requirements impact the proper placement of a connection frame. You can find them in the reference page of the joint or constraint block.

If the target is a joint, take note of its degrees of freedom—the types of motion allowed between the joint connection frames—and of the frame axes to which they correspond. For example, the Revolute Joint block provides one rotational degree of freedom about the common z-axis of the connection frames on the base and follower bodies.

To connect two bodies through a Revolute Joint block, you must then place their joint connection frames so that their z-axes each align with the desired rotation axis on the respective body. The figure shows an example: the Housing and RightWing bodies of the sm_cam_flapping_wing model with connection frames properly positioned for a Revolute Joint block.

If the target of a connection frame is a constraint, such as that characteristic of gears in mesh, take note of the connection frame placements required for assembly. For example, the Common Gear Constraint block requires that the connection frames on the base and follower bodies be apart by a distance equal to the sum of their pitch radii when the meshing type is set to External. It requires also that the z-axes be parallel, and that the x - and y-axes of one be coplanar with those of the other.

The assembly requirements of constraint blocks specify how the remainder of the model must hold the connection frames, partly through body definitions and partly through other joints and constraints, for the constraint to apply without error. To see how to place connection frames on gear bodies for assembly via gear constraint blocks, see Assemble a Gear Model.

Addressing Assembly Errors

Closed-loop models, such as those of four-bar and crank-slider mechanisms, are limited in the positions and orientations that their constituent bodies can take. If the placement of a connection frame renders a joint or constraint incompatible with any other in the loop—that is, if successfully connecting one requires that another break—then assembly fails.

This is the case in a planar four-bar mechanism, for example, when the distance between the connection frames on any one link exceeds the sum of the equivalent distances in the remaining links—or when the orientations of the connection frames force the rotation axes of the joints into anything but a parallel alignment.

You can prevent many assembly errors by carefully defining the connection frames on a body with its future connections in mind. Consider both the assembly requirements specific to a joint or constraint block and the kinematic constraints imposed by the remainder of the model. In general, if you encounter an assembly failure, you must:

  1. Identify the unassembled joint or constraint. Use the Simscape Multibody Model Report (Tools > Model Report in the Mechanics Explorer menu bar).

  2. Examine the corresponding connection frames. Use Mechanics Explorer to visualize these frames. Click the name of the unassembled joint or constraint in the tree view pane to highlight its frames in the visualization pane. Compare the placement of those frames to the assembly requirements of the joint or constraint.

  3. Transform the connection frames to satisfy the joint or constraint assembly requirements. You can use the Rigid Transform block to apply the required rotation and translation transforms. If a connection frame is a custom frame belonging to a solid block, you can use that block instead to edit the frame definition.

For an example showing how to resolve an assembly failure caused by an improperly placed connection frame, see Troubleshoot an Assembly Error.

Related Topics