Explainer
Why an Incremental Encoder Cannot Feed a Robot Analog Input
Short answer
No: an A/B/Z incremental encoder carries position in pulse edges and phase order, not in a voltage level, so a 12-bit analog input that samples one value per scan cannot read it. A quadrature counter stage, a controller encoder option or an external counter returning counts over I/O or fieldbus, must sit between the encoder and the robot.

On this page
No. An A/B/Z incremental encoder carries its information in the count and order of pulse edges, not in a voltage amplitude, so a 12-bit analog input that converts one sampled level per scan cannot capture it. Wire the encoder channels to analog input terminals and you get a number that flickers between near-zero and near-full-scale with the sampling instant, with no direction and no usable position. A quadrature counter stage has to sit between the encoder and the robot controller: either an encoder-input option in the controller itself, or an external hardware counter that returns the count to the controller over I/O or a fieldbus.
What the encoder actually transmits #
An incremental encoder produces two square-wave trains, A and B, that issue pulses as the shaft moves, plus an index pulse Z once per revolution. The position lives in how many edges have passed since the last reference, and the direction lives in whether A leads or lags B at each edge. That is timing information across two channels, evaluated at every edge.
An analog input does none of that. A 12-bit converter on a 0 to 10 V input range resolves the steady voltage present at the sampling instant into one of 4096 levels, about 2.44 mV per step. It has no memory of edges between samples and no way to compare the phase of two channels across time. Feed it a square wave and the reading is simply wherever the sample happens to land: low, high, or mid-transition, depending on where the scan falls relative to each edge.
The two sides also speak different electrical languages. Analog input terminals are a signal input and a common; there is no gate or source terminal to assign, because those are terms for transistor output stages, and the encoder output stage is what carries that character:
- Open-collector NPN: the output sinks to 0 V and needs a pull-up resistor to the supply.
- Open-collector PNP: the output sources to the supply and needs a pull-down.
- Push-pull: the output drives both high and low actively.
- Line driver: differential pairs A and /A, B and /B, Z and /Z, needing a differential receiver.
Read the output type and supply voltage from the encoder datasheet before any wiring, and check the analog input's rated range first, because a pulse swinging to the encoder supply voltage can exceed it.
The number that decides it: edge rate against sample rate #
The decisive comparison is the encoder edge rate against how often the input is sampled. Channel A frequency is:
f_A [Hz] = PPR × rpm / 60
and the quadrature edge rate is four times that in x4 counting.
Worked example, for a 1024 PPR encoder on a shaft turning at 3000 rpm:
- f_A = 1024 × 3000 / 60 = 51,200 Hz
- quadrature edge rate = 4 × 51,200 = 204,800 edges per second
- one edge every 4.88 microseconds
A controller analog input samples once per I/O scan, and scan times are measured in milliseconds; even a few milliseconds per scan is hundreds of times longer than that edge period. The sampled square wave aliases, direction is lost because nothing observes the A-to-B phase at each edge, and every edge missed between scans is gone permanently. These are calculated figures for the stated inputs; your own encoder's PPR and top speed set the real number.
The same arithmetic rules out ordinary digital inputs. A standard digital input is scanned, not latched, and it starts losing counts at edge rates far below the encoder's. A dedicated counter input latches edges in hardware and buffers them between scans; that is the difference, and an article on how a PLC counter handles concurrent edges with event buffering covers the mechanism in detail. A high-speed counter stage is not optional hardware polish here: it is the only stage that actually counts.
The quantities that pick the interface #
| Quantity | What it sets | Where to read it |
|---|---|---|
| PPR (pulses per revolution) | Resolution; 4 × PPR counts per revolution in x4 mode | Encoder nameplate or datasheet |
| Maximum shaft speed | Highest channel A frequency and edge rate | Mechanical design of the axis |
| Output type and supply voltage | Receiver type, pull-ups, level compatibility | Encoder datasheet |
| Counter maximum input frequency | Must exceed the x4 edge rate with margin | Counter or option documentation |
| Analog input rated range | Overvoltage damage limit | Controller I/O hardware manual |
| Counter register width | Rollover interval of the count | Counter documentation |
The three workable routes into the controller #
Pick the route by what the robot must do with the position.
Controller encoder option. For tracking a conveyor or turntable, or adding an external measuring axis, robot builders offer controller options that take an encoder input directly and keep the count in hardware. Confirm the option is present in your controller's configuration and matches your encoder's interface before ordering anything. Where the application is following moving product, the wiring between the tracking encoder and the controller is the foundation everything else rests on.
External counter returning counts. A counter or high-speed-counter module takes A, B and Z in hardware, then passes the count to the controller as grouped digital input data or over a fieldbus the controller supports. The position becomes a sampled value on the robot side, so update latency matters for fast motion, and a narrow mapped register forces you to handle rollover in the program.
Encoder-to-analog converter. A frequency-to-voltage or frequency-to-current unit yields a signal proportional to speed. That route gives speed only: no position, no direction, no Z reference. It suits monitoring, not positioning.
Direct connection to an analog or ordinary digital input is not workable on either route's terms, for the sampling reasons above.
Commissioning the counter route #
- Record the PPR, output type, supply voltage and maximum speed; calculate the x4 edge rate and confirm the counter's rated maximum input frequency exceeds it.
- Match the receiver to the output type: differential receiver for line-driver outputs, pull-up or pull-down for open-collector outputs, level-compatible input for push-pull.
- Power the encoder within its rated range, tie encoder 0 V to the counter reference, and run shielded twisted-pair cable with the shield terminated at one end.
- Set the counter to quadrature x4, or to x1 or x2 deliberately if that is the intent, and enable Z as reset or capture only where the application homes on it.
- Map the count to controller-readable I/O and scale it in the program: revolutions = count / (4 × PPR) in x4 mode.
- Handle rollover in the program if the mapped register is narrow.
Then verify. Reverse the rotation and confirm the count decrements; if it increments, swap A and B or change the counter's direction setting. Run to top speed and back to the start mark, and any residual difference is lost or noise-added counts.
| Observation | Likely cause |
|---|---|
| Count drifts after returning to the same mark | Edge rate near the counter limit, or noise on a long single-ended cable |
| Count rises in both directions | Only one channel connected, or A and B tied together |
| Count is a fraction of four times the PPR per revolution | Counter set to x1 or x2 mode |
| No Z pulse seen | Z on the wrong terminal, or a missing pull-up on an open-collector output |
| Erratic count only when drives run | Shield grounded at both ends, or cable routed with motor power conductors |
A signal that is clean at the counter terminals but miscounts points to configuration; a noisy trace points to wiring and grounding.
The decision #
Direct wiring of A, B and Z to a robot analog input is ruled out by the physics of sampling: a 12-bit converter on a millisecond scan cannot register a pulse train that delivers an edge every few microseconds, and it cannot read direction at any speed. Put a quadrature counter between them, matched to the encoder's edge rate and output stage, and return the count to the controller as I/O or fieldbus data. If a frequency-to-analog converter is all that is available, accept that you have a speed signal and nothing more. And on a robot controller whose encoder-input option is absent, the external counter is the route, not a workaround at the analog terminals.
Questions asked
Can I connect an incremental encoder directly to an analog input on a robot controller?
No. The encoder's A, B and Z outputs are square-wave pulse trains whose information is in the number and order of edges. An analog input converts one voltage level to a number once per scan, so it reports a value that flickers with the sampling instant, loses direction and permanently misses every edge that falls between scans. A hardware quadrature counter has to sit between the encoder and the controller.
How do I calculate whether a counter is fast enough for my encoder?
Compute the channel A frequency as PPR multiplied by rpm divided by 60, then multiply by 4 for the quadrature edge rate. A 1024 PPR encoder at 3000 rpm gives 51,200 Hz on channel A and 204,800 edges per second in quadrature. The counter's rated maximum input frequency must exceed that figure with margin; take both numbers from the encoder nameplate and the counter datasheet.
What does an encoder-to-analog converter actually give me?
A frequency-to-voltage or frequency-to-current converter produces a signal proportional to speed. That is all it gives: no position, no direction and no index reference. It suits speed monitoring on a panel meter or analog channel, not positioning or conveyor tracking. For position, use a real quadrature counter stage.
How do I verify the counter wiring after commissioning?
Rotate the shaft by hand through exactly ten revolutions and read the count: expect ten times four times the PPR in x4 mode, with the Z pulse seen once per revolution. Return to the start mark at full speed and confirm the count matches the start value.
Why do ordinary digital inputs miscount encoder pulses too?
A standard digital input is sampled by the controller scan, not latched in hardware. Any edge arriving and leaving between two samples is lost, so counts fall behind as soon as the edge period approaches the scan time. Only a dedicated counter input, which latches edges in hardware into an event buffer, keeps up with quadrature rates.