An encoder is a position sensor that converts mechanical motion into a digital signal, reporting how far a shaft has rotated or a carriage has traveled. In robotics, encoders are the most common proprioceptive sensors: they tell a robot where its own joints, wheels and actuators are, which makes them the foundation of closed-loop motion control, odometry and safe manipulation.
Unlike exteroceptive sensors such as LiDAR or a depth camera, which observe the environment, an encoder measures only the machine itself. Its output feeds the position and velocity loops of servo drives, the kinematic models of robot arms and the dead-reckoning estimates of mobile platforms, often hundreds or thousands of times per second.
How an encoder turns motion into counts
Every encoder combines a patterned scale with a read head that detects how the pattern moves past it. On a rotary encoder the scale is a disk or ring attached to the shaft; on a linear encoder it is a strip mounted along the axis of travel. The read head converts each pattern transition into an electrical edge, and the electronics turn those edges into counts per revolution or counts per millimeter.
Most incremental encoders output two square-wave channels, A and B, offset by 90 electrical degrees. This quadrature signal lets the receiver determine direction from which channel leads, and counting both edges of both channels yields four counts per line, so a 1,000-line disk delivers 4,000 counts per revolution. An optional index pulse (Z channel) appears once per turn and serves as a reference mark during homing.
The sensing principle determines accuracy, robustness and cost. The following table compares the main technologies used in robots.
| Technology | Working principle | Typical strengths | Typical weaknesses |
|---|---|---|---|
| Optical | LED light through or off a slotted or etched disk onto photodetectors | Very high resolution and accuracy | Sensitive to dust, oil and condensation |
| Magnetic | Hall or magnetoresistive sensors read a magnetized ring or a diametric magnet | Robust, compact, tolerant of contamination | Lower accuracy, affected by stray fields |
| Capacitive | Electrode patterns change capacitance as the rotor turns | Low power, good resolution, small size | Needs careful shielding from electrical noise |
| Inductive | Coils on a circuit board detect a conductive target | Very robust to dirt, shock and temperature | Larger sensor area, moderate resolution |
Incremental and absolute encoders
The most important design choice is whether the encoder reports relative movement or absolute position. An incremental encoder only counts changes, so the controller must establish a reference after power-up by homing against a limit switch or the index pulse. An absolute encoder assigns a unique code to every position, usually in Gray code or a serial data word, so the robot knows its pose the moment it is switched on.
Absolute encoders come as single-turn devices, which resolve one revolution, and multi-turn devices, which also count complete revolutions using gear stages, a battery-backed counter or an energy-harvesting Wiegand wire. Multi-turn capability matters on the motor side of a geared joint, where the motor turns many times for one output revolution.
| Type | Position after power-up | Typical interface | Typical use in robots |
|---|---|---|---|
| Incremental | Unknown until homing | A/B/Z quadrature, TTL or RS-422 | Wheel odometry, low-cost axes, conveyors |
| Absolute single-turn | Known within one revolution | SSI, BiSS-C, SPI | Output-side joint sensing, steering angles |
| Absolute multi-turn | Known across many revolutions | BiSS-C, EnDat, proprietary serial | Motor-side sensing in industrial and collaborative arms |
| Sin/cos analog | Unknown without extra track | 1 Vpp sine and cosine signals | High-resolution interpolation in precision stages |
Serial protocols such as BiSS-C, EnDat and SSI carry position words together with error flags and, in newer variants, diagnostic and safety data. Many collaborative robots use a dual-encoder joint, with one encoder on the motor and one on the gearbox output, to detect gear deflection and to satisfy functional safety requirements.
Key encoder parameters
Specifying an encoder means separating several properties that datasheets often blur. Resolution is not accuracy: a sensor can report 2^20 steps per turn while its true angular error remains far larger because of disk eccentricity, mounting runout or magnetic nonlinearity.
| Parameter | Typical range | What it affects |
|---|---|---|
| Resolution | 100 to 10,000 lines incremental; 12 to 26 bits absolute | Smallest detectable change in position |
| Accuracy | About ±1 arcminute to ±1 degree | Agreement between reported and true position |
| Repeatability | Usually much better than accuracy | Ability to return to the same reading |
| Maximum speed | Thousands to tens of thousands of rpm | Highest usable shaft speed before signal loss |
| Update rate and latency | Microseconds for serial absolute devices | Stability and bandwidth of the control loop |
| Operating temperature | Commonly -20 to +85 °C | Drift, sealing and component life |
Velocity is usually derived from encoder data rather than measured directly. At low speeds the finite-difference method becomes noisy because few counts arrive per sample, so drives switch to period measurement between edges or apply an observer or tracking filter. This is one reason why higher resolution improves low-speed smoothness even when positioning accuracy requirements are modest.
Encoders among other robot sensors
An encoder answers a narrow question very well: where is this axis right now. It complements rather than replaces other sensors in the Sensors topic. An IMU measures acceleration and angular rate of a body in space, a force sensor measures interaction loads, and a tactile sensor detects contact at the surface. Fusing wheel encoders with an IMU is a standard way to reduce odometry drift on mobile robots.
Encoders also differ from resolvers, the rotary transformers used in harsh automotive and aerospace drives. A resolver is extremely robust to heat and vibration but needs an excitation signal and a resolver-to-digital converter, whereas a modern encoder delivers digital data directly with higher resolution in a smaller package.
Choosing and integrating an encoder
Selection starts from the control task, not from the catalog. The decision table below summarizes common situations in robot design.
| Situation | Recommended choice | Reason |
|---|---|---|
| Differential-drive mobile base | Incremental magnetic encoder on each motor | Low cost, robust, homing not needed for odometry |
| Industrial arm joint | Absolute multi-turn encoder on the motor | No homing run after power loss or emergency stop |
| Collaborative arm joint | Dual absolute encoders on motor and output | Detects gear deflection and supports safety functions |
| Precision linear stage | Optical linear encoder on the axis | Measures the load directly, bypassing screw errors |
| Dusty or oily environment | Magnetic or inductive encoder | Tolerates contamination better than optical disks |
Integration details decide whether the specified performance appears in practice. Shaft alignment and runout must stay within the tolerance of the read head, cables carrying quadrature signals should use differential RS-422 drivers and shielding, and the controller must sample fast enough to avoid missed counts at peak speed.
Common encoder problems and their causes
Most encoder faults show up as position drift, jitter or sudden jumps rather than as complete failure. Recognizing the pattern speeds up diagnosis.
- Gradual position drift on an incremental axis usually means lost counts from electrical noise, a too-slow counter or signal edges exceeding the input frequency limit.
- Jitter at standstill often comes from a reading that sits exactly on a transition or from excessive control gain amplifying quantization noise.
- Periodic error once per turn points to eccentric mounting or a bent shaft rather than to the encoder electronics.
- Wheel odometry errors frequently arise from wheel slip, which the encoder cannot detect because it measures the wheel rather than the ground.
Explained without jargon
An encoder is like a very precise tally counter attached to a turning wheel. Each time the wheel moves a tiny step, the counter clicks, so the robot always knows exactly how far each joint or wheel has turned.
Some encoders only count steps from wherever they started, so the robot must find a known starting point first. Others remember the exact position at all times, even after the power goes off. Either way, the encoder lets a robot move accurately instead of guessing where its own parts are.
A typical use case
A warehouse operator runs a fleet of small mobile robots that carry totes between shelves. Each robot has two drive wheels, and each drive motor carries a magnetic incremental encoder with 4,096 counts per motor revolution behind a 20:1 gearbox, which gives more than 80,000 counts per wheel revolution.
The motor controllers close their velocity loops at 1 kHz using the encoder counts, and the navigation software combines wheel odometry with an IMU and LiDAR localization. When the team noticed that robots drifted on freshly cleaned floors, the logs showed encoder counts that no longer matched LiDAR position. The cause was wheel slip, not sensor failure, and the fix was to lower acceleration limits and weight the odometry less in the sensor fusion filter, which restored docking accuracy to within a few millimeters.