forked from Zero-Grav/ERCF-Software-V3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ercf_software.cfg
260 lines (213 loc) · 10.5 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
[save_variables]
filename: {klipper_config_home}/ercf_vars.cfg
########################################################################
# Tool change macros
#######################################################################
[gcode_macro T0]
gcode: ERCF_CHANGE_TOOL TOOL=0
[gcode_macro T1]
gcode: ERCF_CHANGE_TOOL TOOL=1
[gcode_macro T2]
gcode: ERCF_CHANGE_TOOL TOOL=2
[gcode_macro T3]
gcode: ERCF_CHANGE_TOOL TOOL=3
[gcode_macro T4]
gcode: ERCF_CHANGE_TOOL TOOL=4
[gcode_macro T5]
gcode: ERCF_CHANGE_TOOL TOOL=5
[gcode_macro T6]
gcode: ERCF_CHANGE_TOOL TOOL=6
[gcode_macro T7]
gcode: ERCF_CHANGE_TOOL TOOL=7
[gcode_macro T8]
gcode: ERCF_CHANGE_TOOL TOOL=8
########################################################################
# 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={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) %}
_ERCF_FORM_TIP_STANDALONE FINAL_EJECT={FINAL_EJECT}
# These last ones 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
########################################################################
# Tip forming. This should match your slicer configuration
########################################################################
[gcode_macro _ERCF_FORM_TIP_STANDALONE]
description: Generic tip forming macro
# Extruder constants, effects where the initial retraction ends and the size of cooling movements around this point
variable_cooling_tube_length: 15 # Dragon ST: 15, Dragon HF: 10, Mosquito: 20, Revo: 10, Phaetus Rapido HF: 22
variable_cooling_tube_retraction: 35 # Dragon ST: 35, Dragon HF: 30, Mosquito: 3, Revo: 35, Phaetus Rapido HF: 43
# Controls the cooling movement speed and number of cycles
variable_initial_cooling_speed: 10
variable_final_cooling_speed: 50
variable_cooling_moves: 4
# SkinnyDip settings (no equivalent in PrusaSlicer)
variable_use_skinnydip: 0
variable_skinnydip_distance: 30
variable_dip_insertion_speed: 30
variable_dip_extraction_speed: 70
variable_melt_zone_pause: 0
variable_cooling_zone_pause: 0
# Temp change settings (no equivalent in PrusaSlicer)
variable_toolchange_temp: 0
variable_use_fast_skinnydip: 1
# Speed of initial 15mm of retract then speed for rest of retract
variable_unloading_speed_start: 80
variable_unloading_speed: 40
# Ramming. Unlike slicer, the ramming time and shape is fixed in macro
variable_ramming_volume: 0 # Try 15-26 (in mm3)
variable_initial_retract: 0 # Use an initial retract or not. Don't use it if you want to ram the filament
variable_final_eject: 0 # Fully eject the filament afterwards, default is no
gcode:
{% set COOLING_MOVES = params.COOLING_MOVES|default(printer['gcode_macro _ERCF_FORM_TIP_STANDALONE']['cooling_moves']) %}
{% set COOLING_TUBE_LENGTH = params.COOLING_TUBE_LENGTH|default(printer['gcode_macro _ERCF_FORM_TIP_STANDALONE']['cooling_tube_length']) %}
{% set COOLING_TUBE_RETRACTION = params.COOLING_TUBE_RETRACTION|default(printer['gcode_macro _ERCF_FORM_TIP_STANDALONE']['cooling_tube_retraction']) %}
{% set COOLING_ZONE_PAUSE = params.COOLING_ZONE_PAUSE|default(printer['gcode_macro _ERCF_FORM_TIP_STANDALONE']['cooling_zone_pause']) %}
{% set DIP_EXTRACTION_SPEED = params.DIP_EXTRACTION_SPEED|default(printer['gcode_macro _ERCF_FORM_TIP_STANDALONE']['dip_extraction_speed']) %}
{% set DIP_INSERTION_SPEED = params.DIP_INSERTION_SPEED|default(printer['gcode_macro _ERCF_FORM_TIP_STANDALONE']['dip_insertion_speed']) %}
{% set FINAL_COOLING_SPEED = params.FINAL_COOLING_SPEED|default(printer['gcode_macro _ERCF_FORM_TIP_STANDALONE']['final_cooling_speed']) %}
{% set FINAL_EJECT = params.FINAL_EJECT|default(printer['gcode_macro _ERCF_FORM_TIP_STANDALONE']['final_eject'], True) %}
{% set INITIAL_COOLING_SPEED = params.INITIAL_COOLING_SPEED|default(printer['gcode_macro _ERCF_FORM_TIP_STANDALONE']['initial_cooling_speed']) %}
{% set INITIAL_RETRACT = params.INITIAL_RETRACT|default(printer['gcode_macro _ERCF_FORM_TIP_STANDALONE']['initial_retract']) %}
{% set MELT_ZONE_PAUSE = params.MELT_ZONE_PAUSE|default(printer['gcode_macro _ERCF_FORM_TIP_STANDALONE']['melt_zone_pause']) %}
{% set RAMMING_VOLUME = params.RAMMING_VOLUME|default(printer['gcode_macro _ERCF_FORM_TIP_STANDALONE']['ramming_volume']) %}
{% set SKINNYDIP_DISTANCE = params.SKINNYDIP_DISTANCE|default(printer['gcode_macro _ERCF_FORM_TIP_STANDALONE']['skinnydip_distance']) %}
{% set TOOLCHANGE_TEMP = params.TOOLCHANGE_TEMP|default(printer['gcode_macro _ERCF_FORM_TIP_STANDALONE']['toolchange_temp'],True) %}
{% set UNLOADING_SPEED = params.UNLOADING_SPEED|default(printer['gcode_macro _ERCF_FORM_TIP_STANDALONE']['unloading_speed']) %}
{% set UNLOADING_SPEED_START = params.UNLOADING_SPEED_START|default(printer['gcode_macro _ERCF_FORM_TIP_STANDALONE']['unloading_speed_start']) %}
{% set USE_FAST_SKINNYDIP = params.USE_FAST_SKINNYDIP|default(printer['gcode_macro _ERCF_FORM_TIP_STANDALONE']['use_fast_skinnydip'], True) %}
{% set USE_SKINNYDIP = params.USE_SKINNYDIP|default(printer['gcode_macro _ERCF_FORM_TIP_STANDALONE']['use_skinnydip'], True) %}
G91
G92 E0
SET_PRESSURE_ADVANCE ADVANCE=0
{% set OLD_TEMP = printer.extruder.target %}
# Ramming with SuperSlicer standard setting
{% if INITIAL_RETRACT|int == 1 %}
G1 E-8.5000 F3000
{% endif %}
{% 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
# set toolchange temperature just prior to filament being extracted from melt zone and wait for set point
# (SKINNYDIP--normal mode only)
{% if TOOLCHANGE_TEMP|float > 0 and USE_FAST_SKINNYDIP|int == 0 %}
M109 S{TOOLCHANGE_TEMP}
{% endif %}
# Retraction
{% set TOTAL_RETRACTION_DISTANCE = COOLING_TUBE_RETRACTION|float + COOLING_TUBE_LENGTH|float / 2 - 15 %}
G1 E-15 F{1.0 * UNLOADING_SPEED_START|float * 60}
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
{% 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 %}
# Generate a skinnydip move
{% 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 %}
{% 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