NC Microswitch Z Probe with 3.2.2
-
I am having trouble figuring out how to use a normally closed Microswitch as a Z Probe on my DuetWiFi. So far I am thinking something like the following in my config.g
M558 P8 C"zprobe.in" H5 F120 T3000
Thus far it will show the Z Probe sensor on the main web interface, but I can't seem to get it to trigger. I have it plugged into the ZProbe In and Ground pins that are right next to each other.
Any ideas on what I may be doing wrong here? This is for a Railcore 3 Z motor build, so I will need it to probe for bed leveling.
Thanks
-
@MakeStuffMakeStuff said in NC Microswitch Z Probe with 3.2.2:
M558 P8 C"zprobe.in" H5 F120 T3000
Try turning on the pullup.
- M558 P8 C"^zprobe.in" H5 F120 T3000
And then test with M119
-
And you can experiment with inverting the signal with
!
in front of the pin name. -
@alankilian That worked perfectly! Thanks!
Out of curiosity, what does the pull up resistor do that helps in this scenario?
-
@MakeStuffMakeStuff said in NC Microswitch Z Probe with 3.2.2:
Out of curiosity, what does the pull up resistor do that helps in this scenario?
I'm unlikely to be able to explain it satisfactorily. Try this.
-
@MakeStuffMakeStuff said in NC Microswitch Z Probe with 3.2.2:
what does the pull up resistor do
You have a switch connected from ground to an input pin on the CPU.
The CPU reads the voltage at the pin.
- If it's above a certain level, it returns a binary one.
- If it's below a certain value, it returns a binary zero.
When your switch is closed, it's connecting the pin to ground, and when the CPU reads the voltage at the pin, it's pretty close to zero and it returns a binary zero.
When your switch is open, the pin is not connected to anything, and is just floating around. Sometimes, the CPU will read a low voltage and STILL return a binary zero.
The "pull-up" resistor is a high-value resistor that connects to a positive voltage, so when your switch is open, it "pulls-up" the pin to a higher voltage and the CPU reads it as a high-enough voltage to return a binary one.
When your switch is closed, the resistor still tries to "pull" the pin up to a higher voltage, but the resistor's value is too large to do that and your switch wins the fight and can drive the voltage at the pin close to zero.
-
@alankilian Far better than I could ever do it justice.