Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    Macro for PA testing with Prusa Slicer

    Scheduled Pinned Locked Moved
    Gcode meta commands
    1
    1
    254
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • mikeabuilderundefined
      mikeabuilder
      last edited by

      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.

      1 Reply Last reply Reply Quote 3
      • First post
        Last post
      Unless otherwise noted, all forum content is licensed under CC-BY-SA