1. How do linear optical encoders work?

A linear optical encoder is a type of linear position sensor used for very high accuracy tracking of position and displacement of distances up to 100 meters. The optical encoder is formed of an optical read head and high accuracy scale. The scale has a reflective surface marked with equally spaced black (non-reflective) lines at intervals of 20-40 µm. The encoder read head contains a light source, optical grating and a photo detector (i.e. a light sensitive sensor). The grating pattern matches the scale’s line pattern so that the average light amplitude passing through the grating varies sinusoidally as the read head scans along the scale (as depicted in the drawing). The photo detector generates a sine wave output, from which position is determined by counting the number of peaks and troughs of the sine wave. The precise optical principal is more complex because the light diffracts as it passes through the grating. However, the description provided is sufficient for most process engineers.

Illustration of optical magnetic encoder


So far we have explained how the encoder tracks position. However, many applications require that direction (i.e. forwards or backwards) is also tracked. To determine direction, an additional photo detector is built into the read head, positioned so that its output signal is 90° out of phase with that of the original detector. The two out of phase signals are known as channel A and channel B. When the encoder transverses in one direction, channel A rises before channel B. When the direction of motion is switched, channels B rises before channel A. By detecting which channel is leading, the direction of motion can be deduced. The second channel also increases the spatial resolution of the encoder. The two channels, A and B, are pictured below as square waves.

Incremental encoder A and B channel square wave outputs

Signal interpolation

The scale’s line spacing is typically 20-40 µm, providing only moderate resolution. To increase resolution, the instantaneous voltage is measured at regular intervals along the sine wave. The encoder interpolates instantaneous position by calculating the inverse sine of the normalized voltage. Position is interpolated a fixed number of times per sine wave and a high frequency square wave output is generated, coinciding with the signal interpolations. The number of interpolation points per wavelength varies between encoder models and may be programmable. Optical encoders typically have 4 to 100 interpolations per wavelength, though many are capable of performing 1000’s. Note: Use of large interpolation factors decreases the encoders maximum operating speed.

Encoder sine wave signal interpolation

Incremental vs Absolute encoders

The encoder described so far measures displacement as a series of high-resolution pulses but does not store absolute position. Such encoders are known incremental encoders. To obtain absolute position, position must be tracked by the proccess controller which does so by starting at a reference position and updating its stored position with each pulse received from the read head. Missing a pulse (e.g. due to moving too rapidly) causes an error in the absolute position stored by the process controller. Moreover, if the system is switched off, the process controller loses its absolute position and must therefore return to a known position (e.g. a proximity switch) on start-up.

An encoder capable of tracking its absolute position on the scale is known as an absolute encoder. To enable tracking of absolute position, an additional row of lines is included on the scale and read by an additional photo detector inside the read head. The additional row of lines are of non-uniform and unique spacing such that each small section of lines represents a unique location on the scale (similar to a supermarket barcode). Every time that absolute position is determined, the encoder outputs its position to the proccess controller as a digital signal. Absolute encoders still provide an incremental sine or square wave output because the absolute position is determined at a lower spatial resolution than the incremental position. On start-up, some optical encoders must move a small distance in order to detect the absolute position. Other optical encoders are capable of simultaneously scanning multiple lines and are therefore capable of reading absolute position whilst remaining stationary.

Absolute optical encoder scale

2. General characteristics of linear optical encoders

Linear optical encoders are medium priced sensors that can accurately measure distance over a wide range of lengths (full scale range of 0.1-100 meters). They provide extremely high spatial resolution up to 1 nm and operate at velocities up to 100 m/s. However, over long distance overall accuracy is significantly lower than resolution. Furthermore, the practical limit on the speed of the electronics means that operating at extremely high-resolution severely limits the maximum linear velocity. There is no physical contact or wear between the encoder read head and scale, resulting in a long lifetime. However, optical encoders have a low ingress protection and so, with the exception of sealed encoders, cannot operate in an environment where there is a risk of contamination by liquids or solid debris. Optical encoders can be negatively effected by background light sources. Optical encoders may be of either incremental or absolute type. Absolute encoders are limited to maximum scale lengths of about 10 meters because of the number of bits required to code the unique absolute position information.

3. Input and output signals

Linear optical encoders typically require a 5-24 Vdc supply voltage. Incremental encoders without signal interpolation output two 90° out of phase sine waves (known as channels A and B) with wavelengths equal to the line spacing on the scale. Incremental optical encoders with built-in signal interpolation generate a pair of 90° out of phase square waves of significantly higher spatial resolution (up to 1 nm). Incremental encoders include reference lines at equal increments (about 50 mm), known as the Z channel. The incremental encoder may also include the inverse of each channel (A-, B- and Z-) for verification purposes. Absolute encoders output a digital signal describing the absolute position, in addition to a two channel (A and B) square or sine wave signal.

