PID level control of sequential pumps

skyfire

Member
Join Date
Jan 2023
Location
USA
Posts
4
Hi,

I started off my career in PLC programming doing water/wastewater on AB around 20 years ago, but then moved overseas a few years later and got mostly into manufacturing and materials handling on Siemens equipment. I have now moved back to the US and back into water/wastewater on AB, but I am a bit rusty on PID pump control and don't have other programs to go off of, and it seems RSLogix has changed a bit as well, with some new blocks specifically the PIDE. I am looking for some advice on best practices and potentially an example program if someone can point me to one if easily available.

I need to control 4 pumps in lead/lag configuration using ascending level start/stop setpoints to sequentially start/stop the pumps while using a PID to control them to maintain the level of a wetwell at a target level. I also need to include soft start functionality and control the initial ramp up rate as the site is regularly on generator power.

I am looking at the PIDE function block, which is new to me, and thinking about how best to set up my pump control. All 4 pumps will be trying to maintain the same target level setpoint, but will engage at different stages when they are within their window of level start/stop setpoints, and I'm trying to determine if I should use separate PIDE blocks for each pump or one PIDE to control them as a group, and what that structure should look like. Also, how to integrate the soft start and ramp up feature with the PIDE. Can the PIDE block be configured to do this with the rate of change limit or do I just need to put it manual and use a ramp block before switching it to auto? This PIDE block has so many features, it's a bit overwhelming. Can anyone point me to some good examples I can review? Any advice is appreciated.

Thanks!
 
It's Studio 5000, and yes, I have looked at the manual. My question is more about best practices for my use case, as described. For instance, whether I should use a master PIDE block to control all 4 pumps as a group, rescaling it's output based on how many pumps are running or separate PIDE blocks for each pump. Also, am I better off using manual mode and the CV Limiter to control the ramp up each of the pumps, or a RLIM or something? Basically, I'm asking what works better in practice, and what that structure would look like.
 
Can the level be allowed to fluctuate a bit i.e. it's not a hard level specification?

Also, does the level move fast when the flow changes i.e. will it drain in seconds if the pumps are in manual?

If the answers are yes to the first and no to the second, then a simple linear P-only level control might be good enough.


E.g. say you can allow the level to move ± a foot either side of the halfway point:

  • Pump 1 could run at 0% at 12" below halfway, and at 100% at 6" below halfway
  • Pump 2 could rung at 0% at 6" below halfway, and at 100% at halfway.
  • Pump 3 could run at 0% at halfway, and at 100% at 6" above halfway.
  • Pump 4 could run at 0% at 6" above halfway, and at 100% at 12" above halfway.
To account for level measurement noise, put a deadband between each pump's band: pump 1 = [-12",-6.5"]; pump 2 = [-6" ,-0.5"]; pump 3 = [+0.0",+5.5"]; pump 4 = [+6",+12"].

The ramping is a different issue.
 
Again, not enough information!


This is tank level control. It should be easy. If the level doesn't need to be controlled precisely, then a proportional band will do for the level control. Otherwise only a simple PI control is needed.
The output should be a required flow rate.



Matching the pumps to the required flow rate is a problem.
The outer level control will set a required flow. It is possible that each pump will require a PI control. I am thinking about it. I have some ideas but implementing them on a PLC would be difficult. The simple thing to do is start the pumps in a least recently used order. The other would be to use the pumps with the lowest run time or total Revs if anybody keeps track of that. These are obvious.



We need drbitboy to start pulling teeth.
 
One technique is to use a cascade control. Level CV -> Total Flow MV. Then you can divide the flow as appropriate among the pumps that are running. Flow CV -> speed MV.

Start/stop pumps as the total flow goes above or below the capacity of those running.
 
Are you sure you need PID? If the pumps "will engage at different stages when they are within their window of level start/stop setpoints," then why not run them each at 100% any time they are on?

