SOLVED - Help needed with Duet Gen 3 external triggers
-
@bearer The UPS is pretty dumb in that respect. It simply has a few sets of contacts that close on various events. I should have mentioned it but I'm running stand alone - i.e. not using the RPi just yet.
-
ah, can't say i've tried triggers with the standalone firmware.
maybe M118 can help you spit out some debug info to web or usb to determine if the triggers do trigger?
https://duet3d.dozuki.com/Wiki/Gcode#Section_M118_Send_Message_to_Specific_Target -
@bearer I can get the trigger to work if I set the "T" parameter to "0" and so initiate an emergency stop, rather than call a macro. Which is why I think I've done something stupid with the macro. Maybe it needs a "G4" here and there? I'll give that a shot and see if it helps.
-
@deckingman said in Help needed with Duet Gen 3 external triggers:
a trigger macro called "trigger2"
with .g suffix presumably? if T0 works but the macros don't it would explain things if you left out the .g
-
@bearer Yes to the ".g" but I've made a bit of progress thanks to your tip about using M118.
So I have these two commands in config.g
M581 P"0.io3.in" S0 T2 C0; Main board io3. Run macro trigger2 to set bed temperature fault detection to 60 degrees to 0 on falling edge
M581 P"0.io3.in" S1 T3 C0; Main board io3. Run macro trigger3 to restore bed temp fault detection on rising edge
Then I've put M118 S "Trigger 2" at the start of trigger2.g and M118 S "Trigger 3" at the start of trigger3.g.
Now when I short the io3 to GND, nothing happens. But when I then make that open circuit, both trigger 2 and trigger 3 get run. Trigger 3 restores the fault detection parameters back to where they were in config. g which is why it appeared that nothing was happening (because trigger 3 runs straight after trigger 2).
Maybe I can't use triggers in this way? Basically I'm trying run a macro when a switch closes and run a different macro when it opens. So I thought that using S0 and S1 to detect rising edge or falling edge was that way to do that. Am I wrong? What seems to be happening is that both rising edge and falling edge macros run when the switch is open circuit and neither macro runs when it is closed.
-
move the T3 M581 from config.g and move it to trigger2.g
and also reset T2 in trigger3.g and T3 in trigger2.g, should be possible to toggle them with something like that.
-
@bearer Sorry I'm being thick today. I've read that about 6 times but I can't make sense of it. Not sure what this means nor how to reset a "T" parameter. "also reset T2 in trigger3.g and T2 in trigger2.g, "
Wait............I should have checked the documentation for gen 3. https://duet3d.dozuki.com/Wiki/RepRapFirmware_3_overview#Section_M581. It is clearly stated that quote :
"The S parameter is removed. The command waits for a low-to-high input transition. To wait for a high-to-low transition, invert the pin name."
I'll try that.
-
...........and that works a treat!!!.
@bearer - Thanks for your help and sorry for taking up your time - I should have read the documentation.
-
should probably have used "disable" instead of reset. you can program the triggers in trigger files to change it on the fly, but not sure how you'd disable a trigger without the S parameter
-
@bearer said in Help needed with Duet Gen 3 external triggers:
should probably have used "disable" instead of reset. you can program the triggers in trigger files to change it on the fly, but not sure how you'd disable a trigger without the S parameter
No worries - it's all working fine (now that I've done what I should have to start with and read the documentation).