MOULDLKnowledge BaseElectrical Knowledge Base3D Model DownloadsMembership
中文版Model Store »
Knowledge Base › Electrical Knowledge Base › Encoder to PLC high-speed counter wiring
HomeModels
Table of contents

On this page

Drives & Actuators (102 articles)

Quick Reference

  • PLC & Programming
  • Electrical & Electronic Basics (monthly)(每月更新中)
  • Electrical Control & Drawings (monthly)(每月更新中)
  • Drives & Actuators (monthly)(每月更新中)
  • Sensors & Detection (monthly)(每月更新中)
  • Industrial Communication & Networks (monthly)(每月更新中)
  • HMI & Host Systems (monthly)(每月更新中)
  • Industrial Robots & Motion Control (monthly)(每月更新中)
  • Mechatronic System Integration (monthly)(每月更新中)
  • Fault Diagnosis & Standards (monthly)(每月更新中)

Encoder to PLC high-speed counter wiring

Wrong multiplication factor or thresholds lose counts before the program ever runs. This page covers AB-phase wiring, factor choice, input thresholds and filtering.

1. How it works

Interface choices: 5 V differential outputs (A plus/minus, B plus/minus, Z plus/minus) into differential high-speed inputs, robust within 10 m; 24 V open-collector into ordinary high-speed inputs, cheaper but noise prone on long runs. Multiplication: times 1 counts only A rising edges, times 2 adds falling edges, times 4 uses every edge of A and B for the finest resolution with no dead zone. Budget the frequency: a 1000-line encoder at times 4 gives 4000 counts per revolution, so 3000 rpm means 200 kHz, which must stay below the PLC counter limit, typically 100 to 200 kHz.

2. Numbers and practice

Thresholds and filtering: 24 V inputs switch around 11 to 15 V, so open-collector outputs need pull-ups to 24 V. Digital filter at 0.5 to 2 microseconds: longer eats pulses, shorter admits glitches; pair with shielded twisted pairs and ferrites in noisy plants. Use the Z phase for homing with a pull-up when unused. Direction comes from the AB phase lead-lag; reversed counting means swap A and B.

3. Pitfalls and fixes

Commission in three steps: hand-rotate and confirm count direction matches mechanics; run exactly 100 turns at set frequency and verify the total, 400000 counts for the example; then hard stop and start to prove no loss. For lost counts: scope the A edges for glitches, recheck frequency against the limit, confirm factor matches the program, and check the cable tray. Drift within tens of counts is normal accumulation; close positioning with periodic Z-phase correction.

4. High-speed counter wiring quick table

ItemRecommendedConsequence if wrong
Output type5 V differential for distance24 V open-collector picks noise
MultiplicationTimes 4, finestMismatch with program loses scale
Pulse frequencyBelow 80 percent of counter limitLost counts at speed
Filter time0.5 to 2 microsecondsToo long eats pulses, too short admits noise
Z phasePull-up, home clearFloating false triggers
AB phase orderSwap to fix directionCounts run backwards

5. Notes

Write line count, factor, counts per revolution and maximum speed into program comments; recalculate on any encoder change. Back up the counter channel parameters with the PLC project so upgrades can restore them.

6. References

The quantities and component characteristics discussed here follow current national standards and the corresponding IEC documents: Counting and measurement interfaces follow GB/T 5226.1; PLC high-speed functions reference the IEC 61131 series. Always check the device datasheet and the product design file for ratings and derating.

7. Cautions

⚠️ Three common pitfalls:
① Exceeding the counter frequency limit loses counts progressively and the error grows with speed
② A multiplication factor mismatched with the program scale makes 100 mm commands land 50 mm
③ Encoder cable sharing a tray with power lines injects glitches and the position drifts without an traceable source

Locate the issue with the approach above, then confirm with measurements; safety-related circuits must follow the standards and manufacturer requirements.

Related reading

Related 3D models: Ready to build it? Download free 3D models & CAD drawings at MOULDL »
MOULDL · Electrical Knowledge Base · free self-study reference for electrical & automation engineers, 3D CAD models at MOULDL