Curious Minds

Clear answers to science and history questions

Incremental Encoder: How It Works and Why It Matters

· 6 min read · Science

An incremental encoder works by converting rotary or linear motion into a series of electrical pulses, where each pulse represents a fixed increment of movement. It typically uses a light source and a photodetector array to sense a patterned disk or scale, producing two square-wave signals (A and B) that are 90 degrees out of phase, plus an optional index pulse (Z) once per revolution. The number of pulses per revolution (PPR) determines the resolution, and the phase relationship between A and B indicates direction of rotation.

Background: What Is an Incremental Encoder?

An incremental encoder is an electromechanical device that measures relative motion rather than absolute position. Unlike an absolute encoder, which outputs a unique code for every shaft position even after power loss, an incremental encoder only reports changes. This means that on power-up, the system must establish a reference point—often by moving to a home position or using the index pulse—before it can know the actual position. Incremental encoders are widely used in motor control, robotics, CNC machinery, and conveyor systems because they are simple, robust, and cost-effective for speed and direction feedback.

The core components include a light-emitting diode (LED), a photodetector array, and a disc or linear scale with alternating opaque and transparent slots. As the disc rotates, the light beam is interrupted, generating a pulse train. The resolution is defined by the number of slots per revolution (for rotary) or per unit length (for linear). Common resolutions range from a few hundred to several thousand pulses per revolution; higher resolutions provide finer measurement but require more careful signal processing.

How It Works: The Pulse Generation Process

The operation of an incremental encoder can be broken down into a sequence of steps:

  1. Light emission: An LED shines a beam through a lens or directly onto the coded disc.
  2. Disc rotation: The disc, attached to the shaft, rotates with the motion being measured. Its pattern of slots and bars modulates the light.
  3. Photodetection: On the other side of the disc, photodetectors (often phototransistors) receive the interrupted light and convert it into electrical current.
  4. Signal conditioning: The raw signals are amplified and shaped into clean square waves, typically by a comparator circuit. This produces the A and B channels.
  5. Quadrature output: The A and B channels are offset by 90 electrical degrees. By monitoring which channel leads, the direction of rotation is determined. For example, if A leads B, the shaft is rotating clockwise; if B leads A, counterclockwise.
  6. Index pulse (optional): A third channel, Z, provides a single pulse per revolution to mark a home position, enabling repeatable referencing.

The frequency of the output pulses is directly proportional to speed. For a rotary encoder with N pulses per revolution, the output frequency f (in Hz) at a rotational speed of n revolutions per minute is f = (N × n) / 60. This relationship is fundamental for speed measurement and position tracking.

Signal Types and Output Circuits

Incremental encoders are available with several output configurations to suit different controllers:

  • Open collector: The output transistor's collector is left open, requiring an external pull-up resistor. This allows interfacing with various logic levels but limits cable length and speed.
  • Push-pull (totem-pole): Provides active high and low outputs, offering better noise immunity and faster switching, but cannot be wire-ORed.
  • Line driver (differential): Outputs complementary signals (A, A/, B, B/, Z, Z/) using RS-422 or similar standards. This is the most robust option for long cables and noisy environments, as the receiver rejects common-mode noise.

Additionally, some encoders offer sinusoidal outputs (1 Vpp) for high-resolution interpolation, but the majority use digital square waves. The choice depends on cable length, noise, and the input requirements of the motion controller.

Resolution, Accuracy, and Quadrature Decoding

Resolution is often expressed in pulses per revolution (PPR) or counts per revolution (CPR). With quadrature decoding, the effective resolution can be multiplied. There are three common decoding methods:

  • X1 decoding: Counts each rising edge of channel A only, yielding N counts per revolution.
  • X2 decoding: Counts both rising and falling edges of channel A, yielding 2N counts per revolution.
  • X4 decoding: Counts all edges of both A and B, yielding 4N counts per revolution. This is the most common method in modern controllers.

For example, a 1000 PPR encoder with X4 decoding provides 4000 counts per revolution. It's important to note that resolution (the smallest measurable increment) is not the same as accuracy (how close the measured position is to the true position). Accuracy is affected by mechanical mounting, disc eccentricity, and signal quality. A high-resolution encoder can still be inaccurate if poorly installed.

Common Problems and Troubleshooting

Incremental encoders are reliable, but several issues can arise:

  • Noise and interference: Long cables or nearby motors can induce noise, causing false pulses. Use shielded twisted-pair cables, proper grounding, and differential line drivers.
  • Signal distortion: Excessive cable capacitance or incorrect termination can round off square waves, leading to counting errors. Keep cable lengths within specifications and use termination resistors if required.
  • Mechanical misalignment: Shaft misalignment or excessive axial load can damage bearings or cause disc wobble, resulting in erratic signals. Use flexible couplings and ensure proper mounting.
  • Contamination: Dust, oil, or moisture can block the optical path. Choose encoders with appropriate IP ratings for the environment.
  • Missing index pulse: If the Z channel is not functioning, homing routines fail. Check wiring and alignment of the index slot.

Regular maintenance and correct installation are key to avoiding these problems.

Incremental vs. Absolute Encoders

The fundamental difference is that incremental encoders report relative movement, while absolute encoders report a unique position code at all times. Absolute encoders do not require homing after power-up and can detect position even if movement occurred while powered down. However, they are generally more complex and expensive. Incremental encoders are simpler, often smaller, and sufficient for many applications where a reference point can be established at startup. For tasks like emergency stop recovery or multi-turn positioning without power, absolute encoders are preferred.

Frequently Asked Questions

What does PPR mean on an encoder?

PPR stands for pulses per revolution. It indicates how many pulses the encoder outputs for one full rotation of the shaft. Higher PPR means finer resolution for measuring position or speed.

Can an incremental encoder measure absolute position?

No, it only measures relative movement. To determine absolute position, the system must establish a reference point, typically by moving to a home position or using the index pulse, and then count pulses from there.

What is the purpose of the Z channel?

The Z channel, or index pulse, provides a single pulse per revolution to mark a specific shaft position. It is used for homing and to verify position after power-up.

How do I determine the direction of rotation?

Direction is determined by the phase relationship between channels A and B. If A leads B, the rotation is in one direction; if B leads A, it is in the opposite direction.

What is quadrature decoding?

Quadrature decoding is a technique that uses both edges of both A and B channels to increase resolution. X4 decoding, for example, multiplies the PPR by four.

Why does my encoder count erratically?

Erratic counting is often caused by electrical noise, poor grounding, cable issues, or mechanical problems like misalignment. Check wiring, shielding, and mounting first.

In this article
  1. Background: What Is an Incremental Encoder?
  2. How It Works: The Pulse Generation Process
  3. Signal Types and Output Circuits
  4. Resolution, Accuracy, and Quadrature Decoding
  5. Common Problems and Troubleshooting
  6. Incremental vs. Absolute Encoders
  7. Frequently Asked Questions