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

Endstop as controllable switch?

Scheduled Pinned Locked Moved
General Discussion
6
10
546
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.
  • undefined
    kzamani
    last edited by 9 Mar 2021, 18:39

    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

    undefined 1 Reply Last reply 9 Mar 2021, 19:20 Reply Quote 0
    • undefined
      fcwilt @kzamani
      last edited by 9 Mar 2021, 19:20

      @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
      • undefined
        kzamani
        last edited by 9 Mar 2021, 19:46

        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
        • undefined
          Phaedrux Moderator
          last edited by 9 Mar 2021, 20:41

          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
          • undefined
            kzamani
            last edited by 9 Mar 2021, 21:49

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

            undefined 1 Reply Last reply 9 Mar 2021, 21:49 Reply Quote 0
            • undefined
              alankilian @kzamani
              last edited by 9 Mar 2021, 21:49

              @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
              • undefined
                kzamani
                last edited by 9 Mar 2021, 22:00

                Perfect. Thanks for the information!

                1 Reply Last reply Reply Quote 0
                • undefined
                  alankilian
                  last edited by alankilian 3 Sept 2021, 22:06 9 Mar 2021, 22:04

                  @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
                  • undefined
                    dc42 administrators
                    last edited by 10 Mar 2021, 06:37

                    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
                    • undefined
                      o_lampe
                      last edited by 10 Mar 2021, 07:15

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