Closed sn4k3 closed 9 months ago
This can be done quite easily with print status events. You'd run the disable on the ready
event and enable on the purge
event.
This can be done quite easily with print status events. You'd run the disable on the
ready
event and enable on thepurge
event.
Worked, tested with:
GCODE_ON_PRINT_STATUS STATUS=ready COMMAND="SET_FILAMENT_SENSOR SENSOR=toolhead_runout ENABLE=0" TYPE=ENTER WHEN=ALWAYS
GCODE_ON_PRINT_STATUS STATUS=purging COMMAND="SET_FILAMENT_SENSOR SENSOR=toolhead_runout ENABLE=1" TYPE=ENTER WHEN=ALWAYS
Thanks! You can close this PR if you wish.
Yeah, I'm going to close. If I add something specific for runout sensors I'd want to address a broader range of scenarios (e.g. my own runout macro pauses immediately on the first layer, waits for a layer change everywhere else, and debounces the runout events).
The filament sensors are poorly handled by klipper and lacking, it only supports them but then all functions must be handed by user macros. We need a more robust way to deal with them (configs and communication)...
Examples:
Purge more
, Resume
and even Toggle Sensor state
.runout
until user had resume the print (I had experience multiple runouts triggers when playing with the filament insert by hand). In a natural way we expect to happen only once: Runout detected -> fire runout event -> Insert filament -> fire insert event -> Wait for user prompt. (Can be addressed with global variables) however a native solution is best for users.
When having a filament sensor, by default they are ON, causing unloading/loading events to trigger even if we don't want to (hand feed or preparation).
We can disable the sensor by default using:
However, this introduces another problem, we want the sensor ON when printing, but OFF when not printing, as so, this PR allows the user to select a list of sensors to switch ON/OFF on those print events. This will allow user to do any handling of the extruder without the annoyance of removing the filament and it trigger an
PAUSE
which doHOME
,PREHEAT
,PARK
andUNLOAD
or insert the filament in cold just to prepare a future print and it trigger another unrequired sequence of events.We could use slicer start and end gcode, but that is ugly, don't handle print cancel and make them less sharable. This integrated solution is cleaner and less prompt to error.
Usage: