2 PID loops for one control variable

You could have two loops and run the backup loop (not being used) with the .MO bit and tieback the CV value so both the P&ID loops are producing the same output. When you switch loops, the other loop will start at the same point and go up/down depending on your loop value. I would also hold the calculated intergral value at zero (PID.DATA[0] register) when .MO is set, so the loop doesn't run away, and let it calculate (remove forced 0 into PID.DATA[0]). You would want to both ways to switch back and forth.
 
Remember that when you are controlling "pressure" by changing pump speed you are ultimately controlling flow as you change speed.

I understand that the OP wants to maintain constant pressure to the filter. What I proposed is a simplification. By using flow as the output of the pressure control loop operation will be more stable and tuning simplified. Pressure response to speed is very non-linear. The pump speed (flow) will always use the same loop. The change is merely if the setpoint is manually entered or cascaded. I've used this in the past.

This article is on lift stations, but the concepts are applicable: https://www.mswmag.com/editorial/2016/06/flow_pressure_and_pump_performance
 
Why do I always need to ask questions?

I have a need to control the speed of a pump using two different control scenarios. The hardware is an AB CompactLogix with Studio5000 V30.

Normally the pump is controlled based on the discharge pressure as the control variable with a single set point. However, when a carbon filter is backwashing, they want me to control the pump based on flow as the control variable, with two different set points, one for backwash and one for rinse.
Are the flows higher when back flushing or rinsing than when controlling pressure?

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.
I'm guessing I will need to use two PID instructions and enable the appropriate one as needed. What would be the cleanest way to do this?
Yes
 
All these fancy algorithms and "tricks" just to reduce the number of PID tags and instructions will ultimately make the system harder to develop, harder to tune each requirement, and make it less transparent what is going on to someone who inherits the code down the line.

I really cannot see what is wrong with having 2 or 3 loop instructions, each with their own tags containing set-points, PID gains, control bits, etc. The controllers have tons of memory to play with, so an additional 1 or 2 PID tags is not an issue.

It also makes it easier to attach a single HMI or SCADA faceplate for monitoring and/or tuning, the relevant tag is pulled in at the appropriate time.
 
Are the flows higher when back flushing or rinsing than when controlling pressure?

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.

Yes the flows are higher when backwashing and rinsing. I have decided to go with multiple PIDs as suggested by daba. As he also suggested I will use a separate PID faceplate for each control scenario. I like his approach...:nodi:
 
Yes the flows are higher when backwashing and rinsing. I have decided to go with multiple PIDs as suggested by daba. As he also suggested I will use a separate PID faceplate for each control scenario. I like his approach...:nodi:

Depending on which HMI you are using, you could probably do it with a single faceplate, with tag substituion, and multisate title bar for identification.
 
Depending on which HMI you are using, you could probably do it with a single faceplate, with tag substituion, and multisate title bar for identification.

I'm using a 10" PanelView Plus 7. True, I could use tag substitution but I'm good with separate screens for each faceplate.
 
I'm using a 10" PanelView Plus 7. True, I could use tag substitution but I'm good with separate screens for each faceplate.

OK, no problem with that, but make sure you can't call up the "wrong" faceplate depending on the operating mode of the filter.

Otherwise someone may just be trying to tune a loop that isn't actually controlling the output.
 
Note that you will need two loops. I propose one always in use for controlling flow, and the second in use for normal operation only for controlling pressure with the loop output being flow.

By using flow control directly with one loop you will have consistent tuning for that loop regardless of the source of the flow setpoint. This loop should be quite stable.

The pressure control loop, with flow setpoint as its output, is going to be more difficult to tune. If most of the pump head is going to be friction loss then the pressure / flow characteristic will be very different before and after backwash. That will change the "slope" of the pressure / flow curve. Non-aggressive tuning is going to be required.

The pressure / speed characteristic will be even more non-linear.
 
Tom, I think you may be confusing people, by referring to the pressure control loop as "controlling flow", which it will definitely not be doing. The flow will be determined by the condition of the filter, and as I've already stated, will reduce as time goes on, triggering the need for the backwash. The loop output will not be "flow", it will be pump speed.

I once worked on a "High-Temperature How Water" (HTHW) system, where recirculating water was held at a constant pressure, by 1, 2, or 3 pumps from a 4 pump set. The water was heated to 120 deg.C

The pumps did "replenish" the recirculating water loop when the HTHW was used for cleaning by various systems throughout the factory, but when no-one was using it, they had to maintain the pressure in the loop, even though there was no flow through the pressurising pumps. If the pressure dropped, the HTHW would flash boil in the pipework, and loads of pressure relief valves would vent it to atmosphere, obviously an undesirable situation.
 
Tom, I think you may be confusing people, by referring to the pressure control loop as "controlling flow", which it will definitely not be doing.

The confusion is because most controls guys don’t understand how centrifugal pumps really work.

Pumps produce flow, not pressure. If you doubt this, run a pump with the discharge piping disconnected. Lots of flow, no pressure. The system’s resistance to flow creates pressure (head) that the pump must overcome to move water through the system.

The pump performance curve identifies the pump’s pressure capability at a given flow when operating at a given speed. Reducing pump speed creates a new performance curve down and to the left of the original curve in conformance with the affinity laws. Looking at a pump curve by itself you cannot tell what the flow or pressure will be.

The system curve identifies the flow vs. pressure characteristics of the piping and the filter – the friction losses from moving water through the system. For a given condition the losses are proportional to the square of the flow – a parabola. Superimposing the system curve on the pump curve identifies the actual operating point at a set of conditions. Now you can see the operating flow and pressure.

When the filter gets dirty the friction increases for a given flow and the system curve gets steeper – the parabola moves to the left and up. If you don’t have a control system, the flow will drop and the pressure will increase simultaneously. If you want to get back to the initial pressure YOU CAN ONLY CHANGE THE FLOW. A lower flow will move the operating point down and to the left along the steeper system curve, resulting in the original pressure but at a lower flow.

The method of choice for reducing flow is changing the pump speed. This shifts the pump curve until the new curve intersects the steeper system curve at the lower flow. The new flow creates the same pressure drop through the dirty filter that the higher flow created in the clean filter.

Control engineers may think they are changing pressure directly by changing speed, but they aren’t. They are changing flow, moving up and down the system curve.

The attached Excel file shows how it works.
 
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.
 
The confusion is because most controls guys don’t understand how centrifugal pumps really work.

Pumps produce flow, not pressure.

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.
 
I'm with Tom. Go with a cascaded loop arrangement where flow is the inner loop and pressure is the outer loop. Normally the pressure controller sends the sp to the inner flow loop. In the backwash mode the flow sp would come from the logic you setup to detect the mode. When going to backwash set the flow loop mode from cascade to auto and pressure loop to from auto to man (or no.. depends on if the PID instruction supports initialization). If you pv tracking is an option for the pressure loop check that box as well or build it yourself.
 

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,531
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,686
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