I've got a control loop that I can't quite figure out how to accomplish.
Three variable speed wells feed water to a tank, the tank supplies water to the plant. Plant water usage can vary and they need the tank to remain full at all times. The lead well runs almost continuously and is usually enough to keep the tank full. Each well has its own PID and the tank level to maintain is the SP (so each PID uses the same SP and PV). The well will vary speed to keep the tank at SP. If the tank level drops, the second and third wells come on (the wells alternate every so often to keep an even runtime). The wells are different size, so they have different pumping rates, so each PID has its own P&I and min/max out settings (to limit each well's max flow rate to their permit amounts, which is around 1,000 GPM each). The above is all the easy part. The problem is that the combined pumping flow rate cannot exceed a max value (2,000 GPM). It normally doesn't matter how much the wells are pumping unless the combined flow rate exceeds a setting, which is all the piping can handle. Two wells at full speed can exceed 2,000 GPM, three wells definitely will. Each well has its own flowmeter, which I add to get the combined flow. I cannot figure out how to manipulate the PID's to limit the speed in order to limit the combined flow when it exceeds the max flow setting. I used a negative feed forward value to slow down the highest flowing well (checking every few seconds for which well has the highest flow rate), but the I term overrides the FF and all PID CV's end up at 100% before long. I can't put the PID's into manual to clamp the speed because then they won't slow down as the tank level approaches SP, and I can't overshoot the level SP or the tank will shoot out water. Each well flow rate/speed varies with ground water conditions and tank level, so it isn't consistent. Does anyone have any ideas?
Three variable speed wells feed water to a tank, the tank supplies water to the plant. Plant water usage can vary and they need the tank to remain full at all times. The lead well runs almost continuously and is usually enough to keep the tank full. Each well has its own PID and the tank level to maintain is the SP (so each PID uses the same SP and PV). The well will vary speed to keep the tank at SP. If the tank level drops, the second and third wells come on (the wells alternate every so often to keep an even runtime). The wells are different size, so they have different pumping rates, so each PID has its own P&I and min/max out settings (to limit each well's max flow rate to their permit amounts, which is around 1,000 GPM each). The above is all the easy part. The problem is that the combined pumping flow rate cannot exceed a max value (2,000 GPM). It normally doesn't matter how much the wells are pumping unless the combined flow rate exceeds a setting, which is all the piping can handle. Two wells at full speed can exceed 2,000 GPM, three wells definitely will. Each well has its own flowmeter, which I add to get the combined flow. I cannot figure out how to manipulate the PID's to limit the speed in order to limit the combined flow when it exceeds the max flow setting. I used a negative feed forward value to slow down the highest flowing well (checking every few seconds for which well has the highest flow rate), but the I term overrides the FF and all PID CV's end up at 100% before long. I can't put the PID's into manual to clamp the speed because then they won't slow down as the tank level approaches SP, and I can't overshoot the level SP or the tank will shoot out water. Each well flow rate/speed varies with ground water conditions and tank level, so it isn't consistent. Does anyone have any ideas?
Last edited: