Can we please merge the PID calibrate improvements already 😭

So here I am, trying to get the Bambu hotend to keep temperature reasonably well.

The temp there changes crazy quick, I think mainly due to the sensor being so close to the heater.

A normal pid tune will give temp fluctuations over 1 degree at the target temp. M190 takes forever to pass the 1 degree treshold.
When repeating the PID tune, the computed parameters vary 10+% between runs.
When keeping steady temp, the power graph is all over the place.

Lowering smooth time to 0.3 helps somewhat but still seeing ~0.4 deg fluctuations.
The power graph is all over the place. And if I try to print 20 degrees away form the calibration temp, it’s 1-2 deg fluctuations all the time.

I suspect in practice the whole hotend fluctuates way less and this is mostly sensor being close to the heater. So just smoothing this out for M190 would be a solution.
The smooth time unfortunately affects both calculation of the avaraged and PID loop speed. And the pid loop needs to be fast here just because the heater is fast.

The Experimental PID improvement changes - #66 by DanS seems tho mostly solve this. We have real use cases where it helps, why no merge?

The main question here is “Does it affect your printing?”

I’m never against improvements, but they have to be kept in perspective of the ultimate goal you’re trying to achieve here.

Otherwise you’re just “chasing zeros” for accuracy with diminishing returns.

Case in point, Hotend temps.

Ultimate goal: Melt a thermoplastic past it’s glass transition temp to extrude it.

Glass transition temp isn’t a sharp cut off point, It’s a smooth curve.

If you look up a glass transition temp, It’s just giving you the glass transition POINT (where the region begins) and it always says “Approx x degrees” or “~x degrees” because there is wiggle room and then past that point you’re within the transition region for a relatively wide band of temperatures.

but still seeing ~0.4 deg fluctuations

That’s an outstanding level of control. The ultra highest accuracy PID controllers used in labs and metrology only claim .1% accuracy

At 230c that would be 230 * .001 = .23 c fluctuation, you’re double that but still, you’re better than most industrial controls tuned by professionals that get paid to do it with the best equipment.

it’s 1-2 deg fluctuations all the time.

Nature of the beast, you tuned for one temp, if you go outside that range you will get variance. 2 degree fluctuation at 230c is .8% (Edit: It’s .87%, or closer to .9% since we’re chasing accuracy here :nerd_face:) , less than a 1% variance. That’s pretty awesome and well within glass transition temp.

If you were fluctuating 20 degrees or so, that’d be a MUCH bigger issue.

All in all, Your PID is doing it’s job and is on par with some of the best out there.

Again, It all comes down to… “How is it affecting my printing?”

Alright, then why pid control wait for temp condition is within 1 degree AND <0.1 deg/sec speed.

Either better PID control or more relaxed stability conditions. As it stands Bambu hotend is borderline unusable.

It’s because you lowered your smooth time to .3 as you stated up top.

Now Klipper thinks the temperature is still in flux and is waiting for it to settle down before its ready to start printing.

All PIDs need and have some smoothing on their measurement values or else the PID controller is constantly knee jerk adjusting to changes via it’s derivative term.

MOST people want their temp to be stable before they start printing so they don’t have issues. If you raise your smooth time back up you won’t have this issue.

If your temp is fluctuating so much that it won’t hit the threshold and stay there, then you have sensor issues or you need a higher smooth rate not a lower one.

Post a pic of your temp graph.

I doubt it will ever be pulled into klipper code. Kevin has already strongly indicated he wont make any improvmements and prefers a less accurate, less responsive, more simple PID implemenation as good enough.

The klipper fork, DangerKlipper, has PID improvements that you might be interested in:
-pid profiles to set different pid params for different temps
-pid_v
-pid_p and dans pid improvememts currently in a PR that will be merged soon. Add Dan98's positional PID algorithm by jslaker ¡ Pull Request #210 ¡ DangerKlippers/danger-klipper ¡ GitHub

I’m still honestly curious, I’m not trying to dismiss any concerns or actual issues. You have to understand that some people expect their printers to magically heat up nearly instantly to a temp and hold there rock solid with zero variance.

That’s not only unrealistic it breaks the laws of physics.

I keep hearing that the Bambu labs printer users are the ones with the PID issues or concerns, since I don’t have one myself if you could provide a pic of your temp graph showing what you mean it would be helpful in understanding.

With the PID change linked in the post, all it really did was minimize overshoot at the cost of taking longer to heat up. The change was minimal.

Overshoot isn’t even necessarily an issue with 3d printers as long as it’s not drastic like +20c. I almost exclusively print in ASA and I can print successfully between 225c and 260c with the only change being at the higher end I need to tweak my retraction settings a bit.

It’s not that the Bambu labs hot ends are ultra powerful or anything from what it seems. From Googling it looks like their heaters are 50W, I use a Phaetus Rapido that’s 88W with no issues.

For example, I ran this just now.

On a typical print, I heat the hotend up to 150c and hold while my bed heats up. Then I probe the bed for QGL / Homing and then heat up to my final printing temp. I simulated that just now.

It took 5-6 seconds to reach each temp and I overshot by slightly less than 3c but it settled back to it’s commanded temp within another 5-10 seconds max.

If I just straight went to one temp we’re talking 10-15 seconds max time until ready to print.

The graph above with the “upgrade” is the same, it just doesn’t overshoot. It just takes longer to reach the same temp.

So it’s basically choose your poison with the same result.

Unless I’m missing something?

Here is a quick one from mobile. It seems that it starts resonating with ~3 degrees amplitude after the initial heat up.

How many extruders do you have? I don’t necessarily think that’s the issue but I’m wondering if there is a commonality between people with PID issues and people with multiple extruders.

That is a crazy amount of oscillation, which could really be any of the PID tuning factors. I’m more curious as to why your getting oscillations and other people PID tune and it’s fine.

Can you post your klippy log?

5 extruders. Was working fine until I switched one of them to Bambu, the other extruders are fine.

Will post the log later today.