-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathFIND_PROBE.cfg
61 lines (55 loc) · 1.66 KB
/
FIND_PROBE.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
[gcode_macro FIND_PROBE]
gcode:
{% set TRAVEL_Z = 50|int %}
{% set FOUND = False %}
# TRAVEL_Z is how far the Z axis will go down in mm, or by whatever is G0 movement in FIND_PROBE1
SET_KINEMATIC_POSITION
G91
G0 Z10
G90
G28 X
G28 Y
QUERY_PROBE
{% if not printer.probe.last_query %}
M118 Probe is already attached!
SET_KINEMATIC_POSITION Z=33.33
{% else %}
G90
G0 X47 Y356.5 F3500 ; Move directly over probe
G91
{% endif %}
{% if not FOUND %}
{% for i in range(TRAVEL_Z) if printer.probe.last_query%}
FIND_PROBE1
{% endfor %}
{% endif %}
FIND_PROBE2
#------------------------------------------------------------------------------
[gcode_macro FIND_PROBE1]
gcode:
QUERY_PROBE
{% if not printer.probe.last_query %}
M118 Made contact with probe!
{% else %}
SET_KINEMATIC_POSITION Z=1
G0 Z-1 F400
{% endif %}
#------------------------------------------------------------------------------
[gcode_macro FIND_PROBE2]
gcode:
QUERY_PROBE
{% if not printer.probe.last_query %}
{% set X_MID = printer.configfile.config["stepper_x"]["position_max"]|float / 2.0 %}
{% set Y_MID = printer.configfile.config["stepper_y"]["position_max"]|float / 2.0 %}
G91
G0 Z2
G90
G0 X100 Y356.5 F3500 ; Swipe to the side to free probe of cradle
G0 Z25 F800 ; Raise back up
error_if_probe_not_deployed ; Verify probe attached
G0 Y{Y_MID} X{X_MID} F3500
PROBE
G0 Z25
{% else %}
M118 No soup for you!
{% endif %}