toolboard pickup/docked detection
-
OK, I throw in the towel. How do I do this? I have an NC switch I plan on wiring up to IO2 on the toolboard and want the docking move to stop as soon as the switch is tripped.
I also want to check the state of all of the switches on all of the tools before I do things like running bed tramming and mesh probing.
My best guess is in a macro to temporarily modify the endstop for the X axis and set it to "switch-type & high", and do a homing type move. then reset the endstop for X to "stall detection & low" for the typical homing move.
Does that sound right?
Also, I wired up the switch and it caused the board to stop working until I opened the switch, so I'm not sure what I'm doing wrong. I connected the 5v and gnd pins.
-
@gnydick don't wire 5v to ground. Never
You want to wire iox.in to ground.
You're lucky the duet boards are well made and you didn't fry it, which is what could've happened on cheaper boards.A homing move sounds best if you want the movement to instantly stop.
You can query all the switches states from the object model in your bed file before tramming the bed
-
@jay_s_uk thanks. I'm 95% sure when reading the docs about the board, it says 5v for endstops specifically, not sure how else I was supposed to interpret that. I'll reread to confirm.
-
@jay_s_uk I have a half working solution. If I swap the X endstop for the io2.in pin on the appropriate tool board, the docking will stop with a
G1 H4
.But, if I want to home, I have to change the endstop back to the original. At that point, there are no endstops configured to be read. I have 4 tools, I want to make sure all 4 are docked before I do certain moves.
I looked at triggers, no good, because they're a single event, so I can't look at state.
I can define a GPIO pin but apparently, there is no way to just read the pin value from the object model.
Any more ideas?
-
@gnydick have you looked under sensors.gpIn[].value?
That's where they should be listed if setup with M950 J -
@gnydick You can certainly check gpio pins from gcode, see DC42's blog post from some time ago that does something like you want to do: https://miscsolutions.wordpress.com/2020/06/06/improvements-to-the-hemera-tools/
-
@jay_s_uk thank you, I kept searching for "gpio" not "gpIn"
-
@gnydick the wiki page on the object model can be quite handy to look through as it'll give you an idea of everything available
https://github.com/Duet3D/RepRapFirmware/wiki/Object-Model-Documentation