Measuring the position of a rotating shaft, speed or direction of motion typically requires a rotary encoder. The two main types of encoding techniques are: absolute and incremental encoders.
The absolute encoding technique provides a specific and unique position value for every point of rotation when it is switched on. Absolute encoding is commonly achieved using either optical, magnetic or capacitive encoding discs, where each point on the disc indicates a unique point.
Optical encoder designs contain a light source (photoemitter) and photodetector or photoreceiver that provide a digital means of measuring displacement or velocity when an alternating opaque and translucent grid passes between them.
The unique design of an absolute optical encoder. Source: Exxelia
Typically, incremental encoders are less complex and lower cost than absolute encoders. In an incremental encoder, uniformly spaced apertures on a wheel allow logic circuitry to count the number of pulses in a given time frame to determine shaft velocity or angular displacement. Linear measurements of displacement and velocity are also possible but require two channels to achieve quadrature sensing.
Incremental optical encoder. Source: Understanding Smart Sensors.
In quadrature sensing, the relative positions of the output signals from two optical channels are compared. The two optical channels create electrical signals that are nominally 90° out of phase with each other. The two waveforms are in four equal quadrants, exactly 90° out of phase with each other. The detector is on when light is present and turns off when the web blocks the beam.
Quadrature detection. Source: Understanding Smart Sensors.