Using PrusaSlicers M73 progress to run macro ?
Marius Breuer last edited by
I was wondering if it's possible to use the M73 code generated by PrusaSlicer to run a macro based on the print progress. I'm asking because i had the idea to add neopixels to my printer and light them in red/green according to print progress (ie 60% done means the left side 60% of the led strip are lit green/white/..., the 40% on the right side are out/red/...).
All of the led stuff is done on a seperate board, I only need the duet to tell me the print progress (ie as duty cycle of a PWM output, I2C, or anything alike). PrusaSlicer can include the print progress in the gcode, so i wouldn't have to rely on DWC. However that would suffice too, because the led-based visual indicator isn't accurate to the minute.
The M73 code is looking like this:
M73 P17 R22
The P-value is the print progress in %, R-value is the remaining print time in Minutes
Thanks in advance!
bearer last edited by
Are you targeting the new RRF3 or the old RRF2?
Danal last edited by Danal
You could use a post-processor to change the M73 to an M42 and therefore signal on a pin with PWM for your separate board. Prusa slicer will call the post processor automatically, if you wish.
There are many things you could do. One of the easiest would be to use the percentage as a 0 to 1 value:
M73 P17 R22 might become M42 Px F0.17
This would slowly increase the PWM from 0 to 100% as the print progressed. You could light up more and more of the neopixels. There are many other things you could do...
You can put a macro file M73.g in /sys on the SD card and it will be run whenever M73 occurs in the GCode stream. Currently you can't access the parameters, but that facility will be provided in RRF 3.02.
arhi last edited by
@dc42 any way we can actually inform the firmware or DWC about the estimated finish time? something like, read data from M73 and send it to firmware? (if firmware is not supporting M73 on it's own)