Logix 5000 PID with slow process response and odd behavior

defcon.klaxon

Lifetime Supporting Member
Join Date
Feb 2015
Location
Far NorCal
Posts
616
Hi all,

I'm working on a wastewater plant with oxidation ditch aerators. The aerators are on VFDs and the operators want the dissolved oxygen in a really tight control, typically we're talking 1.0-1.5mg/L. There are a few things that make this loop challenging. First, there are two aerators and it seems that one's response affects the other and vice versa. Second, the response is very slow; dead time is around 2 to 3 minutes and while in theory the response should be self regulating, it almost appears to be integrating; a control output change of 6% took over an hour for the DO to settle out and even then, it was very noisy.

Also, if I compare aerator speed command to the DO, the DO lags the speed command by about 90 degrees so it slowly hunts and hunts and hunts. So I'm in an odd spot where I have a sensitive process variable that can vary when the aerator changes speed by just one percent, but if I try to tune the loop so that it's slow to change speed, it can't respond quickly.

Wondering if anyone had some suggestions for how to tackle this loop. One question I have is, how does the Loop Update Time come into play?

Oh and for reference, I'm using the independent mode.

Thanks guys!
 
More questions than answers

First we'll need to know more:

1) PID or PIDE?

2) You asked about "Update Time". Is this in a Periodic task, or in the Continuous task? Is the PID block conditionally triggered?
The loop update time should match how often the PID does its calculation. It is effectively the 'dt' of the integral {∑(error)dt} and derivative {d(error/dt} terms of the PID equation. Changing it changes your tuning constants.

3) If you disable the PID control (set SWM) and set its output by hand (set .SO), can you get the system to where it needs to go and quickly?
If a human can't do it, it may be hard for a dumb equation to do it.

4) Are the two Aerators driven by the same PID output, or is one of them running at a fixed speed (Gross control) and the other under PID (Fine control)?
Doing this should eliminate your "fighting" issue. How you determine what the fixed speed should be might be answered by #3, or you may need to watch the PID output and if it gets saturated (0 or 100%, or other points in between if no process changes occur when greater than, say, 80% or less than 20%) and adjust the fixed speed by +x/-y to keep the PID controlling in the zone where it does the most good.

5) Do you have trends that you can post? Those would be of big help, rather than us trying to visualize your process.

6) What are your PID block's scaled ranges (MinI/MaxI or PVEUMin/PVEUMax) ? Those are used in the calculation of the error (as a % of PV), and too large of a range can produce hard to tune loops.

7) Do the VFDs have their own PID loops? How are they tuned? What are their Accel and Decel times? If they're sluggish, and your PID is trying to change them quickly, that could also be where one of your problem lie.

I'm sure others will jump in with more questions.
 
Last edited:
Your problem might just be the dead time. A normal PID will have problems with dead times that long than the time constant for a step response. You may need a Smith Predictor.



Ditto the request for a trend.


Can the oxygen be controlled with just one VFD? This way the system would be so "sensitive"
 
duplicating/expanding on @Aardwizz's queries:

  • Is the process continuous or batch?
  • If continuous, is there any measurement of the flow coming in and/or going out?
  • how many DO measurements are being made?
  • where are DO measurements being made (near inlet, outlet, middle of ditch)?
  • is there any forced mixing of the material in the ditch?
  • ditto the ditto request for a trend: please post some trend plots of VFD speeds on manual with step changes and corresponding DO measurement(s) vs. time.
  • "the DO lags the speed command by about 90 degrees so it slowly hunts and hunts and hunts?"
    90 degrees in what context?
  • Do the bubbles from the aerators typically make it to the surface, or are the bubbles completely dissolved into the water before they reach the surface?
 
A summary sketch or P&ID of the process would be a nice thing to have (discrete and analog inputs; discrete and analog outputs, etc.).

Also, a plot of the DO measurement, so we can see its "character" (noise, range, etc.). N.B. this might be included in the trend plots.
 
First we'll need to know more:

1) PID or PIDE?

PID, in ladder logic.

2) You asked about "Update Time". Is this in a Periodic task, or in the Continuous task? Is the PID block conditionally triggered?
The loop update time should match how often the PID does its calculation. It is effectively the 'dt' of the integral {∑(error)dt} and derivative {d(error/dt} terms of the PID equation. Changing it changes your tuning constants.

This is a periodic task that executes every 100ms; this matches the Loop Update Time.

3) If you disable the PID control (set SWM) and set its output by hand (set .SO), can you get the system to where it needs to go and quickly?
If a human can't do it, it may be hard for a dumb equation to do it.

