how do I 'queue' machines using PLC & relays

hickman

Member
Join Date
Aug 2003
Location
North Central Texas
Posts
31
I have 12, 3-phase, motor-starters that I want to be able to control. Each motor-starter is 240VAC with a 240VAC coil. Currently, a pressure switch breaks/makes one leg of the coil for control.

I want my program to scan units 1 thru 12. When it finds a unit that needs power, the PLC should allow the unit to come on, but NOT continue scanning until a timer expires (30 sec). The only way I've found to implement this, so far, is to put the 30 second time delay in between units scanned. In other words, I check In_1 for service request. Wait 30 seconds. Check In_2 for service request....

My solution is not very efficient, but it IS do-able. I'm just looking for a more efficient solution.

Thanks in advance for the help!
 
I really don't understand what you're trying to do, but...

If you want to 'speed up' what you have already, you could look at skipping the delay if a unit is already on. Something along these lines:

Check In_1 for service request
If In_1 is off, enable that starter and start a 30 second timer
If In_1 WAS already on OR when timer expires, check In_2 for service request
etc...

This will advance your queue straight to the next starter (in sequence) that needs power, skipping the ones that are already on. When it finds one that's off, it will turn it on and wait 30 seconds before continuing.

If that doesn't make sense to you, post the code you're currently using and we'll try and 'modify' it for you.

beerchug

-Eric
 
The PLC will and should continue scanning in any case.

It apprears that what you want to do is ignore all requests for 30 seconds after responding to a request.


The Timer...



PREPARE TO
CHECK
MTR
----| |---------(RST) RUN TMR

RUN
TMR
----|/|---------( ) CHECK MTR


RUN +---------+
TMR | |
----| |-------+ 30 secs +-------( ) PREPARE TO CHECK MTR
| |
+---------+


.

On the first scan CHECK MTR is OFF so the (RST) RUN MTR is ignored.
RUN TMR is OFF so CHECK MTR is turned ON.
RUN TMR is OFF so the Timer is RESET and PREPARE TO CHECK MTR is OFF


XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


Checking for motor requesting start-up...

CHECK MTR was turned ON in the previous rungs.
CALL MTR-X represents your "request to run".



CHECK CALL MTR-1
MTR MTR-1 is ON
---| |-------| |-------|/|---+---( ) Start Mtr-1
|
+---(RST) CHECK MTR
|
+---(SET) RUN TMR

CHECK CALL MTR-2
MTR MTR-2 is ON
---| |-------| |-------|/|---+---( ) Start Mtr-2
|
+---(RST) CHECK MTR
|
+---(SET) RUN TMR


.
While CHECK MTR is TRUE, if a CALL MTR-X comes in, then
turn on the bit to start that motor - this is only a start flag to
the actual motor control rung. The flag will stay on for one scan.

At the same time, CHECK MTR is (RST) to OFF. CHECK MTR is OFF in all
of the following rungs. Those rungs can not evaluate as TRUE. This
is essentially a "jump" to the motor control rungs.

Also at the same time, the RUN TMR bit is SET ON.

Repeat for each motor

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Starting a motor that has just requested statup...




Start Call
Mtr-1 Mtr-1
---| |---+---| |------( ) Run Mtr-1 <<-- output to the motor mag
|
Run |
Mtr-1 |
---| |---+

Repeat for each motor

As long as the CALL for MTR-X remains ON the motor stays on.
You might certainly consider inserting other conditionals... E-Stops, etc.



.
.
 
Can't post code: using function block in Concept

Concept won't allow me to 'cut n paste'. But what I'm trying to accomplish is load balancing, except I'm only balancing the startup load .

If a unit is running, it should continue to run until it's normal limit switch turns it off. If, however, it is NOT running and wants to start, the PLC should allow it to come on, wait 30 seconds, then move on to the next unit. During that 30 seconds, no other unit should be allowed to start.

Again, I have the Function Block code functional. It's just not as efficient as I'd like it to be. I need to move my timer to only be active when a unit is being serviced (started).

Sorry for being so unclear.

Thanks again for all the help!
 
I was wondering if you couldnt use something along the lines of SFCCNTRL...I am not that familiar with Concept so I am just throwing out ideas.

Seems to me you could create a sequencer with time and/or event conditioning..ie when the machine is started I assume the pressure switch is calling so the sequencer would start the motors in order. Once they have all been started the sequencer resets and starts again but since the event (motor is on) is there it moves on to next step. If it sees a pressure switch calling and the motor NOT ON then it times to restart it.

This make sense?
 
