PID tuning woes

For the P-only feedback control to work, both controller gain, K p, and bias need to be configured (slope and offset).

To help with that, we would need to know the scaling of the level input to the PID PV, and the scaling of the PID CV to the pump and the flow.
 
For the P-only feedback control to work, both controller gain, K p, and bias need to be configured (slope and offset).

To help with that, we would need to know the scaling of the level input to the PID PV, and the scaling of the PID CV to the pump and the flow.
Yes, I have used the term bias instead of offset. We know the gain of the tanks. The rest is easy.

However, I still want to know why there isn't a direct connection between the 4 25 GPM pumps and the sand filter. So far there is no answer. A direction connection would removing the two tanks and two pumps and the control problems.

WTF are there two tanks between the 4 wells and the UV process?
 
[why] are there two tanks between the 4 wells and the UV process?

1) For capacitance.
2) because it was built that way and changing it is not a viable option.

Are you suggesting that, if the wells' inflows are steady, that only the on-or-off decant flow needs the capacitance of the tank and could be fed in separately?
 
Bias and gain are the formal names typically used by the PID instruction, but since we are suggesting a linear relationship between level and pump speed, independent of time (no Integral or Derivative action), slope and offset are analogs that may click more readily in OP's mind.

What we are suggesting is configuring the PID instructions to be functionally equivalent to SCL (linear scaling) instructions.
 
1) For capacitance.
Why is capacitance needed if the wells produce a steady 100 gpm flow? The OP said that flucuations are not good.

2) because it was built that way and changing it is not a viable option.
But why was it designed that way in the first place? Some one must have been selling tanks , pumps and extra controls.

Are you suggesting that, if the wells' inflows are steady, that only the on-or-off decant flow needs the capacitance of the tank and could be fed in separately?
We haven't been told anything different. The extra 15 gpm could be ramped up and down over time to avoid a rapid 15 gpm shock/disturbance.

My questions are meant to extract answers. Start with KISS and make things a little more complicated only if it solves a problem. What problem?

Do the tanks need to be that big? Why two tanks instead of one.

I think we are being trolled.
 
WTF are there two tanks between the 4 wells and the UV process?

First tank is possibly for coagulant or flocculant contact time, prior to the sand filter. Although that's just a guess without knowing what the "unnamed process" is upstream of the sand filter, I'd typically expect to see a clarifier or lamella plate settler before the sand filter and then you wouldn't need T1. However, if the sand filter and the unnamed process are a pressurized system, then the break tank is often required to avoid putting in large well pumps to achieve total required head. Well pumps are expensive.

Tank 2 would be there for a similar reason, after the UV treatment the water needs to be sent to a reservoir or tank.
If the sand filter is a gravity sand filter (open top type), then you have to have the filtered water flow into a tank as it can't be delivered under pressure, due to the nature of the filter design. Even pressure filters have a reasonably low pressure design rating of 2 to 4 bar. If you're delivering into a pressurized water network, this is normally running at pressures of 6-10 bar.
 
First tank is possibly for coagulant or flocculant contact time, prior to the sand filter.
None of that is mentioned and it doesn't make no difference unless if affect flow or tank levels.

Although that's just a guess without knowing what the "unnamed process" is upstream of the sand filter, I'd typically expect to see a clarifier or lamella plate settler before the sand filter and then you wouldn't need T1. However, if the sand filter and the unnamed process are a pressurized system, then the break tank is often required to avoid putting in large well pumps to achieve total required head. Well pumps are expensive.
The well pumps are in place. You are right. The OP has not said what the process is.

Tank 2 would be there for a similar reason, after the UV treatment the water needs to be sent to a reservoir or tank.
If you are right then how does that affect the flow or tank levels?
 
If you are right then how does that affect the flow or tank levels?

If lifting to a reservoir of sufficient capacity, you can run at fixed speed / constant flow out of tank T2.

Some systems though have the need for varying flow to match demand, to avoid having to stop / start the plant. UV reactors are normally limited to around 4 starts a day if you want to get the rated life out of the lamps. Sand filters do also not like lots of start cycles, and you waste water if there's a rinse to waste cycle until the filter beds down. So the normal approach is "try and keep everything running as long as possible", which may mean varying the flow rate through the plant to avoid reaching top water level in the final reservoir.

That would only need to happen gradually though... a few gpm rate change over a half hour.

