Your cart is currently empty!
What is a High Speed Counter and How is it Used with an Encoder?
In this tutorial you will learn about high speed counters and how they are used with encoders as well as how they are both utilized together in Industrial Control environments and configured in the control software (MapleLogic).
What is a High Speed Counter?
A high-speed counter is a device or a feature within a systems that counts inout pulses or events at a rapid rate. It’s specifically designed to accurately and swiftly tally occurences of a particular signal or event.
These counters are commonly used in various industrial applications where precise counting of events or pulses at a rapid pace is crucial.
A high-speed counter is used to capture the state of the inputs for a PLC or I/O Module.
They count the number pulses received in an assigned high-speed digital input.
High-speed inputs usually have a maximum frequency of 100 kHz.
Some examples are:
Industrial Automation: High-speed counters are extensively employed in manufacturing industries to count products on an assembly line or monitor machine rotations for example.


Motion Control: In robotics or CNC machines, high-speed counters are used to keep track of encoder signals, which provide feedback about the position, speed, or direction of a moving part.


- A fast counter is used to count the number of pulses a fast input has received.
- The High Speed Counter is used to capture signal inputs.
- Normal inputs typically will not have the scan cycle (input frequency) that will allow to count these signals.
- An Encoder is therefor used.
What is an Encoder?

Encoders are sensing devices whose purpose is to provide feedback about the motion of objects to control systems.
This feedback allows the control systems to establish whether the object being monitored is being correctly moved or positioned and permits adjustments to be made or actions to be taken on the movement and position of the object.
Encoders are typically used to measure one or more specific parameters about the object like a DC motor for example. It measures parameters like position, direction, speed or provide a count of the object or related value.


Linear encoders deal with the movement of objects along a path or line such as in the cut to length application.
This type of encoder makes use of a transducer to measure the movement or distance between two points, sometimes employing a cable or small rod.
In some cases, a cable is run between the encoder transducer and the moving object. As the object moves, the transducer gathers data from the cable and produce a feedback signal that is used to establish the objects movement or position.

Rotary Encoders are used to provide feedback about the movement of a rotating object such as a shaft of a motor.
The rotary encoder converts the angular position of the moving shaft into a feedback signal that will then enable a control system to establish the shafts position or speed.
And rotary encoders also can be known as a hollow shaft encoder or an alternate name is a thru-bore encoder.

Both linear and rotary encoders are available as either absolute or incremental encoders, which describes the desired signal output for the encoder.

Absolute Encoders are used in applications where knowing the exact position of an object is important. They are used in situations where the machine or process is inactive for a large percentage of time, or moves at a very slow rate.
Also, even if power is lost, the absolute encoder by its design can determine the position of the object since there is a specific digital signal associated with every position.

Incremental encoders use a simpler method of counting movement and rely on establishing the position of the object by counting the number of pulses and then using that count to compute the position. Because they rely on pulse counting, there is no unique digital signature that can be used to determine an absolute position.
Hence in the event of a power loss, incremental encoders must be referenced to a home position or reference point so that the counter can be reset and then used to compute relative movement.
One way to think about the difference is that incremental encoders measure the relative movement against some point of reference, whereas absolute encoders measure the position directly using a unique signal code that directly reflects the position.
Using a High Speed Counter with an Encoder
Using a high-speed counter with an encoder involves connecting the encoder’s output to the counter’s input to measure the encoder’s pulses accurately. Encoders produce digital signals in response to motion, translating it into square wave pulses. These pulses represent movement increments, allowing you to measure speed, direction, or position.
We know a high speed counter is integrated into the control system, often within a PLC or dedicated HSC module. The counter is configured to receive and process the pulses generated by the encoder. As the encoder generates pulses, the high speed counter counts the pulses to determine the position of the rotating object. The counter can also analyze the order of pulse transitions or rising and falling edges to determine the direction of movement, forward or reverse.
Here’s an incremental optical type of encoder.

It uses a beam of light that passes through a disc that has opaque lines in a specific pattern. On the other side of the disc is a photo sensing device that will interpret the light based on the pattern on the disc.

The pulses of light are then converted to a square wave signal to be sent back to the processor which here is a Maple PLC and high speed counter module. This is done through the encoders output.
How does the PLC interpret the signal from an Encoder?
Single Phase (1x) High Speed Counter
A “single-phase” high-speed counter typically refers to a counter that operates with a single input channel or signal. In the context of high-speed counters, a “phase” can refer to the input signal’s transitions, such as rising and falling edges.

In the above example, a single-phase rising edge counter is a type of digital counter that counts events or pulses based on the rising edge of a single input signal. In digital electronics, a rising edge refers to the transition of a signal from a low voltage level to a high voltage level.
Input Signal: The counter is triggered to increment on the rising edge of a single input signal. This signal is typically a square wave or a pulse.
Counting: Each rising edge of the input signal causes the counter to increment by one. The counter keeps track of the total number of rising edges it has detected.
Single Phase (2x) High Speed Counter
How can we get more precision from a single-phase counter? It would be utilizing a rising and falling edge counter.
A single-phase rising and falling edge counter is a type of digital counter that counts events or pulses based on both the rising and falling edges of a single input signal.

