Hi,
I'm doing a project regarding pH stating device. The control program based on LabVIEW 6.1 is roughly done. I also use a simple PID subVI from LabVIEW 6.1 examples to adjust the pH compensation. However, there are a couple issues I still can't figure out.
1. The simple PID subVI needs to know two major values: setpoint and process variable; then it will produce a PID output according to its PID definition:
Output=P*Err + I*Err_Sum + D*dErr/dt.
Now suppose I'm going to compensate a sample's pH from 6.5 back to 7.0. I guess we need a ratio,
Ratio = Current PID Output (numerator)/ Initial PID Output (denominator),
to decide how large acid/base injection rate is needed.
My problem is, what is the "Initial PID Output"? I have been trying many ways to do this. For example, at the first guess, I thought this initial value is the output when we start running the PID controller (setpoint=7/ process variable=6.5), with basic PID parameters which could be p=1, i=0.001, d= 0 or something. Because we only got an output value at the start, this intial value is always "FIXED" during the whole running process. Then let's talk about the ratio's numerator. This numerator is an output value we obtain every dT. Furthermore, we can either use same PID parameters or different PID parameters. Using different PID parameters is to speed up or slow down the process ("p" is the main factor). I'm not quite sure here what this initial output should be used. Do I also need to change i and d when p parameter is changed? Guys, am I correct with this PID ratio idea?
2. pH values I get from a pH meter is in numeral form, i.e. 6.5 and 7.0. In fact, pH is a logarithmic value, i.e 10^-6.5 and 10^-7. Assume I switch to use "logarithmic form" to be our setpoint/process variable and now the process variable comes to "7.1" due to overshoot. According to the above calculation, I will get a very tiny current PID ratio basically because "10^-7.0 - 10^-7.1O"(current error) is quite small compared to "10^-7 - 10^-6.5" (initial error), where a reverse injection is almost nothing effective. The only choice for me is to use numeral form instead of logarithmic form. But the thing is, I can't get optimal p, i, and d parameters because this system is not linear. So, how should I deal with this issue?
Thanks for your help in advance.
Scottie