Pretty easy to control. I do it all the time for sequential start up for pool filtration boards to reduce inrush.
The first rungs in the programme should detect a start signal for a motor. Use a DIFF UP to set a latch. Have the latch run a 30 second timer. When the timer times out, reset the latch.
Use logic in the motor start output rung to allow the first motor to start. Also use an ignore routine if the latch is set and the motor is running.
I normally have a "request or OK to start" rung for each motor. Then place the latch in each output line.
You could also use the same basic first rungs and combine with a shift register but the programming would be more complex.
beerchug
 
I just made up a quick code fragment for you to look at.

This is done on RSLogix5. You should be able to convert it to any other processor of your choice.

If I understood you correctly this program should do what you want.

Rungs 7 - 18 can be further simplied into 4 rungs if need be.

the 12 motors are connected to Real World Output Bits 0 - 11
The Pressure Switches are N/O,

make when the pressure is achieved.

These are connected to Real World Input Bits 0 - 11 correspondingly.

(This I/O order is important for the code to work............ design end of it if you want to call it....)
 
So... Hickman...

What is it about your requirements that my suggestion doesn't satisfy?

If a unit is running, it should continue to run until it's normal limit switch turns it off.

Yeah... got it. If Start Mtr-1, then Run MTR-1 while CALL MTR-1

If, however, it is NOT running and wants to start, the PLC should allow it to come on, wait 30 seconds, then move on to the next unit.

Yeah... got it.
Start MTR-1, and RUN TMR.


During that 30 seconds, no other unit should be allowed to start.

Yeah, Got that too! While RUN TMR don't even look to see if any other motor wants to start. CHECK MTR is disabled.

I need to move my timer to only be active when a unit is being serviced (started).

And that too!

So what's up?

You say...
"But what I'm trying to accomplish is load balancing, except I'm only balancing the startup load."

That simply doesn't make any sense.

You have 12 3-phase motors... (all fed by the same source, I assume)

If all 12 motors are running, the load would be balanced.

If all 12 motors started at the same time, the load would be balanced.

Could it be that you are really trying to balance motor run time?
(If so, do a search on-site for "bubble" as in bubble-sort)

I'm pretty sure that this is a "terminology" issue.

Maybe you could expand on what you mean by "load balancing" and "balancing the startup load".
 
Terry said: [Maybe you could expand on what you mean by "load balancing" and "balancing the startup load".]

The power company won't allow us to start more than one unit at a time due to the extra power consumption upon startup. Once the startup period (approximately 30 seconds) has past, then I can allow another unit to start. I want to balance startup load: that extra load upon startup.

It doesn't matter, in this case, how many units are "running" at any given time. The prerequisite is that we don't "start" more than one unit at a time.

Hope that helps clear it up. I knew I'd have problems conveying my question. Sorry about that! banghead

Thanks for all the help!
 
Terry's code

he code that Terry posted will do exactly what you want.

What follows is just a modification of it that may make it a little easier to follow:

START_M01 ALLOW_ANY_START STOP_M01 Motor01
-------| |------------| |------------+-----|/|-----+----------( )
| |
Motor01 | | ALLOW_ANY_START
-------| |---------------------------+ +---------(RST)


START_M02 ALLOW_ANY_START STOP_M02 Motor02
-------| |------------| |------------+-----|/|-----+----------( )
| |
Motor02 | | ALLOW_ANY_START
-------| |---------------------------+ +---------(RST)

... duplicated for each of the 12 motors......


ALLOW_ANY_START +--- TIMER -+ ALLOW_ANY_START
-------|/|------------------| 30 sec |------------------(SET)
+-----------+



Once a motor is started, ALLOW_ANY_START is reset. Since it reset, no motor will start (but any running motor will continue to run). When 'ALLOW' is reset, the 30 second timer delays setting it. Once set, the next motor can be started.

This is EXACTLY what Terry posted (I just put the timer after the code, and combined his motor permissive (CHECK_MTR) and timer enable (RUN_TMR) bits into a single permissive (ALLOW_ANY_START). He also included some PLC-startup logic which is important, but not part of the core logic.

The way you describe your logic, it can take up to 5 1/2 minutes for a motor to be started after the system determines that it needs to be started, which, I agree, is not efficient.

Some caveats associated with the above logic:
1) The concept of "the next motor is started" In this logic, "next" is going to be determined by scan order (assuming that two motors are needed to start during the 30-second wait time.)

2) In the logic above, there is an assupmtion that the START_M01 bit is coming from some logic in the PLC that will remain set while waiting for Motor01 to come on. If the START bit is fleeting (an operator PB, or a PLC one-shot), then you need to capture the fact that the bit is set, and keep it set until Motor_01 is started (which, again, Terry covered, in his "CALL M-01" vs. "START M-01" bits. The only thing that might be missing would be a sealing branch around the CALL bit. )
 
