I thought this deserved its own thread since there are a number of people with these two problems.
There are various ways to implement homing/limit switches. The X-carve firmware (ie Grbl) provides software support to implement homing/limit switches.
A hardware version would have the switches interrupt the power to the X-carve and is the most robust solution, but will not be discussed here.
The software solution has all the characteristics of anything that is controlled by software. As long as everything works right, you’re good to go. If the software gets hung then all bets are off.
The Homing switch solution. Three switches are mounted such that they will trip when the machine is at “Machine Location 0,0,0” which is defined as the HOME position. If you have the switches at the appropriate location and you have configured Grbl to use Homing when you or your G-code software issues a $H command to Grbl then your machine will go to the location indicated by tripping the Homing switch on each axis (there is also a configuration setting to have your machine move a small distance away from the Homing switch after a $H operation so that the Homing switch will not be tripped when you start the remainder of your G-code). This offset lets the Homing switch also function as a Limit switch for that end of each axis.
To keep the machine from running off the end of the axis that does not have a switch, there are settings in Grbl to let Grbl know how far it can travel along the axis without going past the maximum work area. If these variables are set properly and “Soft Limits” are enabled then the combination of Homing the machine and using soft limits will allow the software to keep your machine from leaving the work area (as long as the software is functional).
The other solution Limit Switches. This solution has a switch at each end of each axis. These are usually set up as “Normally closed” so that one pin on the Arduino can be used to handle both switches.
To use the Limit switch option, you would have Grbl set up to use “Hard LImits”. In this mode the software goes to the “Alarm” state and stops processing commands if any of the switches are tripped.
Need to Home question:
If you just turn on your machine then the software has no idea where your spindle is located. Homing is an easy way to synchronize the software and hardware to a known position. You could do it manually if you prefer.
Once the software knows Machine position then you also have to tell the software where the Work position is so that it knows where to move to - to start your carving.
One without the other is not enough for the machine to operate properly.
Hope this helps, if not ask questions and I’ll try again.