diff --git a/klippy/heater.py b/klippy/heater.py index 5addfaca..359c80bd 100644 --- a/klippy/heater.py +++ b/klippy/heater.py @@ -65,14 +65,15 @@ class PrinterHeater: if (read_time < self.next_pwm_time and abs(value - self.last_pwm_value) < 15): return - elif not self.last_pwm_value: + elif not self.last_pwm_value and ( + self.target_temp <= 0. or read_time < self.next_pwm_time): return pwm_time = read_time + REPORT_TIME + SAMPLE_TIME*SAMPLE_COUNT self.next_pwm_time = pwm_time + 0.75 * MAX_HEAT_TIME self.last_pwm_value = value - logging.debug("%s: pwm=%d@%.3f (from %.3f@%.3f)" % ( + logging.debug("%s: pwm=%d@%.3f (from %.3f@%.3f [%.3f])" % ( self.config.section, value, pwm_time, - self.last_temp, self.last_temp_time)) + self.last_temp, self.last_temp_time, self.target_temp)) self.mcu_pwm.set_pwm(pwm_time, value) # Temperature calculation def calc_temp(self, adc):