PID guidance

i got a potable water chlorine dosing problem.

system is low flow (~20gpm), ~3hrs of runtime per day, oversized dosing pump, long run between chlorine analyzer and sample source, so very slow response in the loop.

pump needs to run in 7-9% range to maintain the desired residual. i have set the output min to 5% and max 25%. during startup i manipulated the bias to get the adjustments minimal and things to be happy. customer had some extended downtime and power issues, no idea what else was done but when they restarted they chlorine pump is just bouncing between the min/max and wont find steady state.

so after some reading my bias adjustment was not the correct way to handle things. another thing i noticed is the original developer used tieback and .MO, while some claim using .SWM and .SO would be a better way to handle the manual state for bump less transfer because you dont have to

dumb question. if the PID has no conditions in front of it, will it always be calculating even when i am not in process?

would having a one shot to set a the .SO on startup for a desired value for a small amount of time to get things close before turning control over the PID loop?

below is the current logic and PID settings assuming the operators didnt change anything1743717480052.png.

1743717159174.png
 
PID loops have Auto and Manual mode and that is how to decide if the PID loop is controlling the process automatically or not.
The loop should be executed regardless because it actually does some minimal calculations even in manual mode.

It's quite normal to set the output manually to a good starting point before putting the PID loop in Auto.
For example by saving the output last time the PID loop was in Auto and everything looked good.

It's also quite normal to have some kind of startup sequence. For example set the output manually, wait a few minutes, then put the loop in Auto.

Your parameters looks strange to me.
  • I would expect a PI-loop. With the majority of work done by the slow integral term.
  • No output bias because the integral term will do that job.
  • If the dosage was also dependent on something else, for example the flow, I would expect some type of feed forward.
  • I'm not sure how the tieback works but manual calculations shouldn't be needed.
  • Bumpless transfer is usually achieved automatically by the loop recalculating the manual output into the integral term.
 
system is low flow (~20gpm), , ~3hrs of runtime per day
does the flow rate, of the material to which the dosing is added, change during those 3h?

are the 3h one continuous period, or the total of several separate periods?

long run between chlorine analyzer and sample source, so very slow response in the loop.
how slow? when the CV (dosing rate) makes a step change with the PID in manual, what does the temporal response of the PV look like? e.g.
  • PV responds with a step change about 30s after the CV step change?
  • PV does not change for 15s, then gradually approaches a new value, getting halfway to the new value in about one minute?
  • ...?
 
I would not use a PID for this. I would run it open loop. If you PLC has the water flow rate and you know the chemical pump capacity and desired dose, it's pretty easy to do the math for that.

Then if you think closing the loop with the analyzer data is necessary, apply (multiply) a scale factor to the calculation above and start it out at 1.0.
Wait until you are sure the analyzer data is reflective of the current dosage. That might be 5 minutes, it might be over an hour depending on the distance between the injection point and the analyzer. It might be fairly repeatable, but in cases where you have a storage vessel in between the two, it could vary a lot.

When that time delay expires, calculate an adjustment to that scale factor, but limit the result so it can't go off the deep end either way. The last one I programmed like this had the scale factor clamped between 0.7 and 1.4 and it was good that I did that, because the analyzer went haywire a few months later and that clamp limited the result to a safe and reasonable end result. I also limit how much change I apply to the scale factor at each interval.

I have done a bunch of these and only one ever worked reliably with a PID in the mix. All the others, worked better with just a timer to control the interval between bumps and the bump math with a clamp on it.

Running the chem pump at 7% of its capacity also is going to limit the accuracy of how it doses.

Is there a drawdown tube where you can check the actual output at a slow speed like that?

Is it a peristaltic or diaphragm pump?

With diaphragm pumps on bleach, we usually set the stroke length at 100% to reduce the chance of off gassing causing it to lose prime and it absolutely must have a degassing head. But cutting the stroke length can help get the stroke speed further up into the more repeatable range of the pump.

With a peristaltic, it can sometimes be pretty easy to switch to a lower capacity tube.
 