So

  • at the lowest level, level "0," all pumps are turned off;
  • at the next higher level, level 1, pump 1 turns on at 100%
    • If that is more than the total inflow, then the level will drop until it hits level 0, at which point pump 1 will turn off or
    • if the total inflow is more than pump 1, then the level will increase until ...
  • at the next higher level, level 2, pump 2 turns on at 100%
    • So both pumps 1 and 2 are running,
    • if that two-pump total is more than the total inflow, then the level will drop until it hist level 0, at which point pumps 1 and 2 will turn off, or
    • if the total inflow is more than pumps 1 and 2 together, then the level will increase until ...
  • at the next higher level, level 3, pump 3 turns on at 100%
    • So three pumps, 1 and 2 and 3, are running,
    • etc.
This makes it easier to program e.g. changing lead/lag sequence, maintenance i.e. one or more pumps are out for repair, etc.
 
Thank you for all the replies! To answer some questions:

@drbitboy
-The level control does not need to be super precise, it can fluctuate about a foot, but should be reasonably consistent as to not be starting and stopping pumps too often. Running them at 100% when on would result in frequent start stops, and would not be a very smooth running system. There should be a continuous outflow to match the inflow, but we can't measure inflow, only level. Also, the specs for the project call for PID control of the pumps using the level as the process variable, so that is what we need to deliver.

-It's a wetwell. In case you are not familiar with them in a wastewater scenario, I can give a little more info. It is a relatively small tank holding around 30,000 gallons in normal operation with 4 150hp lift station pumps pumping out of it. The input flow, which is not measured, varies greatly throughout the day. The level setpoint they are trying to maintain for the PID block is 8.5ft. The start SP for the Lead Pump is 9.5ft and stop is 7.5. For Lag1, start is 9.8ft, stop is 8ft, and so on. Basically, the lead pump turns on at 9.5ft then tries to maintain level at 8.5ft. If the Lead pump can't keep up, Lag1 comes on at 9.8ft, and then they try to maintain 8.5ft, and so on. The pumps have a minimum speed requirement per the manufacturer, which I assuming to be 20% for now until I get confirmation, which is the only way they will hit the stop SP, but this would be a rare occasion. This system is meant to have a steady in and out flow.

-I don't know how fast the level will adjust when the pumps run as the site is still under construction, but depending on input flow, if it is low, the system has the potential to change the level fairly fast. The input flow could also go high enough to require all 4 150hp pumps to keep up with it. Hopefully this illustrates why speed control is needed and just running them at 100% to start and stop SPs won't work.

-The specs specifically call for a PID block to control the pumps, but I would think I need a minimum of PI control as I need to take the level PV rate of change into account since the inflow rate (which is unknown) can vary greatly at different times of the day and the number of running pumps will also vary, but only when the PV deviates from the SP by a certain amount, meaning the error rate will also vary quite a bit as well. It seems like a PID would be be preferrable, if not necessary. Wouldn't you agree?

-The pumps get rotated every time they complete a cycle or if the Lead pump has run for 6 hours.



@Peter Nachtwey
-As mentioned in the original post, control is based off of a target level SP, not flow. Again, this is a requirement in the specs, where they call out the process variable for the PID block to be the level. We measure total discharge flow, but not inflow and have no way of calculating a target flow rate for the pumps. At least not that I can think of.

-I have no question about sorting the pumps. This is done with a SRT block based off RTH



@Tom Jenkins
-The only thing we are looking at for control, as per the specs, is level and trying to maintain it at a fixed SP, so the CV would have to be a speed request to the pumps. I'm not sure if that lends itself well to cascade control, but I was considering something similar where I control all 4 pumps as if they were one, using a master PID block to output a single CV of 0-100%, where a CV value of 0-25 gets scaled to 20-100% (I'm waiting on documentation on the pumps, but I'm assuming a minimum speed of 20% at the moment) for the Lead pump, a CV of 26-50 gets scaled 20-100% for Lag1, and so on. One problem with this method is that it does not meet the requirement of enabling each sequential pump only once an increasing level setpoint is met, and I can't think of a good way to implement that in this method.

