2 PID loops for one control variable


Incorrect Tom, pumps produce pressure, and if there is a route for the fluid, you will get a flow.

Did you not read the example I quoted, where the pressure can be, and is being, controlled to this day, even though there is no flow.

If you pump contaminated fluid through a filter, and control the pressure to a setpoint, you will come to a time when there is no flow through the filter, but the control PID maintains the desired pressure. Obviously at this point, the filter is useless, as it is not filtering anything. So usually a low flow setpoint kicks the filter into a backwash cycle.

What you are describing is called dead heading the pump. (Assuming that it is a centrifugal and not a positive displacement pump.) https://techblog.ctgclean.com/2012/03/pumps-pump-performance-curves/

The dead head pressure will vary with speed, like everything else on the performance curve. It is generally a very bad idea to dead head for extended periods of time. The pump will heat up and the result is damage to the pump. You get the same effect if you close a valve at the pump discharge connection. The pressure will rise to the dead head pressure, and no further. (See the link above.)

I suspect that in your system either there was a bypass or relief valve to provide a flow path or the low flow shut off kicked in before you hit dead head pressure.

Obviously, the assumption in my example was the flow would be within the safe operating range. My presumption was that the OP wanted to keep his operation within the safe flow range of the pump.

Again, in your example, the system resistance to flow is what is producing the pressure. The system curve becomes a vertical line because the resistance to flow is infinite. The intersection of that system curve and the pump curve would be at zero flow and the dead head pressure. However, no centrifugal pump manufacturer will provide a curve showing that because the pump self-destructs.
 
Last edited:
^

This is an interesting discussion. Tom, normally I would agree with what you are saying, but in this case I think the best bet would be a separate pressure loop.

Reason being is that as the flow rate approaches zero (think a pump being deadheaded), the flow control will not work at all, since there is no flow. That may be an extreme case, but I've had a number of situations where that is exactly what was needed: pressure control on a pump that was deadheaded, or nearly deadheaded.

I agree that you need a separate pressure loop. I am suggesting that the output of the pressure loop be a flow setpoint to a flow control loop.

Are you sure you were controlling pressure on a dead headed pump, or were you shutting down the pump at high pressure to prevent dead heading and controlling pressure until you reached that point?

In my opinion it is bad engineering to design a system with the intent of running dead headed, and I suspect that most pump suppliers would agree with that.

My suggestion would work as well as direct pressure to speed control in any case. If the pump was dead headed with a pressure setpoint above the dead head pressure, the flow setpoint would rise. The flow control loop would increase the pump speed until the VFD hit maximum allowable. This is exactly what would happen if you controlled speed directly from pressure. If the pump were dead headed with a pressure setpoint below the dead head pressure the flow setpoint would decrease. The pump speed would be dcreased until the new curve had a dead head pressure that matched the setpoint pressure.

And eventually, in all likelihood, the pump would be trash.
 
Last edited:
^ I've done it numerous times in the food and beverage industry. Often it is a centrifugal pump "stuffing" a PD pump, such as the inlet of a barrel freezer. Other times, it is a PD pump stuffing another PD pump. Sometimes a pump is feeding a filler with a simple on/off valve for bowl level control.

In all of these situations, the pump is deadheaded for at least some of the time, and very little flow during other times. Many of these installations have been running for years with no issues.

Unless I'm misunderstanding you, I don't see how a pressure control loop cascading to a flow control loop could work for a deadheading situation, or acceptably well for very low flow/near deadheading situations. The CV of the flow control loop would eventually saturate, calling for 100% pump speed since there is no flow. Until the pressure control CV dropped to 0%, the flow control PID would always be looking for flow, which isn't there.
 
Last edited:
Pumps create flow or pressure depending.
I have had this argument many times on hydraulic forums. Some say flow, some say pressure. I say it can be any combination that increases energy of the fluid.
Tom brought the dead head example that justifies the pressure argument.
If there is no resistance to flow the fluid will move out of the pump but it will still have kinetic energy. Look at Bernoulli's equation.
The motor converts electrical energy to mechanical energy.
The pump converts mechanical energy too fluid energy.
Pumps convert energy.

Cascade loops will work but low select will be easier since both loops can be tuned independently.
 
