The short answer
The Chlorine Residual Loop Is Slower Than You Think
A chlorine residual loop is dominated by dead time: the chemical travels from the injection point to the sample tap, the sample travels down a sample line, and the analyzer takes its own time to report. That total delay is often several minutes, and a controller tuned as if the residual responded immediately will oscillate. The cure is to pace the feed to flow so the loop only has to trim, to measure the delay and tune for it with low gain and a long integral time, and to shorten the delay wherever the piping allows.
Key points
- The residual the analyzer reports is the water that was dosed several minutes ago; the controller is always acting on old news.
- Dead time adds up from transport in the main, transport in the sample line, and the analyzer cycle; measure each.
- Flow pacing handles most of the work as feed-forward; the residual loop should only trim.
- Tune for dead time: low gain, integral time of the order of the dead time or longer, no derivative.
- Shorter sample lines, faster sample velocity, and a sample tap at the right distance cut the delay more than any tuning.
The residual trend at a small water plant looked like a slow sine wave: up to 2.4, down to 1.1, up again, with a period of about twenty minutes, all day, every day. The operators had adjusted the controller gain up and down for a year. Up made the wave bigger. Down made it slower but never made it go away. The loop was tuned for a process that responded in seconds, and the process took six minutes to respond to anything.
Where six minutes goes
The chemical is injected at one point and measured at another, and between them is water moving at the velocity of the main. A sample tap two hundred feet downstream in a twelve inch main flowing at 1.5 feet per second is more than two minutes away. From the tap the sample runs through a quarter inch line to an analyzer in the building, and a hundred feet of quarter inch tubing at a typical sample flow holds another minute or two. Then the analyzer has its own response: a colorimetric unit reports on a cycle of a few minutes, and an amperometric probe responds within a minute or two but only after the sample reaches its cell. None of these delays is large on its own. Together they mean that when the controller moves the feed pump, nothing at all happens on the analyzer for five or six minutes, and then it all happens.
| Contribution | What sets it | Typical range | How to shorten it |
|---|---|---|---|
| Transport in the main | Distance from injection to sample tap divided by velocity | 30 seconds to several minutes | Move the tap closer, but not before the chemical is mixed |
| Sample line | Line length and volume divided by sample flow | 30 seconds to 3 minutes | Shorten the line, use smaller tubing, raise sample flow with a fast loop and bypass |
| Analyzer response | Measurement cycle or probe time constant | 1 to 3 minutes | Select the analyzer for response time; keep it clean and calibrated |
| Filter and averaging | Damping set in the analyzer or the controller input | 0 to 2 minutes | Remove damping that was added to hide a noisy sample |
Sample line delay (s) = Line volume (gal) ÷ Sample flow (gal/min) × 60
- A
- h
- u
- n
- d
- r
- e
- d
- f
- e
- e
- t
- o
- f
- q
- u
- a
- r
- t
- e
- r
- i
- n
- c
- h
- t
- u
- b
- i
- n
- g
- h
- o
- l
- d
- s
- a
- b
- o
- u
- t
- 0
- .
- 2
- g
- a
- l
- l
- o
- n
- s
- ;
- a
- t
- 0
- .
- 1
- g
- a
- l
- /
- m
- i
- n
- t
- h
- a
- t
- i
- s
- a
- b
- o
- u
- t
- t
- w
- o
- m
- i
- n
- u
- t
- e
- s
Measure it, do not guess it
The dead time is easy to measure and almost never measured. With the loop in manual, step the feed pump up by a clear amount, perhaps twenty percent, and watch the residual trend. The time from the step to the first visible movement of the residual is the dead time. The time from that first movement to about two thirds of the final change is the time constant. On the plant with the sine wave, the step test showed a dead time of just over six minutes and a time constant of under one. That ratio, dead time many times the time constant, is the signature of a loop that ordinary tuning rules will not handle.
Let flow pacing do the work
The largest disturbance in a residual loop is a change in flow. When a high service pump starts, the flow doubles and the dose per gallon halves, and a residual loop finds out six minutes later and starts chasing. Flow pacing removes that disturbance before it happens: the feed rate is set in proportion to the measured flow, so a doubling of flow doubles the feed at once. The residual controller then adjusts only the dose per gallon, slowly, to hold the setpoint against changes in demand, temperature, and water quality. In a well set up plant the flow pacing does ninety percent of the work and the residual loop makes small, slow corrections. In a plant without it, the residual loop is asked to do everything and does it six minutes late.
Tuning a dead-time loop
When the measured dead time is longer than the time constant, the controller must be patient. The gain must be low, because a large move made on six minute old information will be far too much by the time it is seen. The integral time must be long, of the order of the dead time or longer, because an integral that winds up during the dead time is what produces the sine wave. Derivative action is useless here and should be off; it reacts to the noise in the sample and not to the process. A useful starting point for a loop dominated by dead time is a gain that gives well under half the process gain and an integral time between one and two times the dead time, then refined by watching the trend after a setpoint change. The response should settle in two or three dead times without overshooting more than once.
- Gain
- Low. If a one percent output change moves the residual 0.05 mg/L, a gain that requests a few percent for a 0.1 mg/L error is plenty.
- Integral
- Long. Start near the measured dead time and lengthen it if the trend still waves.
- Derivative
- Off. It amplifies analyzer noise and does nothing for dead time.
- Output limits
- Set to the dose range that makes chemical sense, so a runaway integral cannot feed the maximum the pump can deliver.
- Sample rate
- The controller should execute no faster than useful; a loop with a six minute dead time gains nothing from executing every scan, and executing every few seconds is fine.
Shorten the delay before you tune around it
Every minute taken out of the delay makes the loop easier to tune than any tuning change could. The sample tap should be far enough from the injection point for the chemical to be mixed, which in a main with a static mixer or a few pipe bends is a short distance, and no farther. The sample line should be as short as the building allows, in small tubing, with a fast loop that keeps the line flushed and a bypass to drain so the analyzer sees fresh water even when it takes only a trickle. Analyzer damping added to calm a noisy sample should be removed and the cause of the noise fixed, usually air in the sample line or a dirty cell. On the plant with the sine wave, moving the tap and shortening the line took the dead time from six minutes to about two and a half, and the loop tuned in an afternoon.
What good looks like
A residual trend from a well designed loop is dull. Flow changes barely register on it because flow pacing caught them. Setpoint changes settle in ten or fifteen minutes with one small overshoot at most. The dose per gallon drifts slowly through the day as demand and temperature change, and that drift is the residual loop doing its one job. When the trend gets interesting, the questions are, in order: is the analyzer clean and calibrated, did the flow signal change, and has anyone changed the tuning. Dead time never got shorter on its own.
Frequently asked questions
- Why not just put the analyzer right at the injection point?
- Because the chemical is not mixed there. A sample taken before mixing reads the streaks of dosed and undosed water and is noise. The tap belongs at the first point where mixing is complete, which is often ten pipe diameters past a static mixer or a few bends, and no farther than that.
- Our loop works fine at night and hunts during the day. Why?
- Daytime flow changes are the disturbance, and the residual loop is being asked to correct them six minutes late. Add flow pacing, or check that the flow signal driving it is right, and the daytime hunting usually stops.
- Would a Smith predictor or model-based control help?
- It can, and some controllers offer dead time compensation. Most small plants get more from flow pacing, a shorter sample line, and patient tuning, all of which are simpler to maintain. Reach for dead time compensation after those are done, not instead of them.
- How much residual variation is acceptable?
- Enough to stay inside the plant's operating band and permit at all times, which for most plants means a few tenths of a milligram per litre around setpoint. A loop that swings a full milligram per litre is not controlling; it is oscillating.
Related topics
- Disinfection ControlControlling chlorine and chloramine dosing at a water plant: the CT concept and how contact time is credited, flow-paced and residual-trimmed feed, gas, hypochlorite, and on-site generation systems, the point-of-entry residual as the compliance measurement, and the interlocks that stop a feed system from over- or under-dosing.
- Chemical FeedChemical feed from the control side: the chemicals and where they go, metering pumps and dry feeders, flow pacing with residual trim, the dose arithmetic, day tanks and drawdown tests, loss-of-feed detection, interlocks, and overfeed protection.
- PID Control for Pumps and ValvesWhat each term actually does, how to tune a loop on a real pump station, and the handful of mistakes that cause most of the oscillation people blame on tuning.
- How to Create a PID Loop in a PLCSet up a PID instruction from scratch: scale the PV and CV, pick the action, set the execution rate, configure limits and anti-windup, tune conservatively, and test the manual and auto transitions before it controls anything.
- Chlorine Residual AnalyzersAmperometric and colorimetric residual analyzers: what each measures, free versus total chlorine, pH and flow dependence, sample line design, calibration against a DPD grab sample, and using the signal for feed control.
- Control StrategiesChoosing how a loop is controlled before choosing how to program it: on-off with deadband, staging, PID, ratio and feedforward, cascade, split range, and override, with the water and wastewater applications each fits and the questions that pick between them.
Direct contact
Have a controls question?
Reach Eric Sullivan directly about anything on this site, a controls or automation topic, or one of his personal projects.