-Alternatively, I could a use master PID block to output a single CV, which I then send to the most recently called pump. For example, if only 1 pump is called for, the CV gets matched to the Lead pump's speed control signal. If the level keeps rising and triggers the second pump to be called for, then the Lead pump's control gets set to 100% and the PID's CV gets matched to Lag1, and so on. There would have to be a suspension of PID control between handoffs from one pump to the next to let the CV and pump speed sync up before putting it back in PID control.

-The most basic way I can think of is to just have one PID block that sends the same speed request CV to all 4 pumps, and the 4 pumps just get turned on or off when they are in their SP window. The problem I have with this method is that, for instance, inflow increases substantially all of a sudden, which will happen at times, to a point that is more than a single pump can handle, but less than what two pumps can handle. The PID will increase the CV to run the Lead at 100% until Lag1's start SP is reached, at which point all of a sudden Lag1 will come on while receiving that 100% command, which will be way too much, and it will have to quickly ramp both pumps down without overshooting the stop SPs. I'm thinking it will be difficult to tune a system like that. That was where I thought about again using an RLIM to more slowly bring the speed up of the new pump at a fixed rate until it matches the CV of the PID, which will be falling as the new pump comes up to speed, and once they're equal, hand over control of the new pump to the PID and it will control both pumps with the same CV, and so on with each additional pump. I wonder how smooth the hand over will be?

-A concern I have with all of these options is that as more pumps turn on, the rate at which the CV affects the PV will change, and how the PID loop will handle that. Do I need to move different sets of gains into the PIDE based on how many pumps are running?



I can think of a number of ways to set this up that will technically 'work', I'm just looking for some feedback to help me chose the best course of action here.

Thanks!
 
Last edited:
Phenomenal! So many words and so little information.

1. Can the capcity of the pumps be changed? With what restrictions?
2. Why can't all 4 pumps be controlled as one?
What are the requirements for sequential start-up of pumps? Do they have to be related to the level?
Please explain to me the requirements for starting / running pumps.

If you specify the depth, length, width of the well and the capcity of the pumps gpm, m^3/h... (and not their power hp), then it will be possible to check the operation of the control algorithms on the model and set up the PI controller (s)

Attached is a diagram of the system operation for one PI controller. The range of output values of the PI controller is 0-100. In the PI range 0-25% pump 1 (0-100%) works, in the PI range 25-50% pump 2 works, in the PI range 50-75% pump 3 works, in the PI range 75-100% pump 4 works. If the well does not have significant changes in cross section and the pumps have (approximately) equal performance, then one PI-controller setting will be sufficient for the entire range.

Pumps.png
 
  • the specs for the project call for PID control of the pumps using the level as the process variable, so that is what we need to deliver.
  • It's a wetwell. In case you are not familiar
    • The input flow ... varies greatly throughout the day.
    • The level setpoint they are trying to maintain ...
    • This system is meant to have a steady in and out flow.
  • The only thing we are looking at for control, as per the specs, is level and trying to maintain it at a fixed SP,
Obviously the system cannot both control level and have a steady in and out flow when the input flow varies greatly.

So what I assume what is implied by "meant to have a steady in and out flow" is that changes in load (inflow) are more or less step changes (rainstorms, morning when people are taking showers, night when everyone is asleep), and in between those changes the flow is fairly steady; is that correct?

And the purpose of the wetwell is as capacitance to give time for the pumps to react to load changes without running dry as the load is changing.

This is split-range control, but the dicey part will be when the inflow is between what 100% of the lead N-1 pumps can deliver* and that plus 20% of the Nth pump*, because that would lead to cycling between running N-1 and N pumps if the lead N-1 pumps are all left running at 100%.

With PI control the PV ranges are somewhat irrelevant as the relationship between CV and PV slides as the integral term accumulates and dissipates.

* what each pump will deliver is dependent on what the other pumps are doing, assuming a common discharge line (system curve).


