RayL's Edge/Mid-Point/Center Finding and Tool Length Setting Macros

I have created these for my own use, and make no representations whatsoever as
to their correctness.  Use them at your own risk.  If you have problems, you
can contact me at Jagboy@pacbell.net.

That said, for me, they have worked very well, and been a huge time-saver.

Copy all the attached macro files to the Mach3\macros\Mach3Mill directory.

Note that your directory *may* not be named Mach3Mill if you are using a profile
with a different name.

The macros are as follows:

M950 - X axis edge finder, moving in the + direction
M951 - X axis edge finder, moving in the - direction
M952 - Y axis edge finder, moving in the + direction
M953 - Y axis edge finder, moving in the - direction
M954 - Z axis tool length setting, moving in the - direction
M955 - X/Y Left Front corner finder
M956 - X/Y Right Front corner finder
M957 - X/Y Left Rear corner finder
M958 - X/Y Right Rear corner finder
M959 - Vise alignment macro, Vise fixed jaw to the rear, parallel to X axis
M960 - Vise alignment macro, Vise fixed jaw to the front, parallel to X axis
M961 - Vise alignment macro, Vise fixed jaw to the left, parallel to Y axis
M962 - Vise alignment macro, Vise fixed jaw to the right, parallel to Y axis
M963 - Finds mid-point between two edges, moving in X
M964 - Finds mid-point between two edges, moving in Y
M965 - Finds center of circle or pocket

The edge finding macros will move in the specified direction until the edge is
detected, then zero the axis DRO to the location of the edge, correcting for
the diameter of the probe tip.

The corner finding macros do the same, but in two axes, so the spindle ends
up aligned exactly to the corner.  It will first move the specified "probe
distance" in one axis, to ensure it is alongside the part, before probing.  So,
you must always position within "probe distance" of the corner in both axes, but
to the outside of both axes, before invoking the macro.

The Mid-point finding macros find a edge first in the + direction, then in the
- direction, then move to the exact center between the two, and zero the axis
DRO.  The center finding macro basically does a mid-point find in X, followed
by a mid-point find in Y, so the X and Y axes end up zeroed to the exact center
of the circle or pocket.

The vise alignment macros always reference to the left end of the fixed jaw, and
first do a corner-find, so setup is the same as for a corner find macro.  After
locating, and zeroing both axis DROs, to the corner, it then moves to 1/8" from
the opposite end of the fixed jaw, and again probes.  The amount by which the
opposite end is misaligned is displayed on the status line.  If the vise is
positioned with the jaw parallel to the X axis, and the fixed jaw towards the
back of the machine, position the probe slightly to the left, and slightly
forward, of the left front corner of the fixed jaw before executing the macro.
When the macro completes, if it indicates a misalignment of +0.010", then the
right end of the vise needs to move towards the front of the machine by 0.010".

These macros use a number of new DROs as follows:

User DRO 1000	' Touch probe diameter
User DRO 1001	' Z Touch plate thickness
User DRO 1100	' Vise width, for vise alignment macros
User DRO 1101	' Back-off distance, after probing in X/Y
User DRO 1102	' Max. Distance to move when probing
User DRO 1103	' Feedrate to use when probing
User DRO 1104	' Back-off distance, after probing in Z

Any of the above macros can be called by buttons or other scripts, by using the
Mach3 "Code" function.  For example, to configure an on-screen button to do
tool length setting, either configure the button in Screen4 to execute G-code
function "M954", or to use a button script containing the single line:

Code "M954"

There are two Mach3 screensets included:

1024Probe.set - is the standard Mach3 1024.set, with most of the above macros
accessible by clicking on the probes, corners, spindle, or circle
center graphics on the Offsets page.

AllInOne.set - is my custom simplified milling screenset.  It contains all of
the functionality I use on a regular basis on a single screen.  All the setup
and probing functions are on the TAB page.
