This has been discussed in depth but would love to hear your take on it as homing with mach is gangster as hell unless you have a motion controller that will support index output from drive. AZ's resident cnc guru's maintain that opto's "flag switches" are the most accurate and repeatable. I've physically observed these and agree with them however i dont care for all the pull up/down resistors and the gymnastics involved in wiring them. PMDX used to make a simple 3 wire 24v unit that was awesome but discontinued them. I'm currently using one on my rotary and it works flawless. My linear axis have the chinese inductive proxis and are repeatable to within a few tenths at worst. (which is way good for me) I do have servos that i soon intend to retrofit that have home on index output with a motion controller that will interface them.
I think i remember you from the zone where you were working on a Hicon or kflop? If that was you then your knowledge would be met with a warm welcome.
Yes, that was me and it was with kflop. My background actually happens to be with automation and controls. The best way of homing is with some sort of switch (doesn't really matter what kind of switch), and an encoder that has a index pulse. Then you simply run into the home switch, and then back off until you get the index pulse. Of course, you need to be careful that the index pulse isn't "too close" to the home switch. If it is, you need to move the home switch, or better, setup your routine so that if you're within so many counts of the switch when the pulse goes high you use the NEXT index pulse.
But most of us just use open loop steppers. The proximity switches are awesome for this because they're very repeatable AND they have a lot of hysteresis. This allows you to do a homing routine like this:
1) rapidly drive each axis into the limit sensor (rapidly is a relative term here...fast enough it's not painful, but not so fast that it's scary when your controller shuts everything down cold). You can drive all axis at the same time
2) re-enable your axis
3) SLOWLY jog off the axis until the limit switch goes off. Do this one axis at a time. If possible, switch your home logic so that the controller itself actually does the limit switch monitoring/shutdown, and you're just monitoring for the limit condition so you know it's OK to continue. Zero the axis and move on to the next one.
Doing it like this I was able to achieve homing accuracy to well within .001", and it was stable for long periods of time. Every so often you'll want to go and re-calibrate your stations, at least just to be sure.
Not only will this get you a reliable home position, but because of the hysteresis in the sensor you're actually able to use (0,0) because the sensor will NOT trigger at your home position when you approach it from the positive side. So you get to jog to the home position quickly, step off slowly to get a very accurate 0, and that zero is very close to the optimal 0 for the system that gets you the biggest work envelope.
If you're going to use flags, which may not have the hysteresis, then what you want to do to make it painless is:
1) jog quick to the flag
2) step off relatively quickly until the flag goes off, and a little bit past that
3) jog SLOWLY to the flag, preferably with the controller monitoring the flag status and controlling shutdown
4) when you hit the flag, jog off the flag a number of steps and set your home position there
You need to jog off the flag or your (0,0) position will not be usable. There will be ambiguity if (0,0) sets off the flag or not. Best to jog off a tiny bit and reduce your work envelope than to have an unusable coordinate.
What makes homing so painful, often times, is missing the idea that you don't have to home on the initial jog to the flag. Get to your basic home position quickly so it's not so painful, but when you actually grab your zero do it VERY slowly. If you really want to, you can go one step at a time, check the sensor, step, check the sensor. That will alleviate any latency issues, but if you do that when your axis is in some random position, it will take forever. Find the rough flag position first, and then go as slowly as you need to go to get whatever accuracy you need.
Just FYI, though: If I build another CNC machine, it will have encoders on it with an index pulse, even if I end up running it open loop. For a little extra wiring, and a few bucks, it's worth having the encoder just for the index pulse IMHO and then all this nonsense goes away. It's the professional way of doing it, and had I thought about when I originally built it that's what I would have done. I hadn't anticipated how useful an absolute (0,0) would be when I originally built it. I'll also mention that I didn't bother putting any limits on my Z axis at all. I'm not recommending that, but I thought it was completely useless given that I didn't have fancy tooling and I would be doing a touch off no matter what anyhow.
I'll also say that having a touch off routine that allows you to match heights of different tools, using a fixed touch plate, is invaluable. I think Mach3 has some canned routines available to do it. I had to invent some for KFlop but it was worth every minute.