Greetings,
I am posting this to document my findings for some feedback before opening an issue on GitHub.
Background
Before switching to Klipper, while I was researching it, I came across random posts and comments from people declaring that Klipper PID control was nowhere near as good as in other firmware. I found that hard to believe.
Once I converted my printer to Klipper I did notice that the hot end temperature was somewhat less stable and tended to oscillate or “buzz” slightly around the set point. In the last few months I upgraded the hot end on my printer from stock Creality to Micro Swiss and I increased the heater power from 40W to 50W. I immediately noticed that the oscillations became worse with higher peak-to-peak amplitude. This prompted me to investigate.
Findings
Klipper uses 2 seconds as the default smooth_time
values for both the extruder (hot end) and the heater bed. Heater beds generally have very large thermal inertia resulting in slow warm-up and cool-down times, and a 2 second (or even longer) filter is perfectly acceptable. In case of extruders, the thermal gain (heating and cooling rates) are significantly higher, particularly with high performance hot ends that are equipped with higher power heaters. In those cases the 2 second filter is significantly too long and results in destabilizing of the PID control loop. This results in periodic oscillations around the temperature set point. The following image illustrates the temperature stability of my hot end with the default 2 second value followed by shortened 1 second value. The power clearly shows the PID loop instability:
In my setup I ultimately settled on 0.4 second that provides a perfect balance between stability and noise immunity (filtering). The following image illustrates how well the PID loop behaves with optimized smooth_time:
Recommendation
I continue seeing people noting hot end temperature instability on Discord and I keep recommending that they experiment with the smooth_time value to fix their issue. I would therefore recommend that the default value be reduced for the extruder and appropriate notes are added in the documentation, perhaps in the PID tuning section, allowing users to optimize the value for their specific installation to get stable hot end temperatures while ensuring adequate electrical noise protection.
Peter.