I would not use a PID for this. I would run it open loop. If you PLC has the water flow rate and you know the chemical pump capacity and desired dose, it's pretty easy to do the math for that.

Then if you think closing the loop with the analyzer data is necessary, apply (multiply) a scale factor to the calculation above and start it out at 1.0.
Wait until you are sure the analyzer data is reflective of the current dosage. That might be 5 minutes, it might be over an hour depending on the distance between the injection point and the analyzer. It might be fairly repeatable, but in cases where you have a storage vessel in between the two, it could vary a lot.

When that time delay expires, calculate an adjustment to that scale factor, but limit the result so it can't go off the deep end either way. The last one I programmed like this had the scale factor clamped between 0.7 and 1.4 and it was good that I did that, because the analyzer went haywire a few months later and that clamp limited the result to a safe and reasonable end result. I also limit how much change I apply to the scale factor at each interval.

I have done a bunch of these and only one ever worked reliably with a PID in the mix. All the others, worked better with just a timer to control the interval between bumps and the bump math with a clamp on it.

Running the chem pump at 7% of its capacity also is going to limit the accuracy of how it doses.

Is there a drawdown tube where you can check the actual output at a slow speed like that?

Is it a peristaltic or diaphragm pump?

With diaphragm pumps on bleach, we usually set the stroke length at 100% to reduce the chance of off gassing causing it to lose prime and it absolutely must have a degassing head. But cutting the stroke length can help get the stroke speed further up into the more repeatable range of the pump.

With a peristaltic, it can sometimes be pretty easy to switch to a lower capacity tube.

This...I run several process like this where there are very long dwell times between correction and results. I simply add/subtract to a ratio control based on results. Sometimes I'll do a small P correction as a feed forward, but the bulk of the work is by the "integral" correction.
 
This...I run several process like this where there are very long dwell times between correction and results. I simply add/subtract to a ratio control based on results. Sometimes I'll do a small P correction as a feed forward, but the bulk of the work is by the "integral" correction.
@mobil1syn: this

search for floating control on this forum. It is also called sliding mode control, IIRC.

Btw, the most likely reason that the PID is now cycling, if it was not cycling immediately after startup when you commissioned it, is that someone has changed the PID:process relative responses e.g.
  • KP was increased
  • the PID PV range was changed
  • the PID CV range was changed
  • the flow rate changed
 
PID loops have Auto and Manual mode and that is how to decide if the PID loop is controlling the process automatically or not.
The loop should be executed regardless because it actually does some minimal calculations even in manual mode.

i am talking when the system is off. the incoming PV goes to zero and then the PID is making adjustments to correct but there is nothing to correct.

does the flow rate, of the material to which the dosing is added, change during those 3h?

are the 3h one continuous period, or the total of several separate periods?

flow rate will drop to 5-7gpm for a duration as the water gets used for backwashing.

unsure on the actual cycle times, im just going off the design conditions and limited time onsite. its been months since ive been onsite and will only have a short amount of time onsite next week to correct the problem. govt funded project with too many people involved and poor engineering on multiple fronts (including ours). burned up all our commissioning hours on showing up to site to find the same issues that had never been addressed from previous visits.

dose to response time on the loop is probably 15-20secs

I would not use a PID for this. I would run it open loop. If you PLC has the water flow rate and you know the chemical pump capacity and desired dose, it's pretty easy to do the math for that.

Then if you think closing the loop with the analyzer data is necessary, apply (multiply) a scale factor to the calculation above and start it out at 1.0.
Wait until you are sure the analyzer data is reflective of the current dosage. That might be 5 minutes, it might be over an hour depending on the distance between the injection point and the analyzer. It might be fairly repeatable, but in cases where you have a storage vessel in between the two, it could vary a lot.

When that time delay expires, calculate an adjustment to that scale factor, but limit the result so it can't go off the deep end either way. The last one I programmed like this had the scale factor clamped between 0.7 and 1.4 and it was good that I did that, because the analyzer went haywire a few months later and that clamp limited the result to a safe and reasonable end result. I also limit how much change I apply to the scale factor at each interval.