I have used Toms approach several times now and swear by it for tank level control, where all i need to do is pump out what comes in, as smoothly as possible (often through filters). Tank level between min and max determines the flow setpoint (Essentially a proportional only gain). Pumps then controlled by a PID loop with flow rate as the PV and using the flow setpoint which was essentially the CV of the first tank level "loop".

Actually just finished fixing the code of some fancy integrator who a client got in for a project. He claimed he'd got tank control sorted after 2 days of tweaking. 3 days later when the plant inlet flow was adjusted it started oscillating. I spent 2 hours implementing my logic as above.. been running perfectly for a month without any further tweaks.

The flow loop is stable and doesn't generally change over time unless someone drastically changes the drive ramp times which introduces lag.
 
Just a question. If you had maybe 25 different setpoints and 4 different input choises. Would you then go for 100 individual pid regulators or a database with 100 rows with each let's say maximum 4 values in each row. P, I, D, and a setpoint? This is maybe not a job that ever have to be done. But wat If?
 
If by inputs you mean process variables (i.e the thing you're trying to control), then potentially 4 loops, maybe less. A setpoint can vary without needing to change the PID gains of course... that's the whole point of a control loop: accept a varying setpoint and control something to achieve that.
 
Just a question. If you had maybe 25 different setpoints and 4 different input choises. Would you then go for 100 individual pid regulators or a database with 100 rows with each let's say maximum 4 values in each row. P, I, D, and a setpoint? This is maybe not a job that ever have to be done. But wat If?

It all depends on the circumstances.

Multiple setpoints is not a problem, a single loop can work anywhere within it's setpoint Min to Max range. In fact you could have an infinite number of setpoints, by making it variable.

The 4 input choices may mean you might need 4 indendently tunable PID Instructions (tags), but only if the 4 input choices change the characteristics of the system. This is clearly the case in the OP, because the Process regulates the Pressure on the filter, and the Backwash and Rinse cycles will regulate Flow through the filter.

EDIT : Saffa beat me to it....
 
I would go for only one pid regulator and just change the setpoint and the pid values if necessary. I've done this some years ago with 3 individual flowsensors and 3 pumps and 3 pid regulators. In this project i only had to change the setpoints regarding to some time values. The program is very small and simple.
 
The dead head pressure will vary with speed, like everything else on the performance curve.

Yes, and the control loops varied the speed of the pumps to maintain a constant pressure on the recirculating hot water, whatever the net flow was into that loop, even zero flow when no demand.

It is generally a very bad idea to dead head for extended periods of time. The pump will heat up and the result is damage to the pump.

The pumps were spec.d correctly for the application.

I suspect that in your system either there was a bypass or relief valve to provide a flow path or the low flow shut off kicked in before you hit dead head pressure.

There were no bypass or relief valves to provide a flow path when the recirculation loop didn't need replenishing. The pumps just ran to maintain the constant pressure in the loop. There was no "low-flow" shut off, the pumps had to run continuously to maintain (if I remember correctly) about 3 bar pressure in the HTHW system, or it would immediately boil in the pipework.

Again, in your example, the system resistance to flow is what is producing the pressure.

I disagree, the pressure is being produced by the pumps, whatever the flow-rate - zero to maximum capacity with all 3 pumps running at 100%.

The intersection of that system curve and the pump curve would be at zero flow and the dead head pressure.

No, not the dead head pressure, we are controlling the pumps to deliver a constant pressure.

However, no centrifugal pump manufacturer will provide a curve showing that because the pump self-destructs.

The pumps were spec.d correctly for the application, and have been in service since about 2005.
 
daba, you should note that I was very careful to use words like "generally" and "mostly" in saying you shouldn't run a pump at dead head. As you clearly demonstrate, it is possible to have special features and designs. For all but this kind of unusual case, though, running at dead head (shut off) should be avoided.

Operating that way is an uncommon situation, representing a special case. Your controls were clearly shifting the performance curve up and down until the dead head pressure at that speed matched the pressure setpoint. None of that contradicts what I said about operating principles. The system curve is dictated by the system restriction. In your case the restriction was infinite and the system curve was a vertical line at zero flow.

In normal applications and in the normal operating range everything I said is exactly correct. The physics of centrifugal pump applications are well established. I think our members here are better served by understanding these principles of operation than by consideration of special cases and incorrectly projecting them to more normal operation.

It is important to note that I restricted the discussion to centrifugal pumps. As Peter pointed out, they are essentially energy conversion machines, converting kinetic energy in the impeller to kinetic energy in the fluid. The pump volute converts some of that kinetic energy to potential energy - static pressure. The degree of conversion from kinetic to potential energy in the pump volute is a function of fluid velocity - i.e. flow rate. A positive displacement pump (PD) is a different animal with different performance characteristics.

We get a lot of pump-related questions on the forum. If any readers want to delve into this further I'm assisting in teaching a class at the University of Wisconsin Madison in a couple of months: https://epd.wisc.edu/course/wastewater-pumping-stations/
 
Last edited:
The other thing to consider is that cascaded loop arrangements are common in the DCS/PLC world (or at least my world). Of course whatever built has to work but consider the fact that someone at some point will have to work on this system.
 
Resistance to flow does not add energy to the oil. If there is no pump adding energy to the fluid then resistance to flow will not create pressure. The resistance to flow only makes the energy in the oil show up as pressure instead of kinetic or thermal energy. It is all about energy folks.
 
If so you may be able to get by with a low select. You run both PIDs at the same time and use the one with the lowest output. There are some tricks to this.
Cascade loops will work but low select will be easier since both loops can be tuned independently.

I agree this, you can do this with cascaded PID's but it is harder to tune, also inner loop needs be faster.

It is also possible to multiple PID outputs together, and divide with 100, but it can be also diffucult to tune.

2 different PID's on paraller is easier, control pump with lowest PID output.
You need only take care changing points.
If your pressure PID output is controlling (lower output value), then flow PID output is maybe 100%.
If there is fast need to control flow, flow PID start change its output from 100%. Flow PID takes control only after when it's output is less than pressure PID's.
This means that there is time lag before flow PID takes control from pressure PID.

Changing from pressure to flow and vice versa is faster if you update PID output from controlling PID to another PID (tracking).
You can do this with manipulating PID output with manual value.
(If pressure PID is controlling pump then copy with timebase 5s or 10s pressure PID's output to flow PID output.

Then when flow increases Flow PID start changing its output from pretty close of pressure PID output, and flow takes control faster because PID outputs are almost same on both PIDs.

Same method also when flow PID is controlling. Then automatic changing of controlling PIDs is smooth to both ways.


This also works if you have more than 2 PIDs to one pump (limiting PIDs)
 
Last edited:
I really don't know why people are over-complicating this.

1. A PID control, with its own PID tag, for the pressure control. SP = Desired Pressure, PV = Actual pressure. As the pressure across the filter tries to increase, the pump speed is reduced to maintain a constant pressure. In this "mode" you map this PID's output to the pump motor drive.

2. When the flow falls below a set-point, you stop the pump, changeover a load of valves, and go into "Backwash" mode. Then you start up the pump again, but this time use a second PID, with its own PID tag, for backwash flow control. In this "mode" you map this PID's output to the pump motor drive.

3. After the Backwash, which may be by time or volume, you again stop the pump, changeover a load of valves again, then go into "Rinse" mode. Then you re-start the pump using either the "Backwash" PID, or a third. Backwash and Rinse will both be flow control, and the plant characteristics may be similar enough to use the "Backwash" PID. You map whichever PID output you are using to the pump motor drive.

All the suggestions of cascaded loops, pressure PID feeding a flow PID, low select etc., just aren't necessary. There are 3 distinct "modes", and the pump is stopped between them, so each PID will ramp up PV to SP from zero, there are no crossovers needed. Keeping the PIDs separate is just going to make it easier to get the system up and running, tune, and maintain in the long-term.

Keep it simple, I say....
 

Similar Topics

Hello Everyone, I am a novice PLC programmer, this is going to be my first PLC program. I am using a Controllogix processor. I will be using...
Replies
1
Views
7,161
Hi All, I am a new member to this site but have been reading posts on this site for years. I now have to ask a few questions for the PID...
Replies
20
Views
17,077
Hey All, I am working on the programming to maintain level and pressure in a 80 gallon surge tank. This tank feeds fillers that fill either 2.5...
Replies
2
Views
1,532
Hi guys! It seems to me that PID loops with feed forward are underutilized. Maybe it's just me but I think almost every loop would work better...
Replies
6
Views
2,688
Hi, I am new to Eaton ELC Soft. I have a background with Allan Bradley plcs but this seems to be set as if from 1950. It seems to be powerful...
Replies
0
Views
1,965
Back
Top Bottom