Rotary encoder
A rotary encoder turns shaft rotation into electrical pulses or a digital position. PLCs use encoders to measure conveyor length, motor speed, the position of an axis or the angle of a rotary table.
Incremental encoders
An incremental encoder gives a train of pulses as the shaft turns. The number of pulses per revolution (PPR) sets the resolution, e.g. 100, 360, 1024 or 2500 PPR.
- Channel A and B: two square waves 90° apart (quadrature). Which one leads tells the direction.
- Channel Z (index): one pulse per revolution, used to find a reference (home) position.
Counting every edge of both A and B (×4 decoding) gives four counts per pulse: a 1000 PPR encoder gives 4000 counts per revolution.
Incremental encoders lose their position at power-off, so the machine must home after starting.
Absolute encoders
An absolute encoder outputs a unique code for every shaft position, so it knows its position immediately at power-on.
- Single-turn: position within one revolution (e.g. 12 bits = 4096 positions).
- Multi-turn: also counts revolutions, using gears or an energy-harvesting counter.
Absolute encoders usually talk over SSI, BiSS, IO-Link or a fieldbus (PROFINET, EtherNet/IP).
Output electronics
| Type | Notes |
|---|---|
| Push-pull (HTL), 10–30 V | works with 24 V PLC inputs; most common for PLCs |
| Line driver (TTL, RS-422), 5 V | differential A/A̅ B/B̅, long cables, high frequency; needs a matching counter card |
| Open collector NPN/PNP | simple, limited cable length and speed |
Connecting to a PLC
Normal PLC inputs are read once per scan and will miss pulses. Wire A and B to the PLC's high-speed counter (HSC) inputs, which count up to tens or hundreds of kHz in hardware. Check the maximum frequency: pulse frequency = PPR × rpm ÷ 60. A 1000 PPR encoder at 3000 rpm gives 50 kHz.
Examples
- Measuring wheel on a conveyor: count = length, for cutting material to size.
- Motor speed monitoring: pulses per second → rpm.
- Rotary table index position.
Servo motors have a built-in encoder that feeds the servo amplifier; the PLC Sim Lab Playground includes a servo amp and axis to play with.
Try it yourself. Wire sensors, contactors and a PLC, write ladder logic and press RUN in the free PLC Sim Lab Playground. Nothing to install.
Open the Playground →Guided lessons →