Efficient Debouncing Method in Ladder Logic Using TOF Timer Controls

Question:

Hello everyone. Is this the most efficient method for debouncing inputs in Ladder logic (with 2 inputs being debounced)? The use of a TOF timer controls the process. I anticipate having numerous timers if I continue with this approach due to the abundance of inputs requiring debouncing. Creating an AOI could potentially add complexity (requiring a tag for each AOI and an intermediary tag for writing into the AOI input). Any recommendations for optimizing, streamlining, or enhancing this process?

Top Replies

Upon initial assessment, your proposed solution may seem excessively intricate. To better understand your goals, could you provide more detail on the desired outcome? Typically, I utilize a single timer for debounce; are we aligned on this concept? When the pressure is within the acceptable range, does this mean the contact is closed? Thus, my logic would dictate: if the system is operational and the pressure remains low for a specified duration, trigger an alarm using a singular timer.

Ken Moore expressed that your solution seems overly complex at first glance and requested further clarification on your objectives. He mentioned that he typically uses a single timer for debounce and questioned if you have the same understanding of "debounce." In the scenario where a wired input triggers an alarm after a 2-second confirmation period, it is essential to ensure the input remains stable. Without a reliable method, the alarm may continuously trigger, causing frustration for the operator. To address this issue, a Time-Off Delay (TOF) function is utilized to confirm that the alarm has been cleared before it can reoccur. The goal is to prevent the alarm from repeatedly cycling on and off, ensuring that it is genuinely cleared before resetting. Although the term "debouncing" is commonly used, there may be a language barrier as the discussion involves French-speaking individuals.

In English, debounce is a widely-used term. A well-known pattern for debounce can be found here, but it’s important to determine if it fits your specific requirements. While debounce on the release may not always be top of mind, it is a key component of this established pattern and aligns with the context you’ve outlined.

This approach utilizes just 1 timer, resulting in a debounced signal of GRT.ACC 4999. It is important to assess if this method is suitable for your specific circumstances. While this may not be clearer, I personally believe that stacking timers can be unnecessarily confusing.

That's exactly what I'm referring to. In my industry, there isn't a strong inclination towards embracing technology, with a reliance on basic devices like mechanical pressure, level, temperature, and flow switches. These devices often exhibit erratic behavior when operating near the setpoint, so I implement debouncing techniques similar to using hysteresis on analog inputs. Sometimes, I even apply debouncing on analog devices. Otherwise, operators monitoring alarm systems for 40 hours a week become frustrated when switches cycle on and off unnecessarily. I have developed a custom quick-use block in Function Block Diagram (FBD) programming, as ladder programming can be laborious and time-consuming. I am searching for a more efficient solution than what I have described here.

While your approach using a TOF timer is valid and functional, you're right in anticipating the potential clutter of multiple timers if you have a lot of inputs to debounce. One alternative that may simplify things for you is to utilize a State Machine. This approach can handle all your inputs and effectively debounce them, decreasing both clutter and processing time. Though it does have a learning curve, once set up it can streamline your processing substantially. Even if you're unfamiliar with State machines, delving into them could be beneficial in the long run not just for debouncing but also for handling other robust tasks in your ladder logic.

Your current method of using a TOF timer for each input in Ladder logic is indeed quite effective but as you've pointed out, it can get cumbersome handling numerous timers for multiple inputs. My suggestion would be to consider using an array of timers along with an indexed addressing method. This way, you only use as many timers as there are actively debouncing inputs. As for AOIs, although they might add an initial layer of complexity, they can greatly enhance the organization and readability of your logic once you get the hang of them. It's a bit similar to how functions can streamline code in text-based programming languages.

More Replies β†’

Streamline Your Asset Management
See How Oxmaint Works!!

βœ…   Work Order Management

βœ…   Asset Tracking

βœ…   Preventive Maintenance

βœ…   Inspection Report

We have received your information. We will share Schedule Demo details on your Mail Id.

To add a comment, please sign in or register if you haven't already..   

Frequently Asked Questions (FAQ)

FAQ: 1. What is the efficiency of using TOF timer controls for debouncing inputs in Ladder logic?

Answer: - Using TOF timer controls for debouncing inputs in Ladder logic can be efficient, but it may lead to numerous timers if there are many inputs requiring debouncing.

FAQ: 2. Are there alternative methods to optimize the debouncing process without using numerous timers?

Answer: - One alternative method to optimize the debouncing process without using numerous timers is to consider creating an AOI (Add-On Instruction), although it may add complexity by requiring additional tags.

FAQ: 3. How can the debouncing process be streamlined or enhanced in Ladder logic?

Answer: - To streamline or enhance the debouncing process in Ladder logic, you can explore different approaches such as optimizing timer controls, using AOIs efficiently, or seeking alternative solutions that balance efficiency and complexity.

Ready to Simplify Maintenance?

Join hundreds of satisfied customers who have transformed their maintenance processes.
Sign up today and start optimizing your workflow.

Request Demo  β†’