Sign in to follow this  
Followers 0
Emerald

PLC Not fast enough?

7 posts in this topic

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?

 

Emerald

Options.jpg

Share this post


Link to post
Share on other sites

why would you use smart relay or PLC for this? inputs are filtered and have response time of 3-10ms which is waaaaay too long for such application and this is without considering scan time. i would look for something that does not have filters or scan at all. and if it does, then it should be at several orders of magnitude faster.  

btw, how do you get 18 from 12 and 14?

Share this post


Link to post
Share on other sites

Zelio's are really only good for temporary pump control.

Share this post


Link to post
Share on other sites
On 11/30/2019 at 4:43 PM, panic mode said:

why would you use smart relay or PLC for this? inputs are filtered and have response time of 3-10ms which is waaaaay too long for such application and this is without considering scan time. i would look for something that does not have filters or scan at all. and if it does, then it should be at several orders of magnitude faster.  

btw, how do you get 18 from 12 and 14?

I used a digital display that tells which section of the digits to light up.  If pressed fast enough both 12 and 14 get triggered before the function that locks out anyone from pressing any other buttons.  So a 12 and 14 superimposed become 18.

 

Do you know why I cannot set the PLC faster?  It claims to be able to operate much faster but wont take the changes.  Is there some sort of limitation I am not aware of?

Digital.jpg

Share this post


Link to post
Share on other sites

why bother, it's still orders of magnitude too slow... looking at something that may get you to milliseconds when you should be aiming for nano seconds is waste of time. noreover, your logic is not good. regardless of acquisition and processing speed, it should not display corrupt result... ever

Share this post


Link to post
Share on other sites

OK.  Thank you for helping so far.

 What would you suggest I use instead?  I did some research and it seems an Arduino would be a good option.  Can you recommend one for this task?

 

I'm confused about your comment that my logic is no good.  You say it should never display a "corrupt" result.  Since that is the only issue I am having and you seem to indicate it is a programming issue, why are you also saying speed is an issue?  Your comment implies (even if you didn't mean it to) that if a programming error is fixed then my problem will go away.

I programmed with ladder logic.  What I did is when someone rings in, it disables all the buzzers until reset by the "host" of the show.  Also I made it so that pressing and even holding down the button only sends a quick pulse, rather than being able to hold closed a contact.  The thing is that if two people ring in at exactly the same time it activates 2 relays at the same time and both send instructions to the outputs resulting in more than one set of lights lighting up.  It activates 3 relays at the same time really.  It activates lets say the relay that makes a 12 display and the the relay that makes a 14 display, as well as the one that disables all the buzzers.  Since they all activate at the same time they all happen.

When I programmed this I assumed (incorrectly) that as soon as someone pressed a button it would disable the buttons, but instead what happens is that after a person presses a button there is actually a delay (milliseconds only I would guess) allowing another button to still activate it's relay.

 

So which is it?  The programming is wrong? The Relay is too slow?  Both?  Could you elaborate on the answer you give please?

Thank you again.

Share this post


Link to post
Share on other sites

what are the specs or requirements? always start with definition of the problem.

 

speed can reduce chance of problem (use custom hardware, not stock PLC). but even then chance of a tie exists. you can never eliminate it so you need to HANDLE it.

in other words, i don't know what your logic looks like but even if the acquisition portion is slow (due slow scan or input filters), you still need to evaluate it and make a decision and then display result. if the result is not unique, do not display garbage... rather don't display anything and light a TIE lamp for example... or on a segmented display show some special pattern such as "-"

if using PLC (even slow one) one can do something like this:

i am using AB style logic but same should be usable on any platform:

EQ = check if values are equal

NEQ = check if not equal

SUB = subtract (c=a-b)

AND = bitwise AND

MOV = move/copy value

BUTTONS = group of inputs (contestants buttons) such as I:1 (could be wired to 16 buttons I:1/0 ... I:1/15)

STATUS, STATUS_NEG, RESULT = group of bits such as N7:0 or B3:0

DISPLAY is group of outputs driving display, such as O:2 (could drive 16 lamps O:2/0 ... O:2/15)

 

instruction SUB and AND are used to find if there was a unique bit set in STATUS

 

 

quiz.png

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0