Printer Model: Fabtotum Personal Fabricator
MCU / Printerboard: Totumduino (ramps like ATMega1280 based)
Host / SBC: Raspberry Pi
klippy.log
Describe your issue:
My printer is configured to be used with a laser head. I’ve written macros to run on the beginning and the end of the job. For gcode creation LaserWeb4 is used. I’ve added the macro names into the appropriate gcode sections there. Looking at the generated gcode file, the Macros are inserted.
However at the end of the job the macro is not executed. Before I created the macros the same code written directly into the Laserweb4 settings performed just fine. Any tipps what could cause this? klippy(1).log (1.5 MB)
When simulated in Klipper it works as expected:
run “START_LASER”
Manually move head using the jog-menu
run “END_LASER” → head returns to previous zero point (set with G92).
[gcode_macro START_LASER]
gcode:
M5 ; Disable Laser
G21 ; Set units to mm
G90 ; Absolute positioning
G0 F10000 ; Set Non-Cutting speed
SAVE_GCODE_STATE NAME=GCODE_STATE_LASER
G92 X0 Y0 Z0 ;Set current position as zero
[gcode_macro END_LASER]
gcode:
M5 ; Disable Laser
G91 ; relative
G0 Z+20 F3000 ;
G90 ; absolute
G0 X0 Y0 ; Home to Starting point
RESTORE_GCODE_STATE NAME=GCODE_STATE_LASER
Unfortunately no change. Where should the logging appear? It didn’t show in the console window. Nor could I find it in the klippy log. Maybe you can see more?
@gaolst
Thanks for your suggestion. Tried with MOVE=1 as well. But no luck
Try to add additional empty new line after “END_LASER” in your GCode, it’s possible that “END_LASER” command is ignored because it don’t have “Line Feed” or “Carriage Return” in the end of command.
YES! Thank you this has solved it. Just added an additional comment Line after the macro.
I’d think this is a pretty common source of error. Maybe the klipper gcode parser should be able to handle this. Or is there a reason for this behavior?