It would be useful to know the design or estimated range of flowrates (one pump at 20% and at 100%), estimated pump differential head, and the system gain (reciprocal of cross-sectional area of the wetwell, or ft/gal, e.g. 17ft/30kGal or ~ 0.57E-3 ft/gal).
 
Last edited:
I still think staggered-SP P-only controls would work.

When the inflow exceeds the what N-1 pumps can deliver, the level rises and triggers the Nth pump, starting at 20%. Then

  • EITHER (N-1 pumps at 100%) plus Nth pump at 20% is less than the inflow, so the level will continue to rise and the Nth pump speed will increase with level until either level is steady or Nth pump reaches 100% speed and next pump turns on,
  • OR (N-1 pumps at 100%) plus Nth pump at 20% is more than the inflow, so the level will drop, the Nth pump speed will stay at 20%, and the (N-1)th pump speed will decrease level until level is steady.
    • Then all that is needed is an algorithm to choose when to turn off the Nth pump, based on some combination of
      • Nth pump PID CV continuously at its minimum (20%), e.g. over some time
      • (N-1)th pump PID CV behavior, e.g. below 75%
      • more?
But tbh, I am only posting because it's an interesting problem; also tbh I am winging it. OP asked for best practice and has been polite in response to my ramblings. I strongly suspect others have already done this (e.g. @Tom Jenkins is in the industry and already provided an answer; how to modify that for minimum single pump speeds is TBD, but I expect it is not complicated).

I will leave one last comment: PIDE and PID instructions implement functionally identical feedback control equations, even if they use different forms of those equations. The only reason to use PIDE instead of PID would be the features PIDE provides e.g. better bumpless mode changes, or cascade control integration.
 
@Peter Nachtwey
-As mentioned in the original post, control is based off of a target level SP, not flow.
Yes, I can read but the gain of the tank is 1/area and the flow determines how fast the tank increase the level and the the in-flow better match the out-flow to maintain a steady state level. At worst, the inflow must be able to exceed the out-flow so FLOW DOES MATTER!

I would NOT use a PID. A simple proportional band will do. You should know the range of acceptable level. You would want all pumps off if at the top of the allowable band. 1 pump on if the level drops 3-6 inches from the top. 2 pumps on if the level drops 6-9 inches. 3 pumps on if the level drops 9-12 inches and 4 pumps on if the level below the lower limit. I turn off the pumps but with different range. Keep 4 pump running until the level goes some hysteresis value above the minimum level. Maybe 1.5 inches would be a good value. Easy.

The problem occurs if the pumps are able to supply 40% of the flow. Then the levels would change quickly and the pumps will cycle on and off quickly. This is why FLOW MATTERS. I would use a simple LRU ( least recently used ) algorithm to start the next pump and alway shut down the pump that has been running the longest.

Again, this is a requirement in the specs, where they call out the process variable for the PID block to be the level. We measure total discharge flow, but not inflow and have no way of calculating a target flow rate for the pumps. At least not that I can think of.
So you see, FLOW DOES MATTER. The designers better size the pump correctly relative to the outflow, tank surface area and allowable proportional band.
 
@Peter I agree in principle, but I wonder about the non-continuous nature of the flow each time a pump or added.

What if the lead pump is P-only, and the rest of the three pumps are I-only with a PV deadband equivalent to 60-90% of the lead pump speed and a CV range of 0-240%, with each lag pump's 20-100% taking one-third of that range.

