Print_end macro not working as desired

Hello all,

I’m very new to macros and macro building. I’ve currently got a very simple print_end macro, but it’s not working exactly as I wanted.

Essentially, the original macro would send a M84 disabling all motors. I wanted to replace it with an M18 X Y E0, so the bed motors would remain engaged. That’s not working. Am I missing something? Any help would be greatly appreciated. Thank you all in advance

[gcode_macro PRINT_END]
# The end_print macro is also called from CANCEL_PRINT.
gcode:
  #SAVE_GCODE_STATE NAME=end_print_state
  M104 S0 ;extruder heater off
  M140 S0 ;heated bed heater off
  G91 ;relative positioning
  G1 Z10 E-2 F3600  ;retract the filament a bit before lifting the nozzle.
  G1 E-2 F3600 ;retract filament even more
  G90 ;absolute positioning
  G0 X5 Y320 ; Park in the back
  M18 X Y E0 ;disable all motors except Z
  M107 ; part cooling fan off
  M117 Done.

AFAIK, Klipper does not support parameters with M18 and M84

It looks like they do:

Not quite:

1 Like

LOL. “Always read the fine print!”

Is there another way of performing this action? Maybe move the bed down 1mm after the motors are disabled? Problem with that is as soon as the motors are disabled, they need to be re-homed. Can I force a Z movement without homing?

Hi @Credo ,

To disable XYE motors, but leave Z activated, you can use:

SET_STEPPER_ENABLE STEPPER=stepper_x ENABLE=0
SET_STEPPER_ENABLE STEPPER=stepper_y ENABLE=0
SET_STEPPER_ENABLE STEPPER=extruder ENABLE=0
1 Like

Thanks! I’ll give that a shot!

Bearing in mind the documentation:

This is a diagnostic and debugging tool and must be used with care. Disabling an axis motor does not reset the homing information. Manually moving a disabled stepper may cause the machine to operate the motor outside of safe limits. This can lead to damage to axis components, hot ends, and print surface.

3 Likes

Are you referring to the “SET_STEPPER_ENABLE” commands?