• Tags
  • Documentation
  • Order
  • Register
  • Login
Duet3D Logo Duet3D
  • Tags
  • Documentation
  • Order
  • Register
  • Login

Dual motor axis end stop woes

Scheduled Pinned Locked Moved
CNC
4
16
749
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • undefined
    tierod
    last edited by 5 Mar 2024, 01:32

    Hi everyone, I’m using a duet2 Ethernet with version 3.4.4. I have a dual motor axis with an end stop for each motor and It works as normal. Each motor stops as each end stop is hit, all good and have been using it for awhile now. I use normally closed switch arrangement as I thought if wiring fails it wouldn’t home, wrong! I had a stuck micro switch on one side(open circuit) poor quality? Anyway I hit home only one side of the gantry started moving, luckily I was able to hit the e stop before it did any damage. I don’t have access to my config right now but it’s the standard m574 x1 s1 P”x stop+e0stop” that I’ve been using for awhile. I also just use x,y,z without the u axis in my homing files but I thought that was how it’s done. What am I missing?

    Rod

    undefined undefined undefined 3 Replies Last reply 5 Mar 2024, 01:36 Reply Quote 0
    • undefined
      tierod @tierod
      last edited by 5 Mar 2024, 01:36

      Forgot to add I use m584 x5:6 u6 y7 z8 for mapping

      undefined 1 Reply Last reply 5 Mar 2024, 07:41 Reply Quote 0
      • undefined
        droftarts administrators @tierod
        last edited by 5 Mar 2024, 07:41

        @tierod please post your full config.g and the homing macro you were running. Please also send M115 in the console and post the response.

        Ian

        Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

        1 Reply Last reply Reply Quote 0
        • undefined
          droftarts administrators @tierod
          last edited by 5 Mar 2024, 11:14

          @tierod Reading your issue again (and not on my phone) I understand what happened. With the stuck endstop, the machine thought that side was homed, and continued to home the other side. Lucky you caught it! Currently, there is no mechanism to stop the other side automatically, but @jay_s_uk has suggested that we make this configurable, e.g. limit the movement of the second side to 5mm. I've asked @dc42 for his thoughts.

          I think your setup is fine. I don't think there's any advantage using Normally Open rather than Normally Closed switches; I would guess the failure mode is still possible.

          There may be a way of checking both switches repeatedly, with a short homing move between, but I expect it would require splitting the Y axis into two separate axes, and homing them together in short movements.

          Ian

          Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

          1 Reply Last reply Reply Quote 0
          • undefined
            jay_s_uk @tierod
            last edited by 5 Mar 2024, 16:43

            @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 movement

            if 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

            Owns various duet boards and is the main wiki maintainer for the Teamgloomy LPC/STM32 port of RRF. Assume I'm running whatever the latest beta/stable build is

            undefined 1 Reply Last reply 5 Mar 2024, 21:00 Reply Quote 3
            • undefined
              tierod @jay_s_uk
              last edited by 5 Mar 2024, 21:00

              @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.

              undefined 1 Reply Last reply 5 Mar 2024, 23:55 Reply Quote 1
              • undefined
                tierod @tierod
                last edited by tierod 3 May 2024, 23:56 5 Mar 2024, 23:55

                @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 positioning

                if 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😕

                undefined 1 Reply Last reply 6 Mar 2024, 07:35 Reply Quote 0
                • undefined
                  jay_s_uk @tierod
                  last edited by 6 Mar 2024, 07:35

                  @tierod no, that wouldn't be correct.
                  firstly, you need to maintain the indentation, otherwise the code won't work

                  for 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."
                  

                  Owns various duet boards and is the main wiki maintainer for the Teamgloomy LPC/STM32 port of RRF. Assume I'm running whatever the latest beta/stable build is

                  undefined 1 Reply Last reply 6 Mar 2024, 16:03 Reply Quote 0
                  • undefined
                    tierod @jay_s_uk
                    last edited by 6 Mar 2024, 16:03

                    @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

                    undefined 1 Reply Last reply 7 Mar 2024, 00:38 Reply Quote 1
                    • undefined
                      tierod @tierod
                      last edited by tierod 3 Aug 2024, 00:21 7 Mar 2024, 00:38

                      @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 positioning

                      if 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 = true

                      G1 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

                      undefined 1 Reply Last reply 7 Mar 2024, 08:50 Reply Quote 1
                      • undefined
                        o_lampe @tierod
                        last edited by 7 Mar 2024, 08:50

                        @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

                        undefined 1 Reply Last reply 8 Mar 2024, 00:34 Reply Quote 0
                        • undefined
                          tierod @o_lampe
                          last edited by tierod 3 Aug 2024, 00:36 8 Mar 2024, 00:34

                          @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

                          undefined undefined 2 Replies Last reply 8 Mar 2024, 07:30 Reply Quote 0
                          • undefined
                            droftarts administrators @tierod
                            last edited by 8 Mar 2024, 07:30

                            @tierod great, glad it works for you. I’ll add it to the endstop page of the wiki.

                            Ian

                            Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

                            1 Reply Last reply Reply Quote 0
                            • undefined
                              o_lampe @tierod
                              last edited by 8 Mar 2024, 07:58

                              @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.

                              undefined 1 Reply Last reply 10 Mar 2024, 14:27 Reply Quote 0
                              • undefined
                                tierod @o_lampe
                                last edited by 10 Mar 2024, 14:27

                                @o_lampe
                                No problem, I’ll do that, thanks!
                                Rod

                                undefined 1 Reply Last reply 9 Apr 2024, 17:25 Reply Quote 0
                                • undefined
                                  tierod @tierod
                                  last edited by 9 Apr 2024, 17:25

                                  @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!

                                  1 Reply Last reply Reply Quote 1
                                  • First post
                                    Last post
                                  Unless otherwise noted, all forum content is licensed under CC-BY-SA