I have been investigating a report from @dmbutyugin at Modification of Pressure Advance for high speed Bowden printers - #8 by dmbutyugin that reducing pressure_advance_smooth_time
often results in a reduction in pressure_advance
.
Using some simple modelling, it does seem like pressure_advance_smooth_time
could have a systemic impact on the results of pressure_advance calibration.
To test this I modified the scripts/graph_extruder.py
tool. I modelled and graphed the results of a hotend that perfectly follows the theoretical pressure advance model. I used that to graph the impact of pressure_advance_smooth_time on the nozzle flow rate.
In this graph the yellow line represents the estimated nozzle flow rate when using smooth pressure advance. (The light pink line would be the nominal pressure advance amount, and the light green line is the commanded extruder movement after smoothing.) At first glance, this graph seems sane - the theoretical flow rate after smoothing is very similar to the desired flow rate - differing only for a few milliseconds during cornering.
One troubling part, however, is that the amount that the smoothing alters the flow rate is similar at both high and low toolhead speeds. However, the impact of over-extruding at low toolhead speeds is much more noticeable because all that over extrusion is in one spot - thus resulting in blobbing. It’s possible to estimate the amount of extrusion at each position.
The second graph shows the estimated extrusion at each toolhead position (modelled with a simple summation technique using buckets every 0.200mm). (The bottom graph does not vertically align with the top graph.) The start and the end of the move aren’t particularly interesting, however the cornering (100mm/s down to 5mm/s back up to 100mm/s) does show notable over-extrusion. The graph does seem to show how pressure_advance_smooth_time could result in “blobbing at the corners” due to how it smooths the extruder flow rate during speed changes.
The PA calibrations tests work by measuring blobbing at speed changes. Thus, if pressure_advance_smooth_time
leads to “blobbing during speed changes” then it could result in a systemic bias to the test results. For example:
This graph models how a smoothed PA setting of 0.055 would behave on an extruder that actually follows PA=0.045. If one were to just look at the “blobbing during cornering” then a PA=0.055 would likely appear as a shaper corner.
Thus, it seems, even on an ideal extruder, pressure_advance_smooth_time
is likely to lead to a bias in the observed pressure_advance
during calibration.
Interestingly, the effect is heavily dependent on speeds.
If we use a toolhead speed of 200mm/s then PA=0.055 seems to show notable under-extrusion during cornering.
So, it seems that pressure_advance_smooth_time
could skew the results of calibration, and the amount it skews is dependent on the specifics of the test.
It may be possible to come up with an alternative smoothing system to reduce the amount of over-extrusion during slow speeds. (Possibly by giving greater weight to the desired extruder position at low toolhead speeds.) It’s not immediately clear how to do that though.
-Kevin
EDIT: I temporarily uploaded my (very hacky) graph_extruder.py script to klipper-dev/scripts/graph_extruder.py at work-pressure-20240123 · KevinOConnor/klipper-dev · GitHub in case anyone is curious.