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

    Mapping Endstops

    Scheduled Pinned Locked Moved
    My Duet controlled machine
    6
    21
    1.0k
    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.
    • Lukrativeundefined
      Lukrative @Danal
      last edited by

      @Danal So assuming I wired two NC endstops in series, my config file would look something like this?

      M584 U6 ; use drive 6 for the U axis
      M574 U1 S1 ; U axis endstop on low end, active high

      What about if I wanted to use two separate limit switches? Would this work?

      M584 U6 V6
      M574 U1 V2 S1

      Then I could create homing files for the U and V axes, where "home U" is move to the low end and "home V" is move to the high end. Then I could put in an if statement (in the homeu.g file) where while homing U, it will back off of the endstop if it's already triggered, but not if it's already away from it.

      Is there any reason this wouldn't work?

      1 Reply Last reply Reply Quote 0
      • Danalundefined
        Danal
        last edited by Danal

        That would probably work, but there is no need for V.

        U can have a high and a low homing switch.

        Probe with H1 when near the low. Edit: "when trying to find" is probably better phrase than "near"

        Probe with H3 when near the high. Edit: Ditto

        Delta / Kossel printer fanatic

        1 Reply Last reply Reply Quote 0
        • Danalundefined
          Danal
          last edited by Danal

          M574 U1 S1
          M574 U2 S1

          Delta / Kossel printer fanatic

          Lukrativeundefined dc42undefined 2 Replies Last reply Reply Quote 0
          • Lukrativeundefined
            Lukrative @Danal
            last edited by

            @Danal

            Lovely! Thanks for the reply.

            1 Reply Last reply Reply Quote 0
            • dc42undefined
              dc42 administrators @Danal
              last edited by

              @Danal said in Mapping Endstops:

              M574 U1 S1
              M574 U2 S1

              That's not supported (yet). The second command will override the first.

              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

              1 Reply Last reply Reply Quote 0
              • Danalundefined
                Danal
                last edited by Danal

                Oh drat. @dc42, Thanks for the clarification!

                @Lukrative then wire two NC switches in series, and you can still use H1, with appropriate numeric coordinates to find hi or lo.

                I know this works, because the U axis for my toolchanger is wired and configured this way.

                Delta / Kossel printer fanatic

                1 Reply Last reply Reply Quote 0
                • Danalundefined
                  Danal
                  last edited by Danal

                  To expand on that:

                  Homing U uses a microswitch in a very conventional fashion. Homing unlocks a tool.

                  The second switch, wired in series with the first, is between two disks with a spring arrangement such that when locking a tool, the lock reaches a certain amount of torque and the spring stretches and the disks move in relation to each other, thus opening the second switch.

                  This forms a "torque sensor" so the lock is moved to a specific torque (not a specific position) when locking a tool.

                  Tool Unlock Macro. Moving the same direction that homing moves, that is, toward 0 (rotation), in this case via negative numbers because we want a relative move. Note the H1.

                  G91                 ; Set relative movements
                  G1 U-4 F9000 H2     ; Back off the limit switch with a small move
                  G1 U-360 F9000 H1   ; Perform up to one rotation looking for the home limit switch
                  G90                 ; Restore absolute movements
                  

                  Tool lock macro. Note the H1, even though we are now rotating positive it is still H1, not H3. Only one (logical) switch... that is really two physical, one at 'each end'.

                  ; Engage the toolchanger lock
                  
                  G91                 ; Set relative mode
                  G1 U10 F9000 H0      ; Back off the limit switch with a small move
                  G1 U360 F9000 H1    ; Perform up to one rotation looking for the torque limit switch
                  G90                 ; Set absolute mode
                  

                  This all applies directly to your linear axis. Two switches, series wired, always probe with H1, relative moves set positive/negative for the appropriate end.

                  Make sense?

                  Delta / Kossel printer fanatic

                  1 Reply Last reply Reply Quote 0
                  • Lukrativeundefined
                    Lukrative
                    last edited by

                    @Danal It's good to know that wiring in series is an option, but I want my tool change macros to work even if somehow the filament changer is out of alignment or if I'm just starting the machine. For example, suppose I call tool 0, which is on the left side of my printer. If the filament changer is already at the left endstop, I want it to move off the endstop to the right first, then go back to the endstop. If it's sitting at the right endstop, I would like it to just move to the left endstop without moving to the right first. As far as I understand, RRF3 allows you to do this with conditional statements. But if both endstops are wired in series, there's no way of knowing which of these options to choose without prior information.

                    @dc42 is this a viable method of tricking the firmware into having min and max endstops?

                    M584 U6 V6
                    M574 U1 V2 S1

                    1 Reply Last reply Reply Quote 0
                    • jay_s_ukundefined
                      jay_s_uk
                      last edited by

                      I remap my endstops within my tool locking and unlocking macros.

                      ; Engage the toolchanger lock
                      
                      M400                    ; Make sure everything has stopped before we make changes
                      
                      ; ################## Prepare Axis #########################
                      M584 P4			; Unhides U axis
                      
                      ; ################## Endstop Mapping ######################
                      M574 U2 S3        				; set U axis (tool changer) maxima to use motor stall
                      
                      ;################### Stall Detection ######################
                      
                      M915 U S3 F0 H20 R4700				; Coupler
                      
                      ;################### Locking Procedure ####################
                      G91                     ; Use relative positioning
                      G1 H1 U180 F5000 	; Move all carriages up 700mm, stopping at the endstops
                      G90                     ; Back to absolute positioning
                      
                      ; ################## Reset System #########################
                      M584 P3			; Hides U axis
                      
                      ; Unlock the toolchanger lock
                      
                      M400                    ; Make sure everything has stopped before we make changes
                      
                      ; ################## Prepare Axis #########################
                      M584 P4			; Unhides U axis
                      
                      ; ################## Endstop Mapping ######################
                      M574 U1 S1 P"io3.in"                    	; configure active-high endstop for low end on U via pin io3.in
                      
                      ;################### Locking Procedure ####################
                      G91                     ; Use relative positioning
                      G1 H1 U-90 F5000 	; Move all carriages up 700mm, stopping at the endstops
                      G1 H1 U5 F5000
                      G90                     ; Back to absolute positioning
                      
                      ; ################## Reset System #########################
                      M584 P3			; Hides U axis
                      

                      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

                      1 Reply Last reply Reply Quote 0
                      • Danalundefined
                        Danal
                        last edited by Danal

                        No problem... at startup, home, just like any other axis. I can't overstress that I'm doing EXACTLY what you are doing, just in a circle instead of a line. It all works. No jams, no funny startups. G28 and/or G28 U work normally. etc, etc, etc.

                        Do include homeu.g in homeall.g

                        homeu.g

                        G91                     ; Set relative mode
                        G1 U-360 F9000 H1       ; Big negative move to search for home endstop
                        G1 U6 F600              ; Back off the endstop
                        G1 U-10 F600 H1         ; Find endstop again slowly
                        G90                     ; Set absolute mode
                        

                        Jay is remapping so he can use stall detect. Which also works great, after you tune it. (Jay and I talk a lot on the Jubilee discord).

                        Delta / Kossel printer fanatic

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