The latest thing I've been working on is a little fixture that allows me to automatically find zero for all three axes on a workpiece: X, Y and Z. The hardware end of this is fairly simple; it looks like this:
To use this, it's placed on the corner of the rough stock that you want to be (0,0), typically I'd say the lower left hand corner, with the metal side up. Each of those sides is known width, say 1.000" although that doesn't matter. The automatic zero routine is software running in Mach3, the machine controller, which moves the table until a metal piece held in the spindle touches X, then pulls it back and checks it again with a slower approach for more accuracy. Then it moves the table away from the spindle in X and over to a point in Y that should clear the part and repeats the find. It does the Y axis twice as well. Finally, it retracts the Z-axis up a distance it expects to be above the part, and slowly touches down onto the top of the part. Let's say I'm using a 1/4" dowel pin that I know measures 0.2499. When it touches the edge of the part, the center of the spindle is exactly 1/2 of that, .12495" plus the 1.000" from the tool. The software sets X and then Y to -1.12495. Yes, -1.125 is close enough! Of course, those sides can be any width as long as the software knows how big they are. Note that the top of the part (Z = 0.0) is offset by both the thickness of the metal and the plastic. That changes the offset from the thickness of the metal here to the metal plus plastic (1.075" in mine).
How does it know it has "found" the part? It measures continuity through the Break Out Board in my controller box. See that hole on the end of the right side of the tool? That gets one lead of a continuity checker with a banana plug on it; and the tool or dowel pin or whatever is in the spindle gets the other lead clamped to it with a big gator clip. That's the purpose of the plastic insulation on the bottom; the insulator keeps it from reading continuity as soon as you put it on the table. (The plastic side pieces are to grab onto the corner of a piece of stock without using a metal side that will read continuity). Those thick pieces are just electrical insulation, and can be any convenient size. I use .075" thick plastic from my mill enclosure.
CNC4PC breakout board, which I implemented just like this except I used pin 15 instead of 13 (pins 10 through 15 are inputs on a standard parallel port). The pin is configured in Mach3 so that the software knows to look for activity on that line.
All of this is run from a set of macros in Mach3 which aren't made by them. They're written by another company called the CNC Woodworker - they're called the 2010 Screen Set.
Does it all work? Not yet. I have it together but I'm still working through their instructions. I had to modify my controller box, taking out the BoB to put the resistor on the bottom of the board and solder the two wires to it. The line changes state, a test "light" in Mach3 shows its there, and now it's "just" getting everything to play right. "All ya gotta do...", right?