Once you have your CNC Milling Machine up and running. You will need to set it up to cut keys.
You will need a vice to hold your key. The best option for this is to use a vice off a key machine and mount it onto your mill bed. You might be able to buy a second hand machine or even a new machine. (there are some brand new manual machines around for a few hundred dollars). There are a couple of places selling replacement a replacement vice too.
Mounting the vice
The vice will have to be mounted so that it is electrically isolated from the rest of the mill. This can be done by mounting the vice to a thick piece of plastic (Nylon, Acetal, etc). Mount it with countersunk bolts that wont make contact with the mill bed. Then bolt the plastic block to the mill bed.
The vice will then have to be connected to the probe wire. If you have a breakout board connect one wire to ground and one to the vice. Start up MACH3 and go to the diagnostic tab to test the probe function. Simply short the vice to ground and the probe LED should light up.
The above photo shows the vice mounted to a piece of Acetal, which is bolted to the bed of the mill. The Probe wire is attached to the front middle of the vice. This vice is off an old key cutting machine.
When you mount the vice it is a good idea to make sure that when you have a blank key inserted that the key is not going to hit any objects when you home the machine.
If this vice was to be removed from the mill bed the machine would not know where the key is located to cut. You could make a jig for aligning the vice. This would assure accurate alignment.
Coordinate settings can get a bit confusing and there are some good articles about coordinate systems on the Mach3 web site.
To cut keys on a milling machine you need to understand 2 basic concepts.
1st is the "Machine Coordinates" - (Homing is where you tell the machine to move until it hits the homing switches and the bed is at the beginning of its travel ) Every time you home the machine the machine sets the coordinates to X = 0, Y = 0 & Z=0 (if you have a Z homing switch). Once homed the machine coordinates do not change until you home the machine again. They always measure from where they made contact with the switches.
2nd is "Work Coordinates" - When cutting a key the work coordinates will usually be the zeroed at the key edges. ie the tip of the key or the key shoulder and one edge of the key. Zeroing the work coordinates does not affect the Machine coordinates which will stay the same. The main work coordinates we use are G54 they are the coordinates that MACH3 uses when it starts.
You could use other coordinates such as G55. You could use G54 for cutting track keys and G55 for cutting cylinder keys for example. The zero position for G54 would be over the track key vice and the zero position for the G55 coordinates would be over the cylinder key vice.
MACH3 has a built in probe function that we can use to centre keys in the vice and even to measure cuts in keys for duplication (like the commercial machines).
If you are using a breakout board the probe will be connected to the probe contact. ground will be connected to the base of the machine. By connecting to the base we can get electrical contact through the mill cutter. Each time the cutter touches the key we get a contact signal.
The probe contact has to be attached to the key vice to complete the circuit. The vice must be isolated from the bed of the mill as in the above photo. Make sure the vice has good isolation from the bed of the mill as brass chips can cause unwanted connections.
The probe can be used to accurately determine the keys position on the mill bed. After you have homed the mill you can jog over to the center of the key. write down the X, Y & Z positions and enter them into a MACRO. ( a Macro is a set of instructions that MACH3 will follow to perform a task.) When you run the Macro the computer can determine the Z Height of the key and the X and Y edges. It will then zero the coordinates so the key will be cut in the exact right spot on the mill bed.
A Macro for aligning a key in the vice is as follows.
code"G00 X-12 Y98" ' Set X and Y Values to be the center of the key
code"g31 z-100 F20" ' Probe to find the top of the key
Setdro(2,0) ' Set DRO Z to 0
code"g00 z5" ' Z axis up to 5
code "Y84" ' go past end of key to set Y value
code "Z-2" ' Z mill cutter down ready to touch end of key
code"g31 y100" ' Probe until touches end of key Setdro (1,-1) ' Set DRO Y =1 (using 2 mm mill)
code"G00 Z5" ' Z axis up to 5 code"G00 x-18" ' Go to the side of the key to set X value
code"g00 Y28" ' Go past the end of the vice
code"G00 Z-1" ' Mill cutter down ready to touch side of key
code"g31 x0 F20" ' Probe until touches side of key
setdro(0,-1) ' Set DRO X = -1 (using 2mm mill)
code"g00 z5" ' Z up to 5