Skip to content

Dynamic Pressure Advance

hadesz edited this page Feb 6, 2024 · 5 revisions

What's this and why I need it?

To print fast but maintain good survace quality, the sprint speed needs to vary a lot (100mm/s External Perimeter and 300+ InternalPerimeter/Infill/...) and these speeds need significantly different PA values, like 0.05 for slower speeds, but 0.03 for faster moves.

How does it work?

Initially I wanted to work with speeds, but that would require post processing and altering the end gcode, what is a more fragile way, compared to using slicer features. So I came up with 2 macro commands, one for setting up parameters and the other what sets the proper value on every Extrusion feature type change.

Setup

1. Download the variable_pa.cfg transfer it to the printers config folder

2. Include it in the printer.cfg and define save_variables section

(the path and filename can be any accesible file on the Pi, I started using saved variables with my ERCF setup, so I kept that name)

image

image

3. Tune the PA values for the speeds you need

The available options are on the screenshot, but basically everything what has its own speed value in the respective page

The feature names might be different in other slicers, but both the macro and post post-processing can handle them dynamically as long as they match with the gcode files

image

4. Put the values in the Filament Start G-code

SET_PAS default=0.035 ExternalPerimeter=0.05 TopSolidInfill=0.05

image

default: this is the fallback value for features that does not have it's own PA (if skipped the printer configs default PA is used)

5a. Insert the activation macro into the Custom G-codes page

_USE_PA F={extrusion_role}

image

5b. Set up post processing if custom g codes are not available

Download the script and set it up as any other post processing script in your preferred slicer (i did not test this with other slicers, the line type names might be different in them)

6. Slice and print

Feature, Filament default and printer default PA values

The _use_pa macro checks if there is a value set to the given type, if not, the value from the 'default' is used if present. If none of these are set, the printer default value will be used.