From f8cb1e30eb3546b00fa58e20779bd4295df84c70 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Sat, 17 Oct 2020 20:48:25 -0400 Subject: [PATCH] heaters: Don't raise an error if PID Ki is set to zero Signed-off-by: Kevin O'Connor --- klippy/extras/heaters.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/klippy/extras/heaters.py b/klippy/extras/heaters.py index 9e2e148a..b86b0ecf 100644 --- a/klippy/extras/heaters.py +++ b/klippy/extras/heaters.py @@ -182,7 +182,9 @@ class ControlPID: self.min_deriv_time = heater.get_smooth_time() imax = config.getfloat('pid_integral_max', self.heater_max_power, minval=0.) - self.temp_integ_max = imax / self.Ki + self.temp_integ_max = 0. + if self.Ki: + self.temp_integ_max = imax / self.Ki self.prev_temp = AMBIENT_TEMP self.prev_temp_time = 0. self.prev_temp_deriv = 0.