diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2024-03-05 19:24:03 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2024-03-13 21:41:04 -0400 |
commit | bddefdde36cab33b19df7e46824e922e9c045527 (patch) | |
tree | 2d0ace1c9e2068f27914b32c71ed64a01d9b3cef /klippy/extras/pid_calibrate.py | |
parent | 0105aa330f2a4865b01cbbc548cba1322be5371e (diff) | |
download | kutter-bddefdde36cab33b19df7e46824e922e9c045527.tar.gz kutter-bddefdde36cab33b19df7e46824e922e9c045527.tar.xz kutter-bddefdde36cab33b19df7e46824e922e9c045527.zip |
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 <kevin@koconnor.net>
Diffstat (limited to 'klippy/extras/pid_calibrate.py')
-rw-r--r-- | klippy/extras/pid_calibrate.py | 9 |
1 files changed, 5 insertions, 4 deletions
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 |