Wrong multiplication factor or thresholds lose counts before the program ever runs. This page covers AB-phase wiring, factor choice, input thresholds and filtering.
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.
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.
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.
| Item | Recommended | Consequence if wrong |
|---|---|---|
| Output type | 5 V differential for distance | 24 V open-collector picks noise |
| Multiplication | Times 4, finest | Mismatch with program loses scale |
| Pulse frequency | Below 80 percent of counter limit | Lost counts at speed |
| Filter time | 0.5 to 2 microseconds | Too long eats pulses, too short admits noise |
| Z phase | Pull-up, home clear | Floating false triggers |
| AB phase order | Swap to fix direction | Counts run backwards |
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.
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.
Locate the issue with the approach above, then confirm with measurements; safety-related circuits must follow the standards and manufacturer requirements.