diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2018-06-27 14:39:20 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2018-06-27 14:39:20 -0400 |
commit | 4889e8241d441141ae6826550607d08ef3011f60 (patch) | |
tree | bc68562f6b5b9dcb8e92772bd5c211f306b04e34 /klippy/extras | |
parent | 7e497af184a24d42bfdb62337e01d188cf630a8b (diff) | |
download | kutter-4889e8241d441141ae6826550607d08ef3011f60.tar.gz kutter-4889e8241d441141ae6826550607d08ef3011f60.tar.xz kutter-4889e8241d441141ae6826550607d08ef3011f60.zip |
pid_calibrate: Update the heater's target temperature during calibration
Update the target temperature during the pid calibration. This gives
additional feedback to the user and it makes it less likely that a
verify_heater error will be raised during calibration.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/extras')
-rw-r--r-- | klippy/extras/pid_calibrate.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/klippy/extras/pid_calibrate.py b/klippy/extras/pid_calibrate.py index 292a2b31..05ec6e99 100644 --- a/klippy/extras/pid_calibrate.py +++ b/klippy/extras/pid_calibrate.py @@ -24,7 +24,7 @@ class PIDCalibrate: except self.printer.config_error as e: raise self.gcode.error(str(e)) print_time = self.printer.lookup_object('toolhead').get_last_move_time() - calibrate = ControlAutoTune(heater) + calibrate = ControlAutoTune(heater, target) old_control = heater.set_control(calibrate) try: heater.set_temp(print_time, target) @@ -45,9 +45,10 @@ class PIDCalibrate: TUNE_PID_DELTA = 5.0 class ControlAutoTune: - def __init__(self, heater): + def __init__(self, heater, target): self.heater = heater self.heater_max_power = heater.get_max_power() + self.calibrate_temp = target # Heating control self.heating = False self.peak = 0. @@ -70,10 +71,11 @@ class ControlAutoTune: if self.heating and temp >= target_temp: self.heating = False self.check_peaks() - elif (not self.heating - and temp <= target_temp - TUNE_PID_DELTA): + self.heater.alter_target(self.calibrate_temp - TUNE_PID_DELTA) + elif not self.heating and temp <= target_temp: self.heating = True self.check_peaks() + self.heater.alter_target(self.calibrate_temp) if self.heating: self.set_pwm(read_time, self.heater_max_power) if temp < self.peak: |