forked from Desuuuu/klipper-macros
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathG27.cfg
29 lines (26 loc) · 826 Bytes
/
G27.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
[gcode_macro G27]
gcode:
{% set default_x = printer.toolhead.axis_minimum.x + 20 %}
{% set default_y = printer.toolhead.axis_minimum.y + 20 %}
{% if 'save_variables' in printer %}
{% set svv = printer.save_variables.variables %}
{% if 'park_x' in svv %}
{% set default_x = svv.park_x %}
{% endif %}
{% if 'park_y' in svv %}
{% set default_y = svv.park_y %}
{% endif %}
{% endif %}
{% set x = params.X|default(default_x)|float %}
{% set y = params.Y|default(default_y)|float %}
{% set z = params.Z|default(20)|float %}
{% if printer.toolhead.homed_axes != "xyz" %}
{action_respond_info("Please home XYZ first")}
{% else %}
SAVE_GCODE_STATE NAME=G27_state
G91
G1 Z{z}
G90
G1 X{x} Y{y} F3000
RESTORE_GCODE_STATE NAME=G27_state MOVE=0
{% endif %}