To place a solid in space, with a given position and orientation, you use frames. By connecting the solid reference frame to another frame, you resolve its position and orientation within the model. For example, connecting the solid reference frame directly to the World frame causes their origins and axes to coincide. However, if the model does not yet contain the desired frame, you must first add it.
Adding a frame is the act of defining its position and orientation. Because these properties are relative, you must always define a frame with respect to another frame. Every model starts with one of two frame blocks you can use as reference: World Frame or Reference Frame. As a model grows, so does the number of frames that you can use as a reference.
The spatial relationship between the two frames, the existing and the new, is called a frame transformation. When the transformation is fixed for all time, it is rigid. Two frames related by a rigid transformation can move with respect to the world, but never with respect to each other. In Simscape™ Multibody™, you add a frame by applying a rigid transformation to an existing frame. The block you use for this task is the Rigid Transform block.
Frame transformations can also vary with time. In this case, the two frames that the transformation applies to can move with respect to each other. In Simscape Multibody, joint blocks provide the degrees of freedom that allow motion between two frames. Depending on the joint block, frames can move along or about an axis. For example, the Revolute Joint block allows two frames to rotate with respect to each other about a common +Z axis. Likewise, the Prismatic Joint block allows two frames to rotate with respect to each other along a common +Z axis. For more information about joints, see Modeling Joint Connections.
You can apply two rigid transformations: rotation and translation. Rotation changes the orientation of the follower frame with respect to the base frame. Translation changes the position of the follower frame with respect to the base frame. A third, implicit, transformation is available—identity. This transformation is marked by the absence of both frame rotation and translation, making base and follower frames coincident in space.
Every rigid transformation involves two frames: a base and a follower. The base frame is a reference, the starting point against which you define the new frame. Any frame can act as the base frame. When you apply a rigid transformation, you do so directly to the base frame. The follower frame is the new frame — the transformed version of the base frame. The Rigid Transform block identifies base and follower frames with frame ports B and F, respectively.
As an example, consider a binary link. You can model this rigid body with three elementary solids: main body, peg, and hole sections. This type of rigid body is known as compound. Each solid has a local reference frame, which is fixed with respect to the solid, but which can move with respect to the world. The figure shows the binary link compound rigid body and the three solids that comprise it.
When modeling the binary link, the goal is to place the peg at one end of the link, and the hole section at the other end. The proper approach is to apply a rigid transformation between the main peg and peg reference frames, and main body and hole section reference frames. The transformations specify the separation distance and rotation angle, if any, between each pair of frames. Because the transformations are rigid, they constrain the solids to move as a single unit — a rigid body. The rigidly connected solids can move together with respect to the World frame, but never with respect to each other.
The figure shows the set of transformations used to model the binary link. These include translation, rotation, and identity. No Rigid Transform block is required to apply an identity transformation. See Representing Frames.
The block diagram, shown in the following figure, reflects the structure of the binary link. Three Solid blocks represent the main body, peg, and hole sections. Their R ports identify the respective reference frames. Two Rigid Transform blocks, named to_hole and to_peg apply the rigid transformations that relate the solid pairs main–hole and main–peg.
Rigid transformations describe the operation that takes the base frame into coincidence with the follower frame. In this sense, the transformation acts on the base frame. Switching base and follower port frames causes the transformation to act on a different frame, changing the relationship between the two frames. The result is a follower frame with different position and orientation and, as a consequence, a different rigid body subsystem.
Consider the binary link system. In the original configuration, rigid transformations translate the peg to the right of the main body and the hole to the left. To accomplish this, the main body frame connects to the base port frame of the corresponding Rigid Transform blocks, while the hole and peg frames connect to the follower port frames. When you switch base and follower frame ports, the transformations instead translate the main body to the right of the peg and to the left of the hole.
While in the first case the peg translated to the right of the main body, in the second case the peg translated to the left. The same principle applies to the hole. The figure shows the effect of switching base and follower frames in both Rigid Transform blocks of the binary link block diagram.