v2.4: update macros, add Y parameter to PARK

This commit is contained in:
Konstantin Koslowski 2021-10-16 19:51:22 +02:00
parent b8638e4535
commit bbe58d0642

View file

@ -17,7 +17,7 @@ gcode:
description: Change filament
gcode:
SAVE_GCODE_STATE NAME=M600_state
PAUSE
PAUSE Y=15
M117 > change filament
RESTORE_GCODE_STATE NAME=M600_state
@ -44,12 +44,15 @@ gcode:
[gcode_macro PARK]
gcode:
{% set Y=params.Y|default(295) %}
{% if "xyz" in printer.toolhead.homed_axes %}
# set park positon for x and y
## close to max
{% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %}
## close to min
{% set y_park = printer.toolhead.axis_minimum.y|float + 5.0 %}
{% set y_park = printer.toolhead.axis_maximum.y|float - 5.0 %}
{% if Y != y_park %}
{% set y_park = Y %}
{% endif %}
# calculate save lift position
{% set max_z = printer.toolhead.axis_maximum.z|float %}
{% set act_z = printer.toolhead.position.z|float %}
@ -73,19 +76,20 @@ rename_existing: PAUSE_BASE
# 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 %}
# end of definitions
M117 > pause
PAUSE_BASE
{% if printer.extruder.can_extrude|lower == 'true' %}
G91
G1 E-{E} F2100
G90
{% else %}
{action_respond_info("Extruder not hot enough")}
{% endif %}
PARK
{% set Y=params.Y|default(295) %}
# read E from pause macro
{% set E = printer["gcode_macro PAUSE"].extrude|float %}
# end of definitions
M117 > pause
PAUSE_BASE
{% if printer.extruder.can_extrude|lower == 'true' %}
G91
G1 E-{E} F2100
G90
{% else %}
{action_respond_info("Extruder not hot enough")}
{% endif %}
PARK Y={Y}
[gcode_macro RESUME]