So I've got a machine that uses non-interchangeable ER collets so I can't use tool offsets per-se. Every time a tool is inserted it has a random amount of stickout. I'm trying to write an M31 macro to make use of a tool height sensor, though.
So I guess first is theory. In a "real" machine you would zero off the part with a probe (something of known offset) to get the top of your part and each of your tools would have a pre-set offset which you would have in your Tool Offsets and would be corrected when you call your tool. The only time you'd need to run the macro would be when you changed an old tool out for a new one and want to change the offset.
I have just an ER collet so I have to use a freshly inserted tool of unknown length to find the top of the part for that operation and zero the Z axis DRO. I'll then find the top of a fixed point (like my vice) with that tool and note its offset from part zero. Now, every time I change a tool I can take that new tool, find where it contacts that fixed point and re-set my Z axis DRO to the offset I noted before; which means now the tip of the new tool should be in the same location as the tip of the previous tool. Not fun.
So, I'm trying to figure out how to make a tool change macro using this touch plate and the probe input, but without having any fixed tool reference.
My best idea so far would be to put in the first tool, zero it on the part and call the macro. Each time it is run, it would show a dialog box asking if this was the first tool on a new part and if so, use the touch plate to store a Z value for the tip of that tool. Then, when changing to a new tool, saying "no" at the dialog box would take that tool to the touch plate and when it makes contact, change the Z axis DRO to match the stored value.
I don't really see the need to involve the tool offsets since I'll never have a fixed offset for any tools and I largely ignore the tool numbers anyway because I've never had a reason to use them. I just grab the tool listed in the gcode comments and put it in the collet.
So, any ideas? I've already got the touch plate part working - it finds the plate but that's about it. Any help on the dialog box (I assume that's possible) or does anyone have any better ideas?
Thanks!