pO2 and PID


Recommended Posts

Currently I control a bacterial culture process with DF a LabJack and a Me-UBre relay box. One phase of this process is called the "anaerobic phase". 
The pO2 (dissolved oxygen) should be kept at 0 for 2.5 hours. To maintain this value at 0 I open a 12V solenoid valve with a relay at t0 with a fixed 
nitrogen flow and I close this valve after 2.5 hours. The gas flow cannot be regulated automatically and the valve is either fully open or fully closed. 
In order to save nitrogen, I would like the valve to close when the pO2 is at 0 and that it opens if the pO2 goes back to 0.3 and then closes again when 
the measurement is at 0. I would like to use a PID for that. I know that PID is more for fine regulation, but is it possible to use it in this case? 
If it is possible I cannot find the settings which allow me this regulation. I have configured a PID, it works very well to lower the pO2 to 0. 
Once at 0 the valve closes well, but if the pO2 goes up the nitrogen valve does not open.
The pO2 should not exceed 0.3.
Can you help me?

Link to comment
Share on other sites

What you are talking about is not really PID.  PID really only works with analog outputs, or with pulse width modulated digitals (which are effectively an analog out).  You could maybe make it work with PWM, but it would be severe overkill and you'd waste a lot of time trying to tune it.  In your case, you just need a thermostatic type control.  To do so, go to the event on your pO2 input channel.  Then add some code, something like this (assuming "relay" is the name of your relay channel):

if (relay[0] && (pO2[0] == 0)) 
   relay = 0
if (!relay[0] && (pO2[0] > 0.3))
   relay = 1

Of course you can set the 0.3 to something smaller to ensure you don't exceed 0.3.

I should mention here that I rarely ever use PID for anything slow moving.  It is much simpler to use thermostatic type control, possibly with a little proportional output (so a P loop instead of a PI or PID).  


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.