Main Content

Transform Sensor

Sensor that measures the relative spatial relationship between two frames

  • Library:
  • Simscape / Multibody / Frames and Transforms

  • Transform Sensor block

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.

OutputsPorts
Rotation measurementsq, axs, Q, and R
Quaternion derivativesQ and Qdd
Rotation-matrix derivativesRd and Rdd
Distance and its derivativesdst, 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, and rotation matrix. Select the Angle and Axis parameters to use the angle-axis parameterization. Select the Quaternion or Transform parameters under Rotation to use the quaternion or rotation matrix parameterizations. 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

CoordinateDescription
RadiusThe length of the projection of the vector BF, in the X-Y plane of the measurement frame.
AzimuthThe 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 [-π, π).
ZThe standard Cartesian Z-coordinate of the vector BF resolved in the measurement frame.

Cylindrical Coordinate System

Spherical Coordinates

CoordinateDescription
DistanceThe distance between origins of the base and follower frames.
AzimuthThe 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 [-π, π).
InclinationThe 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].

Spherical Coordinate System

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

expand all

Frame port associated with the base frame for the measurements.

Frame port associated with the follower frame for the measurements.

Output

expand all

Angle of relative rotation, returned as a scalar. The angle indicates the rotation of the follower frame with respect to the base frame about the axis that is specified by the vector exported from port axs. The angle falls in the range [0, π]. Use ports q and axs to output the rotation signals using the angle-axis parameterization.

Dependencies

To enable this port, under Rotation, select Angle.

Axis of relative rotation, returned as a 3-by-1 unit vector. The vector is dimensionless and indicates the rotational axis. Use ports q and axs to output the rotation signals using the angle-axis parameterization.

Dependencies

To enable this port, under Rotation, select Axis.

Relative rotation, returned as a vector in quaternion parameterization. See Rotational Measurements and Selecting a Measurement Frame for more information.

Dependencies

To enable this port, under Rotation, select Quaternion.

Relative rotation, returned as a 3-by-3 matrix. See Rotational Measurements and Selecting a Measurement Frame for more information.

Dependencies

To enable this port, under Rotation, select Transform.

X-coordinate of the relative angular velocity, returned as a scalar. See Selecting a Measurement Frame for more information.

Dependencies

To enable this port, under Angular Velocity, select Omega X.

Y-coordinate of the relative angular velocity, returned as a scalar. See Selecting a Measurement Frame for more information.

Dependencies

To enable this port, under Angular Velocity, select Omega Y.

Z-coordinate of the relative angular velocity, returned as a scalar. See Selecting a Measurement Frame for more information.

Dependencies

To enable this port, under Angular Velocity, select Omega Z.

Relative angular velocity, returned as a 4-by-1 vector that equals the time derivative of the signal from port Q.

Dependencies

To enable this port, under Angular Velocity, select Quaternion.

Relative angular velocity, returned as a 3-by-3 matrix. The matrix equals the time derivative of the signal from port R.

Dependencies

To enable this port, under Angular Velocity, select Transform.

X-coordinate of the relative angular acceleration, returned as a scalar. This quantity equals the time derivative of the signal exported from port wx if the Measurement Frame parameter is not set to a non-rotating frame. See Measurement Frame and Selecting a Measurement Frame for more information.

Dependencies

To enable this port, under Angular Acceleration, select Alpha X.

Y-coordinate of the relative angular acceleration, returned as a scalar. This quantity equals the time derivative of the signal exported from port wy if the Measurement Frame parameter is not set to a non-rotating frame. See Measurement Frame and Selecting a Measurement Frame for more information.

Dependencies

To enable this port, under Angular Acceleration, select Alpha Y.

Z-coordinate of the relative angular acceleration, returned as a scalar. This quantity equals the time derivative of the signal exported from port wz if the Measurement Frame parameter is not set to a non-rotating frame. See Measurement Frame and Selecting a Measurement Frame for more information.

Dependencies

To enable this port, under Angular Acceleration, select Alpha Z.

Relative angular velocity, returned as a 4-by-1 vector that equals the second time derivative of the signal exported from port Q.

