Controllerfan PWM scaling, kickstart (#24873)

This commit is contained in:
InsanityAutomation
2022-10-21 14:03:38 -04:00
committed by Scott Lahteine
parent bdd5da5098
commit c8b2d0c0fd
7 changed files with 53 additions and 23 deletions

View File

@ -72,6 +72,22 @@ void ControllerFan::update() {
? settings.active_speed : settings.idle_speed
);
speed = CALC_FAN_SPEED(speed);
#if FAN_KICKSTART_TIME
static millis_t fan_kick_end = 0;
if (speed > FAN_OFF_PWM) {
if (!fan_kick_end) {
fan_kick_end = ms + FAN_KICKSTART_TIME; // May be longer based on slow update interval for controller fn check. Sets minimum
speed = FAN_KICKSTART_POWER;
}
else if (PENDING(ms, fan_kick_end))
speed = FAN_KICKSTART_POWER;
}
else
fan_kick_end = 0;
#endif
#if ENABLED(FAN_SOFT_PWM)
thermalManager.soft_pwm_controller_speed = speed;
#else