Filament Presence & Trigger via Same Input?
-
Hi guys,
I am trying to configure an Orbiter filament presence sensor on my Maestro.
My issue is that the filament presence lead essentially needs to perform 2 functions:
- Runout detection via M591
- Trigger for filament auto-load
These are my configuration lines, but it won't accept the M950 because "pin not free".
M591 D0 P1 C"e0stop" S1 ; presence sensor connected to E0 endstop for drive 0, enabled M950 J1 C"e0stop" ; define logical input for filament auto load M581 P1 T2 S0 R0 ; define trigger for filament auto load triggers trigger2.g M950 J2 C"e1stop" ; define logical input for filament unload M581 P2 T3 S0 R0 ; define trigger for filament auto load triggers trigger3.g
Is there a way to use that e0stop pin for double duty, or do I have to split the wire and run it to a second pin?
-
@CCS86 you could
notdefine it directly as a filament presence sensor and then change the behaviour of the trigger depending on either the state of the machine or some variable in start gcode or filament load gcode or both. -
@T3P3Tony said in Filament Presence & Trigger via Same Input?:
@CCS86 you could not define it directly as a filament presence sensor and then change the behaviour of the trigger depending on either the state of the machine or some variable in start gcode or filament load gcode or both.
Could, or could not?
It seems viable to have full functionality as a presence sensor and as an autoload trigger, since they each work in opposite directions with the signal.
Not present > present = autoload trigger
Present > not present = filament runout@dc42 Is this something that could be implemented in a future version?
-
@CCS86 said in Filament Presence & Trigger via Same Input?:
Could, or could not?
Sorry! could!
@CCS86 said in Filament Presence & Trigger via Same Input?:
It seems viable to have full functionality as a presence sensor and as an autoload trigger, since they each work in opposite directions with the signal.
Not present > present = autoload trigger
Present > not present = filament runoutyou should be able to use conditional gcode within your trigger macro to implement this functionality.
-
@T3P3Tony said in Filament Presence & Trigger via Same Input?:
you should be able to use conditional gcode within your trigger macro to implement this functionality.
Could you shed some light on this?
Would I use M591 to define the pin for filament sensing, then skip the M950? Can the M581 reference the pin defined in the M591?
-
@CCS86 one option is to undefine it as a filament sensor and define it as a trigger in your sprint start and end macros. Roughly (untested):
start gcode:M950 J1 C"nil" ; free up the pin M591 D0 P1 C"nil" M581 T2 P-1
end gcode:
M591 D0 P0 M950 J1 C"e0stop" M581 P1 T2 S0 R0
The other option is keep it as a trigger the whole time (which is probably easier) and have the conditional gcode to check the state (https://github.com/Duet3D/RepRapFirmware/wiki/Object-Model-Documentation#statestatus)
e.g.
;trigger2.g if state.status = "processing" M98 filament-error.g ;example of some logic to handle the filament out situation else ;the existing logic to handle filament loading.