This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.  
Your Personal PLC Tutor Site - Interactive Q & A

""Sequencing of Multiple Pumps" "

New Here? Please read this important info!!!
Email this topic to a friend
Printer-friendly version of this topic
Locked thread - Read only 
Previous Topic | Next Topic 
Home Conferences Questions/Answers--Early 2001 (Public)
Original message

nigelS Click to EMail nigelS - (3 posts) Click to check IP address of the poster Apr-19-01, 06:19 AM (EST)
""Sequencing of Multiple Pumps" "

This is to be my first serious PLC project - I've done an Allen Bradley SLC course & understand the basics, but am having problems making a start:
We have an existing installation in which 5 pumps are switched in as required by a fairly crude step controller taking a 0-10V signal from a Eurotherm controller which in turn takes an i/p from a pressure transducer. The object is to maintain a nominally constant supply pressure over a widely varying demand range.

The intention is to install a small (probably Micrologix) PLC to implement the following:

1) Perform the step controller function (retaining the existing Eurotherm controller)

2) Periodically rotate the switching order to equalise run hours.

3) Detect if any pump(s) becomes unavailable - i.e. switched out of 'auto', trips or fails to start etc. & re-order the switching
sequence accordingly

I wonder if anyone has done anything similar & could point me in the right direction?


  Top

 Table of contents

RE: "Sequencing of Multiple Pumps" , Tom Jenkins, Apr-19-01, (1)
RE: "Sequencing of Multiple Pumps" , Allen Nelson, Apr-19-01, (2)
RE: "Sequencing of Multiple Pumps" , Terry Woods, Apr-22-01, (3)
RE: "Sequencing of Multiple Pumps" , Wildpen, Apr-23-01, (4)
RE: "Sequencing of Multiple Pumps" , Terry Woods, Apr-29-01, (5)
RE: "Sequencing of Multiple Pumps" , Terry Woods, Apr-30-01, (6)
RE: "Sequencing of Multiple Pumps" , ShawnB, May-01-01, (7)
RE: "Sequencing of Multiple Pumps" , Allen Nelson, May-02-01, (8)
RE: "Sequencing of Multiple Pumps" , NigelS, May-03-01, (9)

Lobby | Topics | Previous Topic | Next Topic
Messages in this topic

Tom Jenkins Click to EMail Tom Jenkins - (768 posts) Click to check IP address of the poster Apr-19-01, 09:18 AM (EST)
1. "RE: "Sequencing of Multiple Pumps" "
I have seen a couple of schemes that work OK for this, but most are for three pumps. It will be a little more complicated with 5.

If you want to use an external switch the simplest way is to have five different positions, and five fixed sequences. 1-2-3-4-5, 5-1-2-3-4, 4-5-1-2-3, etc. This works OK, but you will have to add logic so that if one pump in the sequence is failed the next in line starts up. The disadvantage is that some sequence combinations are not available - for example 5-1-4-2-3.

I usually use an operator interface for setting the lead, lag1, lag2, lag3, and standby. For example you can set pump 1 as lead, pump 5 as lag1, etc. You logic sets to run lead, run lag 1, and run lag2 based on demand, and then you use additional logic to determine which pump this is. If a pump fails you rotate it to the standby and move eveybody else up one. This system also allows you to easily implement first on first off alternation. A simplified example:


|
|LeadSP 1 Pump1_is_Lead
|-----|=|--------(C1)
|
| LagSP 1 Pump1_is_Lag
|-----|=|--------(C2)
|
| RunLag Pump1_is_Lag
| C5 C2 Start_1
|-----| |--+----| |----------(Y1)
| |
| | Pump2_is_Lag
| | C12 Start_2
| +----| |----------(Y2)
|
| Pump1_Fail Pump1_is_Lead
| X1 C1
|------| |----------| |-----+----|LeadSP=LagSP
| |
| +----|LagSP=StandbySP
| |
| +----|StandbySP=1
| Pump1_Fail Pump1_is_Lag
| X1 C2
|------| |----------| |-----+----|LagSP=StandbySP
| |
| +----|StandbySP=1

  Top

Allen Nelson Click to EMail Allen NelsonClick to view user profile - (126 posts) Click to check IP address of the poster Apr-19-01, 09:21 AM (EST)
2. "RE: "Sequencing of Multiple Pumps" "
Your project sounds somewhat similar to my 5 pump system which I mentioned in a previous post. I'm assuming that, depending on demand, you will have anywhere from 1 to 5 pumps running.

