[Logix5000] Compound PID Loop for chlorination

defcon.klaxon

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

I'm wrapping up the code for the water treatment plant I've been working on and I have one last loop to do; the chlorination loop. The functional descriptions call for a compound loop to control the dosing; the two process variables are flow rate prior to chlorination, and cl2 residual after chlorination.

I've done some searching on Google but seem to not be coming up with much as far as how compound loops work and how to set them up; maybe I'm using the wrong term? Maybe I should be using the term "cascade" instead of "compound"?

Any suggestions for where to learn more would be very appreciated, and in the meantime I will keep searching for info.
 
I'm not entirely sure how the plant is set up, but Liptak shows an elaborate scheme for adjusting injection rates of pH, residual chlorine, corrosion inhibitor, and ammonia.

Compound refers to controlling the speed and the stroke of a metering pump. Flow controls the stroke (through a calculation or lookup table), and Cl2 is a PID loop for pump speed.

(Another way might be to use ratio control on speed for a fixed stroke.)

That should be a step in the right direction.
 
Last edited:
Hey... I am working with water plants in Denmark, and we always controls chlorination after the flow (proportionally), and Manuel adjust the factor (0.00 to 5.00) over the year... Chlorine and the water changes over the year.. and Chlorine sensor are a tool, but need good to control after.
 
Unless you are adjusting the flow rate prior to chlorination to control residual I don't think cascade is the answer.

What is the end game control based off of flow rate and if residual gets too high or low have it take priority. If so there is a control scheme for this type of application but I can't remember the name off the top of my head
 
with the Cl sensor you change the ratio of the pump, and with the flow you regulate the speed of the pump according to raatio.
 
Thanks for the replies, all.

I have some more information about the system that will hopefully shed some light on the best way to go about this:

1. The chlorine is a vacuum based, v-notch system that doses CL2 gas into a small stream of water; it is not a chemical pump with frequency and stroke adjustments. So, the control scheme is a single 4-20mA loop that results in a CL2 dosing measured in "pounds per day".

2. The system is a gravity filter that dumps water into a cistern; there are two filters, and the flow rate is adjustable and the system can run a single filter or both simultaneously. During self-cleaning periods, no water will be produced. The water that is treated and dumped into the cistern is then pumped through carbon filters, and then after the carbon filters it enters the chlorine contact tank.

3. The pumps that move the water from the cistern through the carbon filters run off a PID loop that monitors the cistern water level. So, that control will change based on how many filters are treating water, if they're going through a self-clean cycle, etc. The CL2 dosing is based off the flow from the cistern pumps, not the filters.

4. The way the control is described, is that I need to dose chlorine based on the flow from the cistern pumps before the CL2 contact tank, and then take a look at the CL2 residual at the distribution side after the contact tank; the flow paced dosing could be thought of as a "rough" adjustment, and the distribution residual a "fine" adjustment.
 
Here is an update in case anyone stumbles across this thread:

The proper term is "cascaded loop"; "compound loop" seems to be common in the water/wastewater world but if you're looking for specific info on the PID instruction, use the term "cascaded".

It would seem that a cascade loop isn't the right approach here, since I have two process variables but only one output (but I could totally be wrong here). It would seem like the "feed forward" and "bias" adjustments with a single PID loop would be the best way to go about things for my purposes.

It would seem that the .bias is simply a value added, useful for "transport delay" which is exactly what I'm dealing with. And according to Rockwell's reference, bias is added to the CV...so if my CV is the first cl2 meter, the .bias would be added to that to make up the difference; so basically I'd just subtract the second cl2 meter from the first, and use that difference to lower the .CV, which would increase the output of the PID loop...I think I'm starting to get a good grasp on how to do this, but if someone with more experience could confirm this is right I'd be quite grateful.
 
Last edited:
Hi defcon.klaxon

I'm a water guy too. Here's how I do it.

Consider that, generally speaking, if your effluent flow doubles then your chlorine dosing rate should double also, right?
So, have your PID look at chlorine residual (Cl-) only. And separately setup a straight flow paced proportional calculation. Then combine them.
It would go something like this:
Let,
FlowPacedOutput = EffluentFlow / MaxEffluentFlow
so that FlowPacedOuput equals 1 at maximum flow and 0 and minimum flow

Then multiply your Cl- PID output by FlowPacedOutput to set a dosing pump speed.

This way your Cl- reading should better reflect the Cl- demand of the water and not vary as much do due changes in effluent flowrate.
You can then tune the PID to react much slower (for a more damped response) and the loop should still track the setpoint well as effluent flow varies.

The bonus is that you have only one PID to deal with, rather than two cascaded PIDs which would work in theory but is a pain in the a$$.

You could also set upper and lower limits on your pump speed, for example to ensure a minimum dosing rate (as long as EffluentFlow > 0), if your PID goes awry (eg. sensor loses flow, goes bad, poor PID tuning, …)


Good luck. :)
 
Hi defcon.klaxon

I'm a water guy too. Here's how I do it.

Consider that, generally speaking, if your effluent flow doubles then your chlorine dosing rate should double also, right?
So, have your PID look at chlorine residual (Cl-) only. And separately setup a straight flow paced proportional calculation. Then combine them.
It would go something like this:
Let,
FlowPacedOutput = EffluentFlow / MaxEffluentFlow
so that FlowPacedOuput equals 1 at maximum flow and 0 and minimum flow

Then multiply your Cl- PID output by FlowPacedOutput to set a dosing pump speed.

This way your Cl- reading should better reflect the Cl- demand of the water and not vary as much do due changes in effluent flowrate.
You can then tune the PID to react much slower (for a more damped response) and the loop should still track the setpoint well as effluent flow varies.

The bonus is that you have only one PID to deal with, rather than two cascaded PIDs which would work in theory but is a pain in the a$$.

You could also set upper and lower limits on your pump speed, for example to ensure a minimum dosing rate (as long as EffluentFlow > 0), if your PID goes awry (eg. sensor loses flow, goes bad, poor PID tuning, …)


Good luck. :)

Thanks man! This is way helpful info.
 

Similar Topics

Hi! So my problem is a little funky, I had Studio 5000 v 24 and 30 installed, but forgot to install RSLogix (which I cannot go without). Is there...
Replies
2
Views
116
So I had an odd request from a customer for the above. I have written the logic and tested it all in one PLC with only using 7 outputs and 7...
Replies
15
Views
427
I'm a Siemens person, and this is one of my first AB programs. The customer wants everything programmed in Ladder. I have a lot of data (3...
Replies
14
Views
217
Good day everyone. if you have a logic for 3 pumps (lead/lag/off), would you please email it to me? I really appreciate it!
Replies
7
Views
218
Maybe this is just not possible, or maybe I am doing something wrong. Background; I have a data array of over 1500 products. For sorting I...
Replies
6
Views
759
Back
Top Bottom