So when the aerator is set to a constant speed, the DO slowly trends upwards but does plateau several times. Looking at trends, I believe this is because influent flow is brought in by a pump station, so there are surges and the long dead time stalls the new influent flow's DO. Then the DO overshoots a bit once the flow goes back down. I'll provide some trends.

4) Are the two Aerators driven by the same PID output, or is one of them running at a fixed speed (Gross control) and the other under PID (Fine control)?
Doing this should eliminate your "fighting" issue. How you determine what the fixed speed should be might be answered by #3, or you may need to watch the PID output and if it gets saturated (0 or 100%, or other points in between if no process changes occur when greater than, say, 80% or less than 20%) and adjust the fixed speed by +x/-y to keep the PID controlling in the zone where it does the most good.

Each aerator has its own PID output and when I talked to the civil who worked on this project, she suggested that they *wouldn't* affect each other so maybe the fighting against each other is not true.

5) Do you have trends that you can post? Those would be of big help, rather than us trying to visualize your process.

Yep! I'll provide some here in a bit.

6) What are your PID block's scaled ranges (MinI/MaxI or PVEUMin/PVEUMax) ? Those are used in the calculation of the error (as a % of PV), and too large of a range can produce hard to tune loops.

Scaled range is 0-20mg/L, I assumed they should match the full scale of the instrument but hey, maybe adjusting that could help with the error calculation.

7) Do the VFDs have their own PID loops? How are they tuned? What are their Accel and Decel times? If they're sluggish, and your PID is trying to change them quickly, that could also be where one of your problem lie.

Great question. VFDs do not have their own PID loops, they just run off of the mA signal when in Remote or the speed potentiometer when in Local. As far as Accel and Decel times, not sure off the top of my head but I'll put that on the list of things to check when I'm on site next.
 
Your problem might just be the dead time. A normal PID will have problems with dead times that long than the time constant for a step response. You may need a Smith Predictor.

The dead time is definitely something that is hard to deal with. I've not heard of a Smith Predictor but I'll look into it, thanks! And I will be adding trends here in a minute.
 
duplicating/expanding on @Aardwizz's queries:

  • Is the process continuous or batch?
  • If continuous, is there any measurement of the flow coming in and/or going out?
  • how many DO measurements are being made?
  • where are DO measurements being made (near inlet, outlet, middle of ditch)?
  • is there any forced mixing of the material in the ditch?
  • ditto the ditto request for a trend: please post some trend plots of VFD speeds on manual with step changes and corresponding DO measurement(s) vs. time.
  • 90 degrees in what context?
  • Do the bubbles from the aerators typically make it to the surface, or are the bubbles completely dissolved into the water before they reach the surface?

Hi, to answer your questions:

-Process is continuous
-There is an influent flowmeter
-Two; one for each oxidation ditch
-I believe the sensors are towards the middle of each ditch
-No forced mixing
-Will be posting trends in just a minute
-90 degrees in that the aerators speed up, then after awhile the DO rises, so the aerators slow down, DO falls and the DO lags the aerator speed by 90 degrees.
 
@defcon.klaxon: thank you for the responses.

Sorry to keep peppering you, but what is the typical residence time (ditch volume divided by typical influent flowrate)?

And what is the DO of the influent?

An how much is, and what is the character of, the variation in the influent flowrate? E.g. "flowrate generally steady for long periods, but can occasionally double over the course of X minutes."

Since you have a measure of the influent flowrate, one way to handle this might be to set the VFD speeds proportional to the product of

  • the influent flowrate
multiplied by
  • a factor that is basically the CV output of the PID.
That normalizes the required loading and ensures the aerators responds immediately to changes in influent flowrate, instead of waiting for the DO to change when the flowrate changes. I.e. the PID CV output will be a measure of the specific* difference in DO between the influent and the DO setpoint.

* per gallon, per cubic meter, per pound
 
Last edited:
Here is the DO before tuning

Ditch 1 is swinging 0.65-2.11mg/L and Ditch 2 is swinging 1.25-1.62mg/L; the setpoint is 1.4mg/L.

Looking at the PI settings, Ditch 1 Kp was 0.2 and Ki was 0.007; Ditch 2 Kp was 0.2 and Ki was 0.005.

