I built a 5 axis machine with a 2 axis head. I have limit switches on both the B and the C rotary axes. A new operator decided rather than hitting the "Load Position" button I made that raises Z, squares the head, and puts my 2 Y tables in the front position, he hit "REF ALL AXIS" - his reasoning to bring the X axis back to home as well. Unfortunately, the head was already turned just past the switch and did a 360 degree revolution to hit the home switch. After a few times doing this over a week or so, he wound up all the internal wires and eventually the limit switch wire broke which then had the head spinning looking for the switch. We luckily got it to stop before it destroyed all the spindle wiring.
So what I would like to do is limit the distance my B and C axis can travel during a homing operation. Say 30 degree head rotation max, then error if it exceeds it. The home position is about 5 degrees from the square position. Not sure if soft limits work during homing?