Counters in Ladder Logic: Practical Applications in Cement Plants
If timers measure "how long," counters measure "how many." That sounds simple, and the basic instruction is simple — but counters show up in more places on a cement plant than most technicians realize, from batch tracking to bag counting to fault-frequency monitoring. Let's go through how they work and where you'll actually use them.
CTU — Count Up
The workhorse counter. Every time its input transitions from false to true (a rising edge — not while it's held true), the accumulated value increases by one. Once the accumulator reaches the preset, the done bit sets. It keeps counting past the preset too, if you let it, and the done bit stays set until reset.
Real example: Counting bag discharge pulses from a rotary packer to track bags filled per shift, or counting pulses from a proximity sensor on a bucket elevator to detect bucket loss over time.
CTD — Count Down
The mirror image — starts from a preset value and counts down toward zero with each rising edge on the input. Less common on its own, but frequently paired with a CTU on the same counter address (many PLC platforms let a CTU and CTD share the same accumulator) to build an up/down counter — useful for tracking net inventory, like items entering and leaving a buffer zone.
Resetting Counters
Don't Skip This
Just like RTO timers, counters retain their accumulated value even after their input goes false — they only clear when a Reset instruction runs. This trips people up constantly. I've seen shift counters that were "counting wrong" simply because nobody wired in a reset-at-shift-change condition, so the count just kept climbing across shifts, weeks, sometimes months, until someone finally noticed the number looked absurd.
Before you deploy any counter into a live program, ask: what condition resets this, and how often should it reset? If the answer is "never," fine — that's a legitimate use case for lifetime counts. But it should be a deliberate decision, not an oversight.
Practical Application: Weigh Feeder Pulse Counting
This is one close to my own work. Belt weigh feeders and loss-in-weight feeders often use pulse-counting logic, either directly in the PLC or in an associated integrator, to correlate encoder pulses with belt travel for flow rate calculation. While the actual rate calculation is usually handled by a dedicated weighing controller, the PLC side frequently uses counters for diagnostic purposes — confirming the belt encoder is actually producing pulses when the feeder runs, as an early warning for a slipping belt or a failed encoder before it becomes a bigger material-flow problem.
Debouncing: The Silent Counter Killer
If your counting input comes from a mechanical device — a limit switch, a mechanical flow switch — contact bounce can register multiple false counts for a single physical event. This is different from an electrical noise problem (which we've covered before in the context of DI card faults); it's a genuine mechanical characteristic of the switch itself. The fix is usually a short debounce timer gating the counter's input, or using a solid-state proximity sensor instead of a mechanical contact wherever count accuracy actually matters.
Field Tip
When a counter "isn't working," the first thing to check — before assuming a program fault — is whether the input is even reaching the rung as a clean rising edge. Force the input or watch it live while triggering the physical event manually. More often than not, the counter logic is fine; the input signal is the problem.
Next in the series:
interlocks — how ladder logic protects your equipment and your people, and why interlock logic deserves more respect than any other part of the program.
Comments
Post a Comment