Dual motor axis end stop woes
-
@tierod i've talked about this a little more with @droftarts and we think we have a solution.
here is an example check I do on one of my printers in the homing file before any other movementif sensors.endstops[0].triggered = true ; if we're hard against the endstop we need to move away M564 H0 S0 G1 X-20 F1200 M564 H1 S1 M400 if sensors.endstops[0].triggered = true abort "X Endstop appears to be faulty. Still in triggered state."
this checks the endstop status on a single axis and if its triggered, moves the axis away and checks the status again, eventually ending up in an abort if its still showing triggered.
you'll just need to modify it to include an "or" for the second endstop (you can get the right sensor number from the object model browser plugin) and to reduce the movement before the second endstop check -
@jay_s_uk
That’s awesome! Thank you guys very much. I’ll implement that and see how it works but may take me a while, never used object model before. I’ll let you know how it goes.
Again, thank you very much for your help!
Rod. -
@tierod
hi again, i havent been able to get to my cnc yet but does the homeall have to look something like this?; homeall.g
; called to home all axes
G91 ; relative positioningif sensors.endstops[0].triggered = true ;if were hard against endstop or wiring faulty
or sensors.endstops[1].triggered = true ;as above
m564 h0 s0
g1 x-2 f1200
m564 h1 s1
m400
if sensors.endstops[0].triggered = true
abort "x endstop appears to be faulty. still in triggered state"
or sensors.endstops[1].triggered = true abort "u endstop appears to be faulty. still in triggered state"G1 H2 Z5 F6000 ; lift Z relative to current position
G1 H1 X-700 Y-400 F12000 ; move quickly to X and Y axis endstops and stop there (first pass)
G1 H2 X5 Y5 F6000 ; go back a few mm
G1 H1 X-235 Y-215 F360 ; move slowly to X and Y axis endstops once more (second pass)
G1 H1 Z155 F360 ; move Z up stopping at the endstop
G90 ; absolute positioning
g92 x0 y0
g1 x5 y5
g92 x0 y0
im clueless when it comes to anything about meta commands etc. i can sort of get around simple gcode
thanks -
@tierod no, that wouldn't be correct.
firstly, you need to maintain the indentation, otherwise the code won't workfor the or part we can probably simplify it slightly
if sensors.endstops[0].triggered || sensors.endstops[1].triggered M564 H0 S0 G1 X-2 F1200 M564 H1 S1 M400 if sensors.endstops[0].triggered || sensors.endstops[1].triggered abort "X Endstop appears to be faulty. Still in triggered state."
-
@jay_s_uk
Right, that makes perfect sense (says the guy who hasn’t got a clue)
Once again, thank you very much!
The dual motor axis end stops configuration has always worried me because of the potential for disaster, (ask me how I know ) so this issue caught me off guard. I’ll implement it, test it and let you know how it goes. Cheers!
Rod -
@tierod
it works! so awesome!
had to make a few changes, after trying this and that this is what i ended up with. dont know if it can be improved on but a couple things to note: will not work if you have the previous homing file stopping with the endstops triggered and it gives the warning :not sufficient axis homed" even when it works, not sure why? i would prefer have the original message you wrote. no idea how to fix that. could you give me your thoughts on the file? by the way, line 2 to 7 is indented, not sure why it comes up not; homeall.g
; called to home all axes
G91 ; relative positioningif sensors.endstops[0].triggered || sensors.endstops[1].triggered = true
^abort "X Endstop appears to be faulty. still in triggered state"
^m564 h1 s1
^g1 x-5 f1200
^m564 h0 s0
^m400
^if sensors.endstops[0].triggered || sensors.endstops[1].triggered = trueG1 H1 Z95 F3000 ; lift Z relative to current position
g1 h2 z-5 f300 ; move away from endstop
g1 h1 z10 f300 ;move Z up stopping at the endstop
g1 h2 z-5
G1 H1 X-1190 Y-1190 F3000 ; move quickly to X and Y axis endstops and stop there (first pass)
G1 H2 X10 Y10 f300 ; go back a few mm
G1 H1 X-15 Y-12 F360 ; move slowly to X and Y axis endstops once more (second pass)
g1 h2 x10 y10
G90 ; absolute positioning
G92 x0y0z0 ; set xyz position to axis minimum
thanks!
Rod -
@tierod said in Dual motor axis end stop woes:
if sensors.endstops[0].triggered || sensors.endstops[1].triggered = false
abort "X Endstop appears to be faulty. still in triggered state"You should check for "true" state in both cases.
Put your code in </> brackets to show the indention. The </> symbol is on top of the editor window
-
@o_lampe
Thanks for that.
Edited the last post, is correct and works giving the proper warning now, just had to move the warning behind the first if statement. Sorry about the weird indentation! Oh and I also looked at the object model for the first time ️. What a great tool! I double checked the operation and it works with both left and right micro switches. I am so, so happy with this feature and I really think that all the people that help on this forum are number one in my books!! I believe this code should be made known somewhere easy to find, I can’t be the only one that has run into this issue. Again, thank you guys for your help!! Problem solved!
Rod -
@tierod great, glad it works for you. I’ll add it to the endstop page of the wiki.
Ian
-
@tierod I must apologize for my "true/false" mistake:
You are using normally closed endstops and have to check both if statements for false
Then you can move the error warning behind the second if-line. -
@o_lampe
No problem, I’ll do that, thanks!
Rod -
@tierod
hi all, just an update on this script
after changing the if statements to false, with the warning at the end it still gave me the red warning endstops not homed. so i moved it back behind the first if statement and it then gave me the correct blue error message.
it works perfectly this way so unless this is a bad move i’m going to leave it this way.
to reiterate, do NOT have your homing stop on the endstops as it will refuse to move, even 5mm off the endstops and all good.
again, thank you guys for this script!