I have done a bunch of these and only one ever worked reliably with a PID in the mix. All the others, worked better with just a timer to control the interval between bumps and the bump math with a clamp on it.

Running the chem pump at 7% of its capacity also is going to limit the accuracy of how it doses.

Is there a drawdown tube where you can check the actual output at a slow speed like that?

Is it a peristaltic or diaphragm pump?

With diaphragm pumps on bleach, we usually set the stroke length at 100% to reduce the chance of off gassing causing it to lose prime and it absolutely must have a degassing head. But cutting the stroke length can help get the stroke speed further up into the more repeatable range of the pump.

With a peristaltic, it can sometimes be pretty easy to switch to a lower capacity tube.

i will have to explore that idea.

its a diaphragm pump without a draw down tube. they have diluted the cl2 to 5:1 because this problem was even worse before, the operator even considered going to 10:1 but didnt have an easy way to do that.
 
@mobil1syn: this

search for floating control on this forum. It is also called sliding mode control, IIRC.

Btw, the most likely reason that the PID is now cycling, if it was not cycling immediately after startup when you commissioned it, is that someone has changed the PID:process relative responses e.g.
  • KP was increased
  • the PID PV range was changed
  • the PID CV range was changed
  • the flow rate changed

operator wants nothing to do with the system so i doubt he messed with anything. a long time with the system being off and the PID running calculations with no response from the PV may cause it to generate an large margin of error.

which is why im leaning to forcing a desired setpoint for 2-3mins as a way to get things close and let it move on from there.

something like this
1743796119923.png
 
i am talking when the system is off. the incoming PV goes to zero and then the PID is making adjustments to correct but there is nothing to correct.



flow rate will drop to 5-7gpm for a duration as the water gets used for backwashing.

unsure on the actual cycle times, im just going off the design conditions and limited time onsite. its been months since ive been onsite and will only have a short amount of time onsite next week to correct the problem. govt funded project with too many people involved and poor engineering on multiple fronts (including ours). burned up all our commissioning hours on showing up to site to find the same issues that had never been addressed from previous visits.

dose to response time on the loop is probably 15-20secs



i will have to explore that idea.

its a diaphragm pump without a draw down tube. they have diluted the cl2 to 5:1 because this problem was even worse before, the operator even considered going to 10:1 but didnt have an easy way to do that.

That's why you use SWM when the control system can't respond. PID block should always execute, usually in a periodic task.
 
That's why you use SWM when the control system can't respond. PID block should always execute, usually in a periodic task.

so is the PID_HANDOFF ONS i have posted above the best way to resolve that on startup or should create a condition where SWM is activated when the system is not running and force a .SO until the system comes back on?
 
so is the PID_HANDOFF ONS i have posted above the best way to resolve that on startup or should create a condition where SWM is activated when the system is not running and force a .SO until the system comes back on?
No, that will not work, the timer will never be timing, and the values of .TT and of .SWM will never be 1, for more than one scan cycle.

I think you meant to do summat like this (at least for the logic; I wonder if P_110_FIXED_SP is the right value to move to P_110_PID.SO):

1743809350798.png

or even better this:

1743809326538.png
 

Similar Topics

Hi all, I just acquired a Micrologix 1100 and I am interested in getting components to build a PID loop. The purpose is just to help deepen my...
6
Replies
3,026
Views
I have a environmental storage cabinet that my employer bought off the used market. It is controlled for temperature and relative humidity. Two...
16
Replies
6,202
Views
Hello. Atm, I'm working with a PLC-program for a flowcontrolling loop: Pump run by VFD and a flowtransmitter (analog in/outputs). The project is...
0
Replies
2,383
Views
TM221CE24R, Machine Expert Basic, PID Assistant (native block, not scripted). Controlling a steam valve via PWM (%Q0.1) for a slow batch heating...
12
Replies
363
Views
Hello, for the first time in my career, I have a project involving PID control on Mitsubishi FX5U controllers. I’ve spent years working with...
17
Replies
825
Views
Top