PLC High Speed Counter: 5 Practical Encoder Setup Steps

Share:
PLC
PLC High Speed Counter: 5 Practical Encoder Setup Steps

A normal PLC input misses pulses once they arrive faster than the scan, so encoder counts drift and positions go wrong. Dedicated counter hardware catches every edge in real time, independent of the program.

Quadrature Encoder x4 Decoding Preset and Reset Index Pulse

Encoders, flow meters and proximity sensors on gear teeth can produce thousands of pulses per second. Special counter inputs count them in hardware so the program only reads the result.

Hello everyone, today we are going to learn how a PLC high speed counter works with encoders, which counting modes to choose, and how to check the input frequency before you wire anything.
high speed counter

What Is a High Speed Counter?

A high speed counter is a hardware counting circuit inside a PLC or on a dedicated module that counts input pulses independently of the program scan. Ordinary CTU and CTD counters only see an input once per scan, so they miss fast pulses.

Maple Systems notes that high speed inputs usually accept up to about 100 kHz. Standard inputs often have millisecond filters that limit them to a few hundred hertz.

Rotary encoder wired to the fast counter inputs of a PLC
Image credit: Maple Systems

A scan based counter can only catch pulses slower than about half the scan rate. With a 10 ms scan cycle, that is only 50 Hz.

The counter value is read into a register the program uses like any other tag. Compare values and interrupts let the hardware act instantly when a count is reached.

Counting Modes

Up or Down

One pulse input, direction from a fixed setting.

Best for: simple totalising and flow pulses
Basic
Pulse and Direction

One pulse input plus a direction input.

Best for: stepper style signals
Direction
Quadrature x1 or x2

A and B channels, count on some edges.

Best for: noisy environments, lower resolution
Robust
Quadrature x4

Count every edge of A and B.

Best for: precise position and speed
Highest Resolution

Maple Systems explains that quadrature encoders give A and B signals 90° apart, so the counter knows both count and direction. In x4 mode it adds four counts per encoder cycle.

An index or Z pulse arrives once per revolution and can reset or capture the count. It is used for homing machines.

How the Counter Handles an Encoder

Encoder RotatesA and B square waves are produced
Edge DetectionHardware sees each rising and falling edge
Direction LogicPhase order sets up or down
Count RegisterValue updates in real time
Program ReadsSpeed and position calculated

Opto 22 describes the same quadrature decoding in its technical note on quadrature counters. The logic runs in hardware, so the program scan time does not matter.

Speed is found by taking the change in count over a fixed time. Many modules also provide a direct frequency mode for VFD speed feedback.

5 Practical High Speed Counter Setup Steps

1
Check Frequency
Calculate encoder frequency at maximum speed.
2
Match Signal Type
24 V HTL or 5 V line driver to the right input.
3
Wire With Shielded Cable
Twisted pairs, shield grounded at one end.
4
Configure Mode
Select quadrature multiplier, presets and limits.
5
Test at Low Speed
Rotate by hand and confirm count direction.

Match sinking or sourcing encoder outputs to the input card, as explained in sinking and sourcing. Most industrial encoders use 24 V DC push pull outputs.

Noise causes extra counts, so route encoder cables away from motor leads and use shielded twisted pair cable.

Encoder Frequency Formula

Input frequency = PPR × RPM ÷ 60
Count rate = Input frequency × Multiplier

Example:
1024 PPR encoder at 3000 RPM
Input frequency = 1024 × 3000 ÷ 60 = 51.2 kHz
x4 decoding gives 204.8 k counts per second
51.2 kHz is inside a 100 kHz input limit

The input limit applies to the pulse frequency on each channel, not the multiplied count rate. Always check the datasheet definition.

If the frequency is too high, use a lower PPR encoder or a dedicated motion module.

Frequency Calculator

Encoder Input Check
Result
Input 51.2 kHz, 204.8 k counts per s, within limit

Leave at least 20 percent margin below the limit for overspeed and signal distortion on long cables.

Advantages
  • Counts independently of scan time.
  • Accurate position and speed.
  • Hardware compare outputs react instantly.
  • Direction detection with quadrature.
Watch Outs
  • Noise creates false counts.
  • Signal type must match the input.
  • Counter rollover must be handled.
  • Frequency limits vary by model.

When choosing hardware, list counter needs early, as advised in how to select the right PLC.

Opto 22 Quadrature Counter PDF

PDF
Using Quadrature Counters, Technical Note 1823
Opto 22 note on quadrature decoding and wiring

HSC Encoder Setup Video

High Speed Counter FAQ

What does a high speed counter do?
It counts fast pulses in hardware, independent of the PLC scan. The program then reads the count as a normal register value.
Why can normal inputs not count encoders?
They are sampled once per scan and often filtered by several milliseconds. Pulses faster than about half the scan rate are simply missed.
What does x4 mode mean?
The counter adds a count on every rising and falling edge of both A and B. That gives four times the encoder PPR per revolution.
What is the Z pulse for?
It is a once per revolution index pulse used for homing. The counter can reset or capture its value when the pulse arrives.
How do I prevent false counts?
Use shielded twisted pair cable, keep it away from motor leads and ground the shield correctly. Matching signal levels and good filtering also help.
What input frequency is typical?
Many compact PLCs accept up to about 100 kHz on fast inputs. Dedicated motion modules can handle several MHz with line driver encoders.
How is speed calculated?
Take the change in count over a fixed sample time and divide by counts per revolution. Some modules provide a built in frequency mode for this.

Related Articles

External References

What We Learn Today

  • A high speed counter counts pulses in hardware outside the scan.
  • Quadrature modes give direction and up to 4 counts per cycle.
  • Check frequency, signal type and wiring before commissioning.
I hope you like above blog. There is no cost associated in sharing the article in your social media. Thanks for reading!! Happy Learning!!

Leave a Reply

Your email address will not be published. Required fields are marked *