What are Quadrature Encoders

  • strict warning: Non-static method view::load() should not be called statically in /home/bigge1973/webapps/cr1/sites/all/modules/views/views.module on line 906.
  • strict warning: Declaration of views_handler_filter::options_validate() should be compatible with views_handler::options_validate($form, &$form_state) in /home/bigge1973/webapps/cr1/sites/all/modules/views/handlers/views_handler_filter.inc on line 607.
  • strict warning: Declaration of views_handler_filter::options_submit() should be compatible with views_handler::options_submit($form, &$form_state) in /home/bigge1973/webapps/cr1/sites/all/modules/views/handlers/views_handler_filter.inc on line 607.
  • strict warning: Declaration of views_handler_filter_boolean_operator::value_validate() should be compatible with views_handler_filter::value_validate($form, &$form_state) in /home/bigge1973/webapps/cr1/sites/all/modules/views/handlers/views_handler_filter_boolean_operator.inc on line 159.
  • strict warning: Declaration of views_plugin_row::options_validate() should be compatible with views_plugin::options_validate(&$form, &$form_state) in /home/bigge1973/webapps/cr1/sites/all/modules/views/plugins/views_plugin_row.inc on line 134.
  • strict warning: Declaration of views_plugin_row::options_submit() should be compatible with views_plugin::options_submit(&$form, &$form_state) in /home/bigge1973/webapps/cr1/sites/all/modules/views/plugins/views_plugin_row.inc on line 134.

Quadrature Encoders are handy sensors that let you measure the speed and direction of a rotating shaft (or linear motion) and keep track of how far you have moved.

A quadrature encoder normally has at least two outputs - Channel A and B - each of which will produce digital pulses when the thing they are measuring is in motion. These pulses will follow a particular pattern that allows you to tell which direction the thing is moving, and by measuring the time betewwn pulses, or the number of pulses per second, you can also derive the speed.

Let's start with an animation showing how the quadrature encoder inside the HUB-ee wheels works.

Quadrature Animation

This animation shows what it is like inside our HUB-ee wheels. They have a black and white reflective code wheel inside the wheel rim, and the PCB has a pair of reflective sensors that point at the code wheel. These sensors have just the right spacing between them, and relative to the stripes on the wheel, to produce the pattern of pulses you see in the animation.

In technical terms these pulses are 90 degrees out of phase meaning that one pulse always leads the other pulse by one quarter of a complete cycle (a cycle is a complete transition from low -> high -> low again.

The order in which these pulses occur will change when the direction of rotation changes. The two diagrams below show what the two pulse patterns look like for clockwise and counter clockwise rotation.

quadrature diagram

So how do you actually work out the direction?

Lets start with channel A at the top (clockwise rotation):

1 Channel A goes from LOW to HIGH
2 Channel B is LOW
You are going CLOCKWISE!

Now take a look at channel A when going counter clockwise:

1 channel A goes from LOW to HIGH
2 Channel B is HIGH

Forum Submit