12
12
{% for var, value in printer[" gcode_macro RatOS" ].items() %}
13
13
{action_respond_info(var ~ " : " ~ value)}
14
14
{% endfor %}
15
-
15
+
16
16
[gcode_macro RatOS]
17
17
description: RatOS variable storage macro, will echo variables to the console when run.
18
18
# Configuration Defaults
@@ -90,7 +90,7 @@ rename_existing: PAUSE_BASE
90
90
variable_extrude: 1.5
91
91
gcode:
92
92
SAVE_GCODE_STATE NAME =PAUSE_state
93
- # Define park positions
93
+ # Define park positions
94
94
{% set E = printer[" gcode_macro PAUSE" ].extrude|float %}
95
95
{% set speed = printer[" gcode_macro RatOS" ].macro_travel_speed|float * 60 %}
96
96
# Calculate safe Z position
@@ -115,7 +115,7 @@ gcode:
115
115
_PARK LOCATION ={printer[" gcode_macro RatOS" ].pause_print_park_in} X ={printer[" gcode_macro RatOS" ].pause_print_park_x}
116
116
{% else %}
117
117
{action_respond_info(" Printer not homed" )}
118
- {% endif %}
118
+ {% endif %}
119
119
120
120
[gcode_macro RESUME]
121
121
description: Resumes the print if the printer is paused.
@@ -149,7 +149,7 @@ gcode:
149
149
SAVE_GCODE_STATE NAME =prime_line_state
150
150
{% set speed = printer[" gcode_macro RatOS" ].macro_travel_speed|float * 60 %}
151
151
# Absolute positioning
152
- G90
152
+ G90
153
153
# Absolute extrusion
154
154
M82
155
155
M117 Priming nozzle with prime line..
@@ -162,7 +162,7 @@ gcode:
162
162
G1 Z0.3 F3000
163
163
# Reset extrusion distance
164
164
G92 E0
165
- # Prime nozzle
165
+ # Prime nozzle
166
166
G1 Y{printer.toolhead.axis_minimum.y + 80} E16 F1200
167
167
# Wipe
168
168
G1 Y{printer.toolhead.axis_minimum.y + 100} F{speed}
@@ -176,7 +176,7 @@ gcode:
176
176
RESPOND MSG =" Priming nozzle with prime blob.."
177
177
{% set speed = printer[" gcode_macro RatOS" ].macro_travel_speed|float * 60 %}
178
178
# Absolute positioning
179
- G90
179
+ G90
180
180
# Relative extrusion
181
181
M83
182
182
# Lift 5 mm
@@ -186,11 +186,11 @@ gcode:
186
186
# Extrude a blob
187
187
G1 F60 E20
188
188
# 40% fan
189
- M106 S102
189
+ M106 S102
190
190
# Move the extruder up by 5mm while extruding, breaks away from blob
191
- G1 Z5 F100 E5
191
+ G1 Z5 F100 E5
192
192
# Move to wipe position, but keep extruding so the wipe is attached to blob
193
- G1 F200 Y{printer.toolhead.axis_minimum.y + 25} E1
193
+ G1 F200 Y{printer.toolhead.axis_minimum.y + 25} E1
194
194
# Go down diagonally while extruding
195
195
# Broken down in z moves under 2mm as a workaround for a tuning tower test.
196
196
# The tuning tower command thinks a new print has been started when z moves over 2mm and aborts.
@@ -201,12 +201,12 @@ gcode:
201
201
# 0% fan
202
202
M106 S0
203
203
# small wipe line
204
- G1 F200 Y{printer.toolhead.axis_minimum.y +50} Z0.2 E0.6
204
+ G1 F200 Y{printer.toolhead.axis_minimum.y +50} Z0.2 E0.6
205
205
# Break away wipe
206
206
G1 F{speed} Y{printer.toolhead.axis_minimum.y + 100}
207
207
RESTORE_GCODE_STATE NAME =prime_blob_state
208
208
209
-
209
+
210
210
[gcode_macro _PARK]
211
211
gcode:
212
212
{% set speed = printer[" gcode_macro RatOS" ].macro_travel_speed|float * 60 %}
@@ -230,9 +230,19 @@ gcode:
230
230
{% set y = printer.toolhead.axis_maximum.y / 2 %}
231
231
{% endif %}
232
232
# Absolute positioning
233
- G90
233
+ G90
234
234
# Park
235
- G0 X{safe_x} Y{y} F{speed}
235
+ G0 X{safe_x} Y{y} F{speed}
236
+
237
+ [gcode_macro ASSERT_NOZZLE_DIAMETER]
238
+ description: Raises an error unless the configured nozzle diameter is the same as the diameter passed in.
239
+ gcode:
240
+ {% set configured_diameter = printer.configfile.config.extruder.nozzle_diameter|float %}
241
+ {% set sliced_diameter = params.NOZZLE_DIAMETER|float %}
242
+ {% if configured_diameter != sliced_diameter %}
243
+ M117 Aborting print due to nozzle-diameter mismatch between printer config and slicer.
244
+ { action_raise_error(" Nozzle-diameter mismatch between printer config (%s mm) and slicer (%s mm)." % (configured_diameter, sliced_diameter)) }
245
+ {% endif %}
236
246
237
247
# ####
238
248
# COLOR CHANGE
@@ -261,15 +271,15 @@ gcode:
261
271
TEMPERATURE_WAIT SENSOR =extruder MINIMUM ={params.TEMP|default(220, true)}
262
272
{% endif %}
263
273
M117 Unloading filament...
264
- # Extract filament to cold end area
274
+ # Extract filament to cold end area
265
275
G0 E-5 F3600
266
276
# Wait for three seconds
267
277
G4 P3000
268
- # Push back the filament to smash any stringing
278
+ # Push back the filament to smash any stringing
269
279
G0 E5 F3600
270
- # Extract back fast in to the cold zone
280
+ # Extract back fast in to the cold zone
271
281
G0 E-15 F3600
272
- # Continue extraction slowly, allow the filament time to cool solid before it reaches the gears
282
+ # Continue extraction slowly, allow the filament time to cool solid before it reaches the gears
273
283
G0 E-130 F300
274
284
M117 Filament unloaded!
275
285
RESPOND MSG =" Filament unloaded! Please inspect the tip of the filament before reloading."
@@ -306,7 +316,7 @@ gcode:
306
316
307
317
# ####
308
318
# START PRINT MACROS
309
- # Call this from your slicer (custom g-code).
319
+ # Call this from your slicer (custom g-code).
310
320
# Read more here: https://rat-rig.github.io/V-CoreOS/#/slicers
311
321
# ####
312
322
@@ -318,11 +328,15 @@ gcode:
318
328
# Metric values
319
329
G21
320
330
# Absolute positioning
321
- G90
331
+ G90
322
332
# Set extruder to absolute mode
323
333
M82
324
334
# Home if needed
325
335
MAYBE_HOME
336
+ # Check nozzle if told to do so
337
+ {% if params.NOZZLE_DIAMETER %}
338
+ ASSERT_NOZZLE_DIAMETER NOZZLE_DIAMETER ={params.NOZZLE_DIAMETER}
339
+ {% endif %}
326
340
M117 Heating bed...
327
341
RESPOND MSG =" Heating bed..."
328
342
# Wait for bed to heat up
@@ -360,7 +374,7 @@ gcode:
360
374
{% if printer[" gcode_macro RatOS" ].preheat_extruder|lower == ' true' %}
361
375
M117 Pre-heating extruder...
362
376
RESPOND MSG =" Pre-heating extruder..."
363
- # Wait for extruder to reach 150 so an inductive probe (if present) is at a predictable temp.
377
+ # Wait for extruder to reach 150 so an inductive probe (if present) is at a predictable temp.
364
378
# Also allows the bed heat to spread a little, and softens any plastic that might be stuck to the nozzle.
365
379
M104 S150
366
380
TEMPERATURE_WAIT SENSOR =extruder MINIMUM =150
@@ -393,7 +407,7 @@ gcode:
393
407
394
408
# ####
395
409
# END PRINT MACROS
396
- # Call this from your slicer (custom g-code).
410
+ # Call this from your slicer (custom g-code).
397
411
# Read more here: https://rat-rig.github.io/V-CoreOS/#/slicers
398
412
# ####
399
413
0 commit comments