Main Content

Incremental Shaft Encoder

Behavioral model that converts angular position to electrical pulses

  • Incremental Shaft Encoder block

Simscape / Electrical / Sensors & Transducers


The Incremental Shaft Encoder block represents a device that converts information about the angular position of a shaft into electrical pulses. The block produces N pulses on ports A and B per shaft revolution, where N is the value you specify for the Pulses per revolution parameter. Pulses A and B are 90 degrees out of phase. If the shaft rotates in a positive direction, then A leads B. The block produces a single index pulse on port Z once per revolution. The Z-pulse positive transition always coincides with an A- pulse positive transition, and Z- pulse length is equal to the length for the A and B pulses. The voltages at ports A, B, and Z are defined relative to the Ref reference port voltage.

Use this block if you need to model the shaft encoder signals, either to support development of a decoding algorithm or to include the quantization effects. Otherwise, use the Ideal Rotational Motion Sensor block from the Simscape™ Foundation library.

Assumptions and Limitations

  • The Incremental Shaft Encoder block is not linearizable. For control design studies that require model linearization, use the Ideal Rotational Motion Sensor block from the Simscape Foundation library.



expand all

Mechanical rotational conserving port associated with the sensor positive probe.

Mechanical rotational conserving port associated with the sensor negative (reference) probe.

Encoded electrical output.

Encoded electrical output.

Index, or synchronization, electrical output.

Floating zero-volt reference.


expand all

Number of pulses produced on each of the A and B phases per revolution of the shaft.

Amplitude of the shaft encoder output voltage when the output is high.

Offset of the index pulse Z relative to the angle of the shaft at the start of the simulation. This parameter lets you set the initial location of the index pulse.

Extended Capabilities

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

Version History

Introduced in R2017b

See Also

Simscape Blocks