Endstop as controllable switch?
-
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 -
-
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?
-
The difference is that the fan pins are PWM capable, the endstops are not.
-
Does the PWM capability matter if I need to switch on a relay or power a solenoid?
-
@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.
-
Perfect. Thanks for the information!
-
@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.
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.
-
Your guess is correct.
-
@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...