Next step was I did a FOWDT analyzation of the process, which wasn't easy given how the DO will ebb and flow with influent flow, but it was better than nothing and I adjusted both loops to Kp at 0.2 but Ki at 0.002.

Here is the result.

You can see the it's much improved as far as no extreme ringing, but the DO does seem to be affected by the flow, and it's slow to respond because of the deadtime.

Client is very happy with the improved results but I still want to learn about tuning loops and see if there is anything I can do to get things even better.

Thanks for the help and suggestions!
 
Last edited:
  • where are DO measurements being made (near inlet, outlet, middle of ditch)?
  • is there any forced mixing of the material in the ditch?
-I believe the sensors are towards the middle of each ditch
-No forced mixing

Assuming the aerators extend along the entire length of the ditch*, and also assuming very little along-ditch/along-flow mixing other than diffusion, the DO will be low upstream of the sensors and high downstream of the sensors.

* Or perhaps the sensors are downstream of the aerators, which would make more sense from a design standpoint, so the DO measurement is representative of the effluent.
 
Sorry to keep peppering you, but what is the typical residence time (ditch volume divided by typical influent flowrate)?

No apologies needed, I really appreciate the help! As for the residence time, I'll ask the civil I'm working with and get you that info.

And what is the DO of the influent?

Not sure, we don't have a DO probe before the aerator ditches but I'll ask the civil just to be sure.

An how much is, and what is the character of, the variation in the influent flowrate? E.g. "flowrate generally steady for long periods, but can occasionally double over the course of X minutes."

The second trend I shared includes flow in MGD, but it's heavily averaged because it's so noisy. Let me see if I can get a flow trend that can provide some insight.

Since you have a measure of the influent flowrate, one way to handle this might be to set the VFD speeds proportional to the product of

  • the influent flowrate
multiplied by
  • a factor that is basically the CV output of the PID.
That normalizes the required loading and ensures the aerators responds immediately to changes in influent flowrate, instead of waiting for the DO to change when the flowrate changes. I.e. the PID CV output will be a measure of the specific* difference in DO between the influent and the DO setpoint.

* per gallon, per cubic meter, per pound

That is a REALLY interesting idea if it's possible with existing instrumentation.
 
Assuming the aerators extend along the entire length of the ditch*, and also assuming very little along-ditch/along-flow mixing other than diffusion, the DO will be low upstream of the sensors and high downstream of the sensors.

* Or perhaps the sensors are downstream of the aerators, which would make more sense from a design standpoint, so the DO measurement is representative of the effluent.

I'll look into getting the plansheets so we can be sure of aerator ditch design and sensor location.
 
Is this really all that bad?** Yes it's 90deg out of phase at the start but eventually it's 180deg of phase and driving the amplitude of the swings down.

Next step was I did a FOWDT analyzation of the process, which wasn't easy given how the DO will ebb and flow with influent flow, but it was better than nothing and I adjusted both loops to Kp at 0.2 but Ki at 0.002.

Here is the result.


The red line must be the influent flowrate***: when the flow drops quickly e.g. 1000gal/s to 700gal/s, the DO measurement shoots up, because the aerator is initially supplying enough oxygen to bring 1000gal/s from whatever DO the influent is at up to the setpoint, but that is being added to only 700gal/s, so it is over-oxygenating.

This is why normalizing the required oxygen load* might work.

* difference between SP DO and influent DO, i.e. difference in DO per unit.

** duh on me, that is probably for a steady flowrate; if the flowrate varies it will never get to stable control.

*** or perhaps PID CV output/VFD speed, which is a proxy for the flowrate, assuming constant influent DO load.
 
Last edited:

Similar Topics

Hello all, I'm having issues with a PID and trying to tune it. I just do not understand why my CV goes to 105 with the settings I have. Config...
Replies
14
Views
1,568
Hi, Long time not in the forum, and not in the programming. I´m getting back. I was issued a conversion from RSLogix 500 to RSLogix 5000 (studio...
Replies
0
Views
1,287
So I have a PID loop on an 1756-L61 running V17 software just for background. Also the PID PV is a pressure transmitter and the CV is speed sent...
Replies
1
Views
893
Hi All, I have a PID control application that I would like to get your opinions on. As I am reality new to PID loops I am struggling somewhat...
Replies
14
Views
4,276
Good morning guys, I have a machine that fills bags of prepared food at a variable speed, and a machine that checks the weight of the bag. What...
Replies
23
Views
6,819
Back
Top Bottom