-
Notifications
You must be signed in to change notification settings - Fork 102
/
park_macro.cfg
20 lines (19 loc) · 1015 Bytes
/
park_macro.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# You can specify the park_pos variable manually if you do not want
# to use a _USER_VARIABLE macro, The set statement would look like:
# {% set park_pos = {'x': val, 'y': val, 'z': val} %}
# e.g.
# {% set park_pos = {'x': 175.0, 'y': 25.0, 'z': 30.0 } %}
[gcode_macro PARK]
description: Park head depending on parameter P
gcode:
{% if params.P and params.P|lower is not in ['bed','center','front','frontlow','rear'] %}
{action_respond_info("\"PARK P=%s\" not valid use P=[BED,CENTER,FRONT,FRONTLOW,REAR]
Default position BED will be used" % params.P|upper)}
{% else %}
{% set user = printer['gcode_macro _USER_VARIABLE'] %}
{% set pos = params.P|default('bed')|lower %}
_CG28 ; home if not already homed
G90 ; absolute positioning
G0 X{user.park[pos].x} Y{user.park[pos].y} Z{user.park[pos].z} F{user.speed.travel}
{% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %} ; set back to relative
{% endif %}