# Print\_end macro not working as desired

**URL:** https://klipper.discourse.group/t/print-end-macro-not-working-as-desired/23338
**Category:** General Discussion
**Created:** [May 8, 2025, 3:50pm UTC](https://klipper.discourse.group/t/print-end-macro-not-working-as-desired/23338 "2025-05-08T15:50:44Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![Credo](https://avatars.discourse-cdn.com/v4/letter/c/bb73d2/32.png) [@Credo](https://klipper.discourse.group/u/Credo)
#### Post date: [May 8, 2025, 3:50pm UTC](https://klipper.discourse.group/t/print-end-macro-not-working-as-desired/23338/1 "2025-05-08T15:50:44Z")

</div>

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

```auto
[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.

```

---

<div class="post-metadata">

### Author: ![EddyMI3D](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/eddymi3d/32/1981_2.png) [@EddyMI3D](https://klipper.discourse.group/u/EddyMI3D)
#### Post date: [May 8, 2025, 4:00pm UTC](https://klipper.discourse.group/t/print-end-macro-not-working-as-desired/23338/2 "2025-05-08T16:00:20Z")

</div>

AFAIK, Klipper does not support parameters with `M18` and `M84`

---

<div class="post-metadata">

### Author: ![Credo](https://avatars.discourse-cdn.com/v4/letter/c/bb73d2/32.png) [@Credo](https://klipper.discourse.group/u/Credo)
#### Post date: [May 8, 2025, 4:07pm UTC](https://klipper.discourse.group/t/print-end-macro-not-working-as-desired/23338/3 "2025-05-08T16:07:13Z")

</div>

It looks like they do:

 ![Screenshot 2025-05-08 at 10.06.38 AM](https://global.discourse-cdn.com/free1/uploads/klipper/original/3X/0/8/08390a47cb697ccf4086bc9aa365cb00c0d5cec1.png)

---

<div class="post-metadata">

### Author: ![EddyMI3D](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/eddymi3d/32/1981_2.png) [@EddyMI3D](https://klipper.discourse.group/u/EddyMI3D)
#### Post date: [May 8, 2025, 4:10pm UTC](https://klipper.discourse.group/t/print-end-macro-not-working-as-desired/23338/4 "2025-05-08T16:10:16Z")

</div>

Not quite:

 ![grafik](https://global.discourse-cdn.com/free1/uploads/klipper/original/3X/9/6/967070fe9f271946c0cd2bac88a3391366e23111.png)

---

<div class="post-metadata">

### Author: ![Credo](https://avatars.discourse-cdn.com/v4/letter/c/bb73d2/32.png) [@Credo](https://klipper.discourse.group/u/Credo)
#### Post date: [May 8, 2025, 4:20pm UTC](https://klipper.discourse.group/t/print-end-macro-not-working-as-desired/23338/5 "2025-05-08T16:20:26Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![3dcoded](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/3dcoded/32/20297_2.png) [@3dcoded](https://klipper.discourse.group/u/3dcoded)
#### Post date: [May 8, 2025, 4:29pm UTC](https://klipper.discourse.group/t/print-end-macro-not-working-as-desired/23338/6 "2025-05-08T16:29:22Z")

</div>

Hi @Credo ,

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

```auto
SET_STEPPER_ENABLE STEPPER=stepper_x ENABLE=0
SET_STEPPER_ENABLE STEPPER=stepper_y ENABLE=0
SET_STEPPER_ENABLE STEPPER=extruder ENABLE=0

```

---

<div class="post-metadata">

### Author: ![Credo](https://avatars.discourse-cdn.com/v4/letter/c/bb73d2/32.png) [@Credo](https://klipper.discourse.group/u/Credo)
#### Post date: [May 8, 2025, 6:02pm UTC](https://klipper.discourse.group/t/print-end-macro-not-working-as-desired/23338/7 "2025-05-08T18:02:24Z")

</div>

Thanks! I’ll give that a shot!

---

<div class="post-metadata">

### Author: ![flowerysong](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/flowerysong/32/10214_2.png) [@flowerysong](https://klipper.discourse.group/u/flowerysong)
#### Post date: [May 8, 2025, 7:07pm UTC](https://klipper.discourse.group/t/print-end-macro-not-working-as-desired/23338/8 "2025-05-08T19:07:56Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Credo](https://avatars.discourse-cdn.com/v4/letter/c/bb73d2/32.png) [@Credo](https://klipper.discourse.group/u/Credo)
#### Post date: [May 8, 2025, 9:16pm UTC](https://klipper.discourse.group/t/print-end-macro-not-working-as-desired/23338/9 "2025-05-08T21:16:15Z")

</div>

Are you referring to the “SET\_STEPPER\_ENABLE” commands?

---

<div class="post-metadata">

### Author: ![Sineos](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/sineos/32/18_2.png) [@Sineos](https://klipper.discourse.group/u/Sineos)
#### Post date: [May 9, 2025, 8:02am UTC](https://klipper.discourse.group/t/print-end-macro-not-working-as-desired/23338/10 "2025-05-09T08:02:31Z")

</div>

> **[G-Codes - Klipper documentation](https://www.klipper3d.org/G-Codes.html#set_stepper_enable)**

---

<div class="post-metadata">

### Author: ![system](https://global.discourse-cdn.com/free1/uploads/klipper/original/1X/64419bf2aac6639e6ef5cef200dcd456b0a01ac3.png) [@system](https://klipper.discourse.group/u/system)
#### Post date: [July 8, 2025, 8:03am UTC](https://klipper.discourse.group/t/print-end-macro-not-working-as-desired/23338/11 "2025-07-08T08:03:29Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
