Skip to content

PID_CALIBRATE advice test max power after calibration#7209

Open
nefelim4ag wants to merge 2 commits intoKlipper3d:masterfrom
nefelim4ag:pid-calibration-analyze
Open

PID_CALIBRATE advice test max power after calibration#7209
nefelim4ag wants to merge 2 commits intoKlipper3d:masterfrom
nefelim4ag:pid-calibration-analyze

Conversation

@nefelim4ag
Copy link
Collaborator

@nefelim4ag nefelim4ag commented Feb 24, 2026

Right now, some heaters can produce suboptimal pid values after calibration, they are suboptimal because they produce large oscillations during standby or printing. Often, it looks like I and D are large, and decreasing them helps.

That happens, that the calibration of the heater when the time of heating is close (equal) to the time of cooling produces less aggressive PID values.
Those values in the end should be less annoying and less often produce several degrees of oscillations, which can block the machine on M109 indefinitely.

This PR adds a new param to the PID_CALIBRATE, MAX_POWER, which allows adjusting power during the calibration.
On top, here is a small analysis section, which advises/guess MAX_POWER value to use next.
The point is, reduction might be necessary during calibration, but it is not necessary to reduce power for real printing.

*Based on Kevin's idea, I've only implemented it and gathered some testing data before

Thanks,
-Timofey


Testing:

cd ~/klipper
git fetch origin pull/7209/head
git checkout FETCH_HEAD
sudo systemctl restart klipper
PID_CALIBRATE HEATER=extruder TARGET=235
// PID parameters: pid_Kp=35.189 pid_Ki=9.022 pid_Kd=34.310

Graph with default PIDs at steady state:
image

With recommended power:

PID_CALIBRATE HEATER=extruder TARGET=235 MAX_POWER=0.599
// PID parameters: pid_Kp=27.901 pid_Ki=6.643 pid_Kd=29.297
image

So, for me, there is no significant difference.


I did try to calibrate my bed with decreased power (18%), but it seems to make I too low (0.064), so it has too slow heating and overshoots more than I prefer it to.

@nefelim4ag nefelim4ag changed the title PID_CALIBRATE advice max power after calibration PID_CALIBRATE advice test max power after calibration Feb 24, 2026
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
For high power heaters current calibration might give
too high ID of PID. Detect that by time ratios
and suggest to rerun the calibration at different max power.

And add a notice about the too-high heating time.

Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
@nefelim4ag nefelim4ag force-pushed the pid-calibration-analyze branch from 79077c5 to eb079f2 Compare March 11, 2026 13:51
@aka13-404
Copy link

PID changes without restarting WHEN

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants