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

    Slow down before endstop?

    Scheduled Pinned Locked Moved
    CNC
    11
    101
    6.7k
    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.
    • OwenDundefined
      OwenD
      last edited by OwenD

      On some of the CNC plasma systems we sell, they have two inductive sensors as the end stops.
      On reaching the first, the machine slows and on reaching the second it stops and gives a limit error.
      I think that on reaching the first, the max speed is reduced. On leaving the zone it's restored.
      I think you could use a similar approach provided that you can create triggers that activate on both rising and falling
      M581 sort of says that you can if you call it twice for the same input with different values, but you'd have to try.
      When M581 is executed, if the T parameter is present but the other parameters are omitted, the trigger inputs and edge polarities for that trigger number are reported. Otherwise, the specified inputs and their polarities are added to the conditions that cause that trigger.

      EDIT
      Thinking on this, I don't think changing the max speed would interrupt a move in progress.
      You'd have to segment it

      jens55undefined 1 Reply Last reply Reply Quote 0
      • jens55undefined
        jens55 @OwenD
        last edited by

        @owend, that is a good point .... you would have to do the first move to the earlier stop as if it was the real end stop. Then go to the second end stop at a much slower speed.

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

          @thekm

          OK.

          I verified the M204 T does affect the acceleration of a G1 H1 move but when the endstop is triggered it stops immediately.

          Different value for M205 do not seem to change the stopping.

          The firmware supports "triggers" which are external events which can run code - but unless something has changed since I last tested that code cannot interrupt a move in progress.

          You could possibly "home" using a series of short moves (10mm ?) - the trigger code may get a chance to run at the end of each move and it could do one last move with low deceleration.

          I would have to test that.

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

          theKMundefined 1 Reply Last reply Reply Quote 0
          • theKMundefined
            theKM @fcwilt
            last edited by

            @fcwilt ...the more I play with it the more I think it would need a firmware tweak to get something that decelerates to a value or even decelerate to a stop rather than the hard termination.

            fcwiltundefined 1 Reply Last reply Reply Quote 1
            • theKMundefined
              theKM
              last edited by

              ...or I guess I just need to make sure I home it before I turn the machine off, so that when it turns on it can assume it's not far to travel to home it, and once homed it can assume dimensions for limits. And if I forget to home it, then I suffer the wait of the slow job setup when I turn it back on 🙂

              1 Reply Last reply Reply Quote 1
              • fcwiltundefined
                fcwilt @theKM
                last edited by

                @thekm said in Slow down before endstop?:

                @fcwilt ...the more I play with it the more I think it would need a firmware tweak to get something that decelerates to a value or even decelerate to a stop rather than the hard termination.

                I agree. Other than using a series of short moves and a trigger I don't see anyway to have a "soft" endstop.

                There is a firmware suggestion category.

                Frederick

                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
                • kb58undefined
                  kb58
                  last edited by

                  Dumb question: why can't you have and endswitch at, say, 50mm from the hard stop. When it passes that point, you know where it is, and can slow and continue on for N additional counts to get to where you want to end up?

                  Scratch-built 350mmx350mm coreXY, linear rails, ballscrews, 3 Z axis, Duet3 6HC, v3.3, Tool Board v1.1, BondTech LGX + Mosquito hot end

                  fcwiltundefined theKMundefined 2 Replies Last reply Reply Quote 0
                  • fcwiltundefined
                    fcwilt @kb58
                    last edited by

                    @kb58 said in Slow down before endstop?:

                    Dumb question: why can't you have and endswitch at, say, 50mm from the hard stop. When it passes that point, you know where it is, and can slow and continue on for N additional counts to get to where you want to end up?

                    If you a doing a "homing" move (G1 H1) when it triggers the endstop it does an abrupt halt and no settings seem to change that.

                    His machine is massive enough that he wants to be able to have a nice, gentle, controlled stop.

                    Frederick

                    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
                    • kb58undefined
                      kb58
                      last edited by kb58

                      I wonder if you could play games with the code, like, temporarily setting motor current limits low before homing. It seems like it would slow down both acceleration and deceleration, maybe.

                      Scratch-built 350mmx350mm coreXY, linear rails, ballscrews, 3 Z axis, Duet3 6HC, v3.3, Tool Board v1.1, BondTech LGX + Mosquito hot end

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

                        @kb58 said in Slow down before endstop?:

                        I wonder if you could play games with the code, like, temporarily setting motor current limits low before homing. It seems like it would slow down both acceleration and deceleration, maybe.

                        The only thing I was able to come up with, short of a firmware update, was to try and use the ability to create a piece of code called a "trigger" which can be triggered by something like an endstop switch.

                        With that it might be possible to do a regular move (G1 w/o H1) and when switch was activated the code in the trigger could slow and stop the motion.

                        But the last time I tested this (firmware 2.x I think) it did not work - things may have changed in firmware 3.x.

                        That is for tomorrow's testing.

                        Frederick

                        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
                        • theKMundefined
                          theKM @kb58
                          last edited by

                          @kb58 ...simply to be able to home it from anywhere after turning it on, it wont know how near or far it the stop is.

                          But I think I'll just have to start a procedure of parking it somewhere known, by running a script, before turning it off... that way when it wakes up the homing distances will be generally known and it can rapid until it's close, then go slow to the endstop.

                          1 Reply Last reply Reply Quote 0
                          • Yveskeundefined
                            Yveske
                            last edited by

                            @theKM Can't you just jog it close to home before starting a slowed down homing procedure ?

                            theKMundefined 1 Reply Last reply Reply Quote 1
                            • kb58undefined
                              kb58
                              last edited by kb58

                              I just realized the flaw in my suggestion: If it's got enough momentum and bulk, it'll still coast to a stop even when the steppers are trying to stop it after hitting the switch, losing its known position.

                              This seems to make a case for stepper "servos" with positional feedback, or go for the full Monty and move to true servos.

                              Scratch-built 350mmx350mm coreXY, linear rails, ballscrews, 3 Z axis, Duet3 6HC, v3.3, Tool Board v1.1, BondTech LGX + Mosquito hot end

                              theKMundefined 1 Reply Last reply Reply Quote 0
                              • theKMundefined
                                theKM @Yveske
                                last edited by

                                @yveske ...ultimately, yes, but this is all about automation and having things sort themselves out automatically 🙂

                                I'm going to create a script I can run to park it in a known place before turning it off, so that when it's turned back on it can go from there.

                                1 Reply Last reply Reply Quote 0
                                • theKMundefined
                                  theKM @kb58
                                  last edited by

                                  @kb58 it's not about its position being accurate, but that when you turn off the steppers the immediate stop is a horrible crunch... I'm just trying to avoid the crunch.

                                  kb58undefined cjmundefined 2 Replies Last reply Reply Quote 0
                                  • kb58undefined
                                    kb58 @theKM
                                    last edited by

                                    @thekm Understood, but it does argue for position feedback, so that speed can be slowed down smoothly and still end up where you want it.

                                    Scratch-built 350mmx350mm coreXY, linear rails, ballscrews, 3 Z axis, Duet3 6HC, v3.3, Tool Board v1.1, BondTech LGX + Mosquito hot end

                                    1 Reply Last reply Reply Quote 0
                                    • cjmundefined
                                      cjm @theKM
                                      last edited by

                                      @thekm My understanding is that the current end stop approach used by Duet/RepRap firmware is required because all stepper moves are planned and then buffered so to interrupt a planned move when an end stop (or an emergency stop) is triggered requires the planner/buffer to be overridden which is an “internal” firmware controlled action.

                                      I guess this could be avoided if a machine had absolute position encoders, but in this case you wouldn’t really need end stops as the machine would know where it was anyway.

                                      So for stepper controlled machines (where motion control is always relative rather than absolute) then a “proper” solution will require a firmware update (as suggested by @fcwilt above) to apply a pre-defined maximum deceleration when an end stop is triggered (and maybe a different, higher deceleration for an emergency stop?).

                                      Whilst adding a bit of complexity, as Duet applications reach ever larger machines this functionality is likely to become increasingly important so I’d certainly vote for adding it to the Firmware wish list.

                                      theKMundefined 1 Reply Last reply Reply Quote 0
                                      • theKMundefined
                                        theKM @cjm
                                        last edited by

                                        @cjm from a code point of view, the controller already has the ability to carry on with the gcode... sure, it may have steps in a buffer to flush, but there's already that next step. it's mostly a question of how fast can it start executing that next step.

                                        That said, it would already have the deceleration steps and timings in the buffer, the interrupt would be mostly about skipping N places in the buffer for it to slow down gracefully without much exception handling...

                                        ...would be my guess as a software dev, but it's just a guess 🙂

                                        cjmundefined 1 Reply Last reply Reply Quote 0
                                        • cjmundefined
                                          cjm @theKM
                                          last edited by

                                          @thekm I’m sure you’re right that implementing a buffer flush/defined deceleration down to stop after a trigger event is eminently doable from a firmware code point of view.

                                          I was thinking also about helping the Duet team see the need for this (i.e. putting it on firmware wish list) and adding a vote to support its introduction, in comparison with the many other priorities they must have.

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

                                            Given that we already have G1 parameters H1, H3 and H4 which terminate the move it might be simplest to have a new parameter, say H5, which would behave like H4 but would respect the M201 setting for that axis.

                                            That would seem to be a simple update requiring no additional parameters. It could involve using M201 to set a temporary deceleration value if desired and then reset it.

                                            The next step would be to add a additional parameter to G1 for use with H5 which would specify the deceleration to use and eliminating the need to use M201.

                                            I'm sure @dc42 could tell us how much work those two approaches would be.

                                            Frederick

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

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