I'm trying to upgrade a multiple gas flow controller, which must be capable of controlling the mass flowrates of three gases independently through one outlet line to our system, and am in need of a bit of advice on programming it. I'm using an arduino and a few DACs to tell the proportioning solenoid valves how open they should be. The current setup schematic is below, though I have more pressure sensors and mass flow sensors at my disposal if necessary.
My colleagues' advice is to use PID loops for each of the gases. This would be easy, particularly as there's an arduino code already available - however I'm not convinced that's either necessary or the best option, because:
- There is hardly any inertia in the system, unlike the thermal inertia in an oven for example. If it were just one gas, with one inlet pressure and one outlet, just the P part of a PID would be enough I think.
The flow rate of each gas is dependent on the pressure differential before and after the valve, which is then dependent on the mass flow of the other gases and the outlet pressure, hence a PID could reach the optimal flow for one gas but in doing so change the flow rates of the other gases - leaving oscillation in the system. (the pressure in the system at the outlet may be changing slightly also)
I don't know if its possible, or if so then how, to write a PID loop for simultaneous multiple input/outputs.
Hence I would appreciate any ideas, or solutions that exist which I was unaware of, for how my program should go to control the proportioning solenoid valves?
P.S. I'm not asking anyone to actually write a code for me, but just a basic idea of how I should do it would be great please?
P.P.S. (There is a formula for gas flow rate here, so I suppose you could try to work out theoretically what the optimal signal to the valves would be based on some kind of simultaneous solution of this formula for the three gases, taking into account friction factors for all the little fittings and parts in the system and expansion factors for the particular gas mixtures concerned (I don't think any of the gas cylinders are absolutely pure mixtures) etc. but I would think it's possible not to go that complex here!)