mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
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.
This commit is contained in:
parent
b79ed50615
commit
c677cb75df
@ -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();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user