-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathchameleon.cfg
263 lines (239 loc) · 7.1 KB
/
chameleon.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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
#S6
[tmc2209 manual_stepper selector]
uart_pin:
uart_address:
run_current: 0.3
stealthchop_threshold: 0
#S7
[tmc2209 manual_stepper chameleon]
uart_pin:
uart_address:
run_current: 0.8
stealthchop_threshold: 0
#S6
[manual_stepper selector]
step_pin:
dir_pin:
microsteps: 1
rotation_distance: 2
#S7
[manual_stepper chameleon]
step_pin:
dir_pin:
microsteps: 16
rotation_distance: 34.408602151 # reverse computed from the ESteps value
[gcode_macro TOOL_INIT]
description: homes the tool selector. Needed before any tool change.
variable_tool: 0
variable_ysplit_distance: 600
variable_chameleon_speed: 300
variable_chameleon_acc:100
gcode:
MANUAL_STEPPER STEPPER=selector SET_POSITION=0
MANUAL_STEPPER STEPPER=selector MOVE=-1.65
MANUAL_STEPPER STEPPER=selector SET_POSITION=0
MANUAL_STEPPER STEPPER=selector MOVE=0.12
MANUAL_STEPPER STEPPER=selector SET_POSITION=0
MANUAL_STEPPER STEPPER=chameleon SET_POSITION=0
# Set the tool to position T0
SET_GCODE_VARIABLE MACRO=TOOL_INIT VARIABLE=tool VALUE=0
[gcode_macro WIPE]
# assumes we're already parked.
gcode:
G1 X170 F8000
G1 X250
G1 X170
G1 X250
[gcode_macro TS0]
gcode:
TOOL_SELECT TOOL=0
[gcode_macro TS1]
gcode:
TOOL_SELECT TOOL=1
[gcode_macro TS2]
gcode:
TOOL_SELECT TOOL=2
[gcode_macro TS3]
gcode:
TOOL_SELECT TOOL=3
[gcode_macro TOOL_SELECT]
gcode:
{% set TOOL = params.TOOL|int %}
M117 "Setting tool to TOOL{TOOL}"
{% if TOOL == 0 %}
MANUAL_STEPPER stepper=selector MOVE=0
{% elif TOOL == 1 %}
MANUAL_STEPPER stepper=selector MOVE=0.5
{% elif TOOL == 2 %}
MANUAL_STEPPER stepper=selector MOVE=1.0
{% elif TOOL == 3 %}
MANUAL_STEPPER stepper=selector MOVE=1.5
{% endif %}
SET_GCODE_VARIABLE MACRO=TOOL_INIT VARIABLE=tool VALUE={TOOL}
[gcode_macro TOOL_FREE]
gcode:
{% set TOOL = params.TOOL|int %}
M117 "Free filament path for tool {TOOL}"
{% if TOOL == 0 %}
MANUAL_STEPPER stepper=selector MOVE=1
{% elif TOOL == 1 %}
MANUAL_STEPPER stepper=selector MOVE=1.5
{% elif TOOL == 2 %}
MANUAL_STEPPER stepper=selector MOVE=0
{% elif TOOL == 3 %}
MANUAL_STEPPER stepper=selector MOVE=0.5
{% endif %}
[gcode_macro CHAMELEON_UNLOAD]
description: Unloads the filament from the tubing
gcode:
{% set TOOL=printer["gcode_macro TOOL_INIT"].tool %}
{% set YSPLIT_DIST=printer["gcode_macro TOOL_INIT"].ysplit_distance %}
{% set SPEED=printer["gcode_macro TOOL_INIT"].chameleon_speed %}
{% set ACC=printer["gcode_macro TOOL_INIT"].chameleon_acc %}
MANUAL_STEPPER STEPPER=chameleon SET_POSITION=0
{% if TOOL == 0 or TOOL == 1 %}
M117 "Move tool {TOOL} by -{YSPLIT_DIST}"
MANUAL_STEPPER stepper=chameleon MOVE=-{YSPLIT_DIST} SPEED={SPEED} ACCEL={ACC}
MANUAL_STEPPER STEPPER=chameleon SET_POSITION=0
MANUAL_STEPPER stepper=chameleon MOVE=-{YSPLIT_DIST} SPEED={SPEED} ACCEL={ACC}
{% else %}
M117 "Move tool {TOOL} by {YSPLIT_DIST}"
MANUAL_STEPPER stepper=chameleon MOVE={YSPLIT_DIST} SPEED={SPEED} ACCEL={ACC}
MANUAL_STEPPER STEPPER=chameleon SET_POSITION=0
MANUAL_STEPPER stepper=chameleon MOVE={YSPLIT_DIST} SPEED={SPEED} ACCEL={ACC}
{% endif %}
[gcode_macro CHAMELEON_LOAD]
description: Loads the filament into the extruder bowden
gcode:
{% set TOOL=printer["gcode_macro TOOL_INIT"].tool %}
{% set YSPLIT_DIST=printer["gcode_macro TOOL_INIT"].ysplit_distance %}
{% set SPEED=printer["gcode_macro TOOL_INIT"].chameleon_speed %}
{% set ACC=printer["gcode_macro TOOL_INIT"].chameleon_acc %}
MANUAL_STEPPER STEPPER=chameleon SET_POSITION=0
{% if TOOL == 0 or TOOL == 1 %}
M117 "Move tool {TOOL} by {YSPLIT_DIST}"
MANUAL_STEPPER stepper=chameleon MOVE={YSPLIT_DIST} SPEED={SPEED} ACCEL={ACC}
MANUAL_STEPPER STEPPER=chameleon SET_POSITION=0
MANUAL_STEPPER stepper=chameleon MOVE={YSPLIT_DIST} SPEED={SPEED} ACCEL={ACC}
MANUAL_STEPPER STEPPER=chameleon SET_POSITION=0
{% else %}
M117 "Move tool {TOOL} by -{YSPLIT_DIST}"
MANUAL_STEPPER stepper=chameleon MOVE=-{YSPLIT_DIST} SPEED={SPEED} ACCEL={ACC}
MANUAL_STEPPER STEPPER=chameleon SET_POSITION=0
MANUAL_STEPPER stepper=chameleon MOVE=-{YSPLIT_DIST} SPEED={SPEED} ACCEL={ACC}
MANUAL_STEPPER STEPPER=chameleon SET_POSITION=0
{% endif %}
G92 E0
[gcode_macro EXTRUDER_UNLOAD]
description: Unloads the filament from the extruder before a tool change
gcode:
G92 E0
G1 E-2 F300
G1 E-98 F3000
G92 E0
[gcode_macro EXTRUDER_LOAD]
description: Loads the filament in the extruder after a tool change
gcode:
G92 E0
G1 E98 F3000
G1 E105 F300
G92 E0
[gcode_macro T0]
description: Changes the filament to that loaded in tool 0
gcode:
# fetch current tool
{% set TOOL= printer["gcode_macro TOOL_INIT"].tool %}
{% set YSPLIT_DIST=printer["gcode_macro TOOL_INIT"].ysplit_distance %}
# Pause the print
PAUSE
{% if TOOL != 0 %}
EXTRUDER_UNLOAD
TOOL_SELECT TOOL={TOOL}
CHAMELEON_UNLOAD
{% endif %}
# Select the new tool
{% set TOOL=0 %}
SET_GCODE_VARIABLE MACRO=TOOL_INIT VARIABLE=tool VALUE={TOOL}
TOOL_SELECT TOOL={TOOL}
CHAMELEON_LOAD
# clear the path for the filament in the selector
TOOL_FREE TOOL={TOOL}
EXTRUDER_LOAD
# wipe the nozzle a couple of times
WIPE
# continue printing
RESUME
[gcode_macro T1]
description: Changes the filament to that loaded in tool 1
gcode:
# fetch current tool
{% set TOOL= printer["gcode_macro TOOL_INIT"].tool %}
{% set YSPLIT_DIST=printer["gcode_macro TOOL_INIT"].ysplit_distance %}
# Pause the print
{% if TOOL != 1 %}
EXTRUDER_UNLOAD
TOOL_SELECT TOOL={TOOL}
CHAMELEON_UNLOAD
{% endif %}
# Select the new tool
{% set TOOL=1 %}
SET_GCODE_VARIABLE MACRO=TOOL_INIT VARIABLE=tool VALUE={TOOL}
TOOL_SELECT TOOL={TOOL}
CHAMELEON_LOAD
# clear the path for the filament in the selector
TOOL_FREE TOOL={TOOL}
EXTRUDER_LOAD
# wipe the nozzle a couple of times
WIPE
# continue printing
RESUME
[gcode_macro T2]
description: Changes the filament to that loaded in tool 2
gcode:
# fetch current tool
{% set TOOL= printer["gcode_macro TOOL_INIT"].tool %}
{% set YSPLIT_DIST=printer["gcode_macro TOOL_INIT"].ysplit_distance %}
# Pause the print
PAUSE
{% if TOOL != 2 %}
EXTRUDER_UNLOAD
TOOL_SELECT TOOL={TOOL}
CHAMELEON_UNLOAD
{% endif %}
# Select the new tool
{% set TOOL=2 %}
SET_GCODE_VARIABLE MACRO=TOOL_INIT VARIABLE=tool VALUE={TOOL}
TOOL_SELECT TOOL={TOOL}
CHAMELEON_LOAD
# clear the path for the filament in the selector
TOOL_FREE TOOL={TOOL}
EXTRUDER_LOAD
# wipe the nozzle a couple of times
WIPE
# continue printing
RESUME
[gcode_macro T3]
description: Changes the filament to that loaded in tool 2
gcode:
# fetch current tool
{% set TOOL= printer["gcode_macro TOOL_INIT"].tool %}
{% set YSPLIT_DIST=printer["gcode_macro TOOL_INIT"].ysplit_distance %}
# Pause the print
PAUSE
{% if TOOL != 0 %}
EXTRUDER_UNLOAD
TOOL_SELECT TOOL={TOOL}
CHAMELEON_UNLOAD
{% endif %}
# Select the new tool
{% set TOOL=3 %}
TOOL_SELECT TOOL={TOOL}
SET_GCODE_VARIABLE MACRO=TOOL_INIT VARIABLE=tool VALUE={TOOL}
CHAMELEON_LOAD
# clear the path for the filament in the selector
TOOL_FREE TOOL={TOOL}
EXTRUDER_LOAD
# wipe the nozzle a couple of times
WIPE
# continue printing
RESUME