I’ve put together a set of commits that allow for heaters to have their PWM changes apply as soon as possible instead of using the MCU clock scheduling process. This allows for changes to be applied up to ~300ms earlier than they currently are, which removes a significant amount of error in the heating feedback loop, especially on heaters with low thermal mass and high wattage. It Works on My Machine - would love to have a few folks who aren’t afraid to flash their firmware with heater code that works on one printer before putting up a PR.
The impact of this change in isolation is noticeable but not particularly impressive. I believe it opens the door for industry-standard PID auto-tuning to be put in place and allow for a much more aggressive control setup. I did not implement such a tuner 'cause I don’t want to step on the toes of the excellent work done by Daniel. I’m very much looking forward to seeing the combination of the two - I’ll probably take that for a spin tomorrow.
To motivate it a bit, here’s a couple temperature graphs showing the response a Revo sitting in a Stealthburner had to the part cooling fan being changed from 0%->100%->0% when settled at 250c:
Baseline is head revision as of today, Upd-Software is this change with 100ms cycle software PWM, Upd-Hardware is 1ms cycle hardware PWM. PID_CALIBRATE as currently exists was run on each configuration targeting 250c. Line represents the average of 10 runs each.
This fork branch thingy has the codes!
Appreciate anyone who takes it for a spin, and those who don’t 'cause you’re probably cool too.