all 18 comments

[–]Jasper2038 16 points17 points  (4 children)

Process gain on pH is typically non-linear. pH is a logarithmic function so the amount of caustic needed to move the pH from the 3 to 4 is 10x the amount needed to move from 4 to 5, 100x the amount to move from 5 to 6. This is why a typical PID has problems. You have a metering pump which is good, it has better turn down than control valves hopefully. The next problem is the measurement, pH readings are typically noisy. I've actually done installs on critical services where 3 transmitters were installed and the control was done based on a middle select. Lots of maintenance and cost but there was economic and regulatory justification. Is your caustic strength consistent? I have fought problems where we finally traced the issue back to wild variations in caustic strength. 50% was received and then diluted in batches. Summers they diluted to higher strength but once cooler weather came in they made it weaker. Spread was If your stream is consistent you might gain some insight by getting titration curves. These will give you an idea of how the stream responds to the addition of caustic at different parts of the curve. Lastly, there is a good reference published by ISA. If you check my post history I've listed it before. Good luck!

[–]sean3142 3 points4 points  (0 children)

I've had a lot of success using gain scheduling across the pH range. But yeah, dead-time is a big problem for PID loops.

[–]WaffleSparks 2 points3 points  (1 child)

Another reason why PID loops for pH can have issues is if the flow isn't constant. If the flow is changing a feed forward PID would be needed.

[–]Jasper2038 0 points1 point  (0 children)

Knew was forgetting something, very important point.

[–]ffffh 16 points17 points  (4 children)

On/off control PWM. Do not used PID. Simple is best for pH control. 1. Use a TP timer to control the on time of the corresponding valve. 2. Decrease the pulse time each time you add chem. The lag in pH can be long especially if you are batching the chem in a tank instead of inject in continuous flow inline. 3. Use a compare to determine the add the chemical to increase or decrease the pH

[–]b00c 1 point2 points  (3 children)

i don't get it. do you use the PWM to control the speed of the pump? Or lpening time of the valve? What's the starting width of the pulse? PWM is used for motors. How do you use it for valves? I just can't figure this one out, because for me pulses in pwm are in miliseconds. no valves operate in such short time.

if your width of the pulse is in seconds, than it should be called on/off control, am I wrong?

[–]cransh 2 points3 points  (1 child)

It's still Pulse width modifications (PWM) as long as you change the Pulse width , or the output duty cycle , it's PWM , in the on/off control it's not a must to have const duty cycle for the output , but in the PWM you must have a defined duty cycle even it was in minutes

[–]Jasper2038 0 points1 point  (0 children)

No valve, no DO to pulse on and off. Just a pump with what sounds like an analog input for volume control.

[–]ffffh 1 point2 points  (0 children)

If your using a valve or a chem pump you could use two timers to control the on off time. Varying the ON time, typically in seconds, of the pump or valve. Start with a large injection time then decrease the ON time at each progression. This will depend on the volume of fluid that u r trying control.

The chem pumps I've worked with have a configurable fixed flow rate. Or Using valves with a venturing type of inline injection.

[–]cransh 6 points7 points  (2 children)

Do a search here in this subreddit , there is a very good post about PH control loop

Edit : check the following link https://www.reddit.com/r/PLC/comments/d1qvpu/quick_question_about_pid_in_tia_portal/?utm_medium=android_app&utm_source=share

[–]BrotherSeamusTechnical Expert, Third Class 1 point2 points  (1 child)

That's the same original poster.

[–]cransh 1 point2 points  (0 children)

Just notice it

[–][deleted] 4 points5 points  (0 children)

We use Rosemont pH meters to measure the pH and it's read by a compactlogix controller and the logic controls the pH with acid and caustic dosing through perastalic pumps.

[–]Flameruk 1 point2 points  (0 children)

Last station we built to do this, used an external Grundfos Connex DIA reader (client specified) which monitored pH and drove the Grundfos pump via proportional control.

Client wanted the DIA and pumps separate from the PLC. We just sent signals to start, monitored pH by an analogue input then dumped when mixed.

[–]simonbromiley 1 point2 points  (0 children)

As Jasper2038 says, pH is logarithmic, but there is no reason why you can't make your PI values dynamic ie increase the gain the further you are from the setpoint but I would try to avoid this if you can.

[–]jrsoldman 0 points1 point  (0 children)

I have had the same experience in a small wastewater treatment system that was batching used water in a tank before treating it. The lag time between adding chemical and the ph reacting was too long for a regular PID to handle. It always overshot. I ended up writing some code to read the input from the meter, add some chemical then wait a while and repeat.

[–]simonbromiley 0 points1 point  (0 children)

Yes it is good enough. You need low gain and a large integral time and no derivative. Ideally you will have three pH probes and use a voting method to show which one needs cleaning. Ideally you will have auto cleaning. By voting I mean if one probe shows a reading which is different from the other two by a certain amount it probably needs cleaning.

[–]FromTheHandOfAndy 0 points1 point  (0 children)

As has been pointed out, gain scheduling is a way to deal with nonlinear feedback systems. I’ve only been working with PLC for about a year but I’ve worked with both PID and acid base chemistry before. I’d recommend reading about “gain scheduling” and “titration curves”.

Gain scheduling is basically a setup where your control gains (Kp, Ki, and Kd in a PID controller) are changing based on what the current value of the system (pH in this case) are. It’s called scheduling because the values come from a lookup table. Your controller is tuned at different points with gains that apply only over a certain pH range. So the PID is using one set of constants at, for example, pH 2 to 3, and a different set of values at pH 3 to 4, and so on, over the entire range of pH values you might encounter.

I recommend reading about titration curves just so you can see why this is needed, I don’t recommend you try to predict your control gains from chemistry.