-
Notifications
You must be signed in to change notification settings - Fork 0
/
OrbiterSensor223.cfg
342 lines (306 loc) · 17.7 KB
/
OrbiterSensor223.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
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
#################################################################################################################
################################# Orbiter Sensor CONFIGURATION ##################################################
#################################################################################################################
#config file version v2.2.04
#release date: 23.09.2023
# PAUSE and RESUME macros are defined at the end of this config file.
# If you prefer using your own please delete them, otherwise define parking position below.
#################################################################################################################
################################# CHANGE HERE MACRO CONFIGURABLES################################################
#################################################################################################################
[gcode_macro _SENSOR_VARIABLES] # change here macro configurables, enable disable functions!*************************
variable_filament_load_temp :250 # temperature to heat up hotend for filament loading, default is 235
variable_filament_unload_temp :200 # temperature to heat up hotend for filament un-loading, default is 185
variable_filament_load_min_temp :240 # minimum hotend set temperature allowed in filament load macro, default is 190
variable_nozzle_purge_length :200 # filament extrude amount during load sequenc, hotend purge from old filament, default is 200
variable_nozzle_purge_speed :300 # filament extrude speed in mm/min adjust this value lower if flow is too high and extruder skips during loading, default is 300
variable_unload_distance :95 # filament retract distance for unload procedure. this length shall be long enough to extract the filament above the drive gears
variable_disable_autoload :False # disable filament autoload feature by setting this variable True
variable_disable_runnout :False # disable runnout by setting this variable True
variable_disable_autounload :False # disable auto unload filament by setting this variable to True
variable_enable_beep :False # uses M300 sound feature, set it True to enable
variable_park_position_x :230 # edit your X parking position here for pause macro trigerred by runnout
variable_park_position_y :10 # edit your Y parking position here for pause macro trigerred by runnout
variable_park_lift_z :25 # edit your Z lift amount for parking position here, default is 10
Variable_park_retraction :1 # edit your retraction amount for parking, default is 1
gcode:
#///////////////////////////filament sensor button macros/////////////////////////////////////////////////
[gcode_button filament_sense]
pin: !EBBCan:PB3 # Green Wire
press_gcode: # sensor released -runnout detected!
runnout_init
release_gcode: #gcode macro for filament auto-load, sensor pressed
filament_load_init
#********************************************************************************************************
#////////////////////////////////////////Filament Unload macros/////////////////////////////////////////////////
[gcode_button filament_unload]
pin: !EBBCan:PB4 # Yellow Wire
release_gcode: # filament unload procedure
filament_unload_init
press_gcode: # do not add any macro call here
#################################################################################################################################
####################################### DO NOT CHANGE ANYTHING BELOW THIS LINE!!! ###############################################
#################################################################################################################################
####################################### UNLESS YOU KNOW WHAT YOU ARE DOING OR YOU ARE BORED AND NEED TO DO SOMETHING OR YOU ARE ALONE AND NEED SOMETHING TO MESS UP YOUR LIFE OR YOU CAN DO IT BETTER THAN ME OR YOU ARE A REAL SMARTASS OR JUST BECAUSE YOU CAN OR YOU RUN OUT OF BEAR OR HAS NOTHING BETTER TO DO OR ANY UNREASONABLE REASON
#################################################################################################################################
[respond]
default_type: echo
[force_move]
enable_force_move: True
[gcode_macro runnout_init]
gcode:
{% set sensor = printer['gcode_macro _SENSOR_VARIABLES'] %}
{% if (printer.print_stats.state == "printing") %}
{% if(sensor.disable_runnout|lower == 'false') %}
filament_change_state1
{% else %}
M118 Filament runnout is disabled in the sensor config file!
{% endif %}
{% endif %}
UPDATE_DELAYED_GCODE ID=clear_loadbusy DURATION=2
UPDATE_DELAYED_GCODE ID=clear_unloadbusy DURATION=2
SET_GCODE_VARIABLE MACRO=filament_unload VARIABLE=filamentpresent VALUE=0
[gcode_macro filament_change_state1]
variable_changebusy: 0
variable_temp_target: 0
gcode:
{% set sensor = printer['gcode_macro _SENSOR_VARIABLES'] %}
{% if changebusy == 0 %}
PAUSE # call printer pause macro
SET_GCODE_VARIABLE MACRO=filament_change_state1 VARIABLE=changebusy VALUE=1
M118 Filament runnout!
filament_change_state2 # comment this line if you do not want to automatically unload filament in case there is a runnout detected.
{% else %}
{% endif %}
[gcode_macro filament_change_state2]
gcode:
{% set sensor = printer['gcode_macro _SENSOR_VARIABLES'] %}
SET_GCODE_VARIABLE MACRO=filament_load VARIABLE=loadbusy VALUE=1
{% if (sensor.enable_beep|lower == 'true') %}
M300 # beep sound
{% endif %}
M118 Unloading filament...
M83
G92 E0
# {% if printer[printer.toolhead.extruder].temperature < 185 %} # hardcoded threshold
{% if (printer.extruder.can_extrude|lower != 'true')%} # checing for minimum extrusion temperature
# check if temperature is over the minimum extrusion temp. min_extrude_temp must be defined in the extruder config (to about 185)
M118 Hotend heating!
SET_HEATER_TEMPERATURE HEATER=extruder TARGET={sensor.filament_unload_temp} # restore user temp if it was set before loading
TEMPERATURE_WAIT SENSOR=extruder MINIMUM={sensor.filament_unload_temp} #wait for reaching filament unload temp
{% endif %}
{% if(printer.extruder.target == 0) %} # checing for set temperature if is zero than set to 200 / hotend hot but cooling due to set target temp 0
SET_HEATER_TEMPERATURE HEATER=extruder TARGET={sensor.filament_unload_temp} # restore user temp if it was set before loading
TEMPERATURE_WAIT SENSOR=extruder MINIMUM={sensor.filament_unload_temp} #wait for reaching filament unload temp
{% endif %}
G0 E-5 F3600 #extract filament to cold end
G4 P2000 # wait for two seconds
G0 E5 F3600 # push the filament back
G0 E-5 F3600 #extract filament to cold end
G0 E-{sensor.unload_distance} F300 # continue extraction slow allow filament to be cooled enough before reaches the gears
M400
M118 Load new filament! Wait until is loaded, then resume printing.
SET_HEATER_TEMPERATURE HEATER=extruder TARGET=0 # swicth off heater
UPDATE_DELAYED_GCODE ID=clear_loadbusy DURATION=2.5 # timing must be set to clear delay plus 0.5s. is due to wait to remove filament before starting load even in case there is a blob at the tip of the extracted filament which woudl trigger the sensor twice
#############################################END filament auto load macro section END***********************************************************
[gcode_macro filament_load_init]
gcode:
{% set sensor = printer['gcode_macro _SENSOR_VARIABLES'] %}
{% if (printer.print_stats.state != "printing") %}
{% if(sensor.disable_autoload|lower == 'false') %}
filament_load
{% else %}
M118 Filament auto-load is disabled in the sensor config file!
{% endif %}
{% else %}
M118 Printing! Can't load filament right now!
{% endif %}
SET_GCODE_VARIABLE MACRO=filament_unload VARIABLE=filamentpresent VALUE=1
UPDATE_DELAYED_GCODE ID=clear_changebusy DURATION=2
[gcode_macro filament_load]
variable_loadbusy: 0
variable_USER_TEMP: 0
variable_LOAD_TEMP: 0
gcode:
{% set sensor = printer['gcode_macro _SENSOR_VARIABLES'] %}
{% if loadbusy == 0 %} # requires [virtual_sdcard]
SET_GCODE_VARIABLE MACRO=filament_load VARIABLE=loadbusy VALUE=1
SET_GCODE_VARIABLE MACRO=filament_unload VARIABLE=unloadbusy VALUE=1
{% set USER_TEMP = printer.extruder.target %} # save user set temperature before loading
{% set LOAD_TEMP = 0 %}
#M118 USER TEMP {USER_TEMP} # echo back for debug only
{% if (printer.extruder.can_extrude|lower != 'true') or (printer.extruder.target < sensor.filament_load_min_temp) %} # checking for minimum extrusion temperature
# check if temperature is over the minimum extrusion temp. min_extrude_temp must be defined in the extruder config (to about 185)
SET_HEATER_TEMPERATURE HEATER=extruder TARGET={sensor.filament_load_temp} # set user defined load temperature
{% set LOAD_TEMP = sensor.filament_load_temp %} # save user set temperature before loading
M118 Hotend heating!
{% endif %}
{% if (sensor.enable_beep|lower == 'true') %}
M300 # beep sound
{% endif %}
M118 Filament loading!
M82 #set extruder to absolute mode
G92 E0
G4 P1500 # wait for 1.5 seconds
FORCE_MOVE STEPPER=extruder DISTANCE=15 VELOCITY=10 ACCEL=1000 # load filament inside the gears force move needs to be enabled
TEMPERATURE_WAIT SENSOR=extruder MINIMUM={LOAD_TEMP} # wait for reaching set temperature
TEMPERATURE_WAIT SENSOR=extruder MINIMUM={USER_TEMP} # wait for reaching set temperature
G1 E{sensor.nozzle_purge_length} F{sensor.nozzle_purge_speed} # extrude preconfigured purge length
M400 # wait to complete nozzle purge
SET_HEATER_TEMPERATURE HEATER=extruder TARGET={USER_TEMP} # restore user temp if it was set before loading
M118 Filament load complete!
UPDATE_DELAYED_GCODE ID=clear_unloadbusy DURATION=2
{% else %}
M118 Filament already loaded!
{% endif %}
#############################################END filament suto load macro section END***********************************************************
#############################################filament auto unload macro section*****************************************************************
[gcode_macro filament_unload_init]
gcode:
{% set sensor = printer['gcode_macro _SENSOR_VARIABLES'] %}
{% if (printer.print_stats.state != "printing") %}
{% if(sensor.disable_autounload|lower == 'false') %}
filament_unload
{% else %}
M118 Filament auto-unload is disabled in the sensor config file!
{% endif %}
{% else %}
M118 Printing! Can't unload filament right now!
{% endif %}
[gcode_macro filament_unload]
variable_unloadbusy: 0
variable_filamentpresent: 0
gcode:
{% set sensor = printer['gcode_macro _SENSOR_VARIABLES'] %}
{% if unloadbusy == 0 %} # requires [virtual_sdcard]
SET_GCODE_VARIABLE MACRO=filament_unload VARIABLE=unloadbusy VALUE=1
SET_GCODE_VARIABLE MACRO=filament_load VARIABLE=loadbusy VALUE=1
{% if (sensor.enable_beep|lower == 'true') %}
M300 # beep sound
{% endif %}
M118 Filament unloading!
M83
G92 E0
# {% if (printer.extruder.can_extrude|lower != 'true') or (printer.extruder.target == 0)%} # checing for minimum extrusion temperature
{% if (printer.extruder.can_extrude|lower != 'true')%} # checing for minimum extrusion temperature
# check if temperature is over the minimum extrusion temp. min_extrude_temp must be defined in the extruder config (to about 185)
M118 Hotend heating!
SET_HEATER_TEMPERATURE HEATER=extruder TARGET={sensor.filament_unload_temp} # restore user temp if it was set before loading
TEMPERATURE_WAIT SENSOR=extruder MINIMUM={sensor.filament_unload_temp} # wait for reaching configured unload temperature
{% endif %}
{% if(printer.extruder.target == 0) %} # checing for set temperature if is zero than set to 185 / hotend hot but cooling due to set target temp 0
TEMPERATURE_WAIT SENSOR=extruder MINIMUM={sensor.filament_unload_temp} # wait for reaching configured unload temperature
{% endif %}
G0 E10 F500 # extruder 20mm of filament before extracting
G0 E-5 F3600 #extract filament to cold end
G4 P2000 # wait for two seconds
G0 E6 F3600 # push the filament back
G0 E-10 F3600 #extract filament to cold end
G0 E-{sensor.unload_distance} F300 # continue extraction slow allow filament to be cooled enough before reaches the gears
M104 S0 T0
M400 # wait to complete unload
M118 Filament unload complete!
#SET_GCODE_VARIABLE MACRO=filament_load VARIABLE=loadbusy VALUE=0
{% else %}
M118 Nothing to unload!
{% endif %}
#############################################END filament auto unload macro section END***********************************************************
[delayed_gcode clear_unloadbusy]
gcode:
SET_GCODE_VARIABLE MACRO=filament_unload VARIABLE=unloadbusy VALUE=0
#M118 Clear Unload busy!
[delayed_gcode clear_changebusy]
gcode:
SET_GCODE_VARIABLE MACRO=filament_change_state1 VARIABLE=changebusy VALUE=0
#M118 Clear Load busy!
[delayed_gcode set_loadbusy]
gcode:
SET_GCODE_VARIABLE MACRO=filament_load VARIABLE=loadbusy VALUE=1
#M118 Set Load busy!
[delayed_gcode clear_loadbusy]
gcode:
SET_GCODE_VARIABLE MACRO=filament_load VARIABLE=loadbusy VALUE=0
#M118 Clear Load busy!
#################################################################################################################################
##################### DELETE PAUSE AND RESUME MACROS IF YOU WANT TO USE YOUR OWN ONES!###########################################
#################################################################################################################################
#[gcode_macro PAUSE]
#rename_existing: BASE_PAUSE
#gcode:
# {% set sensor = printer['gcode_macro _SENSOR_VARIABLES'] %}
# {% set x = params.X|default(sensor.park_position_x) %}
# {% set y = params.Y|default(sensor.park_position_y) %}
# {% set z = params.Z|default(sensor.park_lift_z)|float %}
# {% set e = params.E|default(sensor.park_retraction) %}
# ##### calculate save lift position #####
# {% set max_z = printer.toolhead.axis_maximum.z|float %}
# {% set act_z = printer.toolhead.position.z|float %}
# {% set lift_z = z|abs %}
# {% if act_z < (max_z - lift_z) %}
# {% set z_safe = lift_z %}
# {% else %}
# {% set z_safe = max_z - act_z %}
# {% endif %}
# SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=bed_restore_temp VALUE={printer.heater_bed.target}
# SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=extruder_restore_temp VALUE={printer.extruder.target}
# ##### end of definitions #####
# SAVE_GCODE_STATE NAME=PAUSE_state
# BASE_PAUSE
# G91
# G1 E-{e} F2100
# G1 Z{z_safe}
# G90
# G1 X{x} Y{y} F6000
# #SET_LED LED=OrbiLED RED=1.0 GREEN=1.0 BLUE=0.0
#[gcode_macro RESUME]
#rename_existing: BASE_RESUME
#variable_bed_restore_temp:0
#variable_extruder_restore_temp:0
#gcode:
# ##### set defaults #####
# {% set sensor = printer['gcode_macro _SENSOR_VARIABLES'] %}
# M118 Restoring heaters temperature, it might take a whyle!
# M140 S{bed_restore_temp}
# TEMPERATURE_WAIT SENSOR=heater_bed MINIMUM={bed_restore_temp}
# M104 S{extruder_restore_temp}
# TEMPERATURE_WAIT SENSOR=extruder MINIMUM={extruder_restore_temp}
# {% set e = params.E|default(sensor.park_retraction) %}
# G91
# G1 E{e} F2100
# G90
# RESTORE_GCODE_STATE NAME=PAUSE_state MOVE=1
# BASE_RESUME
# #SET_LED LED=OrbiLED RED=1.0 GREEN=1.0 BLUE=1.0#
#[gcode_macro CANCEL_PRINT]
#description: Cancel the actual running print
#rename_existing: CANCEL_PRINT_BASE
#gcode:
# M118 Print Cancelled!
#
# G92 E0 ; Zero the extruder
# G1 E-3 F3600 ; Retract and lift Z
#
# TURN_OFF_HEATERS
# CLEAR_PAUSE
# CANCEL_PRINT_BASE
#
# G91 ; Relative positioning
# G0 Z10 X186 Y350 F9001 ; end home X Y axis
# G90 ; Absolute positioning
# M84 ; Turn off motors
# M107 ; Turn off part cooling
# config file version v2.2.04 change note
# Commented out the set Orbiled commands. LED's
# config file version v2.2.03 change note
# 1 - defined user variables at the begining of the file for easier macro parameters adjustment
# 2 - defined disable configuration of features
# 3 - included PAUSE and RESUME macros with restoring bed and hotend temperature featres.
# config file version v2.2.02 change note
# 1 - filament loading will not set hotend temperature to zero in case the hotend was already set hot before the loading / filament change procedure
# 2 - Filament load / unload waits for hotend to reach temp not to reach stabilized temperature - faster filament loading and unloading.
# 3 - Removed messages to screen, only console echo is present
# 4 - Panel beep replaced by M300 / comment it out if not available on your printer
# 5 - unload procedure changed for better filament tip forming.
# 6 - known issue - if printer paused due to runout detection and new filament is not loaded whiting Klipper heaters timeout period (default is 10min) the heaters will be switched OFF.
# If user loads new filament autoload with work with its default loading temperature of 230 deg C but the heaters temperature will not be restored afterwards user needs to set back heaters temperature.
# on my printer this timeout also causes loosing of extruder position and printing can be resumed only after homing first and setting back temperatures manually.