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

    Getting external triggers to work

    Scheduled Pinned Locked Moved
    General Discussion
    3
    9
    2.1k
    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.
    • tomasfundefined
      tomasf
      last edited by

      I've built a filament sensor. It's simply an encased microswitch. I connected it to the E0 endstop – the signal is VCC when filament is present, and pulled down to GND otherwise, and the E0 endstop LED on the Duet changes when I insert and remove filament – so far so good.

      For testing purposes, I configure it like this (in config.g): [c]M581 T2 E0 S1 C0[/c]

      And my sys/trigger2.g looks like this:

      M106 S250
      M117 Yay!
      
      

      The fan starts and the message is shown when I insert filament, but it only works once until I restart the Duet. Executing the M581 again doesn't help. M582 (Check external trigger) does trigger it again, but it does so regardless of the endstop state. Hmm?

      Any ideas?

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

        You will need to remove and re-insert filament to trigger it again so as to get another low to high transition. Did you try that? If so then it sounds like a firmware bug.

        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
        • tomasfundefined
          tomasf
          last edited by

          Yes, that's what I do, and nothing happens. The LED changes state properly, but the trigger doesn't work more than once. Until a reboot, and then it works once more.

          1 Reply Last reply Reply Quote 0
          • tomasfundefined
            tomasf
            last edited by

            Turns out it was my fault after all. I didn't realize that the endstop input had a pull-up already. After removing my pull-down resistor and swapping signal levels (switch now closes to GND when filament present), everything seems to work fine! Thank you and sorry about the fuss!

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

              I'm glad its working now, Yes the endstop inputs have quite strong pullups because of the LEDs (although not as strong as they were on the Duet 0.8.5), and the LED indication isn't always reliable if the device driving them can't pull the input close enough to 0V.

              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

                Hi guys,

                I'm struggling to get this to work. I've fitted micro switches to all the maxima of all the axes and wired them in series (all normally closed). So I have continuity until any of the switches is closed, then it goes open circuit. The idea is that if I do something stupid like tell an axis to move beyond it's maximum before it has been homed, then it'll stop when it hits the switch before doing too much damage. This is connected to E0 and I have a separate emergency stop button that I'd like to use in a similar fashion connected to E1. I'll likely use custom trigger.g files but for now I'm using T0. So in my config.g I have M581 E0 S1 T0 C0 and M581 E1 S1 T0 C0.

                If I then fire up the printer and do something like move Z 100mm (which take a good few seconds) then while it's doing that press any of the switches, nothing happens. If I press the emergency stop button the web interface, it'll stop just like it should. I've wired the switches between estop and gnd (the outer terminals) thinking that it'll normally see 0v but when a switch opens, the pull ups will bring the voltage up. Should I wire them between estop and 3.3v? I've tried bot S1 and S0 too.

                Thanks in advance

                Ian

                Reason for edit - wrote parallel, meant series.

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

                1 Reply Last reply Reply Quote 0
                • tomasfundefined
                  tomasf
                  last edited by

                  Sounds like it should work. Does the indicator LED on the PCB change when you trigger one of the microswitches?

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

                    Hi,

                    I wasn't aware that there was an indicator LED (it's not marked on the wiring schematic) but now that I've looked, I see that there are 2 LEDs between the E1 motor and the E0 motor. The top one (the one nearest the E1 motor) is normally lit but goes out when I press any of the switches and comes back on when the switch is released. I'm guessing that means my wiring is OK.

                    Having just done that, I noticed that the web interface said "halted" rather than "idle". So, I've reset the Duet and without doing anything else, pressed one of the switches and it immediately goes from "idle" to "halted". So it is seeing the trigger. However, if I do a large bed move like Z100, I noticed that the "idle" message is replaced with "busy". It seems that in that situation, the e stops are ignored. Which kind of defeats what I'm trying to do.

                    I guess this one for DC42 to add to his ever growing list?

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

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

                      Just a quick update on this for anyone who comes across this thread. It seems that T0 isn't triggered during a macro. What makes it freaky is that pressing a move button on DWC doesn't just send a simple G1 move command so it is treated like a macro as far as the trigger handling code is concerned. The triggers work fine if I use use say G1 Z100 F240 in the top left corner of DWC and hit send but if I press the "Z+100" button on DWC.they are ignored. DC42 has it in mind to change the handling of T0 triggers in his next firmware release (but please don't nag him - he's a very busy man).
                      Ian

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

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