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

    How can I stop Z moving if Z probe fails

    Scheduled Pinned Locked Moved
    General Discussion
    4
    20
    1.6k
    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.
    • deckingmanundefined
      deckingman
      last edited by

      I have exactly the same line in my config.g with a microswitch connected to E2 so it should work the same as yours. However, when triggered it does an emergency stop because that is what T0 does. If you want run trigger2 file, then you need to change the "T" parameter.

      So with your M581 line as it is, if you trigger the switch at any time, even when idle (because you've used C0) it should initiate an emergency stop (mine does). If it doesn't do that, then I'd say you might have a wiring issue. AFAIK, if you remap the drives, it doesn't re-map the end stops so you might be looking at the wrong end stop on the machine properties page? Dunno about that - David will no doubt confirm or otherwise.

      HTH

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

      1 Reply Last reply Reply Quote 0
      • appjawsundefined
        appjaws
        last edited by

        dc42, I mean the Z endstop input.
        I'm sure that is where I have it connected but I will need to check in the morning.
        I use your mini Z probe to home Z and check the bed levelling.
        So should the M581 line be E0 S1 T0 C0

        deckingman, we had a discussion last year and the original line worked for me before I converted to a coreXYUV and used all 10 controllers.
        I just wanted to have a fail safe so the bed didn't crash into the hotend, if for any reason the Z probe failed. I don't really want to initiate an emergency stop, just a stop and reversal of Z.
        Are we saying that the only way to protect against a crash is to have an emergency stop actioned?
        The problem with that is the hotend remains in contact with the bed and not reversed to relieve the pressure, reversal has to wait for the firmware to start again and then a reversal can be actioned manually.

        appjaws - Core XYUV Duet Ethernet Duex5
        firmware 3.5.0-rc.4 Web Interface 3.5.0-rc.4
        Ormerod 1-converted to laser engraver, Duet wifi
        OpenSCAD version 2024.03.18
        Simplify3D 5.1.2

        1 Reply Last reply Reply Quote 0
        • deckingmanundefined
          deckingman
          last edited by

          Hi Paul. No I'm not saying that the only thing you can do is initiate an emergency stop. What I am saying is that using T0 will initiate an emergency stop. If you want to use your trigger macro instead, you need to change T0 to point to that macro.

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

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

            @appjaws:

            dc42, I mean the Z endstop input.
            I'm sure that is where I have it connected but I will need to check in the morning.
            I use your mini Z probe to home Z and check the bed levelling.
            So should the M581 line be E0 S1 T0 C0

            It should be: M581 Z S1 T0 C0

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

              I think I know what's happening here.

              Paul,

              Did the M581 E2 S1 T0 C0 line come from the config.g that I sent you when you were trying to get XYUV working? I ask because it's identical to what I use. If so, then it'll only work if you have the switch wired the same as me and it will take the same action that I have my machine set up to do. If you have the switch wired to a different end stop, then you need to change the E0 to Z as David has said. You can't use E0 and E1 because these are now U and V endstops.

              Also, the action that I take is to do an emergency stop when the switch triggers so if you want to run your trigger macro, then you have to change T0 to point to that macro. The Wiki explains is quite well https://duet3d.com/wiki/G-code#M581:_Configure_external_trigger

              HTH

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

              1 Reply Last reply Reply Quote 0
              • appjawsundefined
                appjaws
                last edited by

                Thank you both.
                I did have the end stop connected to Z and using T2 does reverse the Z by 5mm as indicated in the trigger macro, however, It does not stop the initial movement, the reversal only happens after the move has taken place. So in the case of a probe failure, Z just keeps moving until the hotend or bed has broken.
                I have looked at all G and M codes and can not find any that will stop the current move, other than emergency stop, Is there a way to interrupt the current move and action the trigger macro?

                appjaws - Core XYUV Duet Ethernet Duex5
                firmware 3.5.0-rc.4 Web Interface 3.5.0-rc.4
                Ormerod 1-converted to laser engraver, Duet wifi
                OpenSCAD version 2024.03.18
                Simplify3D 5.1.2

                1 Reply Last reply Reply Quote 0
                • deckingmanundefined
                  deckingman
                  last edited by

                  @appjaws:

                  Thank you both.
                  ….....................
                  I have looked at all G and M codes and can not find any that will stop the current move, other than emergency stop, Is there a way to interrupt the current move and action the trigger macro?

                  Ahh, now that you mention it, that rings a bell somewhere at the back of my mind. I can't remember exactly but there was a reason why I abandoned using a macro and resorted to just doing an emergency stop. Maybe that was it. No doubt David will come along and put us both right shortly.

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

                  1 Reply Last reply Reply Quote 0
                  • timcurtis67undefined
                    timcurtis67
                    last edited by

                    According to the wiki page, wouldn't using T1 cause the printer to pause? That's what you want to happen if the switch gets tripped. Have you tried that?

                    1 Reply Last reply Reply Quote 0
                    • appjawsundefined
                      appjaws
                      last edited by

                      As I understand it, activating pause will run the pause macro but will not run the trigger macro, also, how would I recover from the pause, without the head moving to the original paused position?

                      Maybe I will just have to use the emergency stop T0 and wait for the firmware to reboot.

                      appjaws - Core XYUV Duet Ethernet Duex5
                      firmware 3.5.0-rc.4 Web Interface 3.5.0-rc.4
                      Ormerod 1-converted to laser engraver, Duet wifi
                      OpenSCAD version 2024.03.18
                      Simplify3D 5.1.2

                      1 Reply Last reply Reply Quote 0
                      • deckingmanundefined
                        deckingman
                        last edited by

                        Yes, pause.g is just another macro so I'd have thought that if the machine waits for the move to complete before running a trigger macro, then you'd get the same behaviour running the pause.g macro. No doubt David will put us all right.

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

                        1 Reply Last reply Reply Quote 0
                        • deckingmanundefined
                          deckingman
                          last edited by

                          @appjaws:

                          Maybe I will just have to use the emergency stop T0 and wait for the firmware to reboot.

                          It's not a big deal to use that. Let's face it, with this "fall back switch" you'll only see this emergency stop if the Z probe fails so it won't be often - hopefully never.

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

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

                            @appjaws:

                            Thank you both.
                            I did have the end stop connected to Z and using T2 does reverse the Z by 5mm as indicated in the trigger macro, however, It does not stop the initial movement, the reversal only happens after the move has taken place. So in the case of a probe failure, Z just keeps moving until the hotend or bed has broken.
                            I have looked at all G and M codes and can not find any that will stop the current move, other than emergency stop, Is there a way to interrupt the current move and action the trigger macro?

                            A move can only be terminated by a trigger from the Z probe during a probing move, or an endstop switch trigger during a G1 S1 move, or an emergency stop, or running out of power. If you use 1.20 series firmware then you could instead use M913 Z0 to set the Z motor current to zero when a trigger occurs. However, a normal trigger doesn't have the same priority as a T0 so there might still be a delay in some cases.

                            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
                            • appjawsundefined
                              appjaws
                              last edited by

                              Thanks for all of the help.
                              I'll use T0 and forget the trigger file

                              appjaws - Core XYUV Duet Ethernet Duex5
                              firmware 3.5.0-rc.4 Web Interface 3.5.0-rc.4
                              Ormerod 1-converted to laser engraver, Duet wifi
                              OpenSCAD version 2024.03.18
                              Simplify3D 5.1.2

                              1 Reply Last reply Reply Quote 0
                              • timcurtis67undefined
                                timcurtis67
                                last edited by

                                Thank you all, This has been a good learning post. I wonder if the pause is after the programmed move is finished or after the planner buffer(?) is empty? Meaning that it completes several moves before the pause takes place?

                                1 Reply Last reply Reply Quote 0
                                • deckingmanundefined
                                  deckingman
                                  last edited by

                                  @appjaws,
                                  Paul. Off topic I know but another tip in case you don't already do it, is to lower the motor currents at the start of homing. You'll need to play around to find the right value but you are looking to find the minimum that you can home reliably at. Then if the worse happens and every switch fails, a head crash won''t do too much damage. (Don't forget to put the motor currents back up again at the end of homing).
                                  Also, I added extra micro switches to X and Y and Z axes maxima and wired them all in series with the Z min so if any one triggers, it'll initiate an emergency stop. This is just for when I'm playing around and attempt to move beyond the axes limits before I've homed the printer. Oh and finally, I added big red emergency stop button and wired that to another estop. It's not a true emergency stop because it doesn't cut power, so wouldn't be much use in the event of a fire. But have an RCD conveniently placed that I can easily trip in that eventuality.

                                  @timcurtis
                                  Tim. I wasn't ignoring you - just don't know the answer to your question šŸ™‚ My guess would be just the current move buy David will confirm or otherwise.

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

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

                                    @timcurtis67:

                                    Thank you all, This has been a good learning post. I wonder if the pause is after the programmed move is finished or after the planner buffer(?) is empty? Meaning that it completes several moves before the pause takes place?

                                    The trigger file starts running asynchronously with respect to commands already being executed, with a few caveats:

                                    • If multiple trigger events other than T0 are pending, only one can be executed at a time. So you might have to wait until the previous trigger macro completes.
                                    • There might be another process accessing the SD card at the time.
                                    • If the trigger macro commands any movement or uses any command that affects movement (other than M906 and M913 in firmware 1.20 and later), all the moves already in the movement queue are completed 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
                                    • timcurtis67undefined
                                      timcurtis67
                                      last edited by

                                      Thank you for the clarification David.
                                      My goal is to rig up a simple filament out switch with the pause command. At least until the filament monitors are ready for sale.

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

                                        See the description of M591 in the GCode wiki.

                                        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
                                        • First post
                                          Last post
                                        Unless otherwise noted, all forum content is licensed under CC-BY-SA