Think of it as start inhibit

Is the order in which the motors are started important?

I had been thinking about merely one-shotting all the motor start bits to initiate a self latched timer. You could then use the timer not energised (assuming AB, sorry) as the enable for the motor start or demand scan sequence.
 
PLC continues to scan regardless....

I tried Terry's code. And I AM using one-shots to try each motor. The PLC continues to scan to the next input that way. I need to pause the process until the timer expires. I've done that with the timer at the top-left of the graphic. It waits 5 seconds after supply power is restored. Then, it allows the processing to begin. I just can't seem to figure out how to place the timer mid-stream. Must be brain melt-down. :confused:

screen_shot.jpg
 

I tried Terry's code.

And I AM using one-shots to try each motor.

The PLC continues to scan to the next input that way.

I need to pause the process until the timer expires.

I've done that with the timer at the top-left of the graphic. It waits 5 seconds after supply power is restored. Then, it allows the processing to begin.

I just can't seem to figure out how to place the timer mid-stream. Must be brain melt-down.


Is that graphic supposed to represent "my" code? It sure doesn't!

Isn't it the case that any one of the motors might want to start at any time? Perhaps Mtr-3 wants to start, then Mtr-8, then Mtr-2...

In your scheme if your counter was at "4" just as In3 came ON for Mtr-3 you would have to wait until you tried 5,6,7,8... all the way through the list until you restarted the list again before you could try Mtr-3.

DON'T USE THE SELECTOR!

Instead of using Chk_1, Chk_2, etc in your AND_BOOL's, use CHECK_MTR in all of them.

Add another pair of SR's in parallel with each of the Start_# SR's.



In_1----->+----------+ +--------+
| AND_BOOL |------+-------->|S1 SR |---> Start_1
CHK_MTR-->+----------+ | In_1->o|R |
| +--------+
| +--------+
| |S1 SR |---> Check_Mtr
+-------->|R |
| +--------+
| +--------+
+-------->|S1 SR |---> Run TMR
|R |
+--------+


.
.
Use the RUN TMR to start the timer. When the Timer Times out, Turn ON CHK_MTR and Turn OFF RUN TMR.

This way, the very next motor that wants to come on (any of the 12) can... after the 30-second delay.

Also, be sure that the motor is not already on (as I showed in my original code). Otherwise you'll be stuck on timing out on the first motor in your code sequence.

A thought just occurred... I'll bet you are really limited in the number of logic blocks you have...?
 
Last edited:
Is that graphic supposed to represent "my" code? It sure doesn't!
You're right. It's not your code. It's the code that I wrote initially. It's already in place, and running just fine. My purpose it to fine tune the app.

Isn't it the case that any one of the motors might want to start at any time? Perhaps Mtr-3 wants to start, then Mtr-8, then Mtr-2...
Yep. You're right. They'll get serviced in that order. Yes, they'll have to wait 'til the SELECTOR comes around again. THIS IS my problem. My current code works without flaw, I just want to make it more effecient. This is the primary example of one of the things that needs to be more efficient.

Instead of using Chk_1, Chk_2, etc in your AND_BOOL's, use CHECK_MTR in all of them.
If I do that, multiple units that request service at the same time, can start simultaneously (ie. a power outage and all t-stats go high. Power comes up with ALL units requesting svc at the same time). That defeats my purpose. I want to achieve exactly the opposite. I want to NOT allow multiple units to start at the same time.

Also, the SELECTOR uses the output of the counter to scroll thru the motor list. It tries each motor in sequence due to the counter output. Show me a different way to do it and I'll definitely try it.

I'll bet you are really limited in the number of logic blocks you have...?
Concept has approx 2 dozen logic blocks, including AND, NOT, OR, XOR, ROL, ROR, SHL & SHR.

đź“š I'm still trying to figure it out. I don't give up easily.
 
Last edited:

Similar Topics

The idea here is to provide for a brief rapid influx of message codes while preventing sequentially repeating the same message. i.e. if two...
Replies
22
Views
426
I'm fairly green at PLC programming compared to everyone here. I have a firm understanding of most commonly used instructions. Everything I've...
Replies
19
Views
7,962
Hello everybody. For a project, I need to make a queue that stores REAL's. There needs to be the possibility to select a place and than move the...
Replies
9
Views
2,467
So, I'm very new to PLC and HMI's and I was asked to investigate something that occurred with my client's system: They set up a queue list of...
Replies
2
Views
1,534
Well can anybody give me a head start on some logic, I cant just seam to get a start. What I need is 4 lanes to queue and and which ever lanes is...
Replies
13
Views
2,972
Back
Top Bottom