Rotary Encoder - Incremental Rotary Encoder

Incremental Rotary Encoder

An incremental rotary encoder provides cyclical outputs (only) when the encoder is rotated. They can be either mechanical or optical. The mechanical type requires debouncing and is typically used as digital potentiometers on equipment including consumer devices. Most modern home and car stereos use mechanical rotary encoders for volume control. Due to the fact the mechanical switches require debouncing, the mechanical type are limited in the rotational speeds they can handle. The incremental rotary encoder is the most widely used of all rotary encoders due to its low cost and ability to provide signals that can be easily interpreted to provide motion related information such as velocity.

The fact that incremental encoders use only two sensors does not compromise their accuracy. One can find in the market incremental encoders with up to 10,000 counts per revolution, or more.

There can be an optional third output: reference or "index", which happens once every turn. This is used when there is the need of an absolute reference, such as positioning systems.

The optical type is used when higher speeds are encountered or a higher degree of precision is required.

Incremental encoders are used to track motion and can be used to determine position and velocity. This can be either linear or rotary motion. Because the direction can be determined, very accurate measurements can be made.

They employ two outputs called A & B, which are called quadrature outputs, as they are 90 degrees out of phase.

The state diagram:

Coding for
clockwise rotation
Phase A B
1 0 0
2 0 1
3 1 1
4 1 0
Coding for
counter-clockwise rotation
Phase A B
1 1 0
2 1 1
3 0 1
4 0 0

The two output wave forms are 90 degrees out of phase, which is all that the quadrature term means. These signals are decoded to produce a count up pulse or a count down pulse. For decoding in software, the A & B outputs are read by software, either via an interrupt on any edge or polling, and the above table is used to decode the direction. For example, if the last value was 00 and the current value is 01, the device has moved one half step in the clockwise direction. The mechanical types would be debounced first by requiring that the same (valid) value be read a certain number of times before recognizing a state change.

On encoders with detents there are different ways to switch states. In some, both A and B are always open circuit at the detents, and an entire 00 → 00 switching cycle occurs while transitioning from one detent to the next. Others have detents of alternating 00 and 11 value, with staggered switching times during the transition between detents.

If the encoder is turning too fast, an invalid transition may occur, such as 00 → 11. There is no way to know which way the encoder turned; if it was 00 → 01 → 11, or 00 → 10 → 11.

If the encoder is turning even faster, a backward count may occur. Example: consider the 00 → 01 → 11 → 10 transition (3 steps forward). If the encoder is turning too fast, the system might read only the 00 and then the 10, which yields a 00 → 10 transition (1 step backward).

This same principle is used in ball mice to track whether the mouse is moving to the right/left or forward/backward.

Rotary encoders with a single output cannot be used to sense direction of motion. They are well-suited for systems that measure rate-of-movement variables. In certain applications they may be used to measure distance of motion (e.g. feet of movement).

Read more about this topic:  Rotary Encoder