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

    How to log triggering of endstop microswitches

    Scheduled Pinned Locked Moved
    Tuning and tweaking
    6
    16
    335
    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.
    • Trietundefined
      Triet
      last edited by

      Hello
      Is there a way to put a message somewhere if any endstop microswitch is triggered, specially when this happens unexpectedly (for example due to EM noise)?

      Assuming that an executable trigger file can be associated with this event, then modifying it to output a message to a file would be fine. Is this possible?

      moth4017undefined soare0undefined 2 Replies Last reply Reply Quote 0
      • moth4017undefined
        moth4017 @Triet
        last edited by

        @Triet im not sure you can trap a false trigger in the object modlel there are the following
        87dab284-9eb9-4d44-91ac-4d300e8cf091-image.png

        If you getting false triggering check you have pull up/down resistors

        <

        Trietundefined 2 Replies Last reply Reply Quote 0
        • soare0undefined
          soare0 @Triet
          last edited by

          @Triet Yes, this would be ok to do. BUT: I myself did not found a gcode to write in/a random file! I you find it, please let me know. So, for now, listing the events in console is the easiest thing to do.
          However, as moth4017 specified, you should check on your pull-ups/downs, first.

          Trietundefined 2 Replies Last reply Reply Quote 0
          • Trietundefined
            Triet @moth4017
            last edited by

            @moth4017 said in How to log triggering of endstop microswitches:

            If you getting false triggering check you have pull up/down resistors

            I never cared about resistors because I was assuming that they are built-in in the Duet2 WiFi PCB.
            Could you confirm I need the resistor in this case?

            I just rewired the connection to NC (normally closed) mode, still getting layer shifts of unknown origin. Belts are tight...

            1 Reply Last reply Reply Quote 0
            • Trietundefined
              Triet @soare0
              last edited by Triet

              @soare0 said in How to log triggering of endstop microswitches:

              Yes, this would be ok to do.

              Which trigger file should be used to put the M118 (output some text) then?

              I am just checking if any message can be output anywhere besides the console.
              I have enabled some output alread using:
              M929 P"eventlog.txt" S1

              But I am still unsure if it is possible to log endstop triggering there.

              1 Reply Last reply Reply Quote 0
              • Trietundefined
                Triet @soare0
                last edited by

                @soare0 said in How to log triggering of endstop microswitches:

                However, as moth4017 specified, you should check on your pull-ups/downs, first.

                I just found this sentence in the Gcode documentation describing the M571 command:

                "Enable pullup resistor with ^ if using Duet 2, running RRF3, using the Z probe input pin, and the probe type is a switch or BLTouch."

                I am checking if this is also valid for the endstop microswitches.

                Trietundefined 1 Reply Last reply Reply Quote 0
                • Trietundefined
                  Triet @Triet
                  last edited by

                  @Triet
                  Again, in the documentation of the M574 command ("Set endstop configuration") I can read:

                  "Pull up resistors on Duet 2/Duex5 inputs should be configured for connecting a digital inputs (like a switch, BLtouch, etc) only on inputs not labelled "n"Stop (xstop, ystop etc)."

                  So it states clearly that no pull up resistors should be "configured". Does that refer to the built-in resistors or does that imply that no external additional pull up resistor should be connected?

                  I don't understand why the user is supposed to tinker with the Duet board (like soldering resistors) in order to do something that is even recommended in by the vendor.

                  oliofundefined Trietundefined 2 Replies Last reply Reply Quote 0
                  • oliofundefined
                    oliof @Triet
                    last edited by

                    @Triet you can enable the pullups in the board config by prepending the pin identifier with ^, i.e. ^xendstop

                    <>RatRig V-Minion Fly Super5Pro RRF<> V-Core 3.1 IDEX k*****r <> RatRig V-Minion SKR 2 Marlin<>

                    Trietundefined 1 Reply Last reply Reply Quote 0
                    • Trietundefined
                      Triet @Triet
                      last edited by

                      @Triet said in How to log triggering of endstop microswitches:

                      "Pull up resistors on Duet 2/Duex5 inputs should be configured for connecting a digital inputs (like a switch, BLtouch, etc) only on inputs not labelled "n"Stop (xstop, ystop etc)."

                      Reading more carefully, this might be valid only for Duet2 boards used together with a Duex5 expansion board. This wording is unfortunate, as it is not clear how exactly it is meant: Duet2 alone OR Duet2+Duex5?
                      I do not use Duex5.

                      gloomyandyundefined 1 Reply Last reply Reply Quote 0
                      • Trietundefined
                        Triet @oliof
                        last edited by

                        @oliof said in How to log triggering of endstop microswitches:

                        @Triet you can enable the pullups in the board config by prepending the pin identifier with ^, i.e. ^xendstop

                        OK, I will try changing my config lines to

                        M574 X1 S1 P"^xstop"
                        M574 Y2 S1 P"^ystop"

                        and see how it goes.
                        Thanks for confirming.

                        1 Reply Last reply Reply Quote 0
                        • gloomyandyundefined
                          gloomyandy @Triet
                          last edited by

                          @Triet The Duet2 endstops already have a pull up resistor on them. You can see the details here: https://docs.duet3d.com/User_manual/Connecting_hardware/Sensors_endstops along with the recommendation to use normally closed switches with the switch between ground and the input pin.

                          Trietundefined 1 Reply Last reply Reply Quote 0
                          • Trietundefined
                            Triet @gloomyandy
                            last edited by

                            @gloomyandy said in How to log triggering of endstop microswitches:

                            The Duet2 endstops already have a pull up resistor on them.

                            Thanks, that is fine. I have already enabled them.

                            gloomyandyundefined 1 Reply Last reply Reply Quote 0
                            • gloomyandyundefined
                              gloomyandy @Triet
                              last edited by

                              @Triet You don't need to enable a pullup, the board has them built in on the endstop inputs as part of the circuit that includes the indicator LEDs. Take a look at the link I included it is all explained under the Duet2 tab. That same link also explains what the best way is to wire your endstops to avoid emi issues.

                              1 Reply Last reply Reply Quote 0
                              • Trietundefined
                                Triet @moth4017
                                last edited by

                                @moth4017 said in How to log triggering of endstop microswitches:

                                @Triet im not sure you can trap a false trigger in the object modlel there are the following

                                I even found an "Endstops Monitor Plugin", so that now I can see the same thing unter "Settings->Machine-Specific":

                                5bdd1cc2-d288-4c9a-bcc1-fe898502b5f0-image.png

                                I don't see how to configure a possibility to log anything either.

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

                                  @Triet The endstop plugin just shows the state from the Object Model. It's also not being updated for RRF 3.5, as the endstop status is shown on the axis legend in DWC now.

                                  Another way to log disconnections is to use triggers. Endstops are only active during homing, the rest of the time they can act as limit switch triggers. Set up with M581:

                                  M581 T3 X Y S1  ; invoke trigger 3 when the X or Y endstop switch is triggered
                                  

                                  Set up a file called sys/trigger3.g that appends a message to a file (see https://docs.duet3d.com/en/User_manual/Reference/Gcode_meta_commands#echo-command😞

                                  ; trigger3.g
                                  echo >>"endstop_error.txt" "Endstop triggered at {state.time}"
                                  

                                  Make sure sys/endstop_error.txt exists before this starts. Or add some conditional gcode to check if it's there, and either create it or append to it. Note: the above is not tested, and may contain errors!

                                  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

                                  Trietundefined 1 Reply Last reply Reply Quote 1
                                  • Trietundefined
                                    Triet @droftarts
                                    last edited by Triet

                                    @droftarts
                                    You have put a lot of valuable information in a couple of lines - thanks!

                                    Edit:
                                    I changed the trigger3.g file this way:

                                    echo >>"endstop_error.txt" "Endstop triggered at ", {state.time}

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