Motion sensor in mechanical rotational systems
Simscape / Foundation Library / Mechanical / Mechanical Sensors

The Ideal Rotational Motion Sensor block represents an ideal mechanical rotational motion sensor, that is, a device that converts an across variable measured between two mechanical rotational nodes into a control signal proportional to angular velocity or angle. You can specify the initial angular position (offset) as a block parameter.
The sensor is ideal since it does not account for inertia, friction, delays, energy consumption, and so on.
Connections R and C are mechanical rotational conserving ports that connect the block to the nodes whose motion is being monitored. Connections W and A are physical signal output ports for velocity and angular displacement, respectively.
The block positive direction is from port R to port C. This means that the velocity is measured as ω = ωR – ωC, where ωR, ωC are the absolute angular velocities at ports R and C, respectively.
The Wrap angle to [0, 2*pi] parameter lets you control the
angular displacement output range. When set to On, it keeps
angular displacement within the range from 0 to 2π radians (360 degrees), regardless of
the number of revolutions performed by the object and the direction of rotation. When
set to Off, the output range is unrestricted.
The figure demonstrates the difference between the two options.

In this example, the object is moving at 6 rad/s in the positive direction for the
first 5 seconds, and then switches to the negative direction at the same speed. The
default angular displacement output (line 1) shows that the object turned forward by 30
rad and then turned back in the negative direction, continuing until –20 rad. If you set
Wrap angle to [0, 2*pi] to On, the
output (line 2) stays in the range from 0 to 2π rad.
Setting the Wrap angle to [0, 2*pi] parameter to
On simplifies development of models with complex
relationship between model parameters and rotation angle, such as pumps and
motors.