After some thought, the original code isn't going to do what is needed.
The following image is a re-design of the firmware having re-assessed
the requirements.
We should delay our shutdown in case the charger decides to ramp down
itself. Otherwise we can get the situation where a smart charger starts
high, tripping the high threshold immediately, leading to the controller
and charger oscillating between on and off.
This will get copied over to setpoints.h, where the developer can
customise them. If they do so, and I have to change things, the
Makefile will warn them of this.
It appears the minimum PWM is more strongly dependent on battery voltage
than I had planned, it needs to be just a little higher to ensure the
fan keeps turning at low RPM.
- Adjust the calculations so that we base our initial PWM at 0 then
clamp to minimum PWM
- Implement a fan kick-start mode
- Start with fan off so kick-start mode works