Many of the Regulars here (probably All of the experienced ones) harp on keeping the code modular. Here's how you could do it (which is to say, here's how I did it).

One section of code (possibly a subroutine) decides if a pump needs to be added, based on pressure (or whatever). It doesn't care if any pumps are available, or which are running, it just winds up setting A SINGLE BIT that says "Start Next Available Pump"

There will be a similar chunk of code that says "Stop Next Available Pump"

You will also have code, identical in structure (but with different addresses) for each pump, that deterimes "I AM AVAILABLE". Again, one bit for each pump.

Next, you will have code, which tracks the run time of each pump.
That's all it does. If the pump is running, it increments timers/counters.

Next, you will have code that will compare the run time of each pump to each other pump. Again, a single bit that says "Pump 1 is 'Older' than Pump 2", another for "Pump 1 is Older than Pump 3", etc.

Now that you have all these bits, each with their own independant logic, you can combine them to determine which pump is the "Next Available". If Pump 1 is "Next available", then it must be "Available", and (Older than Pump 2, Or Pump 2 is Not Available, Or Pump 2 is already running), AND (Older than Pump 3, etc).
The ladder looks like:


P1_Avail P1_RUNNING P1>P2 P1>P3 P1_NEXT_TO_START
--| |------|/|-----+----| |-----+-+----| |-----+---... ---( )
| | | |
| P2_AVAIL | | P3_AVAIL |
+----|/|-----+ +----|/|-----+
| | | |
| P2_RUNNING | | P3_RUNNING |
+----| |-----+ +----| |-----+

You would have similar logic to determine if pump 1, etc, is NEXT__TO_STOP. I'll leave it for you to figure out the rules/ladder.

