What is an encoder?

An encoder is a sensor that converts motion, such as the angular position of a shaft or displacement along a straight line, into an electrical signal from which a PLC, motion controller or drive can derive position, speed and direction of rotation. Encoders provide the feedback that a closed control loop needs to stop an axis at exactly the right place. They are found in virtually every machine with motion control: from servomotors and CNC machining centres to robots, packaging machines and conveyors across industrial automation.


🧠 How does an encoder work?

An encoder consists of a measuring scale (a disc on the shaft or a scale along the travel path), a scanning head and electronics that turn the raw signal into a usable output. The measuring principle largely determines accuracy and robustness:

Measuring principle How it works Strength Weakness
Optical A light source shines through or onto a disc or scale with fine graduations Highest resolution and accuracy Sensitive to dirt, condensation and shock
Magnetic A Hall or magnetoresistive sensor reads a magnetised ring or strip Robust against dust, oil and vibration Usually lower accuracy than optical
Inductive / capacitive Measures changes in an electromagnetic field or capacitance Insensitive to contamination, compact Less common, often in motor feedback and specific applications
Mechanical (contact) Wiper contacts on a code disc Cheap Wear and contact bounce; rare in industry

A further distinction is made between rotary encoders (with a solid shaft or hollow shaft) and linear encoders (glass scale or magnetic tape), for example on the axes of a CNC machine. A related device is the resolver: a rugged analogue angle sensor that uses windings instead of a code disc and is popular in harsh conditions.


πŸ”„ What is the difference between an incremental and an absolute encoder?

An incremental encoder outputs pulses when it moves. Two channels, A and B, are 90Β° out of phase (quadrature): which channel leads tells the direction of rotation, and the pulse frequency gives the speed. An optional Z channel (index) gives one pulse per revolution as a reference point. By counting every edge of A and B (quadruple evaluation, x4), an encoder with 1,024 pulses per revolution (PPR) yields 4,096 steps, or roughly 0.088Β° per step. After a power loss the position is unknown, so the machine first has to perform a reference run (homing).

An absolute encoder provides a unique code for every angular position, so the position is known immediately after power-up. The code disc often uses Gray code: only one bit changes per step, so a small alignment error can never cause a large jump in the reading. Frank Gray of Bell Labs filed a patent on it in 1947, granted in 1953.

  • Single-turn - unique within one revolution; 17 bits means 131,072 positions per revolution, and servomotor encoders often reach 20 bits or more.
  • Multi-turn - additionally counts the number of revolutions, for example 12 bits for 4,096 revolutions. Counting is done with a gear train, a backup battery or energy harvesting with a Wiegand wire, which generates enough energy on every revolution to update the counter without a battery.
Characteristic Incremental Absolute single-turn Absolute multi-turn
Position after power-up Unknown, homing needed Known within one revolution Fully known
Typical output A/B/Z pulses (TTL, HTL) Serial or fieldbus Serial or fieldbus
Complexity and price Low Medium Higher
Typical application Speed measurement, conveyors Rotary tables, valve positions Robot axes, servo axes, long linear axes

πŸ”Œ Which signals and interfaces do encoders use?

Two things are often confused with encoders: the electrical level of incremental pulses and the protocol used to transmit an absolute position.

Interface Kind Characteristic
TTL / RS-422 Incremental, differential 5 V, signals A and /A and so on; highly noise-immune and suited to high frequencies
HTL (push-pull) Incremental 10–30 V, connects directly to the 24 V inputs of a PLC
Sin/cos 1 Vpp Analogue incremental Sine signals that the controller interpolates to very high resolution
SSI Serial absolute Developed by Stegmann in 1984; clock and data over RS-422, typically 100 kHz to 2 MHz
BiSS C Serial absolute, open Open protocol introduced by iC-Haus in 2002; C mode is bidirectional, carrying position and parameters at the same time
EnDat 2.2 Serial absolute Heidenhain; digital and bidirectional, widely used in machine tools
HIPERFACE DSL Serial absolute SICK; two wires inside the motor cable (one-cable technology)
Fieldbus / Ethernet Network Encoder profile PI 3.162 for PROFIBUS and PROFINET, CiA 406 for CANopen, also EtherCAT and IO-Link

Encoders with their own network connection use standardised device profiles. The PROFIBUS/PROFINET encoder profile (version 4.2) uses PROFIdrive telegrams 81 to 84 and, since that version, also defines safe position values via PROFIsafe. The CANopen profile CiA 406 covers rotary and linear, incremental and absolute encoders. This lets you swap in an encoder from another vendor without rewriting the PLC program. Read more about the networks under fieldbuses and Industrial Ethernet.


πŸ›  How do you select and install an encoder?

