Main Content

Visualize Simscape Multibody Frames

What Are Frames?

Simscape™ Multibody™ models are based on frames, abstract axis triads that contain all the position and orientation data in a model. These constructs enable you to connect solids into bodies, assemble bodies into mechanisms, and prescribe and sense forces, torques, and motion. Given their importance, then, it makes sense to visualize where and how you place different frames in a model.

Show All Frames

The easiest way to view the frames in your model is to toggle their visibility on. You can do this by clicking the Toggle visibility of frames icon in the Mechanics Explorer tool strip, shown in the following figure.

Alternatively, you can select View > Show Frames in the menu bar. Mechanics Explorer shows all the frames in your model, suiting this approach well for models with small numbers of frames. The figure shows a radial engine model with frame visibility toggled on.

If your model has many frames, a different approach may be ideal, as toggling frame visibility may clutter the visualization pane with frames that you don’t want to track.

Highlight Specific Frames

To view only the port frames of a block, including those of a subsystem block, you can select a node in the tree view pane. Mechanics Explorer highlights the port frames associated with the selected node using a turquoise color. The following figure shows an example in which one of the connecting rod assemblies in the radial engine model is highlighted in turquoise.

You can also select individual port frames, which you expose by expanding the tree nodes. For example, expanding the Piston_Connecting_Rod_Assembly_A node exposes the port frame P node, which you can then select in order to highlight that frame. The figure shows the result.

Finally, you can select individual solids directly in the visualization pane, highlighting their reference frames. The figure shows the result of selecting one of the piston solids directly. Mechanics Explorer highlights the solid and its reference frame, while the tree view pane reveals the associated Solid block name. This is the block that you need to change if you want to modify this particular solid.

Visualize Frames via Graphical Markers

If a frame in your model has special significance—e.g., if its origin is the point of application for an external force—you can connect to it a graphical marker. So that you can perform this task, the Body Elements library provides a Graphic block. Simply connect the block to the frame you want to visualize and select the marker type to use—sphere, cube, or frame. The figure shows the radial engine model with a sphere marker highlighting each of the piston connection frames.