Pressure_advance_smooth_time on direct extruders with short filament path

The Klipper tuning guide suggests how to tune pressure_advance parameter. However, there is an additional parameter that affects Pressure Advance - the smooth time. Typically it is recommended to leave it at default value, and changing it does not noticeably affect the extruder performance. However, I recently came across the case where I noticed the effect of the smooth_time on the print quality.

I’ve been recently printing with a Matrix Light extruder with Volcano hotend and a bit larger nozzles - 0.5 and 0.6 mm. I noticed some small defects around corners that looked like they could be related to PA (though the PA coefficient was tuned using the tower). So I tried to see if smooth_time has any effect on it, so I printed a couple of tests to check that. Next, come the tests with 0.5 mm nozzle.

First, I printed 4 small square models with smooth_time = 0.04 (default), 0.02, 0.01 and 0.005 with 0 infill and 2 perimeters. This was printed with PA=0.034 that I tuned using the default smooth_time = 0.04. Here’s how one of the corners of the model (the same corner) looks like (counter-clockwise from the top left corner - 0.04, 0.02, 0.01, 0.005):


It is not easy to capture, but one can probably see that the corner of 0.04 model is a bit more ‘smoothed’ and there is under-extrusion, not exactly at the corner, but slightly before it. I see it that the PA starts to ‘kick in’ a bit too early due to smooth_time being a bit too large for the extruder, and so the filament flow starts to decrease before the toolhead actually starts to slow down, hence the underextrusion. On 0.02 model it is already a bit better, and 0.01 and 0.005 models are about the same, and there is a tiny hole between the two wall on those 2 last models, but it is pretty much precisely at the corner, unlike the other two models (0.04 and 0.02).

Here’s the same corner from the side (0.04, 0.02, 0.01 and 0.005 left to right):


The 0.04 model has more smoothing in the corner, and there is even a small ‘dent’ in the middle of that smooth corner, which is quite visible under certain angles. 0.02 model is a lot better, and 0.01 and 0.005 are pretty much the same, they are good without major visible defects.

I then also re-printed the PA tuning tower with smooth_time = 0.01, here’s how it looks like in comparison with 0.04 (left, a bit unfinished is 0.04, right is 0.01):


I noticed that the PA gets a bit larger with smaller smooth_time = 0.01 - it is ~0.04-0.044 instead of 0.034. One can also notice a small dent ~1 cm from the corner. This is where the acceleration starts to change. It goes through almost the entire 0.04 model, but starts much later on 0.01 model. This is, I think, due to the fact that PA gets a bit out of sync with the actual motion with smooth_time = 0.04, and so we start to see over- and under-extrusions even before we exceed the optimal PA value.

So, my take is that on the extruders with a very small PA value (and/or very short filament path) it might be beneficial to adjust the smooth_time parameter to visibly improve the quality of the prints. However, I am unsure about the exact tuning procedure: TUNING_TOWER is not necessarily helpful here, as it is quite beneficial to look at the corner of a model from the top to see how the filament lines from different walls go together at the corner. Changing smooth_time on different layers does not permit that inspection. And it might be difficult to see the right smooth_time value by looking at the model (e.g. PA tuning tower) from the side, as the defect, if present, is fairly faint.

@koconnor FYI, I know you did some experiments with the smooth_time previously, and you had some draft proposal how to tune it.

2 Likes

It’s been a long time since I’ve experimented with pressure_advance_smooth_time. I have also seen slight surface blemishes that I attribute to the smooth time. I have seen reports of quality improvement after configuring a lower smooth time (typically with direct drive extruders).

I don’t have a particularly good test case for tuning the smooth time. I suspect the ideal value is dependent on acceleration.

At https://github.com/KevinOConnor/klipper-dev/blob/work-tuning-20200805/docs/Advanced_Tuning.md#tuning-for-extrusion-quality I suggest a simple tuning tower using the square_tower.stl file. YMMV.

-Kevin

Thanks for posting this, I have found a low value of PA helps print quality, but have been seen that thin extrusion artefact on small V cuts into the model, upping square corner speed helped, but it was still there.

Going to experiment with a low pressure_advance_smooth_time value tomorrow.

I have noticed when tuning pressure advance using the slow-fast-slow lines, that for some combinations of filament, temperature, max flow rate and acceleration, it is not possible to get a good result. There is a point where both increasing and lowering PA give worse result, but the middle ground still shows significant extrusion deviation during acceleration and deceleration.

Based on my understanding of the extruder kinematics, my theory is that the toolhead acceleration is really limited by a combination of PA value, smooth time, and maximum extruder torque (which includes filament grip and maybe cold filament stiffness). The required extruder torque increases with PA value and toolhead acceleration but decreases with smooth_time. Large smooth_time allows larger PA value (such as required for bowden setup) given the same extruder torque, but introduces more deviation to ideal PA. This deviation increases with toolhead acceleration.

So, to summarize the theory:

  • The physical limitation of smooth_time is the available extruder torque and filament grip. Basically how fast the extruder system can respond to requested instantaneous velocity change without skipping or filament deformation.
  • All else being equal, higher PA value increase deviation due to smooth_time
  • All else being equal, higher toolhead acceleration increase deviation due to smooth_time

