Hi - this might be a dumb question, but here goes…
I want to use the PID-controller node (https://xod.io/libs/xod/core/pid-controller/) for temperature control in a biological micro reactor (https://www.hackster.io/jim-haseloff/airflow-microreactor-projects-327330)…and I’m not convinced that I know how to use it properly.
I have 3D printed vessels that are heated by a fan-driven PTC heater (12V, 100W), switched on-off under arduino control, using a MOSFET. I’m using DS18b20 temperature sensors for feedback. All is good electrically/thermally - but I am keen to optimise speed and accuracy of the temperature control. So far, I have been mainly using a simple “bang-bang” software controller, using the target temperature(s) as threshold. I have also hooked up the output of the PID-controller to the MOSFET switch for the heater, and attempted to tune the controller - but I have a few questions, that I’m hoping that a proper engineer can help with!
I’m not sure of the proper use of the values from PID-controller output pin - when the heater device has just on-off states. As I understand it, the controller output will produce a numerical output that decreases to zero as the target is approached. Is there any more information about the range of values or code examples? I have used a standard digital output port, and also piped the PID-controller output through a pwm-node. Am I throwing away useful information by doing this? i.e. effectively clipping the values and reverting to something closer to a simple on-off switch around the set threshold?
I also have some doubts about using an Arduino PWM pin to drive the PTC heater? The normal ~500Hz switching frequency doesn’t seem sensible for a relatively slow responding air heated system (~1 Hz seems more likely, to avoid electrical issues, heating MOSFETs, etc.). I’ve seen (non-XOD) instances online where software is used to convert a PID output to generate a more slowly switching output - say, over 5 secs, instead of 2 ms.
Does anyone have any examples or advice to share? Any help would be much appreciated!
(I’ve attached a view of one of the patches used - the Arduino is hooked up to a 4D Systems touchscreen that is used for input and display)
bw, Jim.