-
Notifications
You must be signed in to change notification settings - Fork 0
/
ercf_software.cfg
310 lines (260 loc) · 14.3 KB
/
ercf_software.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
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
[save_variables]
filename: /home/pi/printer_data/config/ercf_vars.cfg
########################################################################
# Tool change macros
# variable 'standalone' selects slicer based tip creation ro tip formation
# created by the _ERCF_FORM_TIP_STANDALONE macro below. Whilst the two
# are similar in theory, using macro based is easier to setup and maintain.
# It also allows for logic to leverage a purging system and turn off the
# slicer wipe tower.
# 0 = Slicer forms tips
# 1 = Macro forms tips (or hybrid e.g. SS ramming and macro tip forming)
#######################################################################
[gcode_macro T0]
variable_standalone = 1 # 0 slicer, 1 Happy Hare macro (turn off in slicer)
gcode:
ERCF_CHANGE_TOOL TOOL=0 STANDALONE={printer['gcode_macro T0']['standalone']}
[gcode_macro T1]
gcode:
ERCF_CHANGE_TOOL TOOL=1 STANDALONE={printer['gcode_macro T0']['standalone']}
[gcode_macro T2]
gcode:
ERCF_CHANGE_TOOL TOOL=2 STANDALONE={printer['gcode_macro T0']['standalone']}
[gcode_macro T3]
gcode:
ERCF_CHANGE_TOOL TOOL=3 STANDALONE={printer['gcode_macro T0']['standalone']}
[gcode_macro T4]
gcode:
ERCF_CHANGE_TOOL TOOL=4 STANDALONE={printer['gcode_macro T0']['standalone']}
[gcode_macro T5]
gcode:
ERCF_CHANGE_TOOL TOOL=5 STANDALONE={printer['gcode_macro T0']['standalone']}
[gcode_macro T6]
gcode:
ERCF_CHANGE_TOOL TOOL=6 STANDALONE={printer['gcode_macro T0']['standalone']}
[gcode_macro T7]
gcode:
ERCF_CHANGE_TOOL TOOL=7 STANDALONE={printer['gcode_macro T0']['standalone']}
[gcode_macro T8]
gcode:
ERCF_CHANGE_TOOL TOOL=8 STANDALONE={printer['gcode_macro T0']['standalone']}
# Increase or reduce this list to match your number of tools
########################################################################
# Simplified subset of commands For visability in Mainsail/Fluidd UI
########################################################################
[gcode_macro ERCF__EJECT]
gcode: ERCF_EJECT
[gcode_macro ERCF__UNLOCK]
gcode: ERCF_UNLOCK
[gcode_macro ERCF__HOME]
gcode:
{% set TOOL = params.TOOL|default(0)|int %}
{% set FORCE_UNLOAD = params.FORCE_UNLOAD|default(0)|int %}
ERCF_HOME TOOL={TOOL} FORCE_UNLOAD={FORCE_UNLOAD}
[gcode_macro ERCF__STATUS]
gcode: ERCF_STATUS
[gcode_macro ERCF__MOTORS_OFF]
gcode: ERCF_MOTORS_OFF
[gcode_macro ERCF__SERVO_UP]
gcode: ERCF_SERVO_UP
[gcode_macro ERCF__SERVO_DOWN]
gcode: ERCF_SERVO_DOWN
[gcode_macro ERCF__SELECT_TOOL]
gcode:
{% set TOOL = params.TOOL|default(0)|int %}
ERCF_SELECT TOOL={TOOL}
[gcode_macro ERCF__SELECT_BYPASS]
gcode: ERCF_SELECT_BYPASS
[gcode_macro ERCF__LOAD_BYPASS]
gcode: ERCF_LOAD_BYPASS
[gcode_macro ERCF__RECOVER]
gcode: ERCF_RECOVER
[gcode_macro ERCF__PRELOAD]
gcode:
{% set GATE = params.GATE|default(-1)|int %}
ERCF_PRELOAD GATE={GATE}
[gcode_macro ERCF__CHECK_GATES]
gcode:
{% set GATE = params.GATE|default(-1)|int %}
ERCF_CHECK_GATES GATE={GATE}
[gcode_macro ERCF_FORM_TIP_STANDALONE]
gcode:
{% set FINAL_EJECT = params.FINAL_EJECT|default(1) %}
{% set pa = printer.extruder.pressure_advance %}
_ERCF_FORM_TIP_STANDALONE FINAL_EJECT={FINAL_EJECT}
SET_PRESSURE_ADVANCE ADVANCE={pa}
# These last two are for backwards compatabilty or testing...
[gcode_macro ERCF_ENCODER_RUNOUT]
gcode:
{% set FORCE_RUNOUT = params.FORCE_RUNOUT|default(0)|int %}
_ERCF_ENCODER_RUNOUT FORCE_RUNOUT={FORCE_RUNOUT}
[gcode_macro ERCF_CHANGE_TOOL_STANDALONE]
gcode:
{% set TOOL = params.TOOL|default(0)|int %}
ERCF_CHANGE_TOOL TOOL={TOOL} STANDALONE=1
########################################################################
# Standalone Tip Forming (for rapid tuning of Slicer values)
########################################################################
[gcode_macro _ERCF_FORM_TIP_STANDALONE]
description: Standalone macro that mimics SS process
# Unloading and Ramming values - Initial moves to form and shape tip
variable_unloading_speed_start: 80 # Fast here to seperate the filament from meltzone (Very intitial retract SS uses distance of E-15)
variable_unloading_speed: 20 # Too fast forms excessively long tip or hair. Slow is better here UNLOADING_SPEED_START/COOLING_MOVES seems a good start
variable_ramming_volume: 20 # in mm3 SS default values = 2, 5, 9, 13, 18, 23, 27. Only Used to Simulate SS Ramming during standalone
variable_ss_ramming: 0 # Set to 0 when using standalone ramming (RAMMING_VOLUME) or tuning, 1 to let the slicer do it
# Cooling Move Values - To cool the tip formed and separate from strings
variable_cooling_tube_position: 35 # Dragon ST: 35, Dragon HF: 30, Mosquito: 30, Revo: 35, Phaetus Rapido HF: 43; Measured from Top of Heater Block to Top of Heatsink
variable_cooling_tube_length: 10 # Dragon ST: 15, Dragon HF: 10, Mosquito: 20, Revo: 10, Phaetus Rapido HF: 22; Measured from Nozzle to Top of Heater Block
variable_initial_cooling_speed: 10 # Slow to solidify tip and cool string if formed.
variable_final_cooling_speed: 50 # High speed break the string formed. Too fast = tip deformation during eject. Too Slow = long string/no seperation
variable_toolchange_temp: 0 # Used if you want to lower temp during toolchanges default 0
variable_cooling_moves: 4 # 2-4 is a good start
# SkinnyDip values - To burn off VERY FINE hairs only (This is NOT for long tip reshaping)
variable_use_skinnydip: 1 # Tune this LAST, this is for removal of VERY FINE hairs only (Different than a long tip)
variable_skinnydip_distance: 30 # Start just under Cooling_tube_position and increase - Will depend on how much Ramming Volume is used
variable_dip_insertion_speed: 30 # Medium-Slow - Just long enough to melt the fine hairs. Too slow will pull up molten filament
variable_dip_extraction_speed: 70 # Around 2x Insertion speed, Prevents forming new hairs
variable_melt_zone_pause: 0 # in milliseconds - default 0
variable_cooling_zone_pause: 0 # in milliseconds - default 0 - If you need to adjust here its possible Dip Insertion too slow
variable_use_fast_skinnydip: 0 # Skip the toolhead temp change during skinnydip move - default 0
# Park filament ready to eject
# variable_parking_distance: 0 # TODO: SS parks filament after final cooling move
# Final Eject - for standalone tuning only
variable_final_eject: 0 # default 0, enable during standalone tuning process to eject the filament
gcode:
# Initialize Paramaters
{% set UNLOADING_SPEED_START = params.UNLOADING_SPEED_START|default(printer['gcode_macro _ERCF_FORM_TIP_STANDALONE']['unloading_speed_start']) %}
{% set UNLOADING_SPEED = params.UNLOADING_SPEED|default(printer['gcode_macro _ERCF_FORM_TIP_STANDALONE']['unloading_speed']) %}
{% set RAMMING_VOLUME = params.RAMMING_VOLUME|default(printer['gcode_macro _ERCF_FORM_TIP_STANDALONE']['ramming_volume'], True) %}
{% set SS_RAMMING = params.SS_RAMMING|default(printer['gcode_macro _ERCF_FORM_TIP_STANDALONE']['ss_ramming'], True) %}
{% set COOLING_TUBE_LENGTH = params.COOLING_TUBE_LENGTH|default(printer['gcode_macro _ERCF_FORM_TIP_STANDALONE']['cooling_tube_length']) %}
{% set COOLING_TUBE_POSITION = params.COOLING_TUBE_POSITION|default(printer['gcode_macro _ERCF_FORM_TIP_STANDALONE']['cooling_tube_position']) %}
{% set INITIAL_COOLING_SPEED = params.INITIAL_COOLING_SPEED|default(printer['gcode_macro _ERCF_FORM_TIP_STANDALONE']['initial_cooling_speed']) %}
{% set FINAL_COOLING_SPEED = params.FINAL_COOLING_SPEED|default(printer['gcode_macro _ERCF_FORM_TIP_STANDALONE']['final_cooling_speed']) %}
{% set COOLING_MOVES = params.COOLING_MOVES|default(printer['gcode_macro _ERCF_FORM_TIP_STANDALONE']['cooling_moves']) %}
{% set TOOLCHANGE_TEMP = params.TOOLCHANGE_TEMP|default(printer['gcode_macro _ERCF_FORM_TIP_STANDALONE']['toolchange_temp'],True) %}
{% set USE_SKINNYDIP = params.USE_SKINNYDIP|default(printer['gcode_macro _ERCF_FORM_TIP_STANDALONE']['use_skinnydip'], True) %}
{% set USE_FAST_SKINNYDIP = params.USE_FAST_SKINNYDIP|default(printer['gcode_macro _ERCF_FORM_TIP_STANDALONE']['use_fast_skinnydip'], True) %}
{% set SKINNYDIP_DISTANCE = params.SKINNYDIP_DISTANCE|default(printer['gcode_macro _ERCF_FORM_TIP_STANDALONE']['skinnydip_distance']) %}
{% set DIP_INSERTION_SPEED = params.DIP_INSERTION_SPEED|default(printer['gcode_macro _ERCF_FORM_TIP_STANDALONE']['dip_insertion_speed']) %}
{% set DIP_EXTRACTION_SPEED = params.DIP_EXTRACTION_SPEED|default(printer['gcode_macro _ERCF_FORM_TIP_STANDALONE']['dip_extraction_speed']) %}
{% set MELT_ZONE_PAUSE = params.MELT_ZONE_PAUSE|default(printer['gcode_macro _ERCF_FORM_TIP_STANDALONE']['melt_zone_pause']) %}
{% set COOLING_ZONE_PAUSE = params.COOLING_ZONE_PAUSE|default(printer['gcode_macro _ERCF_FORM_TIP_STANDALONE']['cooling_zone_pause']) %}
{% set FINAL_EJECT = params.FINAL_EJECT|default(printer['gcode_macro _ERCF_FORM_TIP_STANDALONE']['final_eject'], True) %}
G91
G92 E0
#---------------------------------#
#-Tip forming Process begins here-#
#---------------------------------#
SET_PRESSURE_ADVANCE ADVANCE=0
{% set OLD_TEMP = printer.extruder.target %}
{% if SS_RAMMING|int == 0 %} # Standalone Ramming
{% set RATIO = (RAMMING_VOLUME|float) /23.0 %}
G1 E{0.5784 * RATIO|float} F299 #7
G1 E{0.5834 * RATIO|float} F302 #3
G1 E{0.5918 * RATIO|float} F306 #6
G1 E{0.6169 * RATIO|float} F319 #6
G1 E{0.3393 * RATIO|float} F350 #0
G1 E{0.3363 * RATIO|float} F350 #0
G1 E{0.7577 * RATIO|float} F392 #6
G1 E{0.8382 * RATIO|float} F434 #3
G1 E{0.7776 * RATIO|float} F469 #9
G1 E{0.1293 * RATIO|float} F469 #9
G1 E{0.9673 * RATIO|float} F501 #2
G1 E{1.0176 * RATIO|float} F527 #2
G1 E{0.5956 * RATIO|float} F544 #6
G1 E{0.4555 * RATIO|float} F544 #6
G1 E{1.0662 * RATIO|float} F552 #4
{% endif %}
# Set toolchange temperature just prior to filament being extracted from melt zone and wait for set point
# (SKINNYDIP -- normal mode only)
# Only used if changing between filament types eg. ABS-->PLA
{% if TOOLCHANGE_TEMP|float > 0 and USE_FAST_SKINNYDIP|int == 0 %}
M109 S{TOOLCHANGE_TEMP}
{% endif %}
# Unloading - This is where the tip spear shape comes from Faster=longer/pointer/higher stringing
{% set TOTAL_RETRACTION_DISTANCE = COOLING_TUBE_POSITION|float + COOLING_TUBE_LENGTH|float / 2 - 15 %}
G1 E-15 F{1.0 * UNLOADING_SPEED_START|float * 60} # Default value from SS - Cannot modify
G1 E-{0.7 * TOTAL_RETRACTION_DISTANCE} F{1.0 * UNLOADING_SPEED|float * 60}
G1 E-{0.2 * TOTAL_RETRACTION_DISTANCE} F{0.5 * UNLOADING_SPEED|float * 60}
G1 E-{0.1 * TOTAL_RETRACTION_DISTANCE} F{0.3 * UNLOADING_SPEED|float * 60}
{% if TOOLCHANGE_TEMP|float > 0 and USE_FAST_SKINNYDIP|int == 1 %}
M104 S{TOOLCHANGE_TEMP}
{% endif %}
# Generate Cooling Moves - Solidifies tip shape and helps break strings if formed
{% set SPEED_INC = (FINAL_COOLING_SPEED|float - INITIAL_COOLING_SPEED|float) / (2 * COOLING_MOVES|float - 1) %}
{% for move in range(COOLING_MOVES|int) %}
G1 E{COOLING_TUBE_LENGTH} F{(INITIAL_COOLING_SPEED|float + SPEED_INC*move*2) * 60}
G1 E-{COOLING_TUBE_LENGTH} F{(INITIAL_COOLING_SPEED|float + SPEED_INC*(move*2+1)) * 60}
{% endfor %}
# Wait for extruder to reach toolchange temperature after cooling moves complete (SKINNYDIP--fast mode only)
{% if TOOLCHANGE_TEMP|float > 0 and USE_FAST_SKINNYDIP|int == 1 %}
M109 S{TOOLCHANGE_TEMP}
{% endif %}
# Skinny dip Move - burns off VERY FINE hairs
{% if USE_SKINNYDIP|int == 1 %}
G1 E{SKINNYDIP_DISTANCE} F{DIP_INSERTION_SPEED|float * 60}
G4 P{MELT_ZONE_PAUSE}
G1 E-{SKINNYDIP_DISTANCE} F{DIP_EXTRACTION_SPEED|float * 60}
G4 P{COOLING_ZONE_PAUSE}
{% endif %}
{% if TOOLCHANGE_TEMP|float > 0 %}
M104 S{OLD_TEMP}
{% endif %}
# Park filament
# TODO: park filament after cooling/skinny dip. Maths to determine distance of previous moves to final parking distance
# Eject once all shaping is done - Standalone mode only
{% if FINAL_EJECT|int == 1 %}
G92 E0
G1 E-80 F3000
{% endif %}
G92 E0
G90
###########################################################################
# EndlessSpool handling
# Note that EndlessSpool is an unsupervised filament change
###########################################################################
[gcode_macro _ERCF_ENDLESS_SPOOL_PRE_UNLOAD]
description: Pre unload routine for EndlessSpool changes
gcode:
# This occurs prior to ERCF forming tip and ejecting the remains of the old filament
#
# Typically you would move toolhead to your park position so oozing is not a problem
#
# This is probably similar to what you do in your PAUSE macro and you could simply call that here...
# (this call works with reference PAUSE macro supplied in client_macros.cfg)
PAUSE
[gcode_macro _ERCF_ENDLESS_SPOOL_POST_LOAD]
description: Optional post load routine for EndlessSpool changes
gcode:
# This occurs after ERCF has loaded the new filament from the next spool in rotation
# ERCF will have loaded the new filament to the nozzle the same way as a normal filament
# swap. Previously configured Pressure Advance will be retained.
#
# This would be a place to purge additional filament if necessary (it really shouldn't be)
# and clean nozzle if your printer is suitably equipped.
#
# This is probably similar to what you do in your RESUME macro and you could simply call that here...
# (this call works with reference RESUME macro supplied in client_macros.cfg)
RESUME
[gcode_macro _ERCF_ACTION_CHANGED]
description: Called when an action has changed.
gcode:
# This occurs when the ERCF action status changes. `printer.ercf.action` will contain
# the current action string. See Happy Hare README for full list
#
# This could be a place to set LED status or similar. The logic here
# demonstrates the three major action states
{% set ACTION = printer.ercf.action|string %}
{% if ACTION|string == "Idle" %}
# Add your logic here
# _STATUS_STANDBY
{% endif %}
{% if ACTION|string == "Loading" %}
# Add your logic here
# _STATUS_LOADING
{% endif %}
{% if ACTION|string == "Unloading" %}
# Add your logic here
# _STATUS_UNLOADING
{% endif %}