Dependencies

To enable this port, under Angular Acceleration, select Quaternion.

Relative angular acceleration, returned as a 3-by-3 matrix. The matrix equals the second time derivative of the signal exported from port R.

Dependencies

To enable this port, under Angular Acceleration, select Transform.

X-coordinate of the relative translation vector resolved in the Cartesian coordinate system, returned as a scalar.

Dependencies

To enable this port, under Translation, select X.

Y-coordinate of the relative translation vector resolved in the Cartesian coordinate system, returned as a scalar.

Dependencies

To enable this port, under Translation, select Y.

Z-coordinate of the relative translation vector resolved in the Cartesian coordinate system, returned as a scalar. Because the Z-coordinate exists in both the Cartesian and cylindrical coordinate systems, the Transform Sensor block only exposes one output port for both coordinate systems.

Dependencies

To enable this port, under Translation, select Z.

Radius coordinate of the relative translation vector resolved in the cylindrical coordinate system, returned as a scalar.

Dependencies

To enable this port, under Translation, select Radius.

Azimuth of the relative translation vector, returned as scalar. The angle falls in the range of [-π, π). The azimuth is undefined if the origins of the base and follower frames coincide with each other. Because the azimuth exists in both the cylindrical and spherical coordinate systems, the Transform Sensor block only exposes one output port for both coordinate systems.

Dependencies

To enable this port, under Translation, select Azimuth.

Radius coordinate of the relative translation vector resolved in the spherical coordinate system, returned as a scalar. The value equals the distance between origins of the base and follower frames.

Dependencies

To enable this port, under Translation, select Distance.

Inclination of the relative translation vector resolved in the spherical coordinate system, returned as a scalar. The angle falls in the range of [-π/2, π/2].

Dependencies

To enable this port, under Translation, select Inclination.

X-coordinate of the relative linear velocity resolved in the Cartesian coordinate system, returned as a scalar. The value equals the time derivative of the signal exported from port x if the Measurement Frame parameter is not set to a non-rotating frame. See Measurement Frame and Selecting a Measurement Frame for more information.

Dependencies

To enable this port, under Velocity, select X.

Y-coordinate of the relative linear velocity resolved in the Cartesian coordinate system, returned as a scalar. The value equals the time derivative of the signal exported from port y if the Measurement Frame parameter is not set to a non-rotating frame. See Measurement Frame and Selecting a Measurement Frame for more information.

Dependencies

To enable this port, under Velocity, select Y.

Z-coordinate of the relative linear velocity resolved in the Cartesian coordinate system, returned as a scalar. Because the Z-coordinate exists in both Cartesian and cylindrical coordinate systems, the Transform Sensor block only exposes one output port for both coordinate systems. The value equals the time derivative of the signal exported from port z if the Measurement Frame parameter is not set to a non-rotating frame. See Measurement Frame and Selecting a Measurement Frame for more information.

Dependencies

To enable this port, under Velocity, select Z.

Radius coordinate of the relative linear velocity resolved in the cylindrical coordinate system, returned as a scalar. The value equals the time derivative of the signal exported from port rad if the Measurement Frame parameter is not set to a non-rotating frame. See Measurement Frame and Selecting a Measurement Frame for more information.

Dependencies

To enable this port, under Velocity, select Radius.

The azimuth coordinate of the relative linear velocity, returned as a scalar. Because the azimuth coordinate exists in both the cylindrical and spherical coordinate systems, the Transform Sensor block only exposes one output port for both coordinate systems. The value equals the time derivative of the signal exported from port azm if the Measurement Frame parameter is not set to a non-rotating frame. See Measurement Frame and Selecting a Measurement Frame for more information.

Dependencies

To enable this port, under Velocity, select Azimuth.

The radius coordinate of the relative linear velocity resolved in the spherical coordinate system, returned as a scalar. The value equals the time derivative of the signal exported from port dst.

Dependencies

To enable this port, under Velocity, select Distance.

