(RRF3.2 beta) Ignore external trigger while processing gcode.
-
I'd like to request for an R2 trigger when not printing /processing g-code - so the trigger is only available when idle or paused.
I have written a conditional external triggers which toggle relay module on/off. The relay will be connected to a dust extractor and used when the machine is not processing g-code, for example to clean up. I need to figure out a way of disabling it while processing g-code, in case it is pressed and turns off the extraction during a job (which is a fire hazard). I wanted to propose a third R option on the M581 command which ignored the trigger while processing , pausing, resuming and stopping g-code.
while state.status == "idle" | state.status == "paused" if state.gpOut[2].pwm==0 M7 M42 P8 S0.1 elif state.status == "starting" | state.status == "pausing" | state.status == "resuming" M7 M42 P8 S0.1 else M9 M42 P8 S0
The above is what I wrote to get around the issue but starting seems not to behave as I expected - is "starting" a state? I also noticed there are moments such as when the tool is moving from one z height to another between passes that if I press the external trigger I can toggle to pin.
-
@EducatingSavvas said in (RRF3.2 beta) Ignore external trigger while processing gcode.:
while state.status == "idle" | state.status == "paused" if state.gpOut[2].pwm==0 M7 M42 P8 S0.1 elif state.status == "starting" | state.status == "pausing" | state.status == "resuming" M7 M42 P8 S0.1 else M9 M42 P8 S0
Just an update that I've found a workaround for my problem described above. I've included the following in the daemon.g file:
if state.status == "paused" | state.status == "pausing" M950 J3 C"duex.e5stop" ; exp.e5stop M581 T3 P3 S0 R0 ; T3 toggle relay 1 M950 J4 C"duex.e6stop" ; exp.e6stop M581 T4 P4 S0 R0 ; T4 toggle relay 2 elif state.status == "resuming" | state.status == "processing" | state.status == "halted" M950 J3 C"duex.e5stop" ; exp.e5stop M581 T3 P-1 ; ignore T3 trigger M950 J4 C"duex.e6stop" ; exp.e6stop M581 T4 P-1 ; ignore T4 toggle trigger else M950 J3 C"duex.e5stop" ; exp.e5stop M581 T3 P3 S0 R0 ; T3 toggle relay 1 M950 J4 C"duex.e6stop" ; exp.e6stop M581 T4 P4 S0 R0 ; T4 toggle relay 2
And simplified the triggers#.g files as such:
if state.gpOut[2].pwm==0 M7 M42 P8 S0.1 else M9 M42 P8 S0
An R2 option on the M581 command would still be a much simpler way of implementing this - which I'd like to keep on the Wishlist for future RRF updates.
-
@EducatingSavvas It's already been done. See the release note - new features for 3.2 beta 1 here https://github.com/Duet3D/RepRapFirmware/blob/v3-dev/WHATS_NEW_RRF3.md
-
@deckingman Ah I was going by the functionality on the gcode library. I just checked this, and R2 does works but I need to still be able to use the relays during a pause. Maybe there could be an R3 option where the trigger is only available when idle and in a paused state.
This would be for turning on a dust extractor during a CNC pause - and manually cleaning up a mess, which is one of the reasons you pause on a CNC machine - in case anyone was wondering.