-
-
Notifications
You must be signed in to change notification settings - Fork 928
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve pressure equalizer so that it's less aggressive #4264
Improve pressure equalizer so that it's less aggressive #4264
Conversation
This also fixes #3839 (comment) and #3839 (comment) |
Fantastic, thank you for fixing this! It had been driving me nuts specifically by being too aggressive after gap fill! |
@Noisyfox , as you know I run 120mm3/s 1 segment length. Before This PR |
@Noisyfox I forgot to check the main issue in my case: screw holes |
This is fantastic! Shall we update the tips of the option too?
|
120mm3/s with segment length 1 Segment length 3 should be fine also and IIRC mandatory for some printer, I don't bother the gcode size that it allegedly gets bigger with length 1 but I never bothered to confirm that. |
Yeap the tool tip could do with an update. I've written up my thoughts below (sorry for the post length!!!) but may be wrong as this is a pretty complicated topic, especially how it interacts with internal motion planners, PA and PA smooth time in the klipper/BBL firmwares. To start the conversation, see image below: That is expected as a higher speed transition results in a higher flow change, meaning you need a higher ERS value to maintain the same smoothing over the same distance. However this may not be the right answer as we are trying to fight:
When I ported it, I targeted BBL printers mostly which, because of the fast external perimeter speed and high accelerations and less than ideal PA smoothing implementation, needed high ERS values to take the "edge" off PA artefacting. Basically providing a small "ramp" to slow down and ramp up speeds to cover for the deficiency in its internal jerk implementation which is worse in my view compared to the Klipper SCV implementation and aggressive PA smoothing. Hence the high value recommendation for BBL stock profiles. Experimentally it worked well - taking the edge off the artefacts. However, this feature won't make a difference if the extrusion rate smoothing slope results in speed changes that are less than what the internal motion planner of the firmware plans during acceleration/deceleration moves. For example, when transitioning from a high speed area to a low speed area there is no "sudden" stop as you're bound by the print acceleration, so what you see on the speed view in Orca isn't exactly what is happening when printing the model. For a BBL printer printing at 10k+ speeds the ERS value can be afforded to be higher as the deceleration-> acceleration slope will result in more sudden extrusion rate changes compared to a print with more moderate accelerations. Then the matter of Pressure Advance smooth time comes in. This is the amount of time allowed to the extruder to smooth out a newly requested extrusion rate value in Klipper. (https://klipper.discourse.group/t/pressure-advance-smooth-time-on-direct-extruders-with-short-filament-path/1971/6) This results in deviations from the ideal nozzle pressure, as the extruder cannot move instantaneously, hence why its extrusion rate change is smoothed over time. This deviation is what we are trying to mitigate here in areas of sudden speed change. Ideally, I think that you'd want extrusion rate smoothing to be resulting in extrusion rate changes that are smaller than the PA smooth time value for it to have any meaningful effect (hence speed changes that are larger than what the planner would produce). I think that if the ERS flow changes are over the PA smooth time threshold the look ahead planner will reduce extrusion rate faster than the ERS smoothing moves hence making it redundant. So in summary it may make more sense to go conservative in this value to allow it to have an effect on the print. For a fast accelerating printer with PA smoothing that is close to 0, as is the BBL printers (which result in artefacts when slowing down quickly), it may make sense to keep the value high, like 200/300 or so. For a Klipper printer, especially if you have PA smooth time of 0.04 which is the default and are printing with more conservative accelerations (like 2-6k), maybe it makes sense to keep the value at a more moderate level, like 100 or so or even lower. For a slower printer with no PA and limited accelerations, a much lower value makes more sense - like 10-15 or so. This should be solvable with math, however it makes my head spin just thinking of it :) You have a speed ramp due to the acceleration profile, that results in an extrusion rate ramp based on the PA value which is smoothed out over PA smooth time. Ideally you want the ERS value to be below the computed flow changes from the above. So where does this leave us? Lower values are more likely to produce a meaningful result, but going too low will slow down the print more than needed to take the edge off these artefacts... Personally I use it on occasion on the BBL X1C where models show the need for it (sharp speed changes on external walls) but in these cases I may just print the perimeter slower anyway to get better quality as loosing arcs is a bigger issue quality wise on that printer (steppers exhibit more VFA without arc moves). When I do use it I have settled on a value of 200 with 3 as a segment (to avoid overloading the MCU). On the V2.4 I dont use it most of the time as I haven't seen the same level of artefacts as on the X1C on external perimeters but then I am using danger klipper with extrusion rate sync to IS and a low PA smooth time value of 0.01s and a nozzle that doesnt take much to pressurise (not a UHF style nozzle that needs to push plenty of material to ramp up pressure). When I do use it on the 2.4 I have settled on a value of around 100 with 1 segment. With the above in mind, a new tool tip could be: This parameter smooths out sudden extrusion rate changes that happen when the printer transitions from printing a high flow (high speed/larger width) extrusion to a lower flow (lower speed/smaller width) extrusion and vice versa. It defines the maximum rate by which the extruded volumetric flow in mm3/sec can change over time. Higher values mean higher extrusion rate changes are allowed, resulting in faster speed transitions. A value of 0 disables the feature. For a high speed, high flow direct drive printer (like the Bambu lab or Voron), especially with a well tuned PA and PA smooth time settings, this value is usually not needed. However, it can provide some marginal benefit in certain cases where feature speeds vary greatly, such as in overhangs or where the extruder and/or hot end cannot keep up with the requested flow changes as a result of pressure advance. In these cases, if printing with high accelerations (10k+) and high speeds (200mm/sec+) a value of around 200-300mm3/sec2 is recommended as it allows for just enough smoothing to assist pressure advance achieve a smoother flow transition. In cases where more moderate accelerations are used (2-5k) and moderate speeds (100mm/sec) a value of around 90-120mm3/sec2 is recommended. Finally for printers not utilising pressure advance a low value of around 10-15mm3/s2 is a good starting point. These printers will benefit the most from this feature due to the lack of pressure advance in the firmware. This feature is known as Pressure Equalizer in Prusa slicer. Note: this parameter disables arc fitting. |
For example, the below is with klipper on the v2.4 printing at 120mm/sec external without ERS. Here PA and smooth time have done a good job of eliminating the extrusion rate issue, together with the G2E extruder that can respond fast enough to the filament flow changes. so I think the “recommendation” that this feature should not really be needed for klipper at least and if it is, maybe a borderline high value will give the most benefit, as long as it’s beneath the acceleration curve, pa smooth time and corresponding speed ramps. |
This is an outstanding technical explanation! You've crafted a perfect document to detail the feature; it would be a shame for it to remain hidden in PR comments. Would you be interested in writing a WIKI page for this option? That way, when users click on the option in Orca, it will automatically direct them to the corresponding WIKI page. Regarding the tooltips, I’m considering keeping them concise and focused on explaining the effects(with little bit of "how" if it's must). |
Of course!! Does the wiki work the same way as regular code PRs? Sorry stupid question I know :) |
Yes! |
Meanwhile, I will merge this PR first |
I’ll get a PR going over the next couple of days with a bit more documentation on this ;) |
Awesome 👍 |
Did some of the math which seem to back the empirical tests by @HakunMatat4 on the Voron and mine on the BBL. Turns out if you’re accelerating at 4k+ a high value is enough to take the edge off (200+). If you’re accelerating at 2k or so which is more typical of Voron external perimeter accelerations a value of 70-100 is more appropriate. This setting basically reduces the deviation as a result of smooth time in klipper and covers for the mechanical limits of the hot end on the Bambu!! |
I've two use cases in case this change anything. When printing PLA tho, I'm cruising at 200mm/s on the walls, 5k acceleration while pushing filament at 20-25mm3/s while keeping the same 120mm3/s and segment length 1 In all cases, I cannot complain about the seam left because of this feature. Also, I don't have seam gap enabled because I believe it will destroy PA logic. |
@HakunMatat4 whst acceleration are you using for your print moves? External, internal perimeter, infill and sparse? |
Reason I’m asking is because having done some of the math it appears that:
basically there is an upper value where ERS does nothing for your print as your printer is slowing down on its own more than the ERS value would make it slow down - at .2 LH with 5k accel for external perimeters that value is 406mm3/s2. setting an ERS value at 100 you’re basically simulating at the points of sharp speed changes what the printer would do on its own if you’re printing at 1.2 k accel or so and 0.2 LH with this feature off. maybe that is also why I haven’t seen the need for it much as I’m printing with 1-2k external wall speeds, so basically running the same extrusion smooth rates as you but from within the printer if that makes sense. |
These are the same profiles I used when this feature was released ages ago. This is my "normal profile" for everything. This is my slowest profile for ASA Voron parts or ASA anything that goes into the printer. |
@HakunMatat4 perfect thank you! What I dont understand is why your seams are improved compared to the no ers setup. Especially since the perimeter speeds are not different between internal and external. If they were I understand it, but as they are not, there is no deviation in extrusion pressure. I dont think ERS does anything there now as there is no speed change before and after your seams. :S There may be a tiny bit of smoothing due to extrusion line width, but that is tiny in comparison to the print speed changes What do you think? Have you tried recently with the feature off and check the seam performance? |
I believe there is. Let's use my 200mm/s 5k accell profile as example.
It is gonna leave an ugly seam, I mean, I magine you driving at 100km and then boom, full stop, another boom, from 0-100km/s
This is PrusaSlicer Pressure Equalizer in action on my MK3S+ back then. |
copied to PrusaSlicer prusa3d/PrusaSlicer@b4fadc1 |
Current pressure equalizer will slow down the print too much when the extrusion rate differs a lot:
bridge test.3mf.txt
This PR fixes the issue:
Some detailed explaination:
float rate_start = rate_end + rate_slope * line.time_corrected();
calculates the max rate possible at the beginning of the segment, so that the rate changes betweenrate_start
andrate_end
across the segment extrusion time does not exceed therate_slope
.However, this formula ignores the fact that the segment extrusion time will be longer than
line.time_corrected()
if therate_start
decreased, which means the actual max extrusion rate should be larger thanrate_start
calculated here.The new formula fixes the problem:
This also fixes #3208