-
Notifications
You must be signed in to change notification settings - Fork 0
/
homing.cfg
88 lines (68 loc) · 2.21 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
# Note you may need to add the following to your printer.cfg somewhere (without the comments of course) for the Kinematic position stuff below to work.
#[force_move]
#enable_force_move: True
[gcode_macro _HOME_X]
gcode:
# Home
{% set RUN_CURRENT_X = printer.configfile.settings['tmc2209 stepper_x'].run_current|float %}
{% set RUN_CURRENT_Y = printer.configfile.settings['tmc2209 stepper_y'].run_current|float %}
{% set HOME_CURRENT = 0.49 %}
SET_TMC_CURRENT STEPPER=stepper_x CURRENT={HOME_CURRENT}
SET_TMC_CURRENT STEPPER=stepper_y CURRENT={HOME_CURRENT}
SET_KINEMATIC_POSITION X=15
G91
G1 X-15 F1200
#G4 P2000
#M400 to finish all pending moves/process the buffer
M400
G28 X
# Move away
G91
G1 X-15 F1200
SET_TMC_CURRENT STEPPER=stepper_x CURRENT={RUN_CURRENT_X}
SET_TMC_CURRENT STEPPER=stepper_y CURRENT={RUN_CURRENT_Y}
[gcode_macro _HOME_Y]
gcode:
{% set RUN_CURRENT_X = printer.configfile.settings['tmc2209 stepper_x'].run_current|float %}
{% set RUN_CURRENT_Y = printer.configfile.settings['tmc2209 stepper_y'].run_current|float %}
{% set HOME_CURRENT = 0.49 %}
SET_TMC_CURRENT STEPPER=stepper_x CURRENT={HOME_CURRENT}
SET_TMC_CURRENT STEPPER=stepper_y CURRENT={HOME_CURRENT}
SET_KINEMATIC_POSITION Y=15
G91
G1 Y-15 F1200
#G4 P2000
#M400 to finish all pending moves/process the buffer
M400
# Home
G28 Y
# Move away
G91
G1 Y-15 F1200
# Wait just a second… (give StallGuard registers time to clear)
SET_TMC_CURRENT STEPPER=stepper_x CURRENT={RUN_CURRENT_X}
SET_TMC_CURRENT STEPPER=stepper_y CURRENT={RUN_CURRENT_Y}
[homing_override]
axes: xyz
gcode:
{% set home_all = 'X' not in params and 'Y' not in params and 'Z' not in params %}
SET_KINEMATIC_POSITION Z=1
G1 Z4 F1200
{% 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 %}
G90
G1 X150 Y150 F6600
G28 Z
G1 Z10 F1500
{% endif %}
[gcode_macro _CG28]
description: Homing only if necessary
gcode:
{% if "xyz" not in printer.toolhead.homed_axes %}
G28
{% endif %}