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

    Possible to have both high and low endstops for an axis?

    Scheduled Pinned Locked Moved
    CNC
    4
    7
    408
    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.
    • p0rr1dg3undefined
      p0rr1dg3
      last edited by

      Hi
      Have built a CNC machine which has dual Nema23s on both X and Y axes, and a single Nema 23 on the Z. Am using a Duet 2 Wifi (2.0.2 firmware) to control the machine and it is working fine.
      Do have a problem with endstops though, in that can only define an endstop as high or low, and hitting an endstop does not stop subsequent commands. Not an issue with FDM machines where endstops are used in homing to define 0,0,0 (always in the same place) and axis travel extents work because calculated and absolute positions are the same.
      With CNC machines however, 0,0,0 is not fixed but is set based on a point on the stock. This means that depending on the axis minima and maxima defined in the config, it is possible to give the machine a move command that exceeds the amount of travel physically available.
      For example, my machine has 500x500x120mm travel (XYZ). Minima and maxima are set to -500,-500,-120 and 500,500 and 120 respectively. If my stock 0,0,0 is at 250,250,60 (absolute bed position), I could send G0 X-300 F750 which is within the defined min max limits but which will crash the machine as it tries to travel to absolute -50 X.
      Thought endstops would be the answer. As a test, wired two microswitches in parallel and put them on either end of the x axis, and added it to config file using M574. Stops X axis when either switch is triggered, which is fine, but problem is 1) Duet assumes has hit whichever endstop is defined in config (high or low) regardless of actual endstop triggered, and 2) does not stop but will carry on with next move command.
      All of this leads to my question - is it possible within the firmware framework to have none, high, low and both options for endstops, the last option using direction of travel to figure out which endstop has been hit, and to have a StopOnEndstopHit flag which would halt further command processing?
      Thanks in advance

      jay_s_ukundefined chimaeraghundefined 2 Replies Last reply Reply Quote 0
      • jay_s_ukundefined
        jay_s_uk @p0rr1dg3
        last edited by

        @p0rr1dg3 you can't as you say have both hi and low endstops. What you can do though is set them both up as triggers once you've homed the machine and then use that trigger to pause the machine

        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

        p0rr1dg3undefined 1 Reply Last reply Reply Quote 0
        • p0rr1dg3undefined
          p0rr1dg3 @jay_s_uk
          last edited by

          @jay_s_uk Thanks for that. Haven't gone particularly in depth into advanced Duet topics, so am not sure how I would go about setting endstops up as triggers. Any advice?

          jay_s_ukundefined deckingmanundefined 2 Replies Last reply Reply Quote 0
          • jay_s_ukundefined
            jay_s_uk @p0rr1dg3
            last edited by

            @p0rr1dg3 have a look at M581 https://docs.duet3d.com/en/User_manual/Reference/Gcodes#m581-configure-external-trigger
            you'll probably also want to run segmentation to speed up pausing e.g. M669 S1 T1

            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 1
            • deckingmanundefined
              deckingman @p0rr1dg3
              last edited by deckingman

              @p0rr1dg3 said in Possible to have both high and low endstops for an axis?:

              @jay_s_uk Thanks for that. Haven't gone particularly in depth into advanced Duet topics, so am not sure how I would go about setting endstops up as triggers. Any advice?

              https://docs.duet3d.com/User_manual/Reference/Gcodes#m581-configure-external-trigger

              A practical example of a Z max switch as I have on my machine is as follows

              M950 J3 C"^1.io5.in" ; exp board1 io 3, Z Max
              M581 P3 T0 R0 S0 ; Do emergency stop (T0), any time (R0). 
              

              Edit: Jay beat me too it as I was typing

              Ian
              https://somei3deas.wordpress.com/
              https://www.youtube.com/@deckingman

              p0rr1dg3undefined 1 Reply Last reply Reply Quote 1
              • p0rr1dg3undefined
                p0rr1dg3 @deckingman
                last edited by

                @jay_s_uk and @deckingman, will have a look at M581 and M669 commands. Both of your help and suggestions much appreciated 👍

                1 Reply Last reply Reply Quote 0
                • chimaeraghundefined
                  chimaeragh @p0rr1dg3
                  last edited by chimaeragh

                  @p0rr1dg3 I have an Ooznest Workbee CNC. It is configured with soft limits which prevent the machine from moving outside the machine limits.
                  What version of Duet Web Control are you using?
                  In CNC mode, we have machine coordinates (the actual physical limits of the CNC) and work coordinates, which are job specific.
                  When you set your X0 Y0 and Z0 they fall within the machine coordinates and you will get an error notification when the machine is given a command to move out of bounds.
                  Your work coordinates CANNOT exceed your machine coordinates limits.

                  Edit
                  I see you're using very old firmware. Please upgrade to the latest stable firmware and your issues will be solved.

                  Duet 2 Wifi, Ooznest Workbee CNC 1510

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