Elegant way to cancel a print during start
-
I'm adding some checks to my start print file and would like to be able to abort a print if some criteria aren't met (such as nozzle diameter, missing parameters etc).
I'm not sure what the most appropriate way to do this is.
I could use M226 to pause the print and then cancel it, but I don't want pause.g or cancel.g to be ran as the printer isn't even in a state where running those would be sensible.
Does anyone know of a better way to achieve this? -
@jay_s_uk I invoke a macro file
check-filament.g
from my start G-code to check the loaded filament (M98 P"check-filament.g" F"PLA"
e.g.). It's simple as this:if move.extruders[0].filament != param.F abort "Incorrect filament loaded!"
That will effectively abort the print if the wrong filament is loaded without running any pause/stop macros.
-
@chrishamm fantastic. I'll give that a go now
-
-
-
-
@chrishamm said in Elegant way to cancel a print during start:
@jay_s_uk I invoke a macro file
check-filament.g
from my start G-code to check the loaded filament (M98 P"check-filament.g" F"PLA"
e.g.). It's simple as this:if move.extruders[0].filament != param.F abort "Incorrect filament loaded!"
That will effectively abort the print if the wrong filament is loaded without running any pause/stop macros.
How would this work? What is the piece that you are looking at to compare in the logic statement?
Where/How are you defining the filament?
sinneD
-
@sinned6915 It's the F parameter passed to the
check-filament.g
macro, see the first line. My start G-code looks like this (PrusaSlicer):M98 P"check-filament.g" F"[filament_type]" M140 S[first_layer_bed_temperature] M116 ; wait for all temps to be reached T0 ; select first tool M703 ; configure it G10 P0 S[first_layer_temperature] ; set nozzle temperature G28 ; home all axes G1 X235 Y5 F30000 ; go to corner of the bed G1 Z0.5 ; lower nozzle M116 ; wait for all temps to be reached
Note that you need to create filaments in DWC and PrusaSlicer where the name must equal the value defined in PS -> Filament -> Advanced -> Type.
-
@chrishamm so do you you use the 'Filaments' to do things like organize, track usage, retraction and such too?
-
@sinned6915
Yes, the filaments folders are being used.
If you look at the start g code there is an M703.
Anything filament specific would be implemented in the filament config.g -
Fantastic idea, I will certainly add this to my setup!
-
Does anyone have an idea how I can detect in PrusaSlicer which tools will be used during a print? I'm already sending over the filaments and the nozzle sizes, but since I have a toolchanger, ideally I'd also need to know which tools are used during a given print...