I am driving a fan using a micro-controller. I want to test the micro-controller code without having fans physically attached to it so I thought I would model one programmatically.
I want to model a fan where when power is applied to it it is ramping up to a certain RPM over time.
My micro-controller is adjusting the power to the fan (between 0 and 100% power let's say) and checks its rpm and makes adjustments. I must simulate the RPM over time given the % of power applied. I can have simple requirements like:
- 0 to 2000 rpm
- linear speed (50% power means eventually 1000 rpm)
- when applying 100% power from 0% it takes 3 seconds for the fan to reach 2000 rpm
It's just that when you apply 50% power when already at 25% power, the speed does not ramp up instantly, that's what I have trouble calculating over time: the ramp up or ramp down from and to any given power.
The problem here is like a car with a gas pedal that you play with, the car accelerates and decelerates slowly. If you hold the pedal steady, the car keeps a constant speed. I am not sure I need to model the fact that it decelerates faster than it accelerates.
Any pointers appreciated.