PLC Simulator
All 151 components

sensors · rotary model

Rotary encoder

A PLC rotary encoder converts shaft rotation into electrical pulses. An incremental quadrature encoder provides channels A and B ninety electrical degrees apart, letting a high-speed counter determine direction as well as movement. The program turns accumulated counts into position, speed or travelled distance using pulses per revolution, mechanical ratio and a defined reference point.

2 I/O points1 snap portsPLC-driven state

Create a free account to run this scenario, or try a PLC lab now — no signup.

Isolated component viewPROP_RotaryEncoder_ROOT

Explore Rotary encoder in 3D

Load the interactive model when you are ready to rotate, inspect and operate it. Deferring WebGL keeps the reference page fast.

Motion and state

Its rotary state can be driven from a PLC output so speed and direction remain visible during a scan.

PLC control pattern

Commission it by proving active feedback before accepting enable.

Fault practice

Inject stuck-on, stuck-off, misaligned states and require the PLC sequence to detect, stop and recover deliberately.

PLC integration guide

How to use a rotary encoder with a PLC

Use the high-speed counter path

Encoder pulses can change faster than the normal PLC scan can sample. Wire the channels to inputs and instructions specifically rated for the required frequency, then configure the counter mode for A/B quadrature and the desired multiplication. A normal contact instruction may miss edges even though it appears to work at hand-turned speed. Shielding, grounding and differential signalling matter as cable length and electrical noise increase.

Convert counts into engineering units explicitly

Document the encoder resolution, whether the counter uses one, two or four edges per cycle, gearbox ratio, wheel circumference and sign convention. Position is accumulated counts divided by counts per engineering unit. Speed is count change over a stable sample interval. Avoid burying these constants across rungs; keep them together and expose raw count, scaled value and status for diagnosis.

Plan reference, rollover and loss detection

An incremental encoder does not inherently know absolute position after power loss. Use a home sensor, index pulse or retained position strategy that matches the machine. Handle counter rollover and reverse motion mathematically. When motion is commanded, compare the expected count change with a timeout or following-error band so a broken coupling, damaged cable or stalled shaft becomes a meaningful fault.

Learn the physical principle first

The reference above focuses on PLC integration. The interactive school lesson shows the device, signal or mechanism before you write the control sequence.

Open the quadrature encoder signal lab

Signal map

I/O you can reason about

PLC output Enable; PLC input Active feedback

SignalPLC directionType / range
Enable
enable
outputbool
Active feedback
active
inputbool

Field checklist

Commissioning sequence

  1. 01Confirm output electrical type, supply, pulses per revolution, maximum frequency and PLC high-speed-input compatibility.
  2. 02Turn the shaft slowly in the positive direction and verify A/B direction and count sign.
  3. 03Rotate one known revolution and compare the count change with the configured edge multiplier.
  4. 04Scale counts into the real distance or angle, then validate across several known positions.
  5. 05Disconnect one channel and simulate stalled feedback to prove channel and no-motion diagnostics.

Fault finding

Symptoms and first checks

SymptomCheck
Count direction is reversedSwap A and B only if permitted by the wiring design, or change the configured direction convention consistently.
Counts are missed at speedCheck input frequency rating, filter time, high-speed-counter configuration, cable shielding and signal level.
Position is correct near zero but drifts with travelVerify pulses per revolution, edge multiplier, gearing, circumference and mechanical slip.

Fault and recovery exercise

Make abnormal states part of the sequence

Inject stuck-on, stuck-off, misaligned states and require the PLC sequence to detect, stop and recover deliberately.

stuck-onstuck-offmisaligned

Engineering boundary

The model teaches PLC sequence behaviour and diagnosis. Confirm ratings, wiring, guarding, process calculations and commissioning limits against the real manufacturer documentation and site design.

Plain-English answers

Rotary encoder FAQ

Why are encoder channels A and B offset?

Their phase relationship reveals direction. The sequence of A and B edges changes when the shaft reverses.

What does encoder PPR mean?

Pulses per revolution describes the base signal cycles. A quadrature counter may count multiple edges per cycle, so configured counts per revolution can be higher than the stated PPR.

Does an incremental encoder retain position?

The encoder provides relative movement. Absolute machine position normally requires homing, an index strategy, retained state with validation, or an absolute encoder.

Free first success

Put the rotary encoder into a working control sequence

Open a related browser scenario, run the PLC logic and see the component state respond. Start without installing software or entering a card.

No installNo credit cardImmediate pass/fail feedback

Technical reference and worked-example guide

Rotary encoder PLC component: field reference

Direct answer

The reader can define pulses per revolution, electrical interface and expected channel sequence, then distinguish motion, wiring, count and scaling faults.

Written for automation learners and technicians connecting incremental encoder channels, direction, count, speed and reference behavior to PLC inputs.

a technician tracing realistic industrial sensors, signal wiring, PLC inputs and measured trends at an instrumentation learning bench while studying rotary encoder selection, wiring and PLC signal interpretation
System map / 02

NODE 01observable

Definition

Motion range, shaft speed, pulses per revolution, A/B/Z channels, electrical output, supply, input frequency, shielding, count mode, units and reference policy.

NODE 02observable

Signal path

Shaft motion through encoder channels, cable and input circuit to edge count, direction, scaled position or speed and independent physical check.

NODE 03observable

Worked example

Known clockwise and counter-clockwise turns with repeatable counts, direction and scaled engineering result.

NODE 04observable

Limits

Maximum frequency, slow edge, reversed channels, lost pulse, noise, index crossing, count rollover, restart and mechanical slip.

NODE 05observable

Common mistake

A mechanical, supply, signal-level, channel-order, input-filter, count, scaling, reference or feedback mismatch.

NODE 06observable

Verification

The selected encoder and high-speed input verified across the real speed range and installed wiring.

Answer surface / 07

How does a rotary encoder connect to a PLC?

Match the encoder supply and output type to a compatible input, route A/B and optional index channels correctly, then configure counting and scaling within documented frequency limits.

How can a PLC determine encoder direction?

Quadrature A and B channels are phase shifted; their edge order indicates direction when wiring and count mode are configured consistently.