diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2020-06-14 11:34:04 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2020-06-14 11:34:04 -0400 |
commit | c4de0bba507e50a3be537d6ffe731427f25fba91 (patch) | |
tree | 4941b2f2c5ddef20ef8757c2aba45a751dc5accf /klippy | |
parent | 35bbd989e4383193b8ef4cfef0b262831e611f75 (diff) | |
download | kutter-c4de0bba507e50a3be537d6ffe731427f25fba91.tar.gz kutter-c4de0bba507e50a3be537d6ffe731427f25fba91.tar.xz kutter-c4de0bba507e50a3be537d6ffe731427f25fba91.zip |
pid_calibrate: Avoid internal error on a shutdown
If a shutdown occurs during a PID_CALIBRATE command (eg, due to a
heater problem) then exit cleanly instead of throwing an internal
error.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy')
-rw-r--r-- | klippy/extras/pid_calibrate.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/klippy/extras/pid_calibrate.py b/klippy/extras/pid_calibrate.py index 0cad07f5..2bc6566c 100644 --- a/klippy/extras/pid_calibrate.py +++ b/klippy/extras/pid_calibrate.py @@ -34,6 +34,8 @@ class PIDCalibrate: heater.set_control(old_control) if write_file: calibrate.write_file('/tmp/heattest.txt') + if calibrate.check_busy(0., 0., 0.): + raise gcmd.error("pid_calibrate interrupted") # Log and report results Kp, Ki, Kd = calibrate.calc_final_pid() logging.info("Autotune: final: Kp=%f Ki=%f Kd=%f", Kp, Ki, Kd) |