Moving the origin point for probing

I learned the hard way (shattered 1/8" Jenny bit) that the controller is only setup to probe the lower left corner of your work piece. I am not a G-code expert, but after a little research I put together the following three pieces of code that let me use my OneFinity touch probe in whichever corner I choose.

Copy/paste/save the following three blocks of G-code into separate G-code files (I used Windows Notepad). Load them just like you were loading a carving file. Put your probe in the desired corner and run the matching file you created above. All of these are specific to a 1/4" bit, but you can modify the code for any diameter bit by changing the radius used in the lines that begin with G92 in the X and Y axis sections. For example, for a 1/2" radius bit you would use .25 instead of the .125 shown in the code below. One other note, I used my CNC machine to determine the actual x, y and z thickness of my probe block. The “thickness” number I use in the x, y and z lines of G92 code are the specific measurements from my block. I do not know what kind of tolerances are maintained in the manufacture of the probe blocks, so if you are concerned about measuring things to the nearest .0001" you might want to measure your specific block and use those numbers in place of mine. Hope this helps!

(Lower right corner probe routine for 1/4" bit)
G20 (Units inches)
G91 (set incremental distance mode)
G92 X0 Y0 Z0 (Set offset to 0 and make the current location 0,0,0)
M0 (MSG, ENSURE MAGNET IS ATTACHED!)

(Probe Z axis)
G38.2 Z -1 F3 (Probe Z down 1" at 3"/min)
G1 Z 0.0625 F20 (Move up 1/16" at 20"/min)
G38.2 Z -1 F1.5 (Probe Z down 1" at 1.5"/min)
G92 Z 0.615 (Set Z offset to CNC measured thickness of plate)
G1 Z 0.25 F40 (Move up 0.25" at 40"/min)

(Move and Probe X axis)
G1 X -0.75 F40 (Move left 3/4")
G1 Z -0.6 (Move down 0.6")
G38.2 X 1 F3 (Probe X right 1" at 3"/min)
G1 X -0.0625 F20 (Move left 1/16" at 20"/min)
G38.2 X 1 F1.5 (Probe X right 1" at 1.5"/min)
G92 X -2.253 (Set X offset. CNC Measured x + bit radius = 2.1277 + 0.125)
G1 X -0.25 F40 (Move left 1/4" at 40"/min)

(Move and Probe Y axis)
G1 Y 0.75 (Move backward 3/4")
G1 X 0.75 (Move right 3/4")
G38.2 Y -1 F3 (Probe Y forward 1" at 3"/min)
G1 Y 0.0625 F20 (Move backward 1/16" at 20"/min)
G38.2 Y -1 F1.5 (Probe Y forward 1" at 1.5"/min)
G92 Y 2.253 (Set Y offset. CNC Measured x + bit radius = 2.1277 + 0.125)
G1 Y 0.25 F40 (Move backward 1/4")

(Move to XY Zero)
G1 Z 1 (Raise bit 1")
M0 (MSG, REMOVE TOUCH PLATE AND MAGNET.)
G90 G1 X 0 Y 0 F80 (Move to X Y ZERO at 80"/min)
M2 (End Program)


(Upper left corner probe routine for 1/4" bit)
G20 (Units inches)
G91 (set incremental distance mode)
G92 X0 Y0 Z0 (Set offset to 0 and make the current location 0,0,0)
M0 (MSG, ENSURE MAGNET IS ATTACHED!)

(Probe Z axis)
G38.2 Z -1 F3 (Probe Z down 1" at 3"/min)
G1 Z 0.0625 F20 (Move up 1/16" at 20"/min)
G38.2 Z -1 F1.5 (Probe Z down 1" at 1.5"/min)
G92 Z 0.615 (Set Z offset to CNC measured thickness of plate)
G1 Z 0.25 F40 (Move up 0.25" at 40"/min)

(Move and Probe X axis)
G1 X 0.75 F40 (Move right 3/4")
G1 Z -0.6 (Move down 0.6")
G38.2 X -1 F3 (Probe X left 1" at 3"/min)
G1 X 0.0625 F20 (Move right 1/16" at 20"/min)
G38.2 X -1 F1.5 (Probe X left 1" at 1.5"/min)
G92 X 2.253 (Set X offset. CNC Measured x + bit radius = 2.1277 + 0.125)
G1 X 0.25 F40 (Move right 1/4" at 40"/min)

(Move and Probe Y axis)
G1 Y -0.75 (Move forward 3/4")
G1 X -0.75 (Move to left 3/4")
G38.2 Y 1 F3 (Probe Y backward 1" at 3"/min)
G1 Y -0.0625 F20 (Move forward 1/16" at 20"/min)
G38.2 Y 1 F1.5 (Probe Y backward 1" at 1.5"/min)
G92 Y -2.253 (Set Y offset. CNC Measured x + bit radius = 2.1277 + 0.125)
G1 Y -0.25 F40 (Move forward 1/4")

(Move to XY Zero)
G1 Z 1 (Raise bit 1")
M0 (MSG, REMOVE TOUCH PLATE AND MAGNET.)
G90 G1 X 0 Y 0 F80 (Move to X Y ZERO at 80"/min)
M2 (End Program)


(Upper right corner probe routine for 1/4" bit)
G20 (Units inches)
G91 (set incremental distance mode)
G92 X0 Y0 Z0 (Set offset to 0 and make the current location 0,0,0)
M0 (MSG, ENSURE MAGNET IS ATTACHED!)

(Probe Z axis)
G38.2 Z -1 F3 (Probe Z down 1" at 3"/min)
G1 Z 0.0625 F20 (Move up 1/16" at 20"/min)
G38.2 Z -1 F1.5 (Probe Z down 1" at 1.5"/min)
G92 Z 0.615 (Set Z offset to CNC measured thickness of plate)
G1 Z 0.25 F40 (Move up 0.25" at 40"/min)

(Move and Probe X axis)
G1 X -0.75 (Move left 3/4")
G1 Z -0.6 (Move down 0.6")
G38.2 X 1 F3 (Probe X right 1" at 3"/min)
G1 X -0.0625 F20 (Move left 1/16" at 20"/min)
G38.2 X 1 F1.5 (Probe X right 1" at 1.5"/min)
G92 X -2.253 (Set X offset. CNC Measured x + bit radius = 2.1277 + 0.125)
G1 X -0.25 F40 (Move left 1/4" at 40"/min)

(Move and Probe Y axis)
G1 Y -0.75 (Move foreward 3/4")
G1 X 0.75 (Move right 3/4")
G38.2 Y 1 F3 (Probe Y backward 1" at 3"/min)
G1 Y -0.0625 F20 (Move forward 1/16" at 20"/min)
G38.2 Y 1 F1.5 (Probe Y backward 1" at 1.5"/min)
G92 Y -2.253 (Set Y offset. CNC Measured x + bit radius = 2.1277 + 0.125)
G1 Y -0.25 F40 (Move forward 1/4")

(Move to XY Zero)
G1 Z 1 (Raise bit 1")
M0 (MSG, REMOVE TOUCH PLATE AND MAGNET.)
G90 G1 X 0 Y 0 F80 (Move to X Y ZERO at 80"/min)
M2 (End Program)

8 Likes