I almost exclusively do controls for water and wastewater systems and by far the most reliable approach I've found is providing the operator with a fixed flow setpoint, or a range that the control system can slowly adjust between, for either the start or finish of the plant.

Each tank in the process then becomes a point where you can de-couple from the previous process, and use the capacitance in the tank (as the good Dr calls it) to deal with any short term flow changes from a wash cycle, automated sampler, etc. The level in the tank normally doesn't matter, within reason... don't overflow it, and don't airlock the pumps.

The Well Pumps in the OPs case are also on VSD, so can be varied. Thinking about it, this could also be part of the problem... if the well pumps are speed controlled to maintain a tank level, but so is Pump 1, they end up influencing each other if the same level setpoint is used for both loops as even a slight deviation from setpoint will cause one loop to increase and one to decrease.

Having the well pumps aiming for a higher tank level setpoint and outflow pump 1 aiming for a lower setpoint will maximize the flow rate through the plant (assuming high enough gain on P only controller, or suitable integral gain).

Plant operators don't give a toss about the tank levels within the plant, just the one at the end. They need to produce a certain amount of water to meet demand, which is best defined by a rate or a volume. This is why i like giving the flow setpoint as the main control.
 
If lifting to a reservoir of sufficient capacity, you can run at fixed speed / constant flow out of tank T2.

Some systems though have the need for varying flow to match demand, to avoid having to stop / start the plant.
This makes sense but we have not been told about varying demand. If there is a sensor that can measure the demand then everything upstream can be synchronized to that demand by using a bias.



So the normal approach is "try and keep everything running as long as possible", which may mean varying the flow rate through the plant to avoid reaching top water level in the final reservoir.
That would only need to happen gradually though... a few gpm rate change over a half hour.
What I suggest would keep plant running.



I almost exclusively do controls for water and wastewater systems and by far the most reliable approach I've found is providing the operator with a fixed flow setpoint, or a range that the control system can slowly adjust between, for either the start or finish of the plant.

Each tank in the process then becomes a point where you can de-couple from the previous process, and use the capacitance in the tank (as the good Dr calls it) to deal with any short term flow changes from a wash cycle, automated sampler, etc. The level in the tank normally doesn't matter, within reason... don't overflow it, and don't airlock the pumps.
This makes sense.


The Well Pumps in the OPs case are also on VSD, so can be varied. Thinking about it, this could also be part of the problem... if the well pumps are speed controlled to maintain a tank level, but so is Pump 1, they end up influencing each other if the same level setpoint is used for both loops as even a slight deviation from setpoint will cause one loop to increase and one to decrease.
Both drbitboy and I have acknowledge the coupling between different pumps and tanks.



We weren't told the well pump flows can vary. This another thing that can be synchronized to the UV flow demand.


Having the well pumps aiming for a higher tank level setpoint and outflow pump 1 aiming for a lower setpoint will maximize the flow rate through the plant (assuming high enough gain on P only controller, or suitable integral gain).
??? Shouldn't the inflow be equal to the demand to keep the levels constant. Of course the inflow can be adjusted if the levels are too high or too low.



Plant operators don't give a toss about the tank levels within the plant, just the one at the end. They need to produce a certain amount of water to meet demand, which is best defined by a rate or a volume. This is why i like giving the flow setpoint as the main control.
Makes sense.


I guess I had nothing better to do than waste time on this thread.
 
??? Shouldn't the inflow be equal to the demand to keep the levels constant. Of course the inflow can be adjusted if the levels are too high or too low.

The inflow will equal the outflow once the system reaches a steady state. I have probably not explained this very well. If DrBitBoy is feeling very bored he can probably simulate this. I'm not feeling that bored!

Well pumps with a tank level setpoint of say, 2 feet. Outflow pump 1 with a level setpoint of say, 1.5 feet. Whichever system has the lower maximum rate will eventually saturate at 100% (assuming some integral gain), and the system with more capacity will settle down to that same rate.

I think we've probably expended as much effort on this as is worth expending right now.
 
Summary

We may not have all the teeth, but we have enough.

TL;DR

Oh dear, I made another post here but it got lost.

Anyway, I have seen no evidence or argument that automating the P-only solution, originally proposed by @Peter Nachtwey, with the current design and operating conditions should not work to meet the constraints and/or assumptions stated and/or validated by OP:

  • minimize Pump 2 discharge flow rate variation over time to prevent UV system trips; this is the primary constraint
  • tank levels may be allowed to vary as long as
    • neither tank overflows
    • neither tank runs dry (pump cavitates)
  • Pump 1 discharge flow rate may be allowed to vary as needed
  • base inflow to process from four wells is relatively constant at 100gpm
  • decant flow adds 15gpm to base inflow for 3h out of every 12h
