From bddefdde36cab33b19df7e46824e922e9c045527 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Tue, 5 Mar 2024 19:24:03 -0500 Subject: pid_calibrate: Fix PID_CALIBRATE command when used with heater_generic Make sure the SAVE_CONFIG command saves the calculated PID parameters to the correct config name. Signed-off-by: Kevin O'Connor --- klippy/extras/pid_calibrate.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'klippy/extras/pid_calibrate.py') diff --git a/klippy/extras/pid_calibrate.py b/klippy/extras/pid_calibrate.py index f32f1be7..20641167 100644 --- a/klippy/extras/pid_calibrate.py +++ b/klippy/extras/pid_calibrate.py @@ -43,11 +43,12 @@ class PIDCalibrate: "The SAVE_CONFIG command will update the printer config file\n" "with these parameters and restart the printer." % (Kp, Ki, Kd)) # Store results for SAVE_CONFIG + cfgname = heater.get_name() configfile = self.printer.lookup_object('configfile') - configfile.set(heater_name, 'control', 'pid') - configfile.set(heater_name, 'pid_Kp', "%.3f" % (Kp,)) - configfile.set(heater_name, 'pid_Ki', "%.3f" % (Ki,)) - configfile.set(heater_name, 'pid_Kd', "%.3f" % (Kd,)) + configfile.set(cfgname, 'control', 'pid') + configfile.set(cfgname, 'pid_Kp', "%.3f" % (Kp,)) + configfile.set(cfgname, 'pid_Ki', "%.3f" % (Ki,)) + configfile.set(cfgname, 'pid_Kd', "%.3f" % (Kd,)) TUNE_PID_DELTA = 5.0 -- cgit v1.2.3-70-g09d2