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

    Duet 2 WiFi Voron 2.4 - Multiple Z endstops query

    Scheduled Pinned Locked Moved Solved
    Duet Hardware and wiring
    4
    18
    648
    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.
    • Chaos3dundefined
      Chaos3d
      last edited by

      Hi All, First Time posting here so hopefully this is enough info for you to see the issue I'm having

      First off here is the machine spec
      Heavily modified Voron 2.4 CoreXY design to increase build volume to approx 450mm Cubed (and a few other things)
      20mm Linear rails all round (yes I know thats overkill)
      Duet2 Wifi & Duex5 expansion board
      Paneldue 7i
      4 x Nema 23 Z motors
      2 x Nema 17 for A/B Drive
      1 x E3D Hermes bowden extruder (now known as Hemera)
      E3D V6 hotend with modified Stealthburner

      Will be a custom bed and heater when i get that far!

      I am running :
      RepRapFirmware for Duet 2 WiFi/Ethernet version 3.4.5 (2022-11-30 19:36:12) running on Duet WiFi 1.02 or later + DueX5
      Duet WiFi Server Version: 1.27
      Duet Web Control 3.4.5

      And this is the machine in its current part built state:
      PXL_20230711_102552010.jpg

      I have got all the movement working and it homes as I want it to (max level on each axis so head ends up top right at the rear of the printer)

      I have installed 4 endstops one per z motor driver and verified each one triggers (led on duet board and on endstop - endstops are standard design makerbot mechanical v1.2 boards which require me to add the "!" mark in the pin names to inverse the signal to allow the axis movement)

      My current endstop and motor configuration looks like this (and there is a reason for only activating the first 3 endstops on the z axis which I will get to in a second:

      ; drive ---------------------------------------------------
      ;   ----+----   Z-Drives
      ;   | 6 | 7 |
      ;   ----+----
      ;   | 5 | 8 |
      ;   ----+----
      ;     Front
      
      M584 X0 Y1 Z5:6:7:8 E3		; motor bindings
      
      M569 P0 S0      ; X motor direction
      M569 P1 S0      ; Y motor direction
      M569 P3 S1      ; E0 motor direction
      M569 P5 S0      ; Z0 motor direction
      M569 P6 S1      ; Z1 motor direction
      M569 P7 S0      ; Z2 motor direction
      M569 P8 S1      ; Z3 motor direction
      
      ; endstops
      M574 X2 S1 P"!xstop"   ; X max active high endstop switch
      M574 Y2 S1 P"!ystop"   ; Y max active high endstop switch
      
      M574 Z2 S1 P"!duex.e2stop+!duex.e3stop+!duex.e4stop" ;+!duex.e5stop" ; Z max active high endstop switch
      

      so here is the issue - in the configuration shown above I have 4 z motors and 4 endstops aligned to the motors, so one endstop at the high end per motor - I want to run it like this to align the gantry when I home the machine, what I expected to happen (as I'm running RRF 3.4.5 ) was to declare the motors and associated endstops as per the documentation and the printer would home Z and as each motor hit its endstop it would stop (this is what I've read in the docs anyway) - what happens is really weird, firstly if I attempt to declare the endstops all together like this:

      M574 Z2 S1 P"!duex.e2stop+!duex.e3stop+!duex.e4stop+!duex.e5stop" ; Z max active high endstop switch
      

      it seems to totally ignore the end of the statement and none of the endstops actually function as written in the code and z will not home. If I remove the last endstop from the line it will home but will stop when ANY of the three configured endstops triggers rather than stopping just the motor its assigned to, I have tested this manually and any of the three will stop the z home but it wont do each motor in turn (which is what I expected to happen and what I understood from the docs and threads Ive read on the subject of multiple endstops and motors on an axis)

      all z motors and z endstops are on the duex board with the X/Y or A/B motors and endstops on the main Duet 2 Wifi board

      my homeall.g file calls another probe_zm.g file that contains this:

      
      G91                                    ; relative positioning
      M98 P"/macros/drive/z_downcurrent.g"
      G1 H1 Z430 F6000                       ; +Z probe move, fast. (*ADJUST* to 10mm larger than your Z size)
      M98 P"/macros/drive/z_fullcurrent.g"
      G1 H2 Z-2 F6000                      ; back off from the endstop
      G1 H1 Z3 F60                           ; +Z probe move, slow
      G1 H2 Z-5 F6000                        ; back off from the endstop
      
      

      Has anyone seen this kind of issue before? the endstop declaration issue looks like it not liking the length of the string between the "" not sure why the homeing is only looking at a single endstop (but any of the 3 !)

      droftartsundefined 1 Reply Last reply Reply Quote 0
      • droftartsundefined
        droftarts administrators @Chaos3d
        last edited by

        @Chaos3d I think your issue is due to a limit on the number of characters allowed in the P parameter. "!duex.e2stop+!duex.e3stop+!duex.e4stop+!duex.e5stop" is 51 character between the quotes, and the limit is 50. That's why removing one endstop works. The only option, unless you want edit and recompile the firmware, is to reduce the length of the parameter.

        As you're using endstop boards, you can't change the wiring to make them Normally Closed rather than Normally Open, which would allow you to shorten the parameter length by removing the !. So, the easiest thing to do is to change the name of the pin; pins often have more than one name, and others are shorter, and should get you under the 50-character limit:

        E2_STOP: duex.e2stop, exp.e2stop, exp.4
        E3_STOP: duex.e3stop, duex.cs6, exp.e3stop, exp.9
        E4_STOP: duex.e4stop, duex.cs7, exp.e4stop, exp.14
        E5_STOP: duex.e5stop, duex.cs8, exp.e5stop, exp.19
        (See https://docs.duet3d.com/Duet3D_hardware/Duet_2_family/DueX2_and_DueX5#pin-names)

        So try:

        M574 Z2 S1 P"!exp.4+!exp.9+!exp.14+!exp.19" ; Z max active high endstop switch
        

        Which would make it 29 characters long.

        The reason it stops all motors with one of the endstops removed is because it realises there would be nothing to stop the fourth axis (because 4 axes are defined), so it stops all of them, in the same way that if you only had one endstop, it would stop all axes.

        You can check the endstop assignment is being configured correctly by sending M574 on its own in the console, eg (this is mine):

        M574
        Endstop configuration:
        X: high end switch connected to pin io1.in
        Y: low end switch connected to pin io2.in
        Z: none
        

        This sort of error should also be picked up if you send M98 P"config.g" from the console, or if you sent the M574 command manually. eg:

        M574 Z2 S1 P"!duex.e2stop+!duex.e3stop+!duex.e4stop+!duex.e5stop"
        Error: M574: string too long
        

        It just doesn't tell you how long it should be!

        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
        • Chaos3dundefined
          Chaos3d
          last edited by

          Hi Ian,

          Many thanks for the help! - That makes a lot of sense I was wondering if it was a string too long error.

          So I've changed the config file and run the M574 command directly in the console and I now get this:

          M574
          Endstop configuration:
          X: high end switch connected to pin !xstop
          Y: high end switch connected to pin !ystop
          Z: high end switches connected to pins !(exp.e2stop,exp.4) !(exp.e3stop,exp.9,spi.cs6,duex.cs6) !(exp.e4stop,exp.14,spi.cs7,duex.cs7) !(exp.e5stop,exp.19,spi.cs8,duex.cs8)
          

          However something is really weird now as if I check the endstop state i see this:
          46c02deb-7930-4dd1-a0db-0db79ac2e634-image.png

          So the zstop state is now triggered and manually triggering all endstops does not clear that setting nor does removing the ! from each pin name

          executing the M574 Z2 S1 P"!exp.4+!exp.9+!exp.14+!exp.19" command at the console does not throw any errors either

          So the plot thickens!!!

          Richard

          droftartsundefined 1 Reply Last reply Reply Quote 0
          • droftartsundefined
            droftarts administrators @Chaos3d
            last edited by

            @Chaos3d Try configuring each endstop individually and testing them. It may be one is wired incorrectly. eg send

            M574 Z2 S1 P"!exp.4"
            

            And test that one endstop, then do the same for !exp.9, !exp.14 and !exp.19. I don't think the endstop logic is switched (ie remove the !), but it might be.

            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
            • Chaos3dundefined
              Chaos3d
              last edited by

              So I've now tried every combination of all the pin names and the only pin names that have any response are the Duex.eXstop versions the exp.4 /9 /14/19 have no response, duex.cs6/7/8 or exp.eXstop variations have no response in the interface at all on the endstop screen, all have been tested individually with and without the ! and none work 😞

              i dont understand why the pin names just dont work, it makes no sense

              Richard

              1 Reply Last reply Reply Quote 0
              • Chaos3dundefined
                Chaos3d
                last edited by

                if I run the M571 command from the console whilst the endstop is configured as exp.4/9 etc i get:

                m571
                Extrusion ancillary PWM has no pin
                
                dc42undefined 1 Reply Last reply Reply Quote 0
                • dc42undefined
                  dc42 administrators @Chaos3d
                  last edited by

                  @Chaos3d unfortunately the pin name aliases listed by @droftarts are not correct. In particular the duex.estop pins are routed through the I2C expander on the DueX and the expansion pins that are labelled as exp.estop become the CS pins on the DueX daughterboard connector.

                  So one option is for you to connect the endstop switches to the CS pins on the daughter board connector. But there is no protection on these pins, in particular the maximum input voltage is 3.3V.

                  @chrishamm could you please do a build of RRF 3.4.6rc1 for Duet 2 with the max pin name length increased to about 55?

                  Duet WiFi hardware designer and firmware engineer
                  Please do not ask me for Duet support via PM or email, use the forum
                  http://www.escher3d.com, https://miscsolutions.wordpress.com

                  chrishammundefined 1 Reply Last reply Reply Quote 0
                  • chrishammundefined
                    chrishamm administrators @dc42
                    last edited by

                    @dc42 @Chaos3d Yes, I can build new binaries with that change tomorrow morning.

                    Duet software engineer

                    1 Reply Last reply Reply Quote 0
                    • Chaos3dundefined
                      Chaos3d
                      last edited by

                      @dc42 said in Duet 2 WiFi Voron 2.4 - Multiple Z endstops query:

                      @chrishamm could you please do a build of RRF 3.4.6rc1 for Duet 2 with the max pin name length increased to about 55?

                      Wow thank you, that would solve all my issues, you are all stars!! 🙂

                      droftartsundefined chrishammundefined 2 Replies Last reply Reply Quote 0
                      • droftartsundefined
                        droftarts administrators @Chaos3d
                        last edited by

                        @Chaos3d Ah! Sorry, my mistake about the pin names. I suppose, when it didn't say 'duex.e2stop' in the response to M574, I should have realised the mapping wasn't correct:

                        Z: high end switches connected to pins !(exp.e2stop,exp.4) !(exp.e3stop,exp.9,spi.cs6,duex.cs6) !(exp.e4stop,exp.14,spi.cs7,duex.cs7)

                        @dc42 is this table wrong, then? https://docs.duet3d.com/Duet3D_hardware/Duet_2_family/DueX2_and_DueX5#pin-names

                        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

                        dc42undefined Chaos3dundefined 2 Replies Last reply Reply Quote 0
                        • dc42undefined
                          dc42 administrators @droftarts
                          last edited by

                          @droftarts yes, the duex.e#stop pins are not aliases for or shared with anything else. Whereas the cs5..cs8 pins are indeed shared with expansion connector pins.

                          Duet WiFi hardware designer and firmware engineer
                          Please do not ask me for Duet support via PM or email, use the forum
                          http://www.escher3d.com, https://miscsolutions.wordpress.com

                          droftartsundefined 1 Reply Last reply Reply Quote 0
                          • Chaos3dundefined
                            Chaos3d @droftarts
                            last edited by

                            @droftarts said in Duet 2 WiFi Voron 2.4 - Multiple Z endstops query:

                            @Chaos3d Ah! Sorry, my mistake about the pin names. I suppose, when it didn't say 'duex.e2stop' in the response to M574, I should have realised the mapping wasn't correct:

                            Hey no worries you helped identify the issue so we are good - I'm still learning all this so everything is useful!! 🙂

                            1 Reply Last reply Reply Quote 0
                            • droftartsundefined
                              droftarts administrators @dc42
                              last edited by

                              @dc42 said in Duet 2 WiFi Voron 2.4 - Multiple Z endstops query:

                              @droftarts yes, the duex.e#stop pins are not aliases for or shared with anything else. Whereas the cs5..cs8 pins are indeed shared with expansion connector pins.

                              Okay, I'll update the table.

                              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 1
                              • Chaos3dundefined
                                Chaos3d
                                last edited by

                                @chrishamm Sorry to pester but did the change go into 3.4.6.rc1? only im seeing the date as last week - or am I looking at the wrong thing?

                                droftartsundefined 1 Reply Last reply Reply Quote 0
                                • droftartsundefined
                                  droftarts administrators @Chaos3d
                                  last edited by

                                  @Chaos3d For a quick workaround, move one of the endstops to the Duet board if there are any available, eg e0stop, which is a shorter name and should get you under the 50 character limit.

                                  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

                                  Chaos3dundefined 1 Reply Last reply Reply Quote 0
                                  • chrishammundefined
                                    chrishamm administrators @Chaos3d
                                    last edited by

                                    @Chaos3d Please try out this v3.4 firmware build for the Duet 2: https://drive.google.com/file/d/1LH90R3sbF8BGaFa6T-F-cP40oIsBkET1/view?usp=sharing It has a maximum port length of 60 instead of 50, but be aware I have not tested it yet.

                                    Duet software engineer

                                    1 Reply Last reply Reply Quote 0
                                    • Chaos3dundefined
                                      Chaos3d
                                      last edited by

                                      @chrishamm - That worked like a charm!! - all endstops triggered as expected and gantry is leveled out which was exactly what i was looking for - I will go through the stuff I had working to make sure its still ok but so far all looking good!! many many thanks!

                                      Rich

                                      1 Reply Last reply Reply Quote 1
                                      • Chaos3dundefined
                                        Chaos3d @droftarts
                                        last edited by

                                        @droftarts ha ha I was just about to try that when I saw @chrishamm has posted an update 🙂 cheers @droftarts

                                        1 Reply Last reply Reply Quote 0
                                        • Phaedruxundefined Phaedrux marked this topic as a question
                                        • Phaedruxundefined Phaedrux has marked this topic as solved
                                        • droftartsundefined droftarts referenced this topic
                                        • First post
                                          Last post
                                        Unless otherwise noted, all forum content is licensed under CC-BY-SA