Endstop pin state
nikos last edited by
I made machne that moves two sets of valves controled by duet2wifi . And I have problem with moving axes.
I need to move axes from one endstop too another. Axes moves only in two position but I need to be sure that it reaches it and after power up, know in what position it is. Thats why I mounted two mechanical endstops.
My problem is that I cant configure this second endstop.
First thought was to make trigger. unfortunately G1 moves are stored in buffer and need to be finished before trigger.
I serched for g/m code for imidately terminated moves but unfortunately I didnt find one. Only m112 but it shoot down duet too.
I was thinking to make a small loop witch move axes for about 0,5mm but before each move check state on endstop pin. I know that duet with meta commands should do this but unfortunately I dont Know how.
I can make loop and it work fine but when I add condition for checking a pin state It dosent work.
I make input Pin with m950 and check state with m409 but it don't change value when I use endstop.
For checking I use:
M950 J1 C"^e0stop"
M409 K"sensors.gpIn.value" or "m409 K"state.gpIn.value"
At this point I use M574 for change endstop pin for axes when moving. But after power up duet don't know axes position before power off. I know that I can use m911 too save state on power loss but hopping that I will be able to configure it depends on pin state. It will open up for me whole new way to use Duet.
jay_s_uk last edited by
if you are just moving from on to the other why not just do it as a homing move?
so for min
M574 U1 S1 P"whatever" G1 H1 U-400
then for max
M574 U2 S1 P"whatever" G1 H1 U400
Although you can only have one endstop at a time for each axis, theres nothing stopping you from reconfiguring it before a move
You could also use a G38.2 probing move
nikos last edited by
@jay_s_uk Your solution is the way it works right now. But when I will be able to configure it with simple logic it will allow me make it full independent from user.