How do I stop the end print macro from clearing the homing state/turning off the motors?

The end macro always turns off the motors, can't find a setting to stop it doing that. Is there one?
Solution:
```[gcode_macro END_PRINT] description: End print procedure, use this in your Slicer. gcode: # reset is_printing_gcode state SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=is_printing_gcode VALUE=False...
Jump to solution
10 Replies
TheTik
TheTik3w ago
You'd have to override the END_PRINT macro
blacksmithforlife
what is the reason you want it to not turn the steppers off? They will continue to consume power just sitting there doing nothing
TheTik
TheTik3w ago
From the title I'm guessing they don't want to lose home for some reason
Toomy~
Toomy~OP3w ago
Yeah I find it annoying to loose home. Especially when I have to stop a print because of a first layer, and then wait ages to get it going again as it does the whole dance. I'm always by my printer so once I'm actually done and don't need home anymore I'll disable them. As in override the main END_PRINT macro, not one of the user ones? I assume that means I need to copy all the special bits out of it for moving to the correct position?
TheTik
TheTik3w ago
Correct, as the end_print macro explicitly turns the motors off
Solution
TheTik
TheTik3w ago
[gcode_macro END_PRINT]
description: End print procedure, use this in your Slicer.
gcode:
# reset is_printing_gcode state
SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=is_printing_gcode VALUE=False

# Save gcode state
SAVE_GCODE_STATE NAME=end_print_state
{% if printer["dual_carriage"] is defined %}
# reset swapped toolheads mode
SET_GCODE_VARIABLE MACRO=_IDEX_REMAP_TOOLHEADS VARIABLE=enabled VALUE=False
# reset spool join mode
SET_GCODE_VARIABLE MACRO=_IDEX_JOIN_SPOOLS VARIABLE=enabled VALUE=False
# reset object xoffset
{% if printer["gcode_macro RatOS"].auto_center_subject|default(false)|lower == 'true' %}
{% set object_xoffset = printer["gcode_macro START_PRINT"].object_xoffset|default(0)|float %}
RATOS_ECHO MSG="Adjusting object x-offset by {(0-object_xoffset)} mm"
SET_GCODE_OFFSET X_ADJUST={(0-object_xoffset)}
{% endif %}
{% endif %}

# run end print macros
_USER_END_PRINT_BEFORE_HEATERS_OFF { rawparams }
_END_PRINT_BEFORE_HEATERS_OFF
TURN_OFF_HEATERS
_USER_END_PRINT_AFTER_HEATERS_OFF { rawparams }
_END_PRINT_AFTER_HEATERS_OFF
_USER_END_PRINT_PARK { rawparams }
_END_PRINT_PARK

# Clear skew profile if any was loaded.
{% if printer["gcode_macro RatOS"].skew_profile is defined %}
SET_SKEW CLEAR=1
{% endif %}

# turn motors off for non idex printers
{% if printer["dual_carriage"] is not defined and printer["gcode_macro RatOS"].end_print_motors_off|lower != 'false' %}
# DEFAULT
M84
{% endif %}

# Part cooling fan off
M107

# Clear bed mesh so that G28 doesn't fail.
BED_MESH_CLEAR
RATOS_ECHO MSG="Done :)"

# restore gcode state
RESTORE_GCODE_STATE NAME=end_print_state

# turn motors off for idex printers
{% if printer["dual_carriage"] is defined %}
# IDEX
# for the IDEX we must do this after RESTORE_GCODE_STATE
M84
{% endif %}

# reset nozzle thermal expansion offset
{% if printer.configfile.settings.beacon is defined %}
{% if printer["dual_carriage"] is not defined %}
# beacon config
{% set beacon_contact_start_print_true_zero = true if printer["gcode_macro RatOS"].beacon_contact_start_print_true_zero|default(false)|lower == 'true' else false %}
{% set beacon_contact_expansion_compensation = true if printer["gcode_macro RatOS"].beacon_contact_expansion_compensation|default(false)|lower == 'true' else false %}
{% if beacon_contact_start_print_true_zero and beacon_contact_expansion_compensation %}
SET_GCODE_OFFSET Z=0 MOVE=0
{% endif %}
{% endif %}
_BEACON_SET_NOZZLE_TEMP_OFFSET RESET=True
{% endif %}

# restore toolhead settings
RESTORE_TOOLHEAD_SETTINGS KEY="start_print"

# chamber filter control
_CHAMBER_FILTER_ON AT="print_end"
_CHAMBER_FILTER_OFF

# chamber heater control
_CHAMBER_HEATER_OFF

_USER_END_PRINT_FINISHED { rawparams }
[gcode_macro END_PRINT]
description: End print procedure, use this in your Slicer.
gcode:
# reset is_printing_gcode state
SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=is_printing_gcode VALUE=False

# Save gcode state
SAVE_GCODE_STATE NAME=end_print_state
{% if printer["dual_carriage"] is defined %}
# reset swapped toolheads mode
SET_GCODE_VARIABLE MACRO=_IDEX_REMAP_TOOLHEADS VARIABLE=enabled VALUE=False
# reset spool join mode
SET_GCODE_VARIABLE MACRO=_IDEX_JOIN_SPOOLS VARIABLE=enabled VALUE=False
# reset object xoffset
{% if printer["gcode_macro RatOS"].auto_center_subject|default(false)|lower == 'true' %}
{% set object_xoffset = printer["gcode_macro START_PRINT"].object_xoffset|default(0)|float %}
RATOS_ECHO MSG="Adjusting object x-offset by {(0-object_xoffset)} mm"
SET_GCODE_OFFSET X_ADJUST={(0-object_xoffset)}
{% endif %}
{% endif %}

# run end print macros
_USER_END_PRINT_BEFORE_HEATERS_OFF { rawparams }
_END_PRINT_BEFORE_HEATERS_OFF
TURN_OFF_HEATERS
_USER_END_PRINT_AFTER_HEATERS_OFF { rawparams }
_END_PRINT_AFTER_HEATERS_OFF
_USER_END_PRINT_PARK { rawparams }
_END_PRINT_PARK

# Clear skew profile if any was loaded.
{% if printer["gcode_macro RatOS"].skew_profile is defined %}
SET_SKEW CLEAR=1
{% endif %}

# turn motors off for non idex printers
{% if printer["dual_carriage"] is not defined and printer["gcode_macro RatOS"].end_print_motors_off|lower != 'false' %}
# DEFAULT
M84
{% endif %}

# Part cooling fan off
M107

# Clear bed mesh so that G28 doesn't fail.
BED_MESH_CLEAR
RATOS_ECHO MSG="Done :)"

# restore gcode state
RESTORE_GCODE_STATE NAME=end_print_state

# turn motors off for idex printers
{% if printer["dual_carriage"] is defined %}
# IDEX
# for the IDEX we must do this after RESTORE_GCODE_STATE
M84
{% endif %}

# reset nozzle thermal expansion offset
{% if printer.configfile.settings.beacon is defined %}
{% if printer["dual_carriage"] is not defined %}
# beacon config
{% set beacon_contact_start_print_true_zero = true if printer["gcode_macro RatOS"].beacon_contact_start_print_true_zero|default(false)|lower == 'true' else false %}
{% set beacon_contact_expansion_compensation = true if printer["gcode_macro RatOS"].beacon_contact_expansion_compensation|default(false)|lower == 'true' else false %}
{% if beacon_contact_start_print_true_zero and beacon_contact_expansion_compensation %}
SET_GCODE_OFFSET Z=0 MOVE=0
{% endif %}
{% endif %}
_BEACON_SET_NOZZLE_TEMP_OFFSET RESET=True
{% endif %}

# restore toolhead settings
RESTORE_TOOLHEAD_SETTINGS KEY="start_print"

# chamber filter control
_CHAMBER_FILTER_ON AT="print_end"
_CHAMBER_FILTER_OFF

# chamber heater control
_CHAMBER_HEATER_OFF

_USER_END_PRINT_FINISHED { rawparams }
TheTik
TheTik3w ago
That's the whole macro, look at lines 36-40
blacksmithforlife
https://github.com/Rat-OS/RatOS-configuration/blob/v2.1.x/macros.cfg#L1230-L1234 you define the macro again in your printer.cfg without the highlighted lines
Toomy~
Toomy~OP3w ago
Cool, is there an appropriate place to do feature requests for RatOS? Personally I feel this should be one of the configuration options, as needing to copy that whole function out (meaning you won't get updates made to it in future versions) seems overkill. I see the GH has issues enabled, so I assume that's the right place?
TheTik
TheTik3w ago
yep, you can do a PR there

Did you find this page helpful?