Hi,
I'm doing a project which needs a simple PID control. The main purpose of this project is to maintain sample's pH at a certain preset pH by injecting base or acid. We choose a preset pH at the beginning, and a pH meter keeps reading pH from the sample. LabVIEW program starts comparing two values and then injecting base or acid. For example, if the preset pH is 5.0 and the sample's current pH is 4.0, base starts being injected to the sample until the current pH equals to the preset pH.
The thing is, I want to add a simple PID control into this program without using NI's extra PID toolkit: if the difference between preset and current pH is quite large, the program can automatically speed up injections. Furthermore, injections slow down when current pH comes close preset pH. I think this kind of PID control is pretty easy and common.
I have been doing some research on general PID control system but not that clearly so far. It seems that I need a proportional part and a derivative part at most if this program doesn't require too much complexity. However, the question is, what is my first step doing this? Do I need to find out a transfer function of base/acid controller and how to find it out? I'm kind of confused when it comes from theory to real application.
Actually, I've come out another not-that-sharp approach without following the fixed PID algorithm. Firstly, I select a basic injection rate of 1X (1 time). If the pH difference is not quite large (ex: below 0.2), we keeps the injection rate at 1X. Otherwise, the injection rate starts at 5X until the difference comes to 0.2. When the difference is becoming quite small (ex: 0.05), the rate is down to 0.5X to make overshoot as small as possible. Well, this way is kind of dull.
Can anyone give me any instruction and hint? Thanks!! 😄
Scottie