I am working on a project using stepper motors meant for a CNC machine. I will control my device with GRBL G code, and have a question regarding end stops.
For my x-axis and y-axis, i am using an optical end stop to mark my "home" position (x=0 when it is triggered).
Important : my device does not have a z-axis.
In order to set home coordinates, I enabled Limit Switches in the software that I am using (universal Gcode sender). However, when I invert my switches (open light switch = good, closed light switch = alarm), then my z-axis is always in "alarm" mode, preventing me from using the machine.
I was wondering if I could connect a 5v source pin directly to the pin representing my z-axis, without damaging the Arduino. I would think that this just gives a constant signal, emulating an open light switch.
If you have any knowledge regarding this topic, please let me know!
Unfortunately fixing your z-axis limit switch to either a high or low input won't work - the homing cycle requires a change of state to operate.
The right way to do this for a two axis machine is to disable z-axis homing in software, to do this you need to change a couple of lines of code in the config.h file of grbl, then recompile your custom version of grbl and flash it to your Arduino.