OK Here is a macro that should do the trick. You have to program the macro at load time with the use of #vars
#1 = X width of part
#2= Y width of part
#3= Probing Feedrate
You call it as
M175 #1=2 #2=2 #3=50
With that it assumes the part is 2X2 and the Probing feedrate = 50
You place the Probe at the approx center of the part then call the macro. It probes down and finds the Top of Material. Then moves over to X positive and probes for the right side of the part, then Moves back away from the part and UP and across the part to the opposite side. It then Probes the Left side of the part. Then moves back away from the part and UP. It then moves to the center distance between the 2 sides.
It repeats the same sequences for Y axis and ends at the center of the X and Y.
AS the standard disclaimer for probing with macros Your mileage may vary as to how it reacts to your system. TRY it in the air above the part BEFORE you commit it to actually probing.
IF it crashes your PROBE sorry about that BUT no guaranties. The motion works here and the math works here , BUT (;-)
(;-) TP
'Macro Center of Part
Xwide = GetVar(1)
Ywide = Getvar(2)
Frate = GetVar(3)
If Xwide = 0 Or Ywide = 0 Or Frate = 0 Then
MsgBox" Mcode Params not stated, Retry"
End
End If
SetVar(100,Frate)
'Move close to center of part
'Z Probe
Code"F#100"
Code"G31 Z-2"
While Ismoving()
Wend
Code"G92 Z0"
Code"G1 Z.010"
Code"G92 Z0"
While Ismoving()
Wend
Ztop = GetDro(2)
Code"G0Z.5"
' X Probe
Code"G0 X" & (.5 * (Xwide +1))
Code"Z-.5"
Code"G31 X0"
While Ismoving()
Wend
SetVar(101,GetVar(2000))
Code"G0 G91 X1"
Code"G90"
Code"Z.5"
Code"G0 X"&(-1* (.5 * (Xwide +1)))
Code"G0 Z-.5"
Code"G31 X0"
While Ismoving()
Wend
SetVar(102,GetVar(2000))
Code"G0 G91 X-1"
Code"G90"
X1= GetVar(101)
X2= Abs (GetVar(102))
Xcenter = ((X1+X2) /2)
'MsgBox"" &Xcenter
Code"G0 G91 X" & (Xcenter +1)
Code"G90"
'Y Probe
Code"G0 Y" & (.5 * (Xwide +1))
Code"Z-.5"
Code"G31 Y0"
While Ismoving()
Wend
SetVar(201,GetVar(2001))
Code"G0 G91 Y1"
Code"G90"
Code"Z.5"
Code"G0 Y"&(-1* (.5 * (Xwide +1)))
Code"G0 Z-.5"
Code"G31 Y0"
While Ismoving()
Wend
SetVar(202,GetVar(2001))
Code"G0 G91 Y-1"
Code"G90"
Y1= GetVar(201)
Y2= Abs (GetVar(202))
Ycenter = ((Y1+Y2) /2)
'MsgBox"" &Ycenter
Code"G0 G91 Y" & (Ycenter +1)
Code"G90"
Message" Probe at CENTER of MATERIAL"
Code" G92 X0.0000 Y0.0000"
Code" G1 Z" & Ztop
Message " Probe at X0 Y0 Z0 of Part Origin"
Code"#1=0 #2=0 #3=0"
End