PLC Not fast enough?

Join Date
Dec 2019
Location
Manitoba
Posts
4
Hello,
I used a Schneider Electric SR3B261B PLC to create a trivia machine (as I call it). Basically 20 buttons that let contestants ring in to trivia. There is a display that shows the number of the person who rang in. It works pretty well unless people press the buttons at exactly the same time. Then it shows 2 results at the same time. Usually resulting in a display of 18 when really it was 12 and 14 that rang in, for example.
The PLC has options for:
"Adjustment of the basic cycle time of the module." and "Type of Hardware Input Filtering."
Which I assume would make the PLC operate faster and avoid two inputs triggering at the same time. If I change the setting and update the changes do not keep. I appear unable to change it past 20 x2 ms and slow (3ms).
Is that a correct assumption that changing this would fix it?
Why can I not change this? Is it because I have so many inputs (14 or so) and Outputs (16 or so)? or because my program uses nearly all 240 lines of ladder logic allowed?
What can I do to fix this?



Options.jpg.c8d008d056de7234647dda6ac7bc7ff2.jpg
 
Why not bebouce the buttons with a timer so each button has to be pressed for 300mS to acknoledge a real press.
 
If two people started holding the button at the same time and the timer completed at the same time wouldn't that be the same issue?


Also another issue that I could have had was that people could hold the button down before the "host" finished talking and activated the game. In that case multiple people could be "pre rung in" and activate at the same time. To solve that I made it so that pressing or even holding the buttons down only sent a short pulse.
 
You will never eliminate the issue of two inputs becoming true in the same program scan. Your best bet will be to include a tiebreaking routine in your logic.
I have never heard of this concept. Could you give me some pointers on how to do that?


Also I have almost used up all allowed lines of ladder logic to make this already.
 
The way that most PLC's work is to scan inputs before scanning the program so if more than one button is pressed at the same time for example within 40ms then the logic will see all buttons that have been pressed during the scan cycle.
Your program is also probably not correct as well in normal circumstances you would lock out all buttons after seeing one pressed however this would mean that if your program is in sequence then the first button in the sequence logic would be the one every time in other words if input 1 was pressed at the almost same time (within 40ms) of button 5 then it would always be button 1.
The only real way is to use the inputs in an interrupt however this may not be possible in that PLC. Not sure why you are getting 18 we would need to see a printout of the logic.
 
The way that most PLC's work is to scan inputs before scanning the program so if more than one button is pressed at the same time for example within 40ms then the logic will see all buttons that have been pressed during the scan cycle.
Your program is also probably not correct as well in normal circumstances you would lock out all buttons after seeing one pressed however this would mean that if your program is in sequence then the first button in the sequence logic would be the one every time in other words if input 1 was pressed at the almost same time (within 40ms) of button 5 then it would always be button 1.
The only real way is to use the inputs in an interrupt however this may not be possible in that PLC. Not sure why you are getting 18 we would need to see a printout of the logic.
If the relay that activates the outputs to display 12 and the relay that activates the outputs to display a 14 are both active they are superimposed and it results in an 18, for example.
 
The only real way is to use the inputs in an interrupt however this may not be possible in that PLC.
Even interrupts have a hierarchy.

I have never heard of this concept. Could you give me some pointers on how to do that?
It depends on what you have available in your instruction set. A tiebreaker is simply a mechanism to arbitrate between two or more inputs that may become true in the same program scan.
You could make each input latch on an internal bit and use a NC contact from that internal bit to prevent the inputs in subsequent rungs of logic from showing as having "rung in". That would be the simplest method, but it would have a bias toward the inputs that are processed earlier in the program.
 
Have the PLC, instead of looking at the PB ON, have each PB trigger a OneShot then look at the OneShot after an entry is allowed. If someone presses and holds their button early the OneShot would have passed and the press not be recorded.

It is unlikely that 2 OneShots could be ON during a single scan, but if there are more than one on for that scan you could ignore any following OneShots if one is accepted (a little in the favor of the first player scanned) or you could alternate each 'tie' and pick #1, then #2, then #3 each following tie.
 
To do this right you'll have to have a way to arbitrate ties. No matter how fast your PLC is or how fast the I/O is scanned, there is always the chance that more than one player will hit on the same I/O scan. It might happen more often than you think. In these cases the fairest solution would probably be some type of random number generator that would select the winner from the tied players. Simply processing the ties in the order they are scanned will of course favor certain players based on their positions. It all depends on the application... obviously the requirements for a classroom setting would be less stringent than those for a nationally televised game show.

All of this is moot however because the controller you mentioned is basically a smart relay and doesn't have the necessary horsepower to implement all this.
 
I cannot see any real answer If two people press a button exactly at the same time then there is no way in any technology can detect this as who came first as they both did. so there will always be one of three possible answers. Accept that both pressed the button at the same time, one or the other will win the right to answer based on the hierarchy of the logic or there is a draw & no lights lit so the question is to be nullified. of course this will be based on the length of the cables so in theory all cables from the buttons would have to be exactly the same length like the Kray.
An interesting spin-off from this is are all game shows buzzer technology biased on the basis of a hierarchy of the circuitry?. :confused:
 
Hmm... Two pressed at same time... Give them an 88 display, and this tells them there is no winner. The next person to press a button (without any others pressing at exactly the same time) is the winner.

Fun! Also possible that person three is the winner, having not pressed their button in the first tie!
 
Hmm... Two pressed at same time... Give them an 88 display, and this tells them there is no winner. The next person to press a button (without any others pressing at exactly the same time) is the winner.

Fun! Also possible that person three is the winner, having not pressed their button in the first tie!

Or, if that PLC can implement a random numbers generator, assign a win to one of the simultaneously detected button inputs using a random value.

That would be at least fair :)
 
Or, if that PLC can implement a random numbers generator, assign a win to one of the simultaneously detected button inputs using a random value.
Just set up a counter that increments every scan. If the accumulated count is even, the lowest numbered member of the tied group wins. If odd, the highest number wins. The existence of a tie is enough of a random factor, equally likely to occur during an even or odd numbered scan. That certainly should eliminate bias between two inputs tied. Not sure about more than two inputs tied though.
 

Similar Topics

Hello Beckhoff experts. I want your opinion on whether the hack I explain below is possible or whether I should forget about it. Our Beckoff PLC...
Replies
8
Views
4,614
Old equipment, trying to run faster than designed. I have a client that is still running a PLC5/40 on an extruder line. They are using a 10ms STI...
Replies
16
Views
2,828
Task Description: Currently I am working on a program in C # for reading data from RSLogix5000 Series controllers (v18.11). The idea is to do...
Replies
36
Views
18,334
I have a need for a system to monitor multiple pressure transducers to detect transients in the 1mS time range. After looking at numerous A/B...
Replies
8
Views
2,884
Hi everyone, long-time reader of the forum, first-time poster. I have a customer that we've built a number of machines for that would like to do...
Replies
8
Views
3,334
Back
Top Bottom