-
Notifications
You must be signed in to change notification settings - Fork 0
/
homing.cfg
110 lines (94 loc) · 3.17 KB
/
homing.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#==============================================================================
# Homing & Z-Tilt
#==============================================================================
[homing_override]
axes: xyz
gcode:
# Move build plate down to avoid collision with bed
SET_KINEMATIC_POSITION Z=0.0
G91
G1 Z25 F1500
M400
{% set home_all = 'X' not in params and 'Y' not in params and 'Z' not in params %}
{% if home_all or 'X' in params %}
_HOME_X
{% endif %}
{% if home_all or 'Y' in params %}
_HOME_Y
{% endif %}
{% if home_all or 'Z' in params %}
# Move over center of bed
G90
G1 X150 Y150 F4000
G28 Z
G1 Z20
M400
G90
{% endif %}
[z_tilt]
z_positions:
-50, 18
150, 348
350, 18
points:
30, 5
150, 245
270, 5
speed: 200
horizontal_move_z: 10
retries: 5
retry_tolerance: 0.01
[gcode_macro _HOME_X]
description: Sensorless homing routine for the X-Axis.
gcode:
# Cache configured stepper run current and define homing run current
{% set RUN_CUR_X = printer.configfile.settings['tmc2209 stepper_x'].run_current %}
{% set RUN_CUR_Y = printer.configfile.settings['tmc2209 stepper_y'].run_current %}
{% set HOME_CUR = 0.400 %}
{% set DEFAULT_ACCEL = printer.configfile.settings['printer'].max_accel %}
{% set DEFAULT_ACCEL_TO_DECEL = printer.configfile.settings['printer'].max_accel_to_decel %}
# Set current for sensorless homing
SET_TMC_CURRENT STEPPER=stepper_x CURRENT={HOME_CUR}
SET_TMC_CURRENT STEPPER=stepper_y CURRENT={HOME_CUR}
SET_VELOCITY_LIMIT ACCEL=500 ACCEL_TO_DECEL=250
G4 P1000
# Home
G28 X0
# Move away and wait for stall flag to clear
G4 P2500
G91
G1 X-10 F1200
# Restore run current and acceleration
SET_TMC_CURRENT STEPPER=stepper_x CURRENT={RUN_CUR_X}
SET_TMC_CURRENT STEPPER=stepper_y CURRENT={RUN_CUR_Y}
SET_VELOCITY_LIMIT ACCEL={DEFAULT_ACCEL} ACCEL_TO_DECEL={DEFAULT_ACCEL_TO_DECEL}
G4 P1000
[gcode_macro _HOME_Y]
description: Sensorless homing routine for the Y-Axis.
gcode:
# Cache configured stepper run current and define homing run current
{% set RUN_CUR_X = printer.configfile.settings['tmc2209 stepper_x'].run_current %}
{% set RUN_CUR_Y = printer.configfile.settings['tmc2209 stepper_y'].run_current %}
{% set HOME_CUR = 0.400 %}
{% set DEFAULT_ACCEL = printer.configfile.settings['printer'].max_accel %}
{% set DEFAULT_ACCEL_TO_DECEL = printer.configfile.settings['printer'].max_accel_to_decel %}
# Set current for sensorless homing
SET_TMC_CURRENT STEPPER=stepper_x CURRENT={HOME_CUR}
SET_TMC_CURRENT STEPPER=stepper_y CURRENT={HOME_CUR}
SET_VELOCITY_LIMIT ACCEL=500 ACCEL_TO_DECEL=250
G4 P1000
# Home
G28 Y0
# Move away and wait for stall flag to clear
G4 P2500
G91
G1 Y-10 F1200
# Restore run current and acceleration
SET_TMC_CURRENT STEPPER=stepper_x CURRENT={RUN_CUR_X}
SET_TMC_CURRENT STEPPER=stepper_y CURRENT={RUN_CUR_Y}
SET_VELOCITY_LIMIT ACCEL={DEFAULT_ACCEL} ACCEL_TO_DECEL={DEFAULT_ACCEL_TO_DECEL}
G4 P1000
# [safe_z_home]
# home_xy_position: 150,150
# speed: 84.0
# z_hop: 0