Input Signal: The counter is triggered to increment on both the rising and falling edges of a single input signal. This input signal is typically a square wave or a pulse.
Counting: Each rising and falling edge of the input signal causes the counter to increment by one. The counter keeps track of the total number of rising and falling edges it has detected.
Quadrature Mode (4x) – 2 Phase x Rising and Falling Edge Counter
How do two-phase counters work?
A two-phase counter typically refers to a type of digital counter circuit that operates in two phases: the “up” phase and the “down” phase. Counters are electronic circuits used to count pulses or events. The two-phase counter can count both up (increment) and down (decrement) depending on the input signals.
Here’s a brief explanation of how a two-phase counter works:
Up Phase: During the up phase, the counter increments its count. It counts up by one for each clock pulse received. The clock pulse is the input signal that drives the counter.
Down Phase: During the down phase, the counter decrements its count. It counts down by one for each clock pulse received in this phase.
The two-phase counter usually has two sets of outputs: one for the up count and another for the down count. These outputs represent the current count of the counter.

While single-channel encoders can be used to establish motion and movement, they suffer from the limitation that they cannot sense the direction of movement.
In a rotary encoder, for example, a clockwise movement will generate the same output signal as a counterclockwise movement, therefore the electrical output of the encoder cannot detect the direction of rotation, only the magnitude of the motion.
This limitation can be eliminated by making use of what is known as a quadrature encoder.
Quadrature encoders generate two square wave signals that are 90 degrees out of phase (A and B channels). This allows for both counting the number of pulses and determining the direction of rotation.

Counting Pulses: The quadrature counter counts the pulses from both Channel A and Channel B. Each rising or falling edge of these signals represents a pulse.
Direction Detection: By analyzing the sequence of pulses on Channels A and B, the direction of rotation can be determined. For example, if Channel A leads Channel B, the rotation is in one direction, and if Channel B leads Channel A, the rotation is in the opposite direction.
High Speed Counter Configuration in MapleLogic
You can configure a high speed counter with the Maple PLC’s (Modular or Micro), while utilizing the PLC control software MapleLogic. (HSC Expansion module only available with Maple Modular PLC)

After starting a new project in MapleLogic with either a Maple Modular or Maple Micro PLC, you’ll now start a Hight Speed Counter Program.
- Right click on Program and select New Program.
- Choose HSC under Special Configuration.

The HSC Program Window will open.

You can choose either Linear Counter or Ring Counter.
A linear counter would be selected if you want to count one-directionally.
This would be used for a Single-Phase HSC.
This is also known as a binary counter or up-counter.
A ring counter would be chosen if you would like to have a closed loop.
This is used when a rotational sequence is needed, usually for a rotary encoder on a motor.

Choosing an Input Pulse Type.
This was mentioned earlier in the tutorial.
Choose either a One Phase or Two Phase.
One- Phase works with a single input signal that represents the events to be counted. This signal is usually in the form of pulses, and the counter increments its count with each pulse.
Two-Phase – The term “two-phase” indicates that the counter uses two clock signals that are 90 degrees out of phase with each other. This means that while one clock signal is rising or falling, the other is in the middle of its high or low state. A two-phase 4 multiplication is referring to a Quadrature Encoder. A HSC that uses a quadrature encoder (2-phase signals) and has a multiplication factor of 4. This would mean that for each complete cycle of the quadrature signals, the counter increments by 4.

Compare Mode can be used for both the Linear or Ring Counter.
For a linear counter, when the count value matches the predefined value, a specific action can be triggered, such as generating an output signal, resetting the counter, or initiating other processes.
A ring counter would involve checking the current state of the counter against a reference state. When the counter reaches the state that matches the predefined reference state, certain actions can be triggered, similar to those in a linear counter with compare mode.
In order to use compared output signal, [Enable Compare Output (Y)] MUST be selected in the Channel Configuration window.

The Unit Time must be set in order to use and measure RPM or PPS. If you leave it as 0, the function will not work. 1000ms is the default value.

In order to measure RPM, this offset value must be configured as something other than zero (0). If zero (0) is configured here, PPS will operate in the measurement mode and an error will be displayed.

For RPM, use the value of 1. For PPS, leave as 0.
According to the flag status of the “RPM/PPS selection”, RPM or PPS measurement values will be stored in this area.

The Enable Count MUST be checked for the High Speed Counter to initiate.

Resources & Documentation
Maple PLC/MapleLogic Resources
- MapleLogic Programming Software
- MapleLogic User Manual
- Maple Modular User Manual
- Maple Micro User Manual
- High Speed Counter Module User Manual
More
Tutorials
Sample Projects
See our Support Center for a complete list of Quick Start and Installation Guides

About the Author