The High-Speed discrete inputs can be configured to measure the amount of time between pulses. When you want a scaled value representing a speed or rate, the high-speed input timer is a better option for pulse rates below 5 kHz. This is compared to using the high-speed input pulse counting selection.
The BRX Do-More series of programmable logic controllers have built-in high-speed inputs. These inputs can function in Counter, Timer, or Pulse Catch modes. Every CPU will have either 6 or 10 high-speed inputs (HSI) available depending on the model. These inputs can be used for input frequencies from 0 to 250Khz. 250Khz represents 250000 input counts per second that can be coming from devices connected to your PLC like an encoder. Due to the speed of the inputs, they function on the BRX Do-More PLC asynchronous with the PLC scan time.
We will continue looking at the high-speed inputs on our BRX Do-More PLC, by looking at the pulse timer mode. Previously we looked at the high-speed count mode of the PLC. We scaled the count to display RPM (Revolutions per Minute). Scaling the edge trigger timer from our incremental encoder, we will scale and compare the RPM from last time. Let’s get started.
Previously in this BRX series PLC, we have discussed:
System Hardware – Video
Unboxing – Video
Installing the Software – Video
Establishing Communication – Video
Firmware Update – Video
Numbering Systems and Addressing – Video
First Program – Video
Monitoring and Testing the Program – Video
Online Editing and Debug Mode – Video
Timers – Video
Counters – Video
High-Speed IO – Video
Compare Instructions – Video
Math Instructions – Video
Program Control – Video
Shifting Instructions – Video
Drum Instruction – Video
Serial Communication – Modbus RTU to Solo Process Temperature Controller – Video
Data Logging – Video
Email – Text SMS Messaging Gmail – Video
Secure Email Communication Video
AdvancedHMI Communication – Modbus TCP – Video
Analog IO – System Configuration – Video
HTTP JSON Instructions – Video
Analog Dusk to Dawn Program – Video
INC DEC 512 Registers for DMX512 – Video
PID with PWM Output – Video
PID Ramp Soak Profile – Video
Do-More Simulator MQTT Publish / Subscribe – Video
BRX Do-More PLC MQTT Communications – Video
Stride Field Remote IO Modules Modbus TCP Ethernet
– Unboxing SIO MB12CDR and SIO MB04ADS Video
– Powering and Configuring Video
BRX Do-More PLC to Stride Field IO Modbus TCP – Video
BRX Do-More PLC Ethernet Remote IO Controller BX-DMIO
– Unboxing BX-DMIO Video
– Configuration and Programming Video
Modbus RTU TCP Remote IO Controller BX-MBIO
– Hardware Video
– Powering and Configuring Video
BRX Do-More PLC to Modbus Remote IO Controller BX-MBIO – Video
Modbus ASCII Protocol – Video
Peerlink Ethernet Communication – Video
HTTP Web Server – Video
Dynamic Web Pages – Video
BRX Do-More PLC FTP Client Get Put – Video
Do-More Designer Element Browser – Video
BRX Do-More PLC High-Speed Input Counter – Video
Our entire BRX Do-More series can be found here.
The programming software and manuals can be downloaded from the Automation Direct website free of charge.
Watch the video below to see the comparisons of scaling pulse rates in our BRX Do-More PLC. The encoder input pulse rate will be calculated using the count and time rates of the high-speed inputs.
Wiring of the Incremental Encoder to the BRX Do-More PLC
We are using the TRDA-2E series of encoders. The one that we have connected is an open collector NPN sinking output. It has 1024 pulses per revolution.
Previously we looked at the wiring of the A, B, and Z phases of the encoder. The sinking output of the encoder means a sourcing input to the BRX Do-More PLC.
Incremental encoders produce a 50% duty cycle. This means that they have the same on and off times if moving at a constant rate. A leads B phase by 90 degrees if moving clockwise (CW). B leads A phase by 90 degrees if moving counterclockwise (CCW).
BRX Do-More High-Speed Input Timer Programming
We will now configure the high-speed input timer.
Call up the system configuration window by selecting it under tools in the project browser or the icon on the main menu. You can also use the main menu | PLC | System Configuration…
On the left-hand side of the system configuration window, select BRX Local I/O. We can now select the HSIO from the picture when you move your mouse over it or the High-Speed I/O button.
This will display the Setup BRX High-Speed I/O window. You can see that we have function 1 already programmed from last time. Select the Function 2… button.
The default is to have the function disabled. You will see that the default device name is HsCtrTmr2. This sets up the structure for the high-speed input function 2. A description of the three different modes is shown. Select the Timer tab along the top of the window.
Device Name – Name was given to this High-Speed Edge Timer function. This name will also be used as the name of the structure you will use to interact with this edge timer function in the ladder logic project. The device name can be 1 to 16 characters in length and consist of any combination of alphanumeric characters and underscores (‘_’, ‘a-z’, ‘A-Z’, 0-9), no spaces or punctuation marks are allowed, and must begin with a letter or an underscore.
Edge Timer Type – Specifies how the edge-to-edge timing will be measured and how that time will be used in the scaling function. There are two choices for the type.
– Edge Timer measures the time from the edge of a single pulse to the same edge on the subsequent pulse.
– Dual Edge Timer measures the time from an edge of a single pulse in one discrete input to the same edge of a single pulse on a second discrete input.
Edge 1 Input – Selects which of the High-Speed discrete inputs to use as the timer input. Dual Edge Timers require a second input. Edge 2 Input selects which of the BRX High-Speed discrete inputs to use as the second input.
Edge Selector -Specifies whether the rising edge -to- rising edge, rising edge -to- falling edge, falling edge -to- rising edge, or falling edge -to- falling edge is monitored for the edge timing function. Clicking the button cycles through the edge selections.
We will leave the default device name. The default input is X0 with the selection of Edge Timer will also be left as it is.
Enable Free Run – This causes the edge timer to automatically re-arm itself after each timing measurement. If unchecked, the edge timer must be manually armed for each measurement. See the help file in the Do-More Designer programming software to manually do each measurement.
Enable Timeout – Enabling this option and entering a timeout value (in microseconds) keeps the edge timer from “getting stuck” waiting for the second edge to signal the end of the timing. When the first edge is detected, if the second edge is not received before the timeout period expires, the $DeviceName.Timeout structure field is set ON. The Timeout value must be between 1 and 2,147,483,647 microseconds.
Enable the free run and timeout. Our timeout value is 100000 microseconds which are equivalent to 100 milliseconds. This is the same value we had for our time frame on the high-speed input count rate.
Interval scaling – This uses the time between input pulses to calculate the frequency of the input pulses, then normalizes that frequency to the desired time base. Interval scaling is typically used for units of speed, flow, velocity, etc., and is preferred over Rate Scaling for input pulse frequencies lower than 5KHz.
The interval scaling operation has the following three parameters:
– Timed Intervals / Unit – The number of pulses over a certain period, for example, the number of teeth on a gear, or the number of index marks on a belt.
– Unit Time Base – The time unit you want the interval normalized to, either unit per Second, Minute, or Hour.
– Scale Offset – You can set a fixed value to add to each frequency calculation.
You can optionally enable a Data Filter that will perform a rolling average of the Interval Scaled values over the time ( in seconds ) specified for the Data Filter. A value of 0 disables the use of the Data Filter.
We will enable interval scaling. The timed intervals unit will be 1024. This represents the pulses per revolution of our incremental encoder. The time rate will be units per minute. Our output will then be revolutions per minute (RPM). We will not use the scale offset or data filter.
Our high-speed input timer is now programmed. Select OK.
Here is our function 2 displayed on the setup BRX High-Speed IO window. Select OK.
Select the filters button.
The setup discrete input response times window will allow us to ensure the first three inputs (A, B, Z phases of our incremental encoder) to 250 000 pulses per second are set. (250 kHz) Select OK.
This warning indicates that we have changed the PLC system configuration. In order for this to function correctly in our BRX Do-More PLC, we must write this new configuration. Select Yes.
In the project browser window under I/O you will be able to see the structure for the high-speed input timer that we just programmed. ($HsCtrTmr2)
BRX Do-More High-Speed Input Timer Ladder Logic
Using the ladder logic developed last time for the high-speed input counter, we will add a new rung.
The structure listed in the project browser will show the variables available for our ladder logic. We will enable the timer and then compare the rates (counter, timer) to see if they are equal. If they are then output Y2 will be turned on.
Use the data monitor to view the structures and watch the values from our encoder pulses come in.
What you will see is that the high-speed input timer rate values are more accurate especially at the lower frequency inputs.
Watch the video below to see this high-speed input counter in action on our BRX Do-More PLC. The encoder is turned by a drill to show the rate comparisons.
Download the BRX Do-More program here.
BRX Series PLC from Automation Direct – Power to deliver
Overview Link (Configure and purchase a system)
Manuals and Product Inserts (Installation and Setup Instruction)
Do-More Designer Software (Free Download Link) – The software will contain all of the instruction sets and help files for the BRX Series PLC.
Watch on YouTube: BRX Do-More PLC High-Speed Input Timer
If you have any questions or need further information please contact me.
If you’re like most of my readers, you’re committed to learning about technology. Numbering systems used in PLCs are not difficult to learn and understand. We will walk through the numbering systems used in PLCs. This includes Bits, Decimal, Hexadecimal, ASCII, and Floating Point. To get this free article, subscribe to my free email newsletter.Use the information to inform other people how numbering systems work. Sign up now. The ‘Robust Data Logging for Free’ eBook is also available as a free download. The link is included when you subscribe to ACC Automation.