Objective. Students wire incremental and absolute encoders to a PLC high-speed counter module, configure the counter, and calculate position and velocity from pulse data.
This lesson, its worked examples and its practice questions has not yet been verified by a licensed engineer or certified journey-level tradesperson or by a certification or approval body. It is a study draft and may contain errors. Do not use it as instructions for work on a job site or on live equipment. Always follow your instructor, your supervising professional, and current official references and regulations.
VoTechWorks program approval and accreditation are still in progress. Credentials are issued only by the certifying bodies named in each program, after their own exams.
Automated machines must know where moving parts are at every moment. A conveyor, robotic arm, or lead-screw axis that loses position can crash tooling, damage product, or injure workers. Encoders convert mechanical motion into electrical pulses or digital words that a PLC or motion controller can read, count, and act on in real time.
Before wiring or handling any encoder or motor shaft, apply OSHA 29 CFR 1910.147 lockout/tagout (LOTO). De-energize the motor drive, verify absence of voltage with a calibrated multimeter, and apply personal lock and tag before making or breaking any connection. Rotating shafts are a mechanical hazard — keep hands, hair, and loose clothing clear even during jog moves. Wear appropriate PPE (safety glasses minimum). Electrical connections at low voltage (5 V, 12 V, 24 V DC) still present short-circuit risk; handle wiring with power removed unless the specific step explicitly requires live observation of signals. Follow NFPA 70E principles: treat any exposed conductor as energized until verified otherwise.
An incremental encoder generates a stream of pulses as its shaft rotates. The most common type uses a slotted disk (code wheel) and photodetectors to produce two square-wave output channels, labeled A and B, offset from each other by 90 electrical degrees — this is called quadrature encoding. A third channel, Z (index), produces one pulse per full revolution and is used to establish a reference home position.
Direction sensing from quadrature: When the shaft turns clockwise, channel A leads channel B (A rises before B). Counter-clockwise rotation reverses the relationship — B leads A. The PLC high-speed counter (HSC) module monitors which channel leads to determine direction and counts accordingly (up for one direction, down for the other).
Resolution is specified in lines per revolution (LPR) or pulses per revolution (PPR). A quadrature decoder counts all four edges of each A/B cycle, so the effective count per revolution is 4 × LPR. For example, a 500-LPR encoder yields 2,000 counts per revolution in quadrature mode (often called ×4 decoding).
Critical limitation: Incremental encoders have no memory of position. If power is lost or the counter overflows, position is lost and the machine must re-home before resuming automatic operation.
An absolute encoder outputs a unique digital code for every shaft position. Even after a power loss, the correct position is available the instant power returns — no homing cycle required. This is essential on axes where re-homing is dangerous or time-consuming (large CNC machines, robotic joints, overhead cranes).
The SSI (Synchronous Serial Interface) protocol is a common absolute encoder interface. The controller sends a clock signal; the encoder shifts its position word out one bit at a time, MSB first, synchronized to that clock. Resolution is expressed in bits: a 13-bit encoder has 2¹³ = 8,192 distinct positions per revolution; a 25-bit multi-turn encoder can track both position and turn count.
Standard PLC discrete input modules cannot keep up with fast encoder pulses — they are scanned once per program cycle (typically 1–20 ms), which is far too slow for a 1,000-LPR encoder spinning at 3,000 RPM (50,000 pulses per second). An HSC module contains dedicated hardware counters that latch every edge independently of the PLC scan. You configure the HSC for:
If an encoder is coupled to a lead screw, rotary encoder counts convert directly to linear distance using the lead of the screw (distance traveled per one revolution).
> Linear position = (Encoder counts / Counts per revolution) × Lead
For example: 500-LPR encoder, ×4 decoding = 2,000 counts/rev; lead = 5 mm/rev. Reading 6,000 counts means the carriage moved (6,000 / 2,000) × 5 mm = 15 mm.
Shaft speed (RPM) can be calculated from time-stamped HSC reads:
> RPM = (ΔCounts / Counts per revolution) × (60 / Δt)
where Δt is the elapsed time in seconds between two HSC reads and ΔCounts is the change in count over that interval.
Incremental encoders typically use 5 V or 24 V DC supply, differential (RS-422) or single-ended (push-pull/NPN/PNP) outputs. Match the HSC input type to the encoder output type. Keep encoder cables shielded, route away from power wiring, and ground the shield at one end only to prevent ground loops. Check the encoder datasheet for maximum cable length and pull-up resistor requirements.
Answer each question, then check it. Nothing is recorded; this is your own practice.
A free tech program — complimentary, as our commitment to get America working. Help us build VoTechWorks. Tell us what works, what doesn’t, and what you want to learn.