Skip to content
This repository has been archived by the owner on Jul 7, 2021. It is now read-only.

Commit

Permalink
chore: update macros to include comments
Browse files Browse the repository at this point in the history
Signed-off-by: Craig Bassett <[email protected]>
  • Loading branch information
cadriel committed Apr 29, 2021
1 parent d543347 commit 1db5118
Showing 1 changed file with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,38 @@ gcode:

[gcode_macro PAUSE]
rename_existing: BASE_PAUSE
default_parameter_E: 1.7
# change this if you need more or less extrusion
variable_extrude: 1.0
gcode:
##### read E from pause macro #####
{% set E = printer["gcode_macro PAUSE"].extrude|float %}
##### set park positon for x and y #####
# default is your max posion from your printer.cfg
{% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %}
{% set y_park = printer.toolhead.axis_maximum.y|float - 5.0 %}
##### calculate save lift position #####
{% set max_z = printer.toolhead.axis_maximum.z|float %}
{% set act_z = printer.toolhead.position.z|float %}
{% if act_z < (max_z - 2.0) %}
{% set z_safe = 2.0 %}
{% else %}
{% set z_safe = max_z - act_z %}
{% endif %}
##### end of definitions #####
SAVE_GCODE_STATE NAME=PAUSE_state
BASE_PAUSE
G91
G1 E-{E} F2100
G1 Z{z_safe} F900
G90
G0 X{x_park} Y{y_park} F6000
G91
G1 X{x_park} Y{y_park} F6000

[gcode_macro RESUME]
rename_existing: BASE_RESUME
default_parameter_E: 1.7
gcode:
##### read E from pause macro #####
{% set E = printer["gcode_macro PAUSE"].extrude|float %}
##### end of definitions #####
G91
G1 E{E} F2100
RESTORE_GCODE_STATE NAME=PAUSE_state
Expand Down

0 comments on commit 1db5118

Please sign in to comment.