Debounce timer code needed

TeG

Member
Join Date
Nov 2007
Location
Memphis
Posts
3
Hello,
I'm having a problem with the parts counter on our robot cell, sometimes it's double counting the parts. I was wondering if someone could look at the ladder code and show me the best way of adding a debounce timer?

PartCounter.jpg
 
You should put the robot DO in series with the OSR, followed by AUTO mode for sure, and possibly the NOT suspend condition as well.


As constructed, your counter will increment any time the logic preceding the OSR goes true.

Edit (2): Which of those preceeding addresses do you want to count? Can it false trigger? If yes, then you need to know either the minimum duration of a true pulse or the minimum period of the true to true transition in order to make a debounce timer...

Only put known, solid definitions of "new part" ahead of the OSR.

If it is a Fanuc robot you can use the pulse output instruction to guarantee (in addition to comms error detection) that the output is ON for a duration long enough o trigger one count and not miss any...

I got bit by that once, at first not realizing that the order of operation is critical with this no-branch havin' logic...

Hope this helps,
Paul

Edit, that robot address is a PLC output...my mistake...so, do you want to count a part everytime the PLC tells the robot to unload?
 
Last edited:
Okay, so did you understand what I meant by using that in series with the OSR?

In your image, the OSR will fire every time ANY of the three conditions is goes from false to true while the other two are true.

So, the robot unload part command from the PLC to the robot is the action you are counting. You are counting false to true transitions of that bit. I am not 100% sure that is the best choice. I would, if possible, let the robot tell me it just unloaded the parts before counting them. Count a digital input from the robot...

Take the AUTO instruction out of the rung entirely unless:

If you only want to count "Robot Unload" commands in AUTO, put the AUTO instruction AFTER the OSR. Then the OSR will not trigger a count if the "robot unload: command is already true when the AUTO bit comes on.
You will have to explain the NOT Suspend bit...again, is that a condition you want to count? Can that address become zero while the robot command is already on?

If either of the conditions "XIC AUTO" or "XIO Suspend" can make a true to false to true transition while the robot unload command is on, then "sometimes it will double count parts".

Hope this helps,
Paul
 
Last edited:
Ok, so I made it so now the robot turns an output on when it finishes the unload program. I just want to point out that this was not my program, and I have no training in Rslogix (im sure you could tell) but I was just trying to fix a problem I've been having.

NewCounter2.jpg
 

Similar Topics

Hi guys, I am pretty new when it comes to programming. I am working with CX-Programmer and I am having a problem where I have a sensor on my...
Replies
6
Views
625
Hi Group I have an on/off type steam valve which is set to maintain temperature in a vessel. If the PV drops below setpoint, the valve is...
Replies
4
Views
1,659
Working with a huge PLC 5 program that does not have much memory left in the processor and it has about 600 alarms in all and about 270 of them...
Replies
12
Views
4,072
Ok, I'm using Rockwell's PlantPax add on instructions. In the package there is a Digital-In function that has a "Debounce" option, which doesn't...
Replies
7
Views
6,533
Hello Again, Simple question for you guys. I am having trouble with a n.c. air pressure switch. I believe I need to have some debounce? in my...
Replies
5
Views
4,660
Back
Top Bottom