So the lead pump P!I!D (P/no-I/no-D), call it PIDlead is configured like this:

  • Scaling tab
    • PV
      • Unscaled Max = EU Max: 9ft (100PV%)
      • Unscaled Min = EU Min: 8ft (0PV%)
    • CV
      • Max at 100%: 100 (%, or whatever maximum pump speed reference is)
      • Min at 0%: 20 (%, or whatever minimum pump speed reference is)
  • Tuning tab
    • Setpoint: 8.5
    • Output bias: 50%
      • equivalent to CV = 60, or halfway between Max at 100% CV and Min at 0% CV above
    • Kp: 0.8
    • Ki: 0.0 (P-only)
    • Kd: 0.0 (P-only)
  • Configuration tab
    • PID equation: Independent
    • Control action: PV - SP
    • Derivative of: PV (but we don't care)
    • Loop update time: at least a second (WAG? level could be filtered some if it's noisy)
    • CV High Limit: 100%
    • CV Low Limit: 0%
    • Deadband value: ? (depends on character of level noise)
So lead pump will run at 20, 100, and 60 when level/PV% are at 8ft/0%, 9ft/100%, 8.5ft/50%, respectively.

Now comes the fun. The lag pumps' speeds control !PI!D (no-P/I/no-D), call it PIDlag:

  • Scaling tab
    • PV
      • Unscaled Max = EU Max: 9.75ft (100PV%)
      • Unscaled Min = EU Min: 7.75ft (0PV%)
    • CV
      • Max at 100%: 240 (%, or whatever 3x [pump speed reference range] is)
      • Min at 0%: 0
  • Tuning tab
    • Setpoint: 8.7
      • halfway between
        • 8.5ft and 8.9ft
        • i.e. 60PV% and 90PV% of lead pump P!I!D
    • Output bias: 0.0
    • Kp: 0.0 (I-only)
    • Ki: ?
    • Kd: 0.0 (P-only)
  • Configuration tab
    • PID equation: Independent
    • Control action: PV - SP
    • Derivative of: PV (but we don't care)
    • Loop update time: at least a second
    • CV High Limit: 100%
    • CV Low Limit: 0%
    • Deadband value: 10% (8.5ft to 8.9ft)
Lag 1 pump speed reference is equal to PIDlag.CV + 20, with an upper limit of 100 (at PIDlag.CV=80); Lag 1 pump is on when PIDlag.CV is greater than 0.

Lag 2 pump speed reference is equal to PIClag.CV - 60, with an upper limit of 100 (at PIDlag.CV=160); Lag 2 pump is on when PIDlag.CV is greater than 80.

Lag 3 pump speed reference is equal to PIClag.CV - 140, with an upper limit of 100 (at PIDag.CV=240); Lag 3 pump is on when PIDlag.CV is greater than 160.

The with stable inflow, the level will be stable between 8.5ft and 8.9ft, with the lead pump running with a speed reference between 60-90%.

If the level goes above 8.9ft i.e. above the PIDlag deadband, the output CV of the PIDlag will accumulate (integrate), and increase the speed of the highest lag pump running, and eventually bring on the next lag pump.

if the level goes above 8.5ft i.e. below the PIDlag deadband, the output CV of the PIDlag will dissipate, and decrease the speed of the highest lag pump running, and eventually stop that lag pump and start decreasing the next highest lag pump speed.

Obviously we can tweak the scaling and the tuning constants to make the operational range and the deadband larger or smaller; the numbers I chose here were for the metric-heads so they would not have to perform calculations beyond their ability ;).

This would be all but trivial to simulate, so offline tuning should provide reasonable starting values well before commissioning.
 
Last edited:

Similar Topics

How can I connect PID Output to a valve. In ladder logic program is there any logic do I want to add between valve and PID? PV=SP What will be the...
Replies
7
Views
384
Have a level control application that consists of a small chamber relative to the size of the incoming and outgoing pumps. I've done this type of...
Replies
6
Views
3,569
Good morning, I have a question and I don't really know what you would call this.... I have 2 tanks which I need to control the level or froth...
Replies
14
Views
7,732
Hi friends I have a L24ER-QBFC1B in a Level Control that you can see in the picture. Tank1 is the process tank. Level sensor is the process...
Replies
4
Views
3,025
I am working on a CIP project. There is a tank which is about 1500L. We need to keep the water volumn inside the tank to be SP:200L. The control...
Replies
17
Views
10,759
Back
Top Bottom