Is this the center finding routine?
If so when I run it, there is a dialog box at the end of the process that shows 2 different decimals.
They appear to be the amounts of correction needed in the X and then Y axis to be at dead center.
Can anyone verify this?
Code:N100 GLOBAL REAL #XC #YC #ZC N102 GLOBAL REAL #PX #PY #PX1 #PY1 #PX2 #PY2 #CX #CY #RAD #STEP N103 GLOBAL REAL #DXDY N103 GLOBAL REAL #DXDY1 N104 (Switch to imperial) N106 G20 N108 (switch to the touch probe, set your tool as needed) N110 M06 T100 N112 (Go to Program X0Y0) N114 G01Y0X0F5 N116 G31 X-1 I7 S1 E0 F1 N118 G01 X#Program.X/2 Y0 F5 N122 (search Y axis to -1 at feed rate of 1 input line 7) N124 G31 Y-1 I7 S1 E0 F1 N126 (First point is Program.X.Program.Y) N128 #PX = #Program.X N130 #PY = #Program.Y (N131 M00 #PX & " " & #PY N132 (Step back slightly to take probe off surface) N133 G01 X#Program.X/3 Y#Program.Y/2 F5 N138 (search Y axis to 2 at feed rate of 1 input line 7) N140 G31 Y.5 I7 S1 E0 F1 N142 (Second point is Program.X.Program.Y) N144 #PX1 = #Program.X N146 #PY1 = #Program.Y (N147 M00 #PX1 & " " & #PY1 N149 G01 X#PX/3 Y#Program.Y/3 F5 N154 (search X axis to 2 at feed rate of 1 input line 7) N156 G31 X2 I7 S1 E0 F1 N158 (Third point is Program.X.Program.Y) N160 #PX2 = #Program.X N162 #PY2 = #Program.Y (N163 M00 #PX2 & " " & #PY2 N164 (Go to Program X0Y0) N166 G01Y0X0F5 IF [#PX1 - #PX] = 0 THEN #PX1 = #PX1 + 0.0001 ENDIF IF [#PX2 - #PX1] = 0 THEN #PX2 = #PX2 + 0.0001 ENDIF IF [#PY1 - #PY] = 0 THEN #PY1 = #PY1 + 0.0001 ENDIF IF [#PY2 - #PY1] = 0 THEN #PY2 = #PY2 + 0.0001 ENDIF #DXDY = [#PY1 - #PY] / [#PX1 - #PX] N174 #DXDY1=[[#PY2]-[#PY1]]/[[#PX2]-[#PX1]] (M00 #DXDY & " " & #DXDY1 IF [#DXDY1 + #DXDY] = 0 THEN M00 "Either lines are on same coord or too small area" ENDIF N176 #CX=[[[#DXDY]*[#DXDY1]]*[[#PY]-[#PY2]]+[[#DXDY1]*[[#PX]+[#PX1]]]-[[#DXDY]*[[#PX1]+[#PX2]]]]/[[2.]*[[#DXDY1]-[#DXDY]]] N178 #CY=[[-1.]/[#DXDY]]*[[#CX]-[[#PX]+[#PX1]]/[2.]]+[[#PY]+[#PY1]]/[2.] (N180 #RAD=[SQRT[[[[#PX1]-[#CX]]*[[#PX1]-[#CX]]]+[[[#PY1]-[#CY]]*[[#PY1]-[#CY]]]]]*[2.] N182 M00 #CX & " " & " " & #CY & " " & #RAD N183 M00 #PX & " " & #PY & "; " & #PX1 & " " & #PY1 & "; " & #PX2 & " " & #PY2 N184 M00