Based on this, the tuning process should probably be:

  1. Roughly tune for PA value, since this one is highly dependent on physics and cannot be altered much.
  2. At the desired toolhead acceleration and best PA value, reduce smooth_time until there is no further improvement.
  3. If the extruder skips, we are hitting its limit and will either have to accept lower toolhead acceleration or less than ideal extrusion.
  4. If the extruder does not skip, there is room to increase toolhead acceleration. Keeping in mind it may require lower smooth_time to maintain the same quality.
  5. Given the max linear toolhead acceleration here and the highest square_corner_velocity the motion system can handle, one can calculate the highest ideal print acceleration. Pushing beyond that will require trading off artefacts from motion system or extrusion system. TODO: Equation
  6. Note, when changing to a filament that requires higher PA value (such as PETG), the maximum smooth_time and therefore toolhead acceleration limits are reduced for the same quality.

For these tuning, I think the line method is better than the corner method as it is decoupled from effects of square_corner_velocity.

On a side note, I have seen reports where people printing at higher PA value, which was the optimum value according to the tuning print, produces significant gaps between perimeters at acute angles. The explanation could be that for acute angles, given the same square_corner_velocity, we get higher toolhead acceleration. For very acute angles, the toolhead accleration may increase so much that the smoothed PA deviates too much from ideal PA. Decreasing the PA value reduces this effect, but most people running direct drive extruder with high gear ratio may have room to reduce the smooth_time instead.

This is still theory and I have not spent time to test yet, but from my recollection, PA around 0.045 starts to show artefacts with smooth_time 0.040 and 3000mm/s^2 acceleration.

Edit: Notes about changing filament

@1999 Thanks!

In general, I do agree that a model that follows a patter of slow-fast-slot-fast-… moves, like this:


might be better for PA tuning than the default Klipper tower because then the test does not deal with the square corner velocity or input shaping smoothing (at least, to some degree).

And yes, I agree to a large degree that

  • PA is a measure of the whole extruder system, including the filament, and extruding conditions (e.g. temperature). It works better when the flow is laminar, so that the filament is fully molten, and the flow rate is limited to a reasonable value for a given hotend.
  • smooth_time helps to improve the extruder performance with large PA values (e.g. on Bowden setups, or on direct drive extruders when printing flex filaments). It also allows Klipper to gracefully handle the pathological cases when the filament flow rapidly changes (e.g. when a slicer generates moves to fill gaps and such, or when the extrusion width is non-constant).
  • Small smooth_time values (how small depends on the extruder and the PA value - printing conditions) below a certain threshold may not cause significant deviations from the expected extrusion flow, and so the quality does not improve when reducing smooth_time further from that ‘threshold’ value. However, increasing smooth_time introduces larger errors into how the filament is extruded (vs the expected flow), thus reducing the quality and introducing printing defects. I’d say there may be an optimal smooth_time value, dependent on the extruder and perhaps on the type of filament, so that it does not make sense to reduce smooth_time below that value.

Now, I had a few comments and questions on your report.

Are you using input shaping by any chance? If yes, what are the parameters of the input shaper that you are using? And what was the ‘optimal’ PA value that you’ve got (and what extruder / filament type)?

Note that in general it is discouraged to increase the square_corner_velocity parameter. Some people still do it, but in general it is better to have high acceleration and moderate (~5 mm/sec, which is the default) rather than high scv and smaller acceleration, for a number of reasons. I wonder if that would improve or, contrary, decrease the performance of the extruder with the enabled PA?

Note that for acute angles, the acute-angle-velocity is proportionally decreased from the square-corner-velocity (Klipper has the exact formula for that). So, I cannot rule out the possibility that you’ve mentioned, but I think it is fairly unlikely - Klipper in fact slows down the toolhead at acute corners, and the maximum acceleration is also respected.

FWIW, today there is a tiny problem in the kinematics and extruder handling - when input shaping is enabled, it applies only to the toolhead kinematics, but the extruder ignores input shaping completely. However, input shaping cases the toolhead to deviate a bit from the expected trajectory, and the same is true for its velocity. However, PA does not account for this deviation today. So, the extruder and the toolhead motion can get out of sync when input shaping is enabled.

That being said, both input shaping and PA introduce some smoothing into the toolhead and extruder motion respectively, and if the smoothing that they cause happens to be comparable, they can sort of cancel out each other, or at least reduce to some degree. But if the smoothing from IS and PA is vastly different (and in general, input shapers for X and Y axes are typically quite different, and so they introduce different smoothing), then it might be impossible to compensate for input shaping with smooth_time value. Therefore, I wonder if some of the issues you and others report are actually due input shaping, which causes the extruder to be out of sync with the toolhead motion?

I was using input shaper, mzv at 54Hz. I just did another test with input shaper turned off, and I still see the gap between PA undercompensating and overcompensating. It may be due to the fact that the test acceleration is much below the input shaper smoothing limit. I have not done a side-by-side comparison with shaper turned on and off for the same PA. My current test with a PETG filament on direct drive shows best result at 0.082 and smooth_time 0.02

I see, I misunderstood how scv works. I need to look at it in more detail.

Hello, my printer is a voron 2.4 with a BMG LGX extruder and i’m having the same issue. I’m trying to figure it out how to solve it, in this discord i will post all my archievements: PA, smooth_time & SCV
I think we could work together… :wink:

BTW, I’ve made some code changes for the extruder to synchronize its PA with the input shaping (discourse topic). If you have been observing some PA issues with IS, that may resolve your issues (or may not, more testing required).