A, B and Z channels of an incremental encoder

4. Applications of linear optical encoders

Optical encoders are widely used in a range of linear motion applications due to their high-resolution, large measurement range and compact size. They are preferred over magnetic encoders in very high-resolution linear motion applications such as machines for electronics and semiconductor manufacturing. Furthermore, sealed optical encoders can be used in environments where potential contaminants are present e.g. in laser cutting or CNC milling machines.

5. Typical specification

CostLow to medium
Measurement range0-0.1 to 0-100 m
Resolution1-5,000 nm
Velocity 0.05-100 m/s (depending on resolution)
LifetimeVery high
Ambient temperature: 0 to 70 °C
Supply voltage5-24 Vdc
Output signalsine or square wave (incremental) or digital (absolute)
Vibration resistance30 g
Shock resistance100 g
Ingress protectionIP40 (IP67 if sealed)
Passive / active Active
Contact / non-contact non-contact

6. Purchasing tips

  • Incremental vs absolute encoders: Optical encoders detect either relative (i.e. incremental) or absolute position. Incremental encoders are of lower cost because only one photo detector is needed inside the read head. Absolute encoders may be required when position must be determined on start-up without movement. Furthermore, absolute encoders reduce the danger of missing a pulse, which would otherwise result in a discrepancy between the actual position and the position stored in the proccess controller
  • Line spacing: The line spacing is the distance between successive lines on the encoder scale. Line spacing, (typically 20-40 µm), is the true spatial resolution of the encoder.
  • Cable length: Using Long sensor cables limits the operating frequency of the encoder read head and therefore reduces the maximum linear operating speed. Cable length can be minimized by placing the proccess controller on the moving assembly, along with the read head. If this is not possible, then place the controller near the center of the scale so that that the cable length can be limited to slightly more than half of the scale length.
  • Sine vs square wave output and interpolation: Optical encoders output either a high frequency interpolated square wave signal or a low frequency uninterpolated sine wave signal. A sine wave output gives the user maximum flexibility in deciding how to interpolate the signal. However, external signal interpolation requires additional high speed electronics.
  • Ride height: The ride height is the gap between the scale and the read head. An air air gap of 0.1-1 mm is normally required.
Optical encoder ride height
  • Sealed encoders: It is possible to purchase encoders mounted to a linear rail, contained within a sealed enclosure. Sealed encoders have higher ingress protection, typically between IP53 and IP67. Furthermore, they are easier to install as they ensure that the correct ride height is maintained. The drawback of sealed encoders is that they are only available in lengths of up to about 3 meters.
  • Resolution vs velocity: Many incremental encoders include variable interpolation factors i.e. variable resolution. However maximum operating speed is inversely proportional to resolution and therefore a trade off must be made.

7. Advantages of optical encoders

Linear optical encoders:

  • Posses a large measurement range (scales available from 0.1 to 100 meters), similar to that of magnetic encoders.
  • Have extremely high spatial resolution of up to 1 nm due to the combination of closely spaced lines and signal interpolation.
  • Have a long lifetime, owing to the fact they are non-contact sensors and therefore do not experience any mechanical wear.
  • Have very small read heads, often making them a more suitable choice than rod type position sensors, which reach lengths over twice their full scale measurement range when fully extended.

8. Disadvantages of optical encoders

Linear optical encoders:

  • Incremental encoders cannot determine absolute position. However, absolute encoders are costly and limited to a measurement range of about 10 meters. The shorter range is a result of the number of bits required to code absolute position information.
  • Are susceptible to disturbance from external light sources and contamination with liquid or debris (with the exception of sealed encoders).
  • With the exception of sealed encoders, linear optical encoders are typically more difficult to install than rod type position sensors because of the need for accurate alignment between the read head and scale.
  • Consume more power than magnetic encoders and most other types of position sensors due to their high frequency electronics

9. Application tips

  • Temperature compensation: Optical encoder scales are subject to thermal expansion of 10-18 µm/m/°C. A 20 meter long scale with a thermal expansion coefficient of 18 µm/m/°C, subject to a 10 °C temperature increase will undergo a 3.6 mm increase in length! The expansion can be compensated for inside the proccess controller.
  • Scale minimum bend radius: Ignoring the minimum scale bend radius provided by the manufacturer is likely to cause damage to the scale. This may increase the chance of the encoder read head skipping lines of the scale
  • Accuracy and resolution: Encoder accuracy is significantly lower than resolution. This is because of limits on the accuracy with which scales can be manufactured as well as errors caused by thermal expansion.