PLC Sim Lab
Industrial sensors

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.

2 min read · Updated 2026-10-02

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.

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.

Absolute encoders usually talk over SSI, BiSS, IO-Link or a fieldbus (PROFINET, EtherNet/IP).

Output electronics

TypeNotes
Push-pull (HTL), 10–30 Vworks with 24 V PLC inputs; most common for PLCs
Line driver (TTL, RS-422), 5 Vdifferential A/A̅ B/B̅, long cables, high frequency; needs a matching counter card
Open collector NPN/PNPsimple, 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

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 →