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 description: Change filament
gcode: gcode:
SAVE_GCODE_STATE NAME=M600_state SAVE_GCODE_STATE NAME=M600_state
PAUSE PAUSE Y=15
M117 > change filament M117 > change filament
RESTORE_GCODE_STATE NAME=M600_state RESTORE_GCODE_STATE NAME=M600_state
@ -44,12 +44,15 @@ gcode:
[gcode_macro PARK] [gcode_macro PARK]
gcode: gcode:
{% set Y=params.Y|default(295) %}
{% if "xyz" in printer.toolhead.homed_axes %} {% if "xyz" in printer.toolhead.homed_axes %}
# set park positon for x and y # set park positon for x and y
## close to max ## close to max
{% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %} {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %}
## close to min {% set y_park = printer.toolhead.axis_maximum.y|float - 5.0 %}
{% set y_park = printer.toolhead.axis_minimum.y|float + 5.0 %} {% if Y != y_park %}
{% set y_park = Y %}
{% endif %}
# calculate save lift position # calculate save lift position
{% set max_z = printer.toolhead.axis_maximum.z|float %} {% set max_z = printer.toolhead.axis_maximum.z|float %}
{% set act_z = printer.toolhead.position.z|float %} {% set act_z = printer.toolhead.position.z|float %}
@ -73,6 +76,7 @@ rename_existing: PAUSE_BASE
# change this if you need more or less extrusion # change this if you need more or less extrusion
variable_extrude: 1.0 variable_extrude: 1.0
gcode: gcode:
{% set Y=params.Y|default(295) %}
# read E from pause macro # read E from pause macro
{% set E = printer["gcode_macro PAUSE"].extrude|float %} {% set E = printer["gcode_macro PAUSE"].extrude|float %}
# end of definitions # end of definitions
@ -85,7 +89,7 @@ gcode:
{% else %} {% else %}
{action_respond_info("Extruder not hot enough")} {action_respond_info("Extruder not hot enough")}
{% endif %} {% endif %}
PARK PARK Y={Y}
[gcode_macro RESUME] [gcode_macro RESUME]