From c677cb75df8e9ea923c48ae999efacc09c247906 Mon Sep 17 00:00:00 2001 From: Jacob Dahl <37091262+dakejahl@users.noreply.github.com> Date: Wed, 4 Mar 2026 19:12:13 -0900 Subject: [PATCH] fix(heater): don't turn heater on when controller time is zero (#26659) When the PI controller computed zero on-time (e.g. temperature already above target), the heater was still momentarily turned on every cycle before being immediately turned off. Skip the on/off toggle entirely when the computed on-time is zero. --- src/drivers/heater/heater.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/drivers/heater/heater.cpp b/src/drivers/heater/heater.cpp index 53360172ee..9eb699e4fb 100644 --- a/src/drivers/heater/heater.cpp +++ b/src/drivers/heater/heater.cpp @@ -417,9 +417,14 @@ void Heater::Run() _temperature_target_met = false; } - _heater_on = true; - heater_on(); - ScheduleDelayed(_controller_time_on_usec); + if (_controller_time_on_usec > 0) { + _heater_on = true; + heater_on(); + ScheduleDelayed(_controller_time_on_usec); + + } else { + ScheduleDelayed(CONTROLLER_PERIOD_DEFAULT); + } } publish_status();