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

    Moving "beyond" the limit switch

    Scheduled Pinned Locked Moved
    Duet Hardware and wiring
    4
    7
    550
    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.
    • TechNiundefined
      TechNi
      last edited by TechNi

      Hey,

      I am homing my axes with a hall sensor which triggers about 10mm away from the sensor which is also the problem. I need the few extra mm and would like to park the print head a bit closer to the sensor.

      I want to home the axis and then move ~5mm further than the defined axis limit and then define this as new axis limit. Is that possible?

      What would I need to add/change?

      G91
      G1 H1 X999 F8000 ; Rough homing
      G1 X-10 F8000 ; Move back a few mm
      G1 H1 X999 F400 ; Precision homing
      G1 X5 ; Move into final parking position (beyond the limit switch)
      
      1 Reply Last reply Reply Quote 0
      • Phaedruxundefined
        Phaedrux Moderator
        last edited by

        The axis limits are set by M208, so if your endstop triggers 10mm away from the actual limit of travel you can set the M208 limit to be negative or positive to adjust the actual range of motion. Does that make sense?

        Can you post your config.g and homing files so I can make a more specific recommendation?

        Z-Bot CoreXY Build | Thingiverse Profile

        TechNiundefined 1 Reply Last reply Reply Quote 0
        • TechNiundefined
          TechNi @Phaedrux
          last edited by

          I've set the center of the bed as origin (0,0), so my axes limits are defined like this in the config file:

          M208 X200 Y200 Z200 U200 S0 ; set axis maxima
          M208 X-200 Y-200 Z0 U-200 S1 ; set axis minima
          

          I think I've found the solution, though it's not very "clean" as I would prefer to have these kind of settings in my config and not my homing file:

          ; Homing X
          G91
          
          M208 X200 Y200 Z200 U200 S0 ; set the original X axis maxima
          G1 H1 X999 F8000 ; Rough homing
          G1 X-10 F8000 ; Move back a few mm
          G1 H1 X999 F400 ; Precision homing
          
          M208 X205 Y200 Z200 U200 S0 ; set the extended X axis maxima
          G1 X5 F400; Move into final parking position
          

          If I now calibrate the axis limits (e.g. for an IDEX printer), I have to change the limits in multiple homing files which is not very practical.

          I wonder if there's a more practical solution?

          Phaedruxundefined OwenDundefined fcwiltundefined 3 Replies Last reply Reply Quote 0
          • Phaedruxundefined
            Phaedrux Moderator @TechNi
            last edited by

            @techni said in Moving "beyond" the limit switch:

            I wonder if there's a more practical solution?

            You can also use G92 to force the current position as whatever you need it to be.

            https://duet3d.dozuki.com/Wiki/Gcode?revisionid=HEAD#Section_G92_Set_Position

            Z-Bot CoreXY Build | Thingiverse Profile

            1 Reply Last reply Reply Quote 0
            • OwenDundefined
              OwenD @TechNi
              last edited by OwenD

              @techni
              You already have the trigger position from your G1 H1 move.
              *EDIT: As @fcwilt pointed out below, G1 H1 would set the current position per M208
              You'd have to use G1 H3 to set M208 to the trigger position then do the addition
              This would require an end stop on the minima as well or you would not have a valid reference *
              You can use that to calculate the M208 parameters.
              You could also easily extend that so that the extra amount is set in config.g by using global variables.

              Config.g

              M208 X200 Y200 Z200 U200 S0 ; set the original  X axis maxima
              global XparkValue = 5
              global YparkValue = 5
              

              .in your home file

              M208 X{move.axes[0].machinePosition + global.XparkValue} S0 ; set the extended X axis maxima
              

              I'd leave out any axis I wasn't setting from the home file to avoid resetting an axis you've already modified

              TechNiundefined 1 Reply Last reply Reply Quote 0
              • fcwiltundefined
                fcwilt @TechNi
                last edited by fcwilt

                @techni said in Moving "beyond" the limit switch:

                I wonder if there's a more practical solution?

                G92 can be used for such a situation.

                As you have found the G1 H1 move sets the position to the min/max of the axis as set in M208.

                And those min/max values may have no relation to the position of the endstop sensor.

                For example on a printer I am currently working on the Z range is from 0 to 200 but the Z endstop sensor triggers at Z = 12.30.

                So here is the essential parts of homez.g:

                G91
                G1 H1 Z-300 F900
                G1 Z10
                G1 H1 Z-15 F300
                G90
                G92 Z12.30 ; this is the important part - it tells the firmware that Z is not at Zmin but at Z=12.30
                

                Printers: a E3D MS/TC setup and a RatRig Hybrid. Using Duet 3 hardware running 3.4.6

                1 Reply Last reply Reply Quote 0
                • TechNiundefined
                  TechNi @OwenD
                  last edited by

                  @owend This is neat. I've never used global variables before but this might actually solve other problems too, thanks!

                  @fcwilt @Phaedrux I think I'll use G92 then in combination with global variables. Thanks a lot!

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