Determining direction with quadrature signals

A quadrature signal consists of two waveforms that are normally slightly offset from each other. The offset allows us to tell whether something like a motor shaft or a rotating wheel is moving forward or backward. By comparing which signal leads or lags we can figure out the direction of movement.

Quadrature signals

Quadrature signals are commonly used in motion control systems to determine position and direction. These signals come from devices known as quadrature encoders, which generate two output waveforms, typically called Channel A and Channel B. These signals are sinusoidal or square waves that are phase shifted by 90 degrees, or one quarter of a cycle. This phase shift is where the term "quadrature" originates.

The two signals are in a fixed relationship, meaning that by analyzing their transitions, it is possible to derive information about movement. If Channel A leads Channel B, the movement is in one direction. If Channel B leads Channel A, the movement is in the opposite direction. This principle allows precise measurement of incremental position changes without ambiguity.

Quadrature signals are frequently found in rotary and linear encoders. They are used in automation, robotics, and industrial applications where precise motion tracking is required.

 

Full explanation of how you determine direction with quadrature signals

Determining direction using quadrature signals relies on the phase relationship between Channel A and Channel B. The following steps outline the process:

  • Observe signal transitions – The signals are square waves that toggle between high and low states. By detecting the transitions we can analyze the timing relationship between them.
  • Compare leading and lagging signals – If Channel A transitions from low to high before Channel B does, then Channel A is leading, meaning the motion is in one direction. Conversely, if Channel B transitions from low to high before Channel A, then Channel B is leading, indicating the opposite direction.
  • Use a quadrature decoder – A microcontroller or dedicated decoder circuit can process these signals and determine direction programmatically. By monitoring the sequence of rising and falling edges on both channels, the system can track movement in real time.
  • Count pulses to determine position – In addition to direction, the number of transitions across both channels provides positional information. The more pulses per revolution, the finer the resolution of the encoder.

For example, if a rotary encoder produces 1000 pulses per revolution (PPR), then every transition on Channel A or Channel B represents 1/1000th of a full rotation. By continuously counting and evaluating which channel is leading, the system maintains an accurate record of position and direction.

 

How does a quadrature encoder work?

A quadrature encoder converts rotational or linear motion into electrical signals that represent movement. There are several types of quadrature encoders, including optical, magnetic, and capacitive encoders, but they all operate on the same principle.

  • Sensing mechanism – An encoder consists of a moving disk, strip, or wheel with patterns that are read by a sensor. Optical encoders use a light source and a photodetector to detect patterns, while magnetic encoders rely on a magnet and a Hall effect sensor.
  • Signal generation – As the disk or wheel moves, the sensor detects alternating light or magnetic patterns, generating two square wave signals that are 90 degrees out of phase.
  • Processing by a controller – A microcontroller or a motion control system receives these signals and determines movement characteristics. This includes direction, speed, and position based on the number of transitions and their sequence.
  • Resolution and interpolation – The resolution of an encoder is determined by the number of transitions per revolution. Higher resolution encoders can track finer movements, making them ideal for precision applications such as CNC machines and robotic arms.

 

Benefits of using a quadrature encoder

Quadrature encoders provide several advantages in motion control and automation:

  • Accurate direction sensing – The phase relationship between the signals ensures reliable direction detection, making quadrature encoders suitable for bidirectional motion applications.
  • High resolution – By utilizing both channels and their transitions, quadrature encoders effectively quadruple the resolution of a single channel encoder. This results in finer position tracking.
  • Robust error detection – Many quadrature encoders include an optional third channel, called the index pulse, which provides a reference point per revolution. This helps correct any counting errors and ensures accurate position tracking.
  • Digital compatibility – Quadrature signals are easily processed by digital controllers, microprocessors, and PLCs, simplifying integration into automated systems.
  • Non-contact operation – Optical and magnetic encoders do not require physical contact between moving parts and sensors, reducing wear and increasing longevity.
  • Versatility – Quadrature encoders are used in various applications, including industrial automation, robotics, medical equipment, and consumer electronics, due to their precision and reliability.

Potential downsides of using a quadrature encoder

Despite their advantages, quadrature encoders have some limitations:

  • Signal noise and interference – Quadrature signals can be affected by electrical noise, which may cause false counts or errors. Shielded cables and proper grounding can help mitigate this issue.
  • Mechanical limitations – While non-contact encoders have longer lifespans, encoders with mechanical components (such as incremental encoders with bearings) can wear out over time.
  • Complexity in decoding – Unlike simpler encoders, quadrature encoders require specialized decoding hardware or software to interpret signals correctly. This adds some complexity to system design and implementation.
  • Cost considerations – High resolution quadrature encoders can be more expensive than simpler alternatives, making them a higher initial investment, especially for cost sensitive applications.
  • Vulnerability to contamination – Optical encoders, in particular, are susceptible to dust, dirt, and oil buildup, which can obstruct the sensor's ability to detect signal transitions. Regular maintenance is required in harsh environments.

The Timken range of quadrature signal encoders

  M9 Miniature Modular Magnetic Encoder

 

M11 Miniature Commutating Modular Magnetic Encoder

 M15 Modular Magnetic Encoder

 M15H High Resolution Modular Magnetic Encoder


 

MPS160 Multiplying Encoder ASIC

MPS512 Multiplying Encoder ASIC