I am working on an air-delivery system which provides a specific amount of air flow to a small box. The air flow into the box is determined by measuring the pressure at the air orifice in the box. All that part works fine and was figured out by the mechanical engineers. The problem is the control electronics, and specifically, the firmware.
A large DC fan is used to generate the air flow. The fan is DC direct drive and does not have PWM input. I am controlling the fan speed and thus the airflow using a custom 12-bit resolution pwm generator. The relationship between fan speed and pwm is, of course, very non linear, being very sensitive to changes in pwm at low speeds, and very insensitive at high speeds. The pressures involved can be very small and the resolution of the system needs to be very high, which is why the 12 bits of pwm resolution is needed. Changes in the duty cycle of
0.02% (1/4096) can make a big difference at low fan speeds.The problem is the control algorithm, i.e. the servo feedback algorithm used to control fan speed in response to pressure. Basically a PIC measures the pressure of the system and changes the fan PWM up or down, and thus the fan speed, and thus the generated pressure, to meet the desired system pressure.
The current control algorithm is very slow (15 minute settling times), has a tendency to oscillate a bit at the sensitive low fan speed areas, and is, in general, yucky. Its basically a bunch of 'thresholds' and various 'pwm change rates' depending on how far away the current pressure is from the desired pressure. BARF.
There must be a better way. This is just your standard non linear control algorithm right (does that exist?).
Anyone know of the right way to do this?
Some notes:
If the fans were running at 100% duty cycle and you removed power from them, they would take a good 40 seconds to completely spin down to zero generated pressure.
I can go from 0% to 100% (and vice versa) duty cycle in about half a second, no faster.
The pressure sensor has a fast response rate of about 1khz.