I've built a project which generates very small amounts of pressure (Pascals) using a fan.
I tested the idea on a bench power supply and proved that changing the voltage from 0-12V increases the pressure.
I then used an Arduino Uno with PWM output fed to a transistor which operates the fan from 0-12V.
Unfortunately the fan operates differently when fed with a PWM output than it does being driven directly off the analog voltage of the bench power supply and results in an output which is less stable than I require.
I was thinking of using a DAC chip fed to a transistor to drive the fan but as my interfacing skills aren't too hot so I'm restricted to using a DAC which has an Arduino library and tutorial.
This limits me to the adafruit breakout board: MCP4725 Link
I don't like this as i'm in the UK so would rather use Farnell or RS as a supplier to avoid the shipping cost, and as I'm building a PCB anyway I'd rather have a DIL chip that i can use on my board.
Is there a way I could use a generic DAC without writing my own library for it?
Interesting, I hadn't considered directly controlling with PWM. I'm working to pretty tight tolerances +/- 1 pascal so don't know if the control would be accurate enough and I know the analog control of my first fan is but I will experiment. Thanks.
You are right, inductive loads (motors...) react differently on PWM and a variable DC voltage. The reason is their impedance, that lets current flow through the clamping diode even if the transistor is off.
But you don't need a DAC, PWM will also work fine if conditioned properly. In either case you need a powerful transistor, that converts excess supply voltage into heat - don't forget a heat sink! Then add a low-pass RC filter between the PWM output and amplifier input, that converts the PWM pulses into a DC voltage.
Even better were a programmable switching voltage or current source, with better efficiency over aforementioned solutions.
But if you need a constant pressure, you need a PID controller (library) that does not control voltage or current, but instead controls the effective pressure, measured by a pressure sensor. Then the PWM approach can be used again, with high efficiency (little heat).
Thanks for the advice. It certainly helps me understand why the difference exists. I didn't mention it as I wanted to keep my explanation concise but I tried a PID loop and spent ages trying to tune it to maintain a stable pressure at one point but it was MORE unstable than just outputting a constant PWM signal. I could try the larger transistor as you suggested and then try PID again, it seems like a good idea but at this point my heart is set on a DAC as i know for certain that it will work.
megamef:
Thanks for the advice. It certainly helps me understand why the difference exists. I didn't mention it as I wanted to keep my explanation concise but I tried a PID loop and spent ages trying to tune it to maintain a stable pressure at one point but it was MORE unstable than just outputting a constant PWM signal. I could try the larger transistor as you suggested and then try PID again, it seems like a good idea but at this point my heart is set on a DAC as i know for certain that it will work.
Sounds like you're just bad at tuning.
I don't mean that to demean you. Control theory is hard. The most probably cause of your instability is probably that your control loop was too strong. The fan blades take time to speed up and slow down, and the pressure sensor will take some time to fully register the pressure change. If your control loop is making adjustments too quickly, that leads to overcompensation which will cause the output to constant swing up and down around the set point. Slowing down and weakening the control loop can make things more stable.
Yep, you're probably right about the over responsive control loop. I also wasn't filtering the input which I'm now doing so that's another thing to try, thanks for everyone's help so far