# Transform Sensor

Sensor that measures the relative spatial relationship between two frames

**Library:**Simscape / Multibody / Frames and Transforms

## Description

The Transform Sensor block measures the relative spatial relationship between two arbitrary frames in a Simscape™ Multibody™ model. The measurements are resolved in the measurement frame of the block and include relative translations, rotations, and their first and second time derivatives.

The block has two frame ports: **B** and **F**. To
measure the relative relationship between two frames, first connect the frame ports to the
frames that you want to measure; then set the **Measurement Frame** parameter
to a desired frame to resolve the measurements; last select the desired output parameters to
express the measurements.

**Tip**

To measure the absolute translational or rotational quantities of a frame, connect the
frame ports **F** and **B** of the block to this frame and
the world frame of the model, respectively.

### Measurement Frame

The **Measurement Frame** parameter setting affects all the outputs of
the block except the ones listed in the table.

Outputs | Ports |
---|---|

Rotation measurements | q, axs, Q,
R, seq |

Quaternion derivatives | Q and Qdd |

Rotation-matrix derivatives | Rd and Rdd |

Distance and its derivatives | dst, vdst, and
adst |

The Transform Sensor block has five different selections
for the **Measurement Frame** parameter: `World`

,
`Base`

, `Follower`

,
`Non-Rotating Base`

, and ```
Non-Rotating
Follower
```

. When you set **Measurement Frame** to
`World`

, all the measurements are resolved in the world frame.
When you set **Measurement Frame** to `Base`

or
`Follower`

, the resolved acceleration measurements include
centripetal and Coriolis terms if the corresponding base or follower frame rotates. When you
set **Measurement Frame** parameter to ```
Non-Rotating
Base
```

or `Non-Rotating Follower`

, the measurements
do not satisfy the standard derivative relationship if the corresponding base or follower
frame rotates. For example, the relative linear velocity does not equal the time derivative
of the relative translation. See Selecting a Measurement Frame for more information.

### Rotational and Translational Measurements

The block has three parameterizations to express the measured rotations: angle-axis,
quaternion, rotation matrix, and rotation sequence. Select the **Angle**
and **Axis** parameters to use the angle-axis parameterization. Select the
**Quaternion**, **Transform**, or **Rotation
Sequence** parameter under **Rotation** to use the quaternion,
rotation matrix, or rotation sequence parameterization. Similarly, the block has three
parameterizations to express rotational velocities and accelerations: *X-*,
*Y-*, and *Z-* coordinates; the time derivatives of a
quaternion; and matrix. To enable these parameterizations, you can select the corresponding
parameters under **Angular Velocity** and **Angular
Acceleration**. See Rotational Measurements for more information.

The block has three coordinate systems to express the translational measurements: Cartesian, cylindrical, and spherical. You can select one or more of them at the same time. See Translational Measurements for more information.

The tables summarize the coordinates of the cylindrical and spherical systems, and the
images show the diagrams of the systems. For simplicity purpose, in the images, the
**Measurement Frame** parameter is set to `Base`

to resolve the measurements.

**Cylindrical Coordinates**

Coordinate | Description |
---|---|

Radius | The length of the projection of the vector `BF` , in the
X-Y plane of the measurement frame. |

Azimuth | The angle of the `Radius` with respect to the positive
X-axis, in the X-Y plane. The angle is
resolved in the measurement frame and falls in the range of [-π, π). |

Z | The standard Cartesian Z-coordinate of the vector
`BF` resolved in the measurement frame. |

**Spherical Coordinates**

Coordinate | Description |
---|---|

Distance | The distance between origins of the base and follower frames. |

Azimuth | The angle of the projection of the vector `BF` in the
X-Y plane with respect to the positive
X-axis. The angle is resolved in the measurement frame and falls
in the range of [-π, π). |

Inclination | The angle of the vector `BF` with respect to the
X-Y plane of the measurement frame. The angle falls in the
range of [-π/2, π/2]. |

To use a specific coordinate system, select the corresponding parameters. For example,
if you want to use the Cartesian system to express the measured relative linear velocity of
the follower frame, select the **X**, **Y**, and
**Z** parameters under **Velocity**. Note that both the
**Measurement Frame** parameter setting and the choice of coordinate
systems affect the translational measurements.

The output ports remain hidden until you select their corresponding parameters. Each
port outputs a time-varying physical signal. You can use the PS-Simulink Converter block to set the units of the outputs when you connect the
Transform Sensor block to Simulink^{®} blocks.

## Ports

### Frame

### Output

## Parameters

## Model Examples

## Extended Capabilities

## Version History

**Introduced in R2012a**