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

    Emergency Stop

    Scheduled Pinned Locked Moved Solved
    General Discussion
    3
    15
    624
    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.
    • SonnyD1undefined
      SonnyD1
      last edited by SonnyD1

      IMG_3515.jpg
      I have wired this Emergency Stop Button (https://www.amazon.com/APIELE-Emergency-Latching-Stianless-Mouting/dp/B08B87GJGB ) to the "e0stop" on my Duet 2WIFI. It is wired normally closed (ground and yellow wire)...I think. I have read https://docs.duet3d.com/en/User_manual/Connecting_hardware/IO_E_stop a few times. From that reading I have written the following into my config.g:
      ; Emergency Stop
      ; M950 J1 C"e0stop" ; identify pin number for emergency stop
      ; M581 T2 P0:3 S1 R1 ; invoke trigger 2 when an inactive-to-active edge is detected on input 0 or input 3 and a file is being printed from SD card

      Do I need an M574? From the reading I gather I need a "triggern.g" file. Do I just create that file manually and then build in it what I want my button to do? Ultimately I want it to disable all steppers, heaters, and part cooling fans. I don't want it to shut the printer down. Just halt everything. Any guidance is appreciated.

      deckingmanundefined 1 Reply Last reply Reply Quote 0
      • SonnyD1undefined SonnyD1 marked this topic as a question
      • deckingmanundefined
        deckingman @SonnyD1
        last edited by deckingman

        @SonnyD1 Firstly you'll need to remove the semi colons from the start of your M950 and M581 lines. Then you need the M581 to refer to the trigger you created using M950. So in your case M950 J1 would mean that you want to use M581 P1 (not P0 and 3 as you have it). The rest depends on what you want to do. If you want to initiate and emergency stop as if you has sent M112, use T0. If you want to pause, use T1. If you want to do something else, you'll need to write a trigger"n" macro (eg trigger2) then run that macro by using T2 in your M581.

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

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

        SonnyD1undefined 1 Reply Last reply Reply Quote 0
        • SonnyD1undefined
          SonnyD1 @deckingman
          last edited by SonnyD1

          @deckingman I have them commented ATM until I have them correct and complete. Based on what your saying I'll implement the following change:
          M950 J1 C"e0stop"
          M581 T2 P1 S1 R1
          Thats the easy part. The macro is what baffles me. Do I manually build a trigger2.g file in the DWC and put in it what I want the button to do when triggered?

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

            @SonnyD1 Yes. You might find that trigger 2 already exists but is blank. If not create it. You can use the web interface or a text editor like notepad++ and upload it. I think the trigger files go in the .sys folder rather than the macros folder but I'm not 100% sure as I'm just using my phone right now.

            Edit. Now that I'm in front of my PC, I can confirm that trigger files do indeed go in the .sys folder.

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

            SonnyD1undefined 1 Reply Last reply Reply Quote 1
            • SonnyD1undefined
              SonnyD1 @deckingman
              last edited by

              @deckingman I built a folder and put a simple M112 in it. Test failed. I've got some checking to do. I suspect it may be a wiring issue. I'll have to work it out and get back with ya.

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

                @SonnyD1 said in Emergency Stop:

                @deckingman I built a folder and put a simple M112 in it. Test failed. I've got some checking to do. I suspect it may be a wiring issue. I'll have to work it out and get back with ya.

                Suggest the first thing you do is change T2 to T0. That will work the same way that M112 does but without needing a trigger macro (that's why trigger 0 and trigger1 should not be used -T1 does a pause like M25). If that doesn't work, then you need to check your wiring etc. If it does work then you need to check the trigger2 file and /or its location.

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

                SonnyD1undefined 2 Replies Last reply Reply Quote 1
                • SonnyD1undefined
                  SonnyD1 @deckingman
                  last edited by

                  @deckingman Yea its gotta be a wiring issue. I think I can sort it out. I'll get back with ya when I do.

                  1 Reply Last reply Reply Quote 0
                  • SonnyD1undefined
                    SonnyD1 @deckingman
                    last edited by

                    @deckingman Ok I cant seem to figure out the wiring and I dont want to use the trial and error method my my new board. Do you know how to wire that particular endstop?

                    droftartsundefined 1 Reply Last reply Reply Quote 0
                    • droftartsundefined
                      droftarts administrators @SonnyD1
                      last edited by

                      @SonnyD1 From a question in the the 'Question and Answer' section of the listing:

                      Question:
                      I assume the the green wire is the common? wireing needs to be in your description.
                      Answer:
                      Hi Green wire is common, Blue is NO, Yellow is NC.

                      So you can wire it NO or NC. We advise NC (Normally Closed), see https://docs.duet3d.com/User_manual/Connecting_hardware/Sensors_endstops#microswitch

                      Duet 3: connect the switch between the IN and GND pins of your chosen IO_x connector.

                      You said:

                      I built a folder and put a simple M112 in it.

                      Do you mean you created a folder called 'trigger2.g'? It needs to be a text file, like any gcode file. And it needs to be in the sys folder.

                      Ian

                      Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

                      SonnyD1undefined 1 Reply Last reply Reply Quote 0
                      • SonnyD1undefined
                        SonnyD1 @droftarts
                        last edited by SonnyD1

                        @droftarts Thats how I have it wired. I have the green wire to the ground and the yellow wire to the signal. Also, I created a folder named trigger2.g with an M112 in it. I started a home all and hit the endstop and nothing happened.

                        droftartsundefined 1 Reply Last reply Reply Quote 0
                        • droftartsundefined
                          droftarts administrators @SonnyD1
                          last edited by

                          @SonnyD1 said in Emergency Stop:

                          I created a folder named trigger2.g

                          A folder, or a file? It should be a text file, not a folder.

                          Ian

                          Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

                          SonnyD1undefined 2 Replies Last reply Reply Quote 0
                          • SonnyD1undefined
                            SonnyD1 @droftarts
                            last edited by SonnyD1

                            @droftarts Yes it is a file. Currently named trigger0.g due to the "T" change you recommended. The file isn't even necessary with a T0.

                            1 Reply Last reply Reply Quote 0
                            • SonnyD1undefined
                              SonnyD1 @droftarts
                              last edited by

                              @droftarts I found the problem. It wouldn't trigger because I had a R1 instead of a R0 in my M581 command. I've changed it and it executes the M112 properly now. Any modifications I do on it from here on out would be easy now that I know. I would say this issues is solved. Thank you very much!

                              droftartsundefined 1 Reply Last reply Reply Quote 0
                              • SonnyD1undefined SonnyD1 has marked this topic as solved
                              • droftartsundefined
                                droftarts administrators @SonnyD1
                                last edited by

                                @SonnyD1 R1 will only trigger while a file is being printed from the SD card. So it probably was working, you just weren't running a job! Also, yes, T0 and T1 ignore any trigger file, so any changes to trigger0.g won't do anything. You need to use T2 or higher to have it run what you want in a trigger#.g file.

                                Ian

                                Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

                                SonnyD1undefined 1 Reply Last reply Reply Quote 0
                                • SonnyD1undefined
                                  SonnyD1 @droftarts
                                  last edited by

                                  @droftarts Thats what I may do later. For now I'm gonna leave it as is. Thanks again for your help!

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