mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-07-23 22:54:10 -06:00
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>
This commit is contained in:
parent
0105aa330f
commit
bddefdde36
2 changed files with 12 additions and 8 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue