Setting up a "Go Home" and "Start" button
-
I set up a duet, and it works great with the touchscreen, for setup. But it's a repetitive task that does not need a fragile touchscreen in this environment. Especially when I'd like to put that screen to use elsewhere.
I tried to configure the endstops as a Start button to run a macro (and to trigger a homing sequence), but it's not working. I'm thinking it's in my config, since neither work, or perhaps it can't work when the control is idle.
Is this possible at all? (Setting up a mechanical "Start" button and mechanical "HomeAll" button?)
Here's my code segment in config.g:; Triggers, for initiating a "FIND HOME" Command and Start a Cycle ; First, configure the inputs: M950 J1 C"!^xstop" ; Input 1 uses e1Stop pin, inverted, pullup enabled M950 J2 C"!^ystop" ; Input 1 uses e0Stop pin, inverted, pullup enabled ; Second, configure the triggers: M581 T2 X S0 ; Home the Z, on X limit NOTE: T{N} = runs the macro "sys/trigger{N}.g" M581 T3 Y S0 ; Start a cycle, on Y limit
My Trigger macros are simple:
; Trigger2.g MACRO ; Disable START button: M581 T3 P-1 ; don't invoke trigger 3 (cycle start) on any input change while running M106 P1 S0 ; TURN OFF GREEN LIGHT connected to Fan ; Call the Homing macro: M98 P"HomeAll.g" M106 P1 S255 ; TURN ON GREEN LIGHT ; Resume checking the input: M581 T3 Y S1 ; START a cycle on Y limit
Trigger3:
; Trigger3.g MACRO ; Triggered on START button ; M581 T2 X S1 ; Home the Z, on X limit NOTE: T{N} = runs the macro "sys/trigger{N}.g" M581 T2 P-1 ; do not invoke trigger 2 on any input change any more M106 P1 S0 ; TURN OFF GREEN LIGHT M106 P0 S255 ; Turn ON fan M98 P"MainGCode.g" M106 P1 S255 ; TURN ON GREEN LIGHT M106 P0 S0 ; Turn OFF fan M581 T2 X S1 ; turn it back on
Any suggestions would be welcome. Thanks in advance.
-
@tenaja I'm having trouble understanding what you are trying to do because you seem to be wanting to use the x and y endstops to be both the trigger to run macros and also to be the trigger to set the homing position. If you trigger the end stop to call the macro, and that macro then calls home all, the same end stop will get triggered again during the homing routine, which will call the macro which will try to do home all which will trigger the macro etc etc....
If it helps, I use 9 spare end stop inputs to run 9 different macros to carry out various functions ( I have a number of expansion boards so plenty of spare io connectors). One of those is a simple momentary push button which, when pressed will run home x and Y. Here is how that one io is configured.......
M950 J9 C"^3.io1.in" ; exp board 3 io1, homing push button using macro trigger4
M581 P9 T4 R0 S0 ;Run trigger4 macro - (homing buttonand here is the macro that runs when the button is pressed
; ******Trigger 4 - Home X and Y push button
M118 S"Trigger 2 - Home and Y"
M98 P0:/"homex.g"
M98 P0:/"homey.g"Edit. If that doesn't help, give a bit more detail about what happens when you try to run your macro. Simply saying it's not working doesn't give much of a clue.
-
@deckingman said in Setting up a "Go Home" and "Start" button:
position
The X&Y axes are not used. I am trying to make them be "start switches" to run the macros. They are NOT used as limit switches or positional home switches.
And I do disable the switch during the homing operation so somebody doesn't press it several times in a row.
When I get back to my computer I'll compare your setups to what I had.
Not working means there are no actions observable.
Thanks!
-
@tenaja The easiest way to debug a macro is to step through it one command at a tine and observe what happens. If you send commands with parameters, send the same command again without parameters and observe the response in the console. Start by checking the end stop state as you trigger it.
-
@deckingman , I forgot to come back here, but your setup helped, and got me working. Thank you very much!
The Duet wifi was not reliable enough to use in debug--it never stays connected for more than a few minutes, and it is in the same room as the router. Even simple edits to gcode were a race to see if you could get it done & saved before losing connection.
-
@tenaja said in Setting up a "Go Home" and "Start" button:
The Duet wifi was not reliable enough to use in debug--it never stays connected for more than a few minutes, and it is in the same room as the router. Even simple edits to gcode were a race to see if you could get it done & saved before losing connection.
There is something wrong somewhere in your WiFi setup.
Have you tried using a cell phone WiFi analyzer application to check the WiFi conditions in your room?
The range of the Duet WiFi board is limited but with the source of the WiFi connection being in the same room it should work fine.
I had to install an WiFi Access Point near my printers to get the signal strength up to the level that that Duet WiFi needed. Since then I have never had a disconnection.
Frederick
-
@fcwilt Yes, I have used a WIFI analyzer. This is my only device that has connection issues, including an RPi0W on the other end of house, down a level, through many walls and bookshelves, and it has remained connected continually for a year.
I have not yet updated the WIFI/web firmware, and that will be next. I will start a new topic if I need help and an update fails. The WIFI was not important for this project, other than it should have been helpful for setup.
-
@tenaja said in Setting up a "Go Home" and "Start" button:
@fcwilt Yes, I have used a WIFI analyzer.
What did it reveal in regards to co-channel and adjacent channel interference?
I have not yet updated the WIFI/web firmware
For reference I am use firmware v3.1.1.
Frederick