← Back to all lessons
Wiring 11
Pro

Wiring 11 — Quadrature Encoder to PLC High-Speed Counter Input

What you'll learn

An incremental quadrature encoder produces two digital pulse trains — A and B — that are 90° out of phase with each other. Because of this phase offset, the PLC can determine both position (by counting edges) and direction of travel: when A leads B the axis is moving forward; when B leads A the axis is moving in reverse. A third signal, Z, produces a single pulse per revolution at a repeatable mechanical position. This index or marker pulse is used to establish an absolute reference after a power cycle or alarm recovery — without it the PLC only ever knows relative displacement from wherever it started.

Lab time: ~18 minutes.

Lesson briefing

Quadrature Encoder to PLC High-Speed Counter Input

The Quadrature Principle

An incremental quadrature encoder produces two digital pulse trains — A and B — that are 90° out of phase with each other. Because of this phase offset, the PLC can determine both position (by counting edges) and direction of travel: when A leads B the axis is moving forward; when B leads A the axis is moving in reverse. A third signal, Z, produces a single pulse per revolution at a repeatable mechanical position. This index or marker pulse is used to establish an absolute reference after a power cycle or alarm recovery — without it the PLC only ever knows relative displacement from wherever it started.

Why Line-Driver / Differential Wiring

Encoders are available in two output circuit types. Open-collector encoders use three signal wires (A, B, Z), a supply, a common, and a shield — six conductors total. They are cheap and adequate for cable runs up to roughly 5–10 metres.

In an industrial cabinet sharing cable trays with VFDs, contactors, and power wiring, open-collector signals are unacceptably noisy over longer runs. Line-driver (RS-422 differential) encoders solve this by sending each phase as a complementary pair: A and A' are always opposite in polarity. The HSC card's receiver subtracts A' from A; any noise that appears equally on both wires — called common-mode noise — cancels out mathematically. This is the same noise-rejection principle used by analog 4–20 mA loops and RS-485 networks. Line-driver wiring is the industrial default whenever cable runs exceed a few metres or EMI sources are present.

5V TTL vs 24V HTL Encoders

Line-driver encoders come in two voltage families. 5V TTL encoders are the traditional choice: they support higher pulse rates (up to several MHz), are cheaper, and suit servo drives with built-in 5V encoder supplies. 24V HTL encoders swing the signal rails to the full 24V bus, making them more immune to resistive voltage drop over long cable runs and compatible with standard PLC I/O supply rails. This lesson uses a 24V encoder — the more common choice in general-purpose industrial automation.

Shield Grounding — One End Only

The encoder cable shield must be bonded to protective earth at exactly one point. In this topology, the shield bonds at the PLC HSC card's SHIELD terminal, which is internally connected to the cabinet ground bar. The encoder end of the shield is left floating. Bonding both ends creates a low-impedance loop between two ground points; any difference in earth potential between the machine frame and the control cabinet drives a circulating current through that loop, inducing noise directly on the differential signal — the exact problem you are trying to prevent. This single-point shield rule is identical to the rule you applied in lessons 06 and 07 for analog signals.

HSC Card vs General Digital Input

General-purpose DI cards can read encoder A and B signals at low speeds, but they route pulses through the PLC backplane and firmware scan cycle. Above a few kHz the firmware cannot keep up and pulses are lost. HSC cards contain dedicated quadrature decode logic in hardware (typically an FPGA counter): they latch every edge in real time, maintain a 32-bit position register, and detect direction without consuming any CPU scan time. Use an HSC card whenever an encoder operates above 1–2 kHz or when direction information is required with guaranteed accuracy.

Hints

Hint 1

Differential pairs travel together: wire A and A' as a matched pair to HSC-A and HSC-A', then B and B' to HSC-B and HSC-B', then Z and Z' to HSC-Z and HSC-Z'. Never wire a true output to the complement input or vice versa — the direction logic will invert.

Hint 2

Sign up to unlock the full hint sequence.

Hint 3

Sign up to unlock the full hint sequence.

Hint 4

Sign up to unlock the full hint sequence.

This lesson uses 8 placed components on the lab canvas. Components are vendor-neutral (no proprietary trademarks); the wiring rules apply to any equivalent industrial part.

Sign up to preview

Create a free account to preview this Pro lab; upgrade to open the interactive circuit.

Sign up to preview →

You might also like

Competency and practice field guide

Quadrature-encoder PLC wiring lesson: practice plan

Direct answer

The learner can predict phase order and count direction, verify electrical compatibility and distinguish wiring, speed, configuration and scaling faults.

Written for pLC and electrical learners connecting encoder power, common, A and B channels, optional index and high-speed inputs.

a technician tracing realistic industrial sensors, signal wiring, PLC inputs and measured trends at an instrumentation learning bench while studying A/B quadrature encoder wiring, direction and count evidence
System map / 02

NODE 01observable

Scope

Encoder supply, output driver, common reference, A and B channels, index, complementary outputs, cable, shield, input type, count frequency, resolution and mechanics.

NODE 02observable

Signal path

Shaft motion through optical or magnetic edges, channel phase, conductor path, high-speed input, count and direction logic, scaled position and independent motion evidence.

NODE 03observable

Baseline practice

Forward and reverse motion produce the expected phase order, count sign and repeatable scaled displacement.

NODE 04observable

Edge cases

Reversed channels, missing common, single lost channel, bounce or noise, excessive frequency, missed index, rollover, stopped jitter and power return.

NODE 05observable

Fault practice

A mechanical, sensor, supply, interface, conductor, channel, input-configuration, frequency, count or scaling mismatch.

NODE 06observable

Transfer to the job

The full chain verified with actual encoder data, target high-speed input and measured representative motion.

Answer surface / 07

What are encoder A and B channels?

They are pulse trains offset in phase; their transition order lets a compatible counter determine direction while the edge count represents motion.

What happens if A and B are swapped?

The indicated direction normally reverses, but exact behavior depends on counter mode and configuration; verify with controlled motion.