All I’m suggesting is to try lowering smooth_time. This may give more accurate filament flow with similar strain on extruder, and may eliminate PA dependency on acceleration - one less variable to worry about, which would be a win. So, at least it’s worth a try.
Yes, I believe that’s what’s happening when smooth_time is too large. In that case, some of the extra movement goes to waste - it affects the filament flow too early - and so extruder has to do more movements to compensate for that.
Perhaps that could contribute to non-linearity effects, but it seems this cannot explain the effect completely. Say, when input shaping is enabled, the toolhead acceleration also starts earlier and finishes later than commanded. If smooth_time gets much smaller than the shaper duration, then, essentially, the toolhead can already start executing acceleration, but pressure advance will be lagging behind and not acting just yet. So, there’s a certain threshold value for smooth_time that one should not go below, and which likely explains why ideal PA value stops to reduce at a certain smooth_time value. And it so happens that non-linearities in PA vs speed can still be observed even in those conditions.
In general, one could argue that still PA can be out of sync with the actual toolhead motion. So, it goes like this: there’s a certain ‘ideal’ toolhead motion (computed in a look-ahead queue), then there’s a commanded trajectory from input shaping, and there’s actual motion (toolhead response), which is a third thing. Notably, even if input shaping is not enabled, and commanded motion == ‘ideal’ motion, then the actual motion still differs from commanded. Just with input shaping the actual motion is less hectic and may be a bit easier to predict. And it also better matches the ideal motion, but only spatially, not time-wise. So, arguably, Pressure Advance should target the actual toolhead motion, rather than the input shaped or the ‘ideal’ motion (which is the case today). I looked into it as a part of my efforts to improve PA synchronization with input shaped motion. My conclusion there was that one could pick specific smoother functions (and of specific durations) for extruder motion in order to at least approximate the expected response of the toolhead. Then applying PA to that motion would produce PA motion that follows the expected toolhead motion after input shaping to a certain extent, improving the extruder synchronization with the toolhead. FWIW, I concluded that the current extruder smoothing in Klipper can be seen as a first-order approximation of a toolhead response for simple shapers like (M)ZV, so that’s why I recommend setting smooth_time to a largest or an average of shaper durations for X and Y, at least for direct drive extruders. That said, in my branch I have smooth functions for the extruder generated for each shaper supported there to give better approximations of the toolhead responses. And for smooth input shapers that that branch has, due to their smooth nature and the fact that they are 0 at their ends, I believe the PA does not have that leakage problem. That is, there is no parasitic pressure built-up that results in filament leakage from the nozzle that you talked about. Basically, the extruder does not have to build-up pressure in advance, and it builds up the pressure as the toolhead also smoothly starts to accelerate. And even there I observe that for different velocity transitions the PA value is different. For example (an actual case for one of the filaments and extruders I tested for), 25->60 mm/sec transition requires PA = 0.038, 25->130 requires PA=0.034, and 60->130 requires PA=0.028.
Now, other sources of non-linearity can probably be seen as follows. The extra required filament push for PA dl
can be calculated as
F = k(dl) * dl = gamma(v) * v
and dl = alpha * v
. Then alpha = gamma(v) / k(dl)
, which is a PA coefficient. So, the higher the resistance of the filament flow gamma(v)
, or lower the rigidity of the system k(dl)
is, the higher the PA coefficient alpha
is. The fact that alpha
is observed to be larger at smaller velocities could mean two things. Either higher flow resistance at lower velocities, which is counter-intuitive, but perhaps is possible due to viscosity and stickiness of the filament? Or that rigidity k(dl)
is smaller at lower displacements, which would be not all that surprising, since even the stepper motor produces higher the torque the larger its offset from the equilibrium position is. And on bowden extruders there are even more sources to have low rigidity until all plays between connecting parts are eliminated.