Programming an input to debounce on and off can be done using logic control systems like Programmable Logic Controllers (PLCs). This process helps to ensure the accuracy of signals sent to and from PLCs and eliminates noise interference.
Using the Productivity Suite PLC Programming software, we will demonstrate the ladder logic using the simulator. We will program an input to debounce on and off in a PLC in several ways. This allows us to write, test and modify our program without having actual hardware. Let’s get started.
What is a PLC input bounce?
Bounce or chatter usually occurs with PLC inputs. An input switch bounce is an electrical phenomenon commonly occurring when a button or switch is activated. When the switch contacts initially touch, they physically “bounce” back and forth for a few milliseconds, causing multiple on/off cycles to occur quickly.
This can cause issues with your electronics setup if not accounted for, as it may register false inputs or misinterpret the intended action of the switch. This action can also take place when the input turns off. When designing circuits that use switches or buttons, you can often include program circuitry to filter out these bounces and ensure that your device registers only one action.
What is ladder logic chatter?
Chatter can also occur within the Ladder Logic if various Logic conditions have been programmed that cause the Output result to alternate every other Logic Scan for a short period.
If the result is used to control an Output Module wired to a real-world device, such as the Coil of a motor starter, then the motor starter will possibly Chatter (input chatter), causing damage to the motor starter’s Contacts.
PLC Input Filter Times
Some programmable logic controllers will have filter times that can be changed. The time in frequency can be set longer than the input chatter. This ensures that the program will only see a single transition from off to on or on to off.
Here are the default input filter times for the BRX Do-More PLC. You can learn more about this PLC controller at the following link. BRX Do-More PLC Series
Debounce Coil (DBN) Instruction
The productivity suite has a Debounce Coil (DBN) instruction. This solves the problem by allowing you to program an adjustable “OFF to ON” Time Delay and an adjustable “ON to OFF” Time Delay. The Time Delay values are set to millisecond values. The value chosen should be longer than the time the Chatter occurs.
This is the programmable logic diagram (PLD) or ladder logic programming code. We will be using the first input on our PLC simulator. However, a real-world example would be a pressure switch used to control the digital input from a pump. Watch the video below to see this ladder logic debounce in action.
Using an On-Delay Timer for Debounce
Your controller may not have a debounce coil instruction. In this case, we can make the debounce PLC circuit using an on-delay timer.
The on-delay timer will have an input rung. This rung must be logically true for the timer’s duration before the output turns on. Individual on-delay timers are used for the input on and off state.
The output is set if the input is on and the timer is on.
The output is reset if the input is off and the timer is on.
Watch the video below to see this ladder logic debounce circuit in action.
Test the Debounce PLC Ladder Logic Circuits
Using the “Data View” in the productivity suite programming software, we can test this circuit using the simulator.
As you can see, this ladder logic circuit is very effective and relatively easy to understand.
Download the Debounce Ladder Logic PLC Program here.
Watch below to see the logic of debouncing circuits in action.
EasyPLC Software Suite – 3D training package
Purchase your copy of this learning package for less than USD 75 for a single computer install or less than USD 100 to allow different computers.
Receive 10% off the investment by typing in ACC in the comment section when you order. http://www.nirtec.com/index.php/purchase-price/
Learn PLC programming the easy way. Invest in yourself today.
C-More EA9 Series of HMI
(Webserver, FTP, Data Logging, Free Remote Apps, etc.)
Node-Red is a free IoT software hub that can communicate MQTT and many standard industrial protocols. This series will help you communicate to the PLC, create an HMI on any electronic device, log data to a database, and view the information on a spreadsheet for analysis.
Node-RED IoT enabling software
Watch on YouTube: How to Program PLC Input Debounce On and Off
If you have any questions or need further information, don’t hesitate to contact me.
If you’re like most of my readers, you’re committed to learning about technology. Numbering systems used in PLCs are not challenging to learn and understand. We will walk through the numbering systems used in PLCs. This includes Bits, decimals, Hexadecimal, ASCII, and Floating points.
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 for free download. The link is included when you subscribe to ACC Automation.