A practical five-step approach:

  1. Define the function - speed only (incremental is enough) or position that must survive a power failure (absolute, and multi-turn when the axis makes several revolutions).
  2. Calculate resolution and frequency - at 2,048 PPR and 3,000 rpm the output frequency is 2,048 Γ— 3,000 / 60 = 102.4 kHz. Check that both the encoder (many datasheets state up to about 300 kHz) and the counter input of the PLC or IO card can handle it; standard digital inputs are far too slow.
  3. Match the signal to the receiver - HTL for simple 24 V counter cards, RS-422 for long cables and high frequencies, a serial or network interface for servo axes.
  4. Mechanics and environment - solid shaft with a coupling or hollow shaft with a torque arm; ingress protection per the IP Code, often IP65 or IP67, plus shock and vibration resistance.
  5. Cabling and EMC - shielded twisted-pair cable, shield bonded all round, and encoder cables routed separately from the motor cables of a variable frequency drive. Interference shows up as counting errors or β€œjumping” positions.

In practice, counting errors from poor shielding, slipping couplings and contaminated optical discs are the most common causes of faults. Diagnostic information from modern encoders, such as signal quality, temperature and operating hours, helps to spot them early.


🏭 Where are encoders used?

  • Servo axes - position and speed feedback for servomotors and drives
  • Stepper motors - detection of lost steps on a stepper motor in closed-loop design
  • Variable frequency drives - vector control with feedback for accurate torque at low speeds
  • Conveying and logistics - speed measurement and product tracking on conveyors
  • Packaging machines - synchronisation of rolls, knives and labellers
  • CNC and robotics - linear glass-scale encoders on machine axes and absolute encoders in every robot joint
  • Control loops - Real-time feedback for a PID controller or a position loop in the motion controller

πŸ” What role do encoders play in functional safety?

When a machine uses safe motion functions, such as safely limited speed or safe standstill monitoring, the position or speed measurement must be dependable too. For this purpose there are safety encoders certified to IEC 61508 and ISO 13849-1, typically up to SIL 2 or 3 and PL d or e respectively. They monitor their own signals internally or provide two independent channels, which a safety PLC or safe drive compares.

For machine builders in the EU this falls under functional safety and the Machinery Directive, which will be replaced from 20 January 2027 by the Machinery Regulation (EU) 2023/1230. A standard encoder cannot simply be included in a safety function: the designer must demonstrate fault detection, for example for a coupling that has come loose.


🌐 How do encoders fit into IT/OT convergence?

Networked encoders with IO-Link, PROFINET or EtherCAT deliver more than position alone: they also provide diagnostics, operating hours, temperature and signal-quality warnings. Through the controller and OPC UA, that data can flow into condition monitoring and predictive maintenance. A contaminated disc or a wearing bearing is then flagged before the machine stops.


❓ Frequently asked questions

What is the difference between an encoder and a resolver?

An encoder measures position with a code disc or scale and delivers digital pulses or a digital position value. A resolver is an analogue angle sensor with windings and no electronics in the measuring part, which makes it very robust against heat, shock and contamination. Encoders usually achieve higher resolution, while resolvers are chosen for harsh conditions.

What does PPR mean on an encoder?

PPR stands for pulses per revolution: the number of pulses an incremental encoder outputs on channel A per revolution. With quadruple evaluation of channels A and B, the controller counts four steps per pulse, so 1,000 PPR gives 4,000 counts per revolution. For absolute encoders, resolution is expressed in bits, for example 17 bits for 131,072 positions.

Why choose an absolute encoder instead of an incremental one?

An absolute encoder knows its position immediately after power-up, so a machine can resume after a power failure without a reference run. That saves time and prevents collisions on axes that cannot move freely to a limit switch, such as robot arms. An incremental encoder is simpler and cheaper and is sufficient when only speed or relative displacement is needed.

Can I connect an encoder directly to a PLC?

An incremental HTL encoder can be wired to a 24 V counter input or high-speed counter on a PLC, provided it can handle the pulse frequency. A TTL encoder requires an RS-422 input, and you connect absolute encoders through an SSI module or directly over a fieldbus such as PROFINET, EtherCAT or IO-Link. Ordinary digital inputs are usually too slow for encoder pulses.

What is a multi-turn encoder?

A multi-turn encoder is an absolute encoder that tracks not only the angle within one revolution but also the number of revolutions, even when power is lost. It does so with a gear train, a backup battery or energy harvesting from a Wiegand wire. Multi-turn encoders are used on axes that make several revolutions, such as spindles and linear axes driven by a ball screw.

Why is my encoder producing counting errors?

Counting errors from an encoder are usually caused by electromagnetic interference, a pulse frequency too high for the input, or mechanical slip. Check the shielding and earthing of the cable, the distance to motor cables from variable frequency drives, the maximum input frequency and the coupling between the encoder and the shaft. With optical encoders, a contaminated code disc can also be the cause.


πŸ“Œ In summary

An encoder translates mechanical motion into a signal a controller can process. The choice between incremental and absolute, between TTL, HTL, a serial interface or a fieldbus, and between a standard and a safety-rated version determines how accurately, robustly and safely a machine moves. With networked encoders, the encoder also becomes a source of diagnostic data for maintenance and analytics.

An encoder is the sense organ of every controlled motion: without reliable position and speed feedback there is no precise motion control, robotics or safe machine.