M581 external trigger
-
Background: I want more hardware buttons and hence more triggers. I have been experimenting with using end stops in use to trigger macros for homing and jogging the x/y.
Unfortunately this has the side effect of triggering the macros during homing. This could probably be avoided by disable the triggers before homing and then enable them again. M581 S-1
The use of conditions in G code (listed in the firmware backlog) could possibly make some or all of below possible without modifying the M581. Also general I/O pins to cause triggers would be really nice
Wish #1
I find it logical to disable triggers on end stops in use while homing, by default or by config.And related an option to trigger different trigger files depending on if printing going on or not. As of today the option is always or only when printing.
Wish #2
A option "when not printing" M581 C2 ??Wish #3
And lastly, possibility to have several M581 for the same port but with different conditions and logical id/trigger#.g file -
@fotomas said in M581 external trigger:
Background: I want more hardware buttons and hence more triggers. I have been experimenting with using end stops in use to trigger macros for homing and jogging the x/y.
Unfortunately this has the side effect of triggering the macros during homing. This could probably be avoided by disable the triggers before homing and then enable them again. M581 S-1You can do that in the homing files.
Wish #2
A option "when not printing" M581 C2 ??I can add that. Do you have a particular use case?
Wish #3
And lastly, possibility to have several M581 for the same port but with different conditions and logical id/trigger#.g file
That's already possible.
-
Building a CNC (MPCNC) with a 0.6 board and a Duex4 I have got six end stops to use.
Use case wish #2 :
I am not there yet but I imagine jogging the spindle to corner of the stock and zeroing all axis there will be a rather common task.Four physical buttons moving to the corner of the stock G1 X / Y, using X / Y end stops.
One physical button to home Z, using Z end stop.None of these is desirable during printing. My end stop micro switches could be triggered by accident during printing. For example leaning over the machine to see or clean with a vacuum cleaner. That is why I would like to block the triggers during printing.
Of course the DWC and Panel Due could be used but leaning over the machine eyeballing where 0,0 will be reaching for physical buttons would be very nice.
This also opens up for other usage for the buttons during printing, like babaystepping, pause etc.
BUT using conditions in G code would be another way to go about it and that modification of the firmware probably opens up to a lot more creative ideas. Assuming the condition IS_PRINTING is implemented.
Related question
Is G10 possible on 0.6 board to do a "current (not knowing coordinate in macro) coordinate will from now be X0, Y0", instead of G92 X0 Y0 and risking running past axis max values?Wish #3:
So this is possible ??(I haven't tested)M581 X S1 T2 C1 ; Do T2 pressing button
M581 X S0 T3 C2 ; Do T3 releasing buttonIn combination with wish #2, C2
M581 X S1 T2 C1 ; Do T2 when printing
M581 X S1 T3 C2 ; Do T3 when NOT printingAnd going all in :
M581 X S0 T2 C1
M581 X S1 T3 C2
M581 X S0 T4 C1
M581 X S1 T5 C2 -
@fotomas said in M581 external trigger:
Is G10 possible on 0.6 board to do a "current (not knowing coordinate in macro) coordinate will from now be X0, Y0", instead of G92 X0 Y0 and risking running past axis max values?
No. The firmware build for legacy Duets is memory-constrained compared to current Duets, so the support for workplace coordinates is disabled in that build. You could enable it if you build the firmware yourself, but you would probably need to make some memory savings elsewhere, for example by reducing the maximum number of drives from the standard value (9).
-
@fotomas said in M581 external trigger:
This also opens up for other usage for the buttons during printing, like babaystepping, pause etc.
I added hardware buttons to my 3d printer. I posted about it on my blog because I had a hard time finding information on the process at the time and had to just wing it. I added buttons for Pause, Reset, ATX On, Home all, and Disable Steppers. I wanted to add Halt (RRF calls it Emergency Stop) and ATX Off but both of those require confirmation in DWC so I wasn't able to get them to work.
Anyway, you can see my trigger files and config settings on my aforementioned blog.
-