PID dead time issues
What you need to do is change your sample time to 250 seconds.
Before you say WHAT THE HELL!! let me explain . . . .
Basically when a controller algorithm makes a change to the manipulated variable to control a given process, there is no point in the controller re-evaluating that process and making anymore changes untill the result in the process from the last manipulation can be evaluated. The inherent properties of what you are doing need to be understood and accepted.
After the dead time (sample time ... and you can allow more than 250 seconds to make sure), the controller can then take another sample of the process and see what effects the last change made and make it's new output accordingly, and this is exactly what will happen with a 250 second sample time.
I have had similar experience with chlorine dosing systems, in which I had to wait 15 minutes for sample water to return before I make anymore adjustments. Of course with shorter sampling times the controller will still manipulate the process however the logic in this approach is a little silly (or just plain wrong!) because the controller tries to correct for something that might not be the case! Meaning the correction it made previously might be suffice, it just doesn't know it yet. What this results in what is called "hunting" whereby the system constantly overshoots and undershoots and it must be avoided at all costs.
On one particular system I worked on we had to dose into a 200kL tank. After collating data over a period it become apparent it took 12 hours (half a day!) for a new dose speed to mix thouroughly in the tank and level out at a steady result to be seen at the controller. For this purpose as that sort of sample time cant be done I needed to write my own PID algorithm (it's actually easier than you think, and you can then customise any which way you want!
) One other option would be to trick the controller by letting the PID make a change, then normalise the output (between 0.0-1.0) and write this to the manual PID setpoint and slip it onto manual, then later down the track slip the PID call back into auto and manipulate your loop table to suit. . . however if your going to this you might as well write your own custom PID algorith!
With regards to the non-linear response of the PH control, what I would do is manipulate your gain setting (it's called adaptive gain) by writing to your PID loop table in the user program dependant on the current PH value. The best way to do this would be to plot the curve of PH response in a microsoft excel spreadsheet, from here you could inset an 'x' 'y' scatter plot and the insert a polynomial trendline and have excel display the equation (3rd order polynomial should be suffice). With this equation in hand you should then find your best gain setting at a stable part of the plot, then multiply this by your polynomial depending on you PV (Ph value) and write this dynamically to the loop table within your plc code (user program).
The loop table memory location for gain is offset 12 bytes from where you define the start of the loop table from the PID wizard. Remember the Gain value is the only value you will need to adjust, as the integral and derivitive aspects of a PID algorithm are both affected by your gain setting.
note** this is not true the other way).
PID output =
P(error*gain) +
I(error*gain . put onto system bias over the integral time) +
D(differnce from previous sample to current sample mltiplied by projecting a resulted error over the derivitive time multiplied by gain)+
current syatem bias value.
Note Gain is common to them all!!
I recently wrote a PID routine of a hydro-pneumatic booster whereby I calculated the polynomial equation of a pump curve for given flow response at varying pressure, therefore I was able to "forward feed" specific information to the PID "feeback" trim routine.
I hope some of this banter helps, there are countless ways to manipulate things to your advantage, the key is always intimately understanding the process you are trying to control and acepting all of it's inherant properties that you cannot change, before setting about brainstorming the best methods to enable you to best control those that things you can change. You also need to know what is an acceptable outcome and what isn't.
If you need any clarification on anything let me know.
I have attached a couple examples of how to work out polynomials in microsoft excel and how they are programmed in the s7-200 with the hydro-pneumatic done.
I can give examples of custom "dead time" algorithms if required as well as PID routines with long sample times. Just let me know.
Cheers
View attachment 17187
View attachment 17188