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

    Endstop as controllable switch?

    Scheduled Pinned Locked Moved
    General Discussion
    6
    10
    547
    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.
    • kzamaniundefined
      kzamani
      last edited by

      Hello! Long time user of the Duet 2 ethernet, moving to firmware 3 now. One issue I have not explored is whether or not an endstop can be used as a g-code controllable switch? Looking towards future expansion in some of my printers, it would be useful to control E0 / E1 endstop pins as switches.

      Thanks,
      Kevin

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

        @kzamani

        Hi,

        What do you mean by "gcode controllable switch"?

        Thanks.

        Frederick

        Printers: a small Utilmaker style, a small CoreXY and a E3D MS/TC setup. Various hotends. Using Duet 3 hardware running 3.4.6

        1 Reply Last reply Reply Quote 0
        • kzamaniundefined
          kzamani
          last edited by

          Hi,

          Can the endstops be configured similar to how fans can be configured as switches? In the current firmware, I can use the following command to define a GPIO pin which can be controlled with m42:

          M950 F2 C"nil" 									; disable fan 2, free pin to be controlled by m42 command
          M950 p3 C"fan2"									; setup fan 2 to be controlled by GPIO port 3
          

          Can something similar be done with endstops?

          1 Reply Last reply Reply Quote 0
          • Phaedruxundefined
            Phaedrux Moderator
            last edited by

            The difference is that the fan pins are PWM capable, the endstops are not.

            Z-Bot CoreXY Build | Thingiverse Profile

            1 Reply Last reply Reply Quote 0
            • kzamaniundefined
              kzamani
              last edited by

              Does the PWM capability matter if I need to switch on a relay or power a solenoid?

              alankilianundefined 1 Reply Last reply Reply Quote 0
              • alankilianundefined
                alankilian @kzamani
                last edited by

                @kzamani said in Endstop as controllable switch?:

                Does the PWM capability matter if I need to switch on a relay or power a solenoid?

                Not if you just want to switch in ON and OFF.

                SeemeCNC Rostock Max V3 converted to V3.2 with a Duet2 Ethernet Firmware 3.2 and SE300

                1 Reply Last reply Reply Quote 0
                • kzamaniundefined
                  kzamani
                  last edited by

                  Perfect. Thanks for the information!

                  1 Reply Last reply Reply Quote 0
                  • alankilianundefined
                    alankilian
                    last edited by alankilian

                    @kzamani However, I just tried it and it's NOT a great output pin.

                    When I do this:

                    m950 p6 c"e1_stop"
                    

                    And then this:

                    m42 p6 s1
                    

                    I get 3.3 Volts on the pin.

                    BUT, when I do this:

                    m42 p6 s0
                    

                    I get 1.45 Volts on the pin.

                    I think the 10K Ohm series resistor and the LED are fighting over the pin and it's getting partway to ground.

                    Untitled.png

                    If you are interested in modifying the PCB you can probably get it to do what you want it to do by removing either the LED or the LED's 1K Ohm resistor. (I noticed I configured E1_stop, but sent the schematic crop for E0_STOP. They are the same circuit but different part designations is all.)

                    @dc42 would be able confirm my guess.

                    SeemeCNC Rostock Max V3 converted to V3.2 with a Duet2 Ethernet Firmware 3.2 and SE300

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

                      Your guess is correct.

                      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
                      • o_lampeundefined
                        o_lampe
                        last edited by

                        @kzamani
                        Why would you want to (mis-)use the E-stop pins, when there are tons of other unused? GPIO pins on the expansion header? Or did you designate all the available pins already and desperately need some more?
                        If so, I'd be very interested to see what you are doing with this Duet2...

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