Created
May 13, 2022 20:35
-
-
Save NameOfTheDragon/12287b3d388646b82be6a5b38c8fcf97 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[gcode_macro PAUSE] | |
rename_existing: BASE_PAUSE | |
gcode: | |
{% set RetractionDistance = params.E | default(1.7) | float %} | |
LED_PAUSED | |
{% set x_park = printer.toolhead.axis_minimum.x|float + 5.0 %} | |
{% set y_park = printer.toolhead.axis_maximum.y|float - 15.0 %} | |
{% set max_z = printer.toolhead.axis_maximum.z|float %} | |
{% set act_z = printer.toolhead.position.z|float %} | |
{% if act_z < (max_z - 40) %} | |
{% set z_safe = 40 %} | |
{% else %} | |
{% set z_safe = max_z - act_z %} | |
{% endif %} | |
SAVE_GCODE_STATE NAME=PAUSE_state | |
BASE_PAUSE | |
G91 | |
G1 E-{RetractionDistance} F2100 | |
G1 Z{z_safe} F900 | |
G90 | |
G0 X{x_park} Y{y_park} F6000 | |
[gcode_macro RESUME] | |
rename_existing: BASE_RESUME | |
gcode: | |
{% set RetractionDistance = params.E | default(1.7) | float %} | |
LED_PRINTING | |
G91 | |
G1 E{RetractionDistance} F2100 | |
RESTORE_GCODE_STATE NAME=PAUSE_state | |
BASE_RESUME |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment