This is machine translation

Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Translate This Page

MathWorks Machine Translation

The automated translation of this page is provided by a general purpose third party translator tool.

MathWorks does not warrant, and disclaims all liability for, the accuracy, suitability, or fitness for purpose of the translation.

Working with Frames

What Are Frames?

Frames are axis triads that encode position and orientation data in a 3-D
multibody model. Each triad consists of three perpendicular axes that
intersect at an origin. The origin determines the frame position and the
axes determine the frame orientation. The axes are color-coded, with the
x-axis in red, the y-axis in
green, and the z-axis in blue.

Role of Frames

Every solid component has one or more local frames to which it is rigidly
attached. By positioning and orienting the component frames, you position
and orient the components themselves. This is the role of frames in a
model—to enable you to specify the spatial relationships between components.

Working with Frames

A frame port identifies a local frame on a component. For example, the R frame port of a
Solid block identifies
the local reference frame of a solid. Every block has one or more frame
ports that you connect in order to locate the associated components in
space. The figure shows the reference frame ports on several of the
Body Elements blocks.

The connections between frame ports determine the spatial relationships between their
frames. A direct frame connection line makes the connected frames
coincident in space. A Rigid Transform block
sets the rotational and translational offsets between the frames. The
figure shows examples of coincident and offset frame connections.

A coincident relationship between solid frames does not, by itself,
constitute a coincident relationship between solid geometries. The
spatial arrangement of two solid geometries depends not only on the
spatial arrangement of the respective reference frames, but also on how
the geometries are defined relative to those frames.

If two geometries differ from each other, or if their positions and
orientations relative to their reference frames differ from each other,
then making the reference frames coincident will cause the solid
geometries to be offset. In the figure, connecting the frame of Solid A
to the left frame of Solid B joins the solids such that their geometries
are offset from each other.

Custom Solid Frames

The Solid block provides a frame creation interface that you can use to
create new, custom, frames. You can position and orient
a custom frame using geometry features such as vertices, edges, and faces.
More conveniently from an inertia standpoint, you can do the same using the
center of mass and three principal axes of the solid.

Try It: Create a Custom Solid Frame

Create a custom frame using the frame creation interface of the
Solid block. Then, place the frame
origin at the center of mass and align the frame axes with the principal
axes of inertia. The result is a frame that coincides with the principal
reference frame—one in which the inertia matrix is diagonal and the
products of inertia are zero.

At the MATLAB command prompt, enter
smdoc_lbeam_inertia. A model opens with a
solid possessing the shape of an L-beam.

In the visualization toolstrip, click the Toggle
visibility of frames button. The visualization
pane shows the frames of the solid, including your new custom
frame, P.

What Are Frame Transforms?

The rotational and translational offsets between frames are called transforms. If the
transforms are constant through time, they are called rigid. Rigid
transforms enable you to fix the relative positions and orientations of
components in space, e.g., to assemble solids into bodies.

Working with Frame Transforms

You use the Rigid Transform block to specify a
rotational, translational, or mixed rigid transform between frames. The
transforms are directional. They set the rotation and translation of a
frame known as follower relative to a frame known as base.

The frame port labels on the Rigid Transform block
identify the base and follower frames. The frame connected to port B
serves as base. The frame connected to port F serves as follower.
Reversing the port connections reverses the direction in which the frame
transform is applied.

You can specify a transform using different methods. For rotational
transforms, these include axis-angle pairs, rotation matrices, and
rotation sequences. For translational transforms, they include
translational offset vectors defined in Cartesian or cylindrical
coordinate systems.

If the rotational and translational transforms are both zero, the
connected frames are coincident in space. This relationship is known as
identity and it is equivalent to a direct frame
connection line between frame ports—i.e., one without a
Rigid Transform block.

Visualizing Frame Transforms

You can visualize frames and examine the transforms between
frames using the Solid block visualization pane or Mechanics Explorer.
Use the Solid block visualization pane to examine the frames of a
single solid element. Click the Toggle visibility of frames button
in the visualization toolstrip to show all the solid frames.

A Frame on a Solid

Use Mechanics Explorer to visualize the frames of more than
a single solid element—e.g., in compound bodies, multibody
subsystems, or complete multibody models. Select View > Show Frames in the Mechanics Explorer menu to show all frames. Select
a node from the tree view pane to show only those frames belonging
to the selected component.

Frames on a Body

Try It: Specify a Frame Transform

This example shows how to offset two solids relative to each
other by specifying a frame transform between the solid reference
frames. The transform consists of a -45 deg rotation
about the z axis followed by a 1 m translation
along the x-axis and a 1 m translation
along the y-axis.

Add the solids to the model

Drag two Solid blocks
from the Body Elements library and place them in a new model.

Each Solid block specifies the default geometry
of a cube 1 m in width.

Connect the Solid block R frame ports.

The frame connection line makes the reference frames—and
cubes—coincident in space.

Visualize the solid frames

Drag a Solver Configuration block
from the Simscape™ Foundation Utilities library and connect it
anywhere on the model.

The visualization pane shows the solid reference frames. The
frames are coincident in space.

Apply the rotation transform

Drag a Rigid Transform block from the
Frames and Transforms library and connect it between the two Solid blocks.

In the Rigid Transform block dialog
box, set:

Rotation > Method to Standard
Axis.

Rotation > Axis to -Z.

Rotation > Angle to 45.

Click OK and update the block
diagram.

The model visualization updates to show the rotated—and
still overlapping—solids.

In the tree view pane, click the Rigid Transform node.

The visualization pane shows the rotated frames.

Apply the translation transform

In the Rigid Transform block dialog
box, set:

Translation > Method to Cartesian.

Translation > Offset to [1
1 0].

The array elements are the translation offsets along the base
frame x, y, and z axes.

Click OK and update the block
diagram.

The model visualization updates to show the translated solids.

In the tree view pane, click the Rigid Transform node.

The visualization pane shows the translated frames.

The Rigid Transform block always applies the
rotation transform first. The translation transform is relative to
the rotated frame resulting from the rotation transform. To apply
the translation transform first, use separate Rigid Transform blocks
for each transform and connect them in the desired order between the Solid blocks.

This website uses cookies to improve your user experience, personalize content and ads, and analyze website traffic. By continuing to use this website, you consent to our use of cookies. Please see our Privacy Policy to learn more about cookies and how to change your settings.