Now that you know who is next (and you will want to add some code to make absolutely sure that no two pumps' "NEXT_TO_START" bits are on at the same time - another exercise for the reader), you can combine the "START_NEXT_AVAIL_PUMP" bit with the "P1_NEXT_TO_START" bit, to actually run the pump.

Notice a few things here. Once the pump starts, it can't be "Next". So you want to make sure that your "Start Next" logic detects the start of the new pump, so that it doesn't keep starting them. I did it by having it calculate how many pumps should be running in any given state, and then compare the number that are running to the number that it needed. If less, start one, if more, stop one. There are probably as many methods as there are programmers, though

Another thing about this approach, is that, since the Availabilty logic is seperate from the Start, is Separate from the Need_to_Start logic, if a pump becomes Unavailable for any reason, the next pump is started, automatically. There is no special logic for "If the pump trips on startup..." or worrying about how Maintenance can shut down a pump without disturbing the process. It's all covered by Avaliablity logic.

That's why we say to modularize your code! This is what we mean!

This solution is not terribly elegant. It takes lots of rungs. But it's a breeze to troubleshoot. And since so many of the rungs are similar except for addressing, with intelligent data table layout you can auto-generate some of the code (using Excel), which is one of truly great things about AB PLCs (Oh-oh, time to put on the asbestos suit; I feel a flame coming on ;) )


{P.S. Phil, thank's for making it so easy to write ladder on this site. I've posted at other sites, and it's sometimes hard to get a point across without the ladder, but "SOR XIC B3/0 BST XIO etc." is so hard to convey. And not everyone speaks AB)

  Top

Terry Woods Click to EMail Terry Woods - (708 posts) Click to check IP address of the poster Apr-22-01, 08:17 AM (EST)
3. "RE: "Sequencing of Multiple Pumps" "
I don't have time to get into it right now, but I think I have a plan that is quite elegant!

One should always try to use Elegance and Finesse when developing a solution to a problem. It sure beats using a big Ugly-Hammer (or Crescent-Hammer).

Anyway, I'm just posting this to keep this thread on the front page. I'll post my solution later.

"I have a plan! If you re-elect me, I'll get us out of there in one year!" RMN

  Top

Wildpen Click to EMail Wildpen - (6 posts) Click to check IP address of the poster Apr-23-01, 03:47 AM (EST)
4. "RE: "Sequencing of Multiple Pumps" "
There are some really sharp people on here!
The only thing I would add is that when switching pumps in you will want to program in some hysteresis of some kind to keep them from kicking in and out. Depending on your application, timers may work, but having separate start and stop setpoints is ceratinly best.
  Top

Terry Woods Click to EMail Terry Woods - (708 posts) Click to check IP address of the poster Apr-29-01, 08:16 PM (EST)
5. "RE: "Sequencing of Multiple Pumps" "
OK, for those that might be interested, as promised, here is my shot at the multiple-pump problem.

The aim of this coding is to automatically determine which pump to bring on-line when the demand increases. Then, when demand decreases, which pump to bring off-line.

The over-all aim is to maintain equal run times on all of the pumps as much as possible.

This routine will constantly attempt to bring all available pumps to equal operating times.

The coding described assumes that "POINTERS" are not available on the PLC. Having "POINTERS" would certainly reduce the amount of coding greatly.

General Description:
Code is created to monitor the Auto/Man Switch. The code should should also monitor for Running pumps faulting out. This code is used to set the "Available" status.

Demand vs. Supply is monitored and decisions are made as to whether a pump should be brought on-line, off-line or no change.
If need to add a pump, ADD PUMP goes TRUE for one scan.
If need to drop a pump, SUB PUMP goes TRUE for one scan.

The change in Demand vs. Supply needs to sufficiently large and of sufficient time. That is, you don't want pumps reacting too quickly to minor changes in Demand vs. Supply.

If there is no change in Demand vs. Supply then the code is bypassed.

The manner in which demand is determined depends on the particular situation.


If Demand Increases: ADD PUMP
The code looks through the "available" pumps to find the pump with the least run-time and brings that pump on-line.

If Demand Decreases: SUB PUMP
The code looks through the "running" pumps to determine which one has the most run-time and brings that pump off-line.

The method used to find the least or most is a "Single Scan Bubble Sort".

A "Bubble Sort" is a method where a value is compared to some other value and a determination is made as to whether to carry forth the former value or the latter value.

At the end of the Bubble Sort, the pump with the least or most run-time (depending on what is sought) is in hand. That pump is then brought on-line or off-line as required.

Meanwhile, there is a 1-sec timer that initiates a run-time update on all running pumps. This is a 1-scan pulse that updates the run-time on all running pumps. Run-time is tracked by Hour-Minute-Second for each pump.

Because pumps are occasionally taken off-line and repaired or replaced, there should be a means to reset the run-time for each pump to zero.

Preliminary Setup:
(this can be done in many different ways, this is just one)

This particular problem, as posted, involves 5 pumps.
Five words of memory need to be set aside for each pump.

PUMP-1 (A-Data)
Word 1 V100 Pump ID # (1, 0001 binary) hard-coded
Word 2 V101 Pump-A Status (1=Available 0001) (3=Running 0011)
Word 3 V102 Pump-A Hours (0 to 32,768)
Word 4 V103 Pump-A Minutes (0 to 59)
Word 5 V104 Pump-A Seconds (0 to 59)

PUMP-2 (B-Data)
Word 1 V200 Pump ID # (2, 0010 binary) hard-coded
Word 2 V201 Pump-B Status (1=Available 0001) (3=Running 0011)
Word 3 V202 Pump-B Hours (0 to 32,768)
Word 4 V203 Pump-B Minutes (0 to 59)
Word 5 V204 Pump-B Seconds (0 to 59)

Repeat and inc as required for Pumps 3(C), 4(D) and 5(E).

In this example,
Word VX00...
0000 = n/a
0001 = Pump-1 (A)
0010 = Pump-2 (B)
0011 = Pump-3 (C)
0100 = Pump-4 (D)
0101 = Pump-5 (E)

Word VX01...
0000 = Not Available
0001 = Available
0010 = Faulted while running -> NOT AVAILABLE 'til reset
0011 = RUNNING

There are any number of ways to set up the intelligence in the code.

Another set of five words need to be set aside as the "Working Registers".

Work Reg Data (R)
Word 1 V600 Pump ID # (1, 2, 3, 4 or 5 in binary) variable info
Word 2 V601 Pump-X Status (1=Available 0001) (3=Running 0011)
Word 3 V602 Pump-X Hours (0 to 32,768)
Word 4 V603 Pump-X Minutes (0 to 59)
Word 5 V604 Pump-X Seconds (0 to 59)

This routine completes in 1 Scan!

There will be a few holes in the following code... I'm just trying to present the general idea.

Again, this code can be greatly reduced if it is done with pointers.

So.... Supply vs. Demand Monitor says,
"ADD Pump" Find Least Run Time on Available Pump.


ADD A +-------------+
PUMP Stat 1 | Copy A-Data |
---| |------|=|----------+ to +-----(SET)REG LOADED
| Working Reg |
+-------------+

.
If Pump-A is available (A-Stat=1) then the words associated with Pump-A are loaded into the working register. The Reg Loaded Flag is SET.
.

ADD B REG +--------+ REG
PUMP Stat 1 LOADED | COPY B | LOADED
---| |------|=|---+---|/|---------------------------------+--+ to REG +---(SET)
| REG B R | +--------+
| LOADED Hr Hr |
+---| |---+---|<|-----------------------+
| B R B R |
| Hr Hr Min Min |
+---|=|---+---|<|-------------+
| B R B R |
|Min Min Sec Sec|
+---|=|-------|<|---+


.
If Reg is NOT loaded, and Pump-B is available, then Pump-B data is loaded into the working reg and the flag is set. Then proceed to find the next available pump.

If Reg IS loaded then begin comparing Pump-B run-time to the run-time in the working reg. If Pump-B has less run-time, then copy Pump-B data into the working reg. Then proceed to find the next available pump.

That pump with the lesser run-time continues to reside in the work register. That is the "Bubble Sort".
.


ADD C REG +--------+ REG
PUMP Stat 1 LOADED | COPY C | LOADED
---| |------|=|---+---|/|---------------------------------+--+ to REG +---(SET)
| REG C R | +--------+
| LOADED Hr Hr |
+---| |---+---|<|-----------------------+
| C R C R |
| Hr Hr Min Min |
+---|=|---+---|<|-------------+
| C R C R |
|Min Min Sec Sec|
+---|=|-------|<|---+

ADD D REG +--------+ REG
PUMP Stat 1 LOADED | COPY D | LOADED
---| |------|=|---+---|/|---------------------------------+--+ to REG +---(SET)
| REG D R | +--------+
| LOADED Hr Hr |
+---| |---+---|<|-----------------------+
| D R D R |
| Hr Hr Min Min |
+---|=|---+---|<|-------------+
| D R D R |
|Min Min Sec Sec|
+---|=|-------|<|---+

ADD E REG +--------+ REG
PUMP Stat 1 LOADED | COPY E | LOADED
---| |------|=|---+---|/|---------------------------------+--+ to REG +---(SET)
| REG E R | +--------+
| LOADED Hr Hr |
+---| |---+---|<|-----------------------+
| E R E R |
| Hr Hr Min Min |
+---|=|---+---|<|-------------+
| E R E R |
|Min Min Sec Sec|
+---|=|-------|<|---+

ADD REG +--------------+ REG
PUMP LOADED | NO PUMPS | LOADED
---| |---+---|/|------+ AVAILABLE!!! +---+---(RESET)
| +--------------+ |
| REG +--------------+ |
| LOADED | Read Pump ID | |
+---| |------+ In V601 and +---+
+----------------->| Start Pump-X |
| +--------------+
|
+-- This causes Pump-X to attempt to start. The Aux contact
on the mag is read to determine if the pump has in fact
started. If so, then the status of the pump is set to
"running". If, after a delay, the Aux contact is not
closed, then the pump status is set to UNAVAILABLE!
The process then begins again to find the next pump.



So.... Supply vs. Demand Monitor says,
"SUB Pump" Find Most Run Time on Running Pump.



SUB A +-------------+
PUMP Stat 1 | Copy A-Data |
---| |------|=|----------+ to +-----(SET)REG LOADED
| Working Reg |
+-------------+

.
If Pump-A is running (A-Stat=3) then the words associated with Pump-A are loaded into the working register. The Reg Loaded Flag is SET.
.

SUB B REG +--------+ REG
PUMP Stat 1 LOADED | COPY B | LOADED
---| |------|=|---+---|/|---------------------------------+--+ to REG +---(SET)
| REG B R | +--------+
| LOADED Hr Hr |
+---| |---+---|>|-----------------------+
| B R B R |
| Hr Hr Min Min |
+---|=|---+---|>|-------------+
| B R B R |
|Min Min Sec Sec|
+---|=|-------|>|---+


.
If Reg is NOT loaded, and Pump-B is running, then Pump-B data is loaded into the working reg and the flag is set. Then proceed to find the next running pump.

If Reg IS loaded then begin comparing Pump-B run-time to the run-time in the working reg. If Pump-B has more run-time, then copy Pump-B data into the working reg. Then proceed to find the next running pump.
.

SUB C REG +--------+ REG
PUMP Stat 1 LOADED | COPY C | LOADED
---| |------|=|---+---|/|---------------------------------+--+ to REG +---(SET)
| REG C R | +--------+
| LOADED Hr Hr |
+---| |---+---|>|-----------------------+
| C R C R |
| Hr Hr Min Min |
+---|=|---+---|>|-------------+
| C R C R |
|Min Min Sec Sec|
+---|=|-------|>|---+

SUB D REG +--------+ REG
PUMP Stat 1 LOADED | COPY D | LOADED
---| |------|=|---+---|/|---------------------------------+--+ to REG +---(SET)
| REG D R | +--------+
| LOADED Hr Hr |
+---| |---+---|>|-----------------------+
| D R D R |
| Hr Hr Min Min |
+---|=|---+---|>|-------------+
| D R D R |
|Min Min Sec Sec|
+---|=|-------|>|---+

SUB E REG +--------+ REG
PUMP Stat 1 LOADED | COPY E | LOADED
---| |------|=|---+---|/|---------------------------------+--+ to REG +---(SET)
| REG E R | +--------+
| LOADED Hr Hr |
+---| |---+---|>|-----------------------+
| E R E R |
| Hr Hr Min Min |
+---|=|---+---|>|-------------+
| E R E R |
|Min Min Sec Sec|
+---|=|-------|>|---+





SUB REG +--------------+ REG
PUMP LOADED | Read Pump ID | LOADED
---| |-------| |------+ In V601 and +--------(RESET)
| Stop Pump-X |
| Reset Status |
+--------------+



Meanwhile, update the run-time for each running pump. Five copies of the following code need to be built; one for each pump.




1 A +--------------+ Dummy
Sec Stat 3 Sec 59 Min 59 Hr 32,768 | Hour OverRun | Bit
--| |----|=|---+---|=|---+---|=|---+---|=|--------+ Message +------------------+--( )
| | | +--------------+ |
| | | Hr 32,768 |
| | +---|<|-------[ADD Hr+1=Hr]---[Min=0]-+-[Sec=0]--+
| | | |
| |Min 59 | |
| +---|<|-------[ADD Min+1=Min]-------------------+ |
| |
|Sec 59 |
+---|<|-------[ADD Sec+1=Sec]----------------------------------------+

So, there ya go... whadaya think?

  Top

Terry Woods Click to EMail Terry Woods - (708 posts) Click to check IP address of the poster Apr-30-01, 07:40 AM (EST)
6. "RE: "Sequencing of Multiple Pumps" "
Ooops!

In the second section, SUB PUMP, we are seeking pumps with Status = 3. That is, RUNNING.

  Top

ShawnB Click to EMail ShawnBClick to view user profile - (25 posts) Click to check IP address of the poster May-01-01, 06:20 PM (EST)
7. "RE: "Sequencing of Multiple Pumps" "
You guys have impressed me again with all of the interesting ways to do this.

Rememeber to keep in mind any mechanical effects: are all of the pumps the same size? Are they the same basic design? Provide for hysterisis to prevent hammer. What size (hp and flow) are these pumps.

That is an ineteresting program idea that Terry posted, now I have to go through it.

  Top

Allen Nelson Click to EMail Allen NelsonClick to view user profile - (126 posts) Click to check IP address of the poster May-02-01, 08:35 AM (EST)
8. "RE: "Sequencing of Multiple Pumps" "
My hat is off to Terry too. His approach and mine both modularize the run time and Start_Next / Stop_Next code. But his "Bubble Sort" is much more efficient than my "Compare everything to everthing" blunt object approach to answering the question "Which is next and available?".

The basic assumption is that the pumps are indentical in size and charactoristics, and that the only critera for starting one pump over another is run-time. The size is somewhat immaterial. This logic only has to do with the initial starting/stopping of the pumps. Ramping, PID, and other issues would be handled by other modules.

Terry's code isn't AB style, but can be easily translated if necessary. If you need help, let us know.

When I first started posting to this sight, someone welcomed me to "the monkey house". I'd say it's pretty clear who the alpha geek is on this site.

(Better stop before Terry's head swells too much)

  Top

NigelS Click to EMail NigelS - (2 posts) Click to check IP address of the poster May-03-01, 05:51 AM (EST)
9. "RE: "Sequencing of Multiple Pumps" "
My profuse thanks to everybody who's offered suggestions as to how to tackle this job; - I now have plenty of material to work with & am confident I can complete the task.

To answer someone's question - the pumps are all the same size. The switching points & on/off differentials will all need to be set in the section of code which emulates the existing hardware step controller. In fact the differentials will probably need to be different for each stage because of the way the pumps balance with the process. Some experimentation will be required during commissioning to ensure stable operation & avoid repeated switching.

  Top


Unlock | Archive | Remove

Lobby | Topics | Previous Topic | Next Topic
Rate this topic (1=skip it, 10=must read)? [ 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 ]
Your Personal PLC Tutor Site Learn Now!!.