Macro for PA testing with Prusa Slicer
-
I thought I'd share this simple macro I wrote for tweaking the PA parameter while printing. I made it because I could not get the prusa slicer code provided in the PA wiki page ( https://duet3d.dozuki.com/Wiki/Pressure_advance) to work for me.
My macro works by inserting an M98 call in the "Before Layer Change" area in the Custom G-code part of Printer Settings in PrusaSlicer. The complete line of code is:
M98 P"0:/macros/PA_tester.g" L[layer_num]
The slicer calls the macro I've named "PA_tester.g" and passes a parameter L and the layer number. This happens for every later change.
The Macro, which I adapted from the PA wiki page looks like this:
; This macro changes the pressure advance setting every 25 layers so that the user can see the effect of different PA values ; 0.2mm layer, 8 bands 5mm each, total height 40mm if param.L = 1 M572 D0 S0.0 elif param.L== 25 M572 D0 S0.05 elif param.L== 50 M572 D0 S0.10 elif param.L== 75 M572 D0 S0.15 elif param.L== 100 M572 D0 S0.20 elif param.L== 125 M572 D0 S0.25 elif param.L== 150 M572 D0 S0.30 elif param.L== 175 M572 D0 S0.35 m99
The advantage of this over the in-slicer Prusa version on the PA page (beyond that code not working), is that I can change the PA parameters and the layers they change on and reprint my test part without needing to go back to the slicer.