I don't know why OP could not get P-only level control to work; I suspect that is due to OP not adequately understanding the PID scaling of PV and/or CV.

The key is eschewing tight level control at a fixed setpoint, and instead configuring the PID instructions to to use time-varying level measurements to control flow rates in response to the decant cycle.

The plots below show an ideal case for the primary process constraint by fixing the Pump 2 discharge and UV system flow rate at the 12h-average inflow. The vertical dotted lines below indicate when Tank 2 net flow crosses zero and occur at Tank 2 level extrema. Obviously that average rate will vary over time, but nothing OP has said indicates that P-only PID parameters of the current control scheme cannot be tweaked to handle that variation.

There may be better control schemes, but it is pointless to suggest alternatives when the current scheme can be so trivially made to work.
levels_flows_103_103.png
 
so to add a few teeth to the pile.

wells are extraction wells offsite the farthest being 1 mile away. speeds are fixed since they couldnt put a VFD in the vaults, flowrate is set with a manual valve before entering T1. 25gpm is fixed because that's what the hydrogeologist want.

process 1 is a aerobic process that is low pressure (<10psi) which prevents the wells going direct into a manifold as Peter has been pushing for.

discharge of process 1 goes to T2 that needs to boosted for the sand filter (pressure vessels), UV, GAC, and IX vessels before going to the recharge basin. overall DP of ~50psi when all said and done

sand filter backwashes to a sludge tank, after 8hrs of settling the 'clean' was is pumped off the top. the 15gpm is a guessimate based on a pump curve and pump down time since there isnt a flow meter on that line.

this is a remediation plant, so there is no demand to be met other than uptime.

I don't know why OP could not get P-only level control to work; I suspect that is due to OP not adequately understanding the PID scaling of PV and/or CV.

The key is eschewing tight level control at a fixed setpoint, and instead configuring the PID instructions to to use time-varying level measurements to control flow rates in response to the decant cycle.

thank you for tonight's reading rabbit hole. i would really love to have a solution by the end of the week, if not i will have to admit defeat and tell them i am not capable of getting things sorted which i REALLY dont want to do.

looking back at my field notes and i think the longer duration between decants previously as we ramped up flow was hiding the flawed PI approach i had going. the increased flows and load mean more biomass carry over which then requires more sand filter backwash.

i can manipulate things to steady state, things respond when the decant happens but after the decant is done they systems gets into this oscillations that build on each other, then another decant event and the unit trips.

4c523a75-ba0d-4814-9c37-2f5c0dac3d98_text.gif


giphy.gif
 
Last edited:
Here is the P-only approach, assuming the well+decant flow (red line below) is a Heaviside (step) function. The Pump 2 flow rate to the sand filter and the UV system (white line in trend) increases at a maximum rate of about 2gpm over 3-4h during the decant, and then decreases at a lower rate for well flow only.
tank_capacitance_trend.png
There are more images, containing the PIDs' setup menus, in the attached .ZIP file.

I chose the CV and PV ranges (maxima and minima) to ensure most of the tanks' combined volume (capacitance) gets used with a Kp value of 1.

The PIDs' CV outputs are the pump flowrates; obviously the CV Max and Min values would need to be differen to set the pump speed references in Hz, but the principle is the same.

The model runs 10s of simulated time per scan cycle. The PIDs's update time values do not matter because Ki and Kd are both zero.
 
Last edited:

Similar Topics

Hello, I am attempting to tune a PID loop on a process. The process involves a valve with electronic actuator that has quite a high deadband...
Replies
10
Views
2,257
Hi everyone, yet another PID problem. I'm hoping I understand enough of the process I'm controlling that my request for help is reasonable. If a...
Replies
113
Views
28,578
A few months ago, I started to look into PID controllers and the tuning of first order processes. This has, partly thanks to you, resulted in a...
Replies
162
Views
63,109
I haven't had to tune a PID loop in a very long time. It's actually a PI loop for a pulse width modulation s.v. What was the name of that tuning...
Replies
16
Views
4,150
Hello, there is anyone who have already used hpmont plc? now i am programming for that plc and have " pid autotuning is not working" issue. I have...
Replies
0
Views
985
Back
Top Bottom