The inclination coordinate of the relative linear velocity resolved in the spherical coordinate system, returned as a scalar. The value equals the time derivative of the signal exported from port inc if the Measurement Frame parameter is not set to a non-rotating frame. See Measurement Frame and Selecting a Measurement Frame for more information.

Dependencies

To enable this port, under Velocity, select Inclination.

X-coordinate of the relative linear acceleration resolved in the Cartesian coordinate system, returned as a scalar. The value equals the second time derivative of the signal exported from port x if the Measurement Frame parameter is not set to a non-rotating frame. See Measurement Frame and Selecting a Measurement Frame for more information.

Dependencies

To enable this port, under Acceleration, select X.

Y-coordinate of the relative linear acceleration resolved in the Cartesian coordinate system, returned as a scalar. The value equals the second time derivative of the signal exported from port y if the Measurement Frame parameter is not set to a non-rotating frame. See Measurement Frame and Selecting a Measurement Frame for more information.

Dependencies

To enable this port, under Acceleration, select Y.

Z-coordinate of the relative linear acceleration resolved in the Cartesian coordinate system, returned as a scalar. Because the Z-coordinate exists in both Cartesian and cylindrical coordinate systems, the Transform Sensor block only exposes one output port for both coordinate systems. The value equals the second time derivative of the signal exported from port z if the Measurement Frame parameter is not set to a non-rotating frame. See Measurement Frame and Selecting a Measurement Frame for more information.

Dependencies

To enable this port, under Acceleration, select Z.

Radius coordinate of the relative linear acceleration resolved in the cylindrical coordinate system, returned as a scalar. The value equals the second time derivative of the signal exported from port rad if the Measurement Frame parameter is not set to a non-rotating frame. See Measurement Frame and Selecting a Measurement Frame for more information.

Dependencies

To enable this port, under Acceleration, select Radius.

Azimuth coordinate of the relative linear acceleration, returned as a scalar. Because the azimuth coordinate exists in both cylindrical and spherical coordinate systems, the Transform Sensor block only exposes one output port for both coordinate systems. The value equals the second time derivative of the signal exported from port azm if the Measurement Frame parameter is not set to a non-rotating frame. See Measurement Frame and Selecting a Measurement Frame for more information.

Dependencies

To enable this port, under Acceleration, select Azimuth.

Radius coordinate of the relative linear acceleration resolved in the spherical coordinate system, returned as a scalar. The value equals the second time derivative of the signal exported from port dst.

Dependencies

To enable this port under Acceleration, select Distance.

Inclination coordinate of the relative linear acceleration resolved in the spherical coordinate system, specified as a scalar. The value equals the second time derivative of the signal exported from port inc if the Measurement Frame parameter is not set to a non-rotating frame. See Measurement Frame and Selecting a Measurement Frame for more information.

Dependencies

To enable this port, under Acceleration, select Inclination.

Parameters

expand all

Frame used to resolve the measured vector quantities. See Selecting a Measurement Frame for more information.

Measurement Frame Types

Measurement FrameTypeDescription
WorldInertial FrameThe block resolves the measured vectors in the coordinates of the world frame.
BaseNon-Inertial FrameThe block resolves the measured vectors in the coordinates of the base frame. The base frame is the frame that connects to the frame port B. The resolved acceleration measurements involve centripetal and Coriolis terms if the base frame rotates.
FollowerNon-Inertial FrameThe block resolves the measured vectors in the coordinates of the follower frame. The follower frame is the frame that connects to the frame port F. The resolved acceleration measurements involve centripetal and Coriolis terms if the follower frame rotates.
Non-Rotating BaseInstantaneous FrameThe block maps the vectors resolved in the world frame to the non-rotating base frame. The non-rotating base frame is an instantaneous frame that is coincident and aligned with the base frame at the current time. The resolved acceleration measurements do not involve centripetal and Coriolis terms.
Non-Rotating FollowerInstantaneous FrameThe block maps the vectors resolved in the world frame to the non-rotating follower frame. The non-rotating follower frame is an instantaneous frame that is coincident and aligned with the follower frame at the current time. The resolved acceleration measurements do not involve centripetal and Coriolis terms.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Introduced in R2012a