By Tolerance Labs engineering team · Updated
A robot joint needs two things from its encoders: an electrical angle to commutate the motor, and a joint angle you can trust at power-up. Encoder type, placement and resolution decide if you get both.
Incremental and absolute encoders
An incremental encoder outputs pulses as the shaft turns. The controller counts them from a reference, so position is lost at power-off and the joint must home on startup. Quadrature output gives four counts per line: a 1,000-line encoder gives 4,000 counts per revolution.
An absolute encoder reports the shaft angle directly, so position is known at power-on. Most robot joints use absolute encoders, because homing a leg or arm against a hard stop is slow and sometimes unsafe.
Single-turn and multi-turn
A single-turn absolute encoder knows the angle within one revolution of its own shaft. That is enough on a joint output or a direct-drive motor. It is not enough on the motor side of a reducer. With a 9:1 reducer the motor turns nine times per output revolution, so a single-turn motor encoder knows the output angle only modulo 40° (360° / 9).
- Battery-backed multi-turn: a counter tracks turns while main power is off. The battery must be monitored and replaced, and the count is lost if it runs flat.
- Gear-based multi-turn: a small gear train drives extra code disks, so the turn count is read mechanically. No battery, but more parts and a larger housing.
- Output-side encoder: a second absolute encoder on the joint output. Often the simplest fix, and it does more than count turns.
Motor-side, output-side and dual-encoder setups
The motor-side encoder serves commutation and the velocity loop. Field-oriented control needs the electrical angle, which is the mechanical angle times the pole-pair count. A 14-bit encoder on a motor with 14 pole pairs gives 16,384 / 14 ≈ 1,170 counts per electrical revolution, enough for current control.
The output-side encoder measures the angle the task cares about. Backlash, reducer compliance and belt stretch all sit between motor and output, and a motor encoder cannot see them. With both, the controller can:
- Read the absolute joint angle at power-up with no homing.
- Close the position loop on the output, so backlash and compliance stop showing up as position error.
- Compute deflection as (motor angle / ratio) minus output angle. With a known joint stiffness, that gives a torque estimate.
Many harmonic joint modules and high-ratio and cycloidal joints offer a dual-encoder option. Low-ratio quasi-direct-drive joints have the same turn ambiguity.
Magnetic and optical encoders
Magnetic encoders use a Hall-sensor IC to read a diametrically magnetized magnet on the shaft end. Common examples: the AS5047P (14-bit, SPI, plus an ABI incremental output), the AS5048A (14-bit, SPI) and the AS5600 (12-bit, I²C, plus an analog or PWM output). They are small, low cost, and tolerate dust and oil. Accuracy depends on magnet alignment and stray fields, and is much coarser than resolution unless you calibrate.
Optical encoders read a patterned disk with a light source and photodetector. Absolute versions of 17 bits and above are common. They need a clean, sealed enclosure and cost more. For hollow-shaft joints with cables through the center, use an off-axis magnetic or optical ring that fits around the bore.
Resolution through the gear ratio
An N-bit absolute encoder gives 2^N counts per revolution. Incremental encoders are quoted in lines per revolution; multiply by four for quadrature counts.
| Bits | Counts per rev | Angle per count |
|---|---|---|
| 12 | 4,096 | 0.088° |
| 14 | 16,384 | 0.022° |
| 17 | 131,072 | 0.0027° |
| 19 | 524,288 | 0.00069° |
Worked example: a 14-bit encoder on the motor of a joint with a 9:1 reducer.
- Counts per motor revolution: 2^14 = 16,384.
- Counts per output revolution: 16,384 × 9 = 147,456.
- Angle per count at the output: 360° / 147,456 ≈ 0.0024°, about 0.15 arcmin.
- At the tip of a 0.5 m link: 0.5 m × (0.0024° × π / 180) ≈ 0.021 mm.
That figure describes the motor, not the output. Planetary backlash is typically several arcminutes or more, which is tens of counts at this resolution, so the motor encoder reports positions the output does not hold. A 14-bit encoder on the output gives 0.022° per count, coarser on paper, but it measures the real joint angle.
Interfaces
- SPI: fast and standard on encoder ICs, but meant for board-level distances.
- SSI: clock and data on RS-422 differential pairs. Absolute position over meters of cable.
- BiSS-C: an open protocol on SSI-style hardware, adding CRC checking and bidirectional register access.
- ABZ: incremental quadrature plus a once-per-turn index. Almost any driver can count it, but it carries no absolute position.
- PWM: angle as duty cycle on one wire. Easy to read, but too slow for current loops.
- I²C: slow and short-range. Use it for configuration and low-rate reads.
Check what your motor driver accepts before picking the encoder. Many drivers take SPI or ABZ for the motor encoder and have a second port for an output encoder. The joint then reports position over its bus; see CAN vs EtherCAT.
Mounting and magnet alignment
- Center the magnet on the rotation axis. An off-center magnet causes a once-per-revolution error.
- Set the air gap to the IC datasheet value, typically around 1–2 mm.
- Hold the magnet in a non-ferromagnetic part such as aluminum or brass. A steel shaft distorts the field.
- Keep the sensor away from rotor magnets and phase wires. In a frameless motor build the rotor field is close, so check readings at load current.
- Bond the magnet, calibrate after final assembly, and redo the commutation offset whenever the encoder is remounted.
Checklist
For comparing encoders and joint modules:
- Motor encoder behind a reducer: add multi-turn counting or an output encoder.
- Accuracy tighter than gear backlash: close the loop on an output encoder.
- Compute counts at the output and compare them with backlash, not with the bit count.
- Magnetic for compact or dirty spaces; optical for the highest accuracy in a sealed housing.
- Interface matches the driver; differential signaling beyond board-level wiring.
- Magnet centered, gap set, non-ferrous holder, calibrated after assembly.
More guides
Not sure what fits? Tell us what you're building.
We procure every part of the robot. Send a sentence or a BOM and we come back with options and a landed quote.
Send a request