Main Content

Transform Sensor

Sensor that measures the relative spatial relationship between two frames

  • Transform Sensor block

Libraries:
Simscape / Multibody / Frames and Transforms

Description

The Transform Sensor block measures the relative spatial relationship between frames connected to ports F and B of the block. The measured quantities includes the relative pose, velocity, and acceleration. 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, R, seq
Quaternion derivativesQ and Qdd
Rotation-matrix derivativesRd and Rdd
Rotation sequence derivativesseqd
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 four parameterizations to express the measured rotations: angle-axis, quaternion, rotation matrix, and rotation sequence. To enable these parameterizations, in the block dialog box, under Rotation, select corresponding parameters. For example, select the Angle and Axis parameters to use the angle-axis parameterization or select the Quaternion, Transform, or Rotation Sequence parameter to use the quaternion, rotation matrix, or rotation sequence parameterization.

Also, the block has various parameterizations to express rotational velocities and accelerations: X-, Y-, and Z- coordinates; the time derivatives of a quaternion or rotation sequence; or matrix. To enable these parameterizations, you can select the corresponding parameters under Angular Velocity or Angular Acceleration. See Rotational Measurements for more information.

The settings of the Measurement Frame parameter and coordinate systems affect the translational measurements. 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 these coordinate systems. For simplicity purpose, in the images, specify the Measurement Frame parameter as Base.

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 of the measurement frame. The angle falls in the range of [-π, π).
ZThe projection of the vector BF on the Z-axis of 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, under Velocity, select the X, Y, and Z parameters.

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.

Relative rotation, returned as a 3-by-1 vector that contains the angles for the three successive elementary rotations that represent the rotation of the follower frame with respect to the base frame. The elements of the vector are in rad.

The setting of the Measurement Frame parameter does not affect the angles. The three rotations are about an intermediate frame and can be one of 12 different rotation sequences. See Rotation Sequence Measurements for more information.

Dependencies

To enable this port, under Rotation, select Rotation Sequence.

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.

Derivatives of the rotation sequence angles, returned as a 3-by-1 vector. The array elements are time derivatives of the output from the port seq. The velocities are in rad/s. The setting of the Measurement Frame parameter does not affect the measurements.

Dependencies

To enable this port, under Angular Velocity, select Rotation Sequence.

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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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.

Sequence of the rotation axis for three successive elementary rotations. See Rotation Sequence Measurements for more information.

Dependencies

To enable this parameter, under Rotation, select Rotation Sequence.

Extended Capabilities

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

Version History

Introduced in R2012a