Conditional code for layer height
-
I'm trying to convert this PrusaSlicer code to a RRF macro. Is there a way to achieve it? where can I find the documentation for all the possible variables I can use?
; 0.2mm layer, 8 bands 5mm each, total height 40mm {if layer_num== 1}M572 D0 S0.0 {elsif layer_num== 25}M572 D0 S0.05 {elsif layer_num== 50}M572 D0 S0.10 {elsif layer_num== 75}M572 D0 S0.15 {elsif layer_num== 100}M572 D0 S0.20 {elsif layer_num== 125}M572 D0 S0.25 {elsif layer_num== 150}M572 D0 S0.30 {elsif layer_num== 175}M572 D0 S0.35 {endif}
-
@tapirath something like this (not tested!):
if exists(job.layer) if job.layer = 1 M572 D0 S0.0 elif job.layer = 25 M572 D0 S0.05
and so on. Object model job.layer will only be present and correct if the GCode includes recognised layer number comments.
-
Maybe take a look here: https://forum.duet3d.com/topic/26272/incremental-pressure-advance-m572-tuning-macros
-
Perfect thank you both
-
If you do write this macro in RRF, you'll still need to insert a custom bit of gcode in your slicer that is called on every layer change. And that custom gcode is an M98 P"<your macro name>". This will call the macro every time a layer is changed. After doing precisely this myself, I found that I preferred to do that work with slicer code.
-
I prefer the macro because
1- Cura doesn't have conditional gcode
2- I can use the macro with any Slicer without changing it -
This post is deleted!