Issues with Pin D9 & homing
I'm pulling my hair out while trying to get homing switches set up and working. Pin D9 on the Nano seems to be the issue. I've got GRBL 1.1e loaded on the Nano, $21=1, $22=1, and firmware otherwise customized for my laser engrager. The limit switches are connected in parallel with the NormallyOpen pins to pin D9 on the nano and Gnd for the switches are connected Gnd. I've measured using a multimeter ~4.75V on pin D9 when I don't have it otherwise externally connected, meaning the internal pullup is working. I've also pulled D9 up to the Vcc voltage for the Nano using a 10Kohm resistor, in case that would make a difference. Pin D9 stays at 4.75V until any of my 4 limit switches are triggered, and in that case D9 goes to 0V. This would appear to be correct. I also tried connecting a 4.7uF capacitor between D9 and Gnd for noise immunity. The issue I'm having is that pin D9 is incredibly sensitive and continually causes Alarms, stalling the Nano's CPU. If I connect my limit switches, which are floating and thus D9 stays at 4.75V, the Nano will immediately experience an Alarm and every time I reset the Nano with D9 still connected to the switches, I immediately get an Alarm. I often cannot connect the 10K pullup resistor to Vcc without causing the Alarm and sometimes I can't even connect my multimeter to D9 in order to measure the voltage without triggering an Alarm. I've even switched out the Nano for second one, with the same firmware loaded, and the result is exactly the same. Any ideas what my issue is and/or how I could fix this?
@aprentice You do not need a pull up resistor, as you said D9 has an internal pull up. I'm not clear on how you have it wired but 2 normally open switches in parallel between D9 and GND should work using my firmware (after enabling home switches). If you display your Grbl parameters and post them perhaps I can see a problem.
Thank you for the reply Zax. Here are my GRBL parameters:
@aprentice Set $21 to 0, then start the homing sequence and tell me what it does. It should move towards your home switches (front left). It will begin moving left until it hits the switch and then back off 1mm (which you may need to increase) and then slowly find the switch again if it goes the wrong direction use $23 to correct it). It will then repeat this process for the front home switch.
Zax- You are the man! Fixed! It seems my understanding of $21 and how the T2 software's Homing function works were incorrect. And thanks for the additional recommendations about the back-off distance and directions. I had to reverse the Y axis homing but not the X. Anyway, again, THANK YOU! ..and Merry Christmas and God bless!
@aprentice You are very welcome. If you set the machine size correctly $130 and $131 then you can use soft limits to prevent the machine from over traveling and hitting the end stops, this is totally optional.