FILAMENT_RUNOUT_DISTANCE_MM or similar at reprap?
-
-
-
-
@dc42 @T3P3Tony
The M25 should not be called until the current extruder position exceeds the global variable position set.I.e when the filament sensor is tripped, the M25 should not be called until another 200mm of filament has been extruded.
This allows for the filament between the sensor and the extruder to be used up. On my case that's about 600mm
At that point a pause is called.I'll check again but I'm pretty sure the the code in daemon.g evaluated to false when pause was called.
EDIT:
I'm wondering if it's because I have a filament monitor defined using M591, rather than just an external trigger using M581? -
@dc42 said in FILAMENT_RUNOUT_DISTANCE_MM or similar at reprap?:
@t3p3tony the daemon.g file suggested by OwenD contains an explicit M25 command. That's probably why pause.g is being run.
I just ran a quick test.
The M25 in daemon.g isn't being called.
In config.g I have
; Filament monitor M591 P1 C"e0stop" S1 D0 ; filament monitor for extruder 0 connected to E0 endstop
In filament-error0.g (and filament-error.g) I have
;0:/sys/filament-error#.g ; run when filament error for extruder # is found. ; if this file not found runs filament-error.g ; if neither found runs pause.g G4 P10 ; delay 10ms to debounce if sensors.filamentMonitors[0].status="ok" echo "switch bounce detected" M99 ; break out if sensor value is zero again (bouncing) var runoutDistance = 300 ; this is just so you can change easily var thisExtruderValue = move.extruders[tools[state.currentTool].filamentExtruder].position set global.filamentDistance = var.thisExtruderValue + var.runoutDistance echo "filament-error0.g run - print will be paused after " ^ var.runoutDistance ^ "mm"
In daemon.g I have
if (move.extruders[tools[state.currentTool].filamentExtruder].position > global.filamentDistance) && (global.filamentDistance !=0) && (state.status = "processing") echo "paused called from daemon" M25 ; pause print if filament has run out G4 S2 ; add a delay for these checks
The console output seems to show the print is paused before filament-error.g is run
In any case, it's paused before the daemon can do it.
Here is the extruder position vs the position it should have paused.
(pause caused a retract)
-
I should also point out that the print paused in the position where the filament sensor tripped
It did not move away as I have in pause.gM83 ; relative extruder moves G91 ; relative movement G10 ; retract filament G1 Z+5 F600 ; lift Z by 5mm G90 ; absolute positioning G1 X{move.axes[0].min} Y{move.axes[1].max} F6000 ; move bed forward and clear nozzle away ;M144 ; put bed on standby T100 ; Put nozzle in standby
-
@dc42 yes. It´s a direct extruder, but with reversed bowden of 400mm, and at the beginning of the reversed bowden it´s the filament sensor, so It would be nice to extrude at leat 90% of that lenght in order not to waste that filament
-
@owend Looking at how caribou3d duet handles the sensor
https://github.com/Caribou3d/CaribouDuet2Wifi-ConfigurationMacrosmay be, on trigger we could deactivate sensor, continue printing for var runoutDistance, and then trigger pause, reactivate, load an resume
??
-
-
I have recreated this - and moved it to firmware wishlist section as the behaviour will need to be changed to allow the filament out logic to run without a pause.
-
@t3p3tony
Thanks Tony -
@t3p3tony thanks
-
@t3p3tony does this feature have an ETA?
-
@apak no ETA yet.
-
-
-
-
@t3p3tony Tell me if I'm correct:
A workaround should be possible by setting a global variable in filament-error.g if you want to cancel the pause. pause.g checks for the variable, and does an M24 if the variable was set, instead of its usual commands.
Do you think this would work? Or would it skip pause.g if filament-error.g ran, giving you no opportunity to cancel the pause? I'm uncertain whether pause.g gets run or not if filament-error.g exists. I know it's not supposed to.
-
@donstauffer if filament-error.g runs then pause.g does not run AFAIK. The issue is that there is always a pause as part of the process no matter which macro is called.
-
@t3p3tony Confirmed. pause.g doesn't run.
-
Just confirming that this is now possible with 3.4.0b7
Albeit you must be aware that the macro called is now filament_error.g, not filament-error.g
i.e. must have an underscore "_" and not a hyphen "-"
There is also a problem if filament_error.g contains an M291 as described herefilament_error.g
;0:/sys/filament_error.g ;run when a filament sensor error is detected. Print will be paused bt Daemon.g after runout distance. var runoutDistance = 350 ; this is just so you can change easily ; first check that we are not currently in an error state and the switch has been toggled again. if (global.filamentDistance !=0) || !(state.status = "processing") echo "Filament sensor triggered, but already no print in progress. No action taken" M99 ; exit macro echo "filament_error.g run" G4 P10 ; delay 10ms to debounce if sensors.filamentMonitors[0].status="ok" echo "switch bounce detected - error cancelled" M99 ; break out if sensor value is zero again (bouncing) echo {"Filament error type " ^ param.P ^ " detected on extruder " ^ param.D} ;M291 R"Filament Error" P{"Filament error type " ^ param.P ^ " detected on extruder " ^ param.D} S1 T3 var thisExtruderValue = move.extruders[tools[state.currentTool].filamentExtruder].position set global.filamentDistance = var.thisExtruderValue + var.runoutDistance echo "filament_error.g run - print will be paused after " ^ var.runoutDistance ^ "mm"
In daemon.g
(Note this is run in a while loop so it's called at intervals less than 10 seconds)while true ; I have a bunch of other stuff in here ;check the filament runout if state.currentTool != -1 if (move.extruders[tools[state.currentTool].filamentExtruder].position > global.filamentDistance) && (global.filamentDistance !=0) && (state.status = "processing") echo "paused called from daemon - filament runout" M25 ; pause print if filament has run out G4 S2 ; add a delay for these checks
In resume.g we reset the distance
if sensors.filamentMonitors[0].status="ok" set global.filamentDistance = 0 ; reset filament sensor extrusion distance ;do all the other stuff needed for resuming
You also need to set the distance to zero in start.g
if sensors.filamentMonitors[0].status="ok" set global.filamentDistance = 0 ; reset filament sensor extrusion distance else abort "Filament sensor shows no filament loaded. Print aborted"
and of course define the global in config.g
if !exists(global.filamentDistance) global filamentDistance = 0 ; global for use to allow filament to feed for set distance after sensor trips else set global.filamentDistance = 0
-
thanks, will try
-
This post is deleted!