If you aren’t familiar with quadrature encoding then it may sound like a complicated topic term that you will never need. In truth, you probably use some form of quadrature encoding device every day without knowing it, and it may even save your life. If you are building a computer-based arcade cabinet, robotic device or a host of other things that move, it is something worthwhile to understand.
Despite the semi-scary sounding word, quadrature encoding is simply one of the most common output formats from a sensing device that measures speed and direction. Some common applications include the scroll wheel on a mouse, a trackball, and even in many vehicles to measure parameters such as tire rotation speed or slip, like what is used for anti lock brakes.
A quadrature encoder is one that measures both speed and direction, typically a rotational movement although the same principle would work for linear movements. A quadrature output has two outputs often labeled A and B, as well as a common connection. These two outputs send pulses in the form of a square wave such that they are 90 degrees out of phase. The term "quadrature" in electronics simply refers to two signals being separated by 90 degrees of phase, hence the name.
The frequency of the square wave determines speed while the phase difference is used to determine direction. In practice this is simply two switches of some form turning on and off in a particular sequence. There are a number of ways to produce a quadrature output, some of the more common are optical, magnetic and mechanical, although other methods can be used.
Although encoders are constructed in many ways for the purpose of explanation, imagine a simple mechanical encoder. The encoder would consist of two push buttons sitting next to each other like you might find on a computer mouse or keyboard. If you were to slide your finger across the two buttons, such that it pushes down one and then the next button, it would produce the same sort of output. The direction can be determined by which button is pushed first and second, and likewise what order they are released in. The speed is determined by how fast this sequence is repeated. In a rotary encoder the buttons are operated by a disk that contains raised portions that buttons as it spins.
This same principle can be used with optical encoders, where a disk with lots of slots is used and two sensors measure the light passing through. Magnetic versions measure teeth on a metallic gear as it passes.
No matter the method, the output is the same: two square waves that are 90 degrees out of phase, which provide all you need to figure out speed and direction. This simple technique has been used for a long time and in devices used every day, from controlling your computer to keeping you safe on the road.