extanker,
heres my center probing macro
instead of starting at the center and then returning to the center after each touch, mine goes around the part from one side to the next and saves time.
It will always probe the front of the part first, then right, back, and left
It requires G154 P98 and P99 to be empty for use in the calculations, but that could be changed
If you dont want to probe the part at the actual center, you can offset where it touches at by as much as 1" in either direction in the Y or X
X offset is I-word
Y offset is J-word
you can increase the offset, but theres an alarm in my macro keeping me from doing it accidentally, just change the value the alarm checks for
the only offsets you can update with this are G54 through G59
you may wish to add some more protected moves in there,
like for the rapid moves between sides,
and the Z moves in the G43 lines
at least untill you get confident with it, give yourself a big retract amount
and make sure the probe is at a clearance height before calling the macro
hope this helps you guys learn some more
ask me anything, I like to help if I can
Code:
%
O09009 (NEW CENTER PROBE)
(PROBES THE CENTER AND UPDATES SPECIFIED OFFSET)
(SAVES X AND Y MEASUREMENTS TO #600 AND #601)
(**MACRO CALL**)
(G65 P9009 A2. X15.38 Y33.43 J-1. Z-0.15 S56 R4.)
(A = 1 FOR BLOCK, 2 FOR POCKET)
(X = OVERALL X WIDTH)
(Y = OVERALL Y WIDTH)
(I = DISTANCE TO OFFSET FROM CENTER IN X)
(J = DISTANCE TO OFFSET FROM CENTER IN Y)
(Z = PROBE DEPTH)
(S = OFFSET TO BE UPDATED)
(R = RETRACT DISTANCE)
(INITIALISE VARIABLES)
#19= ROUND[ #19 ]
#24= ABS[ #24 / 2 ]
#25= ABS[ #25 / 2 ]
IF [ #18 EQ #0 ] THEN #18= #5003
IF [ #19 EQ #0 ] THEN #19= 54
#18= ABS[ #18 ]
IF [ #4 EQ #0 ] THEN #4= 0
IF [ #5 EQ #0 ] THEN #5= 0
(ALARM CONDITIONS)
IF [ [ ABS[ #4 ] LE 1 ] OR [ ABS[ #5 ] LE 1 ] ] GOTO5
#3000= 1 (I OR J MUST BE BETWEEN -1 AND 1)
N5
IF [ #18 GE 0.25 ] GOTO10
#3000= 2 (RETRACT MUST BE GREATER THAN .25)
N10
IF [ #25 NE #0 ] GOTO20
#3000= 3 (NO Y VALUE)
N20
IF [ #24 NE #0 ] GOTO30
#3000= 4 (NO X VALUE)
N30
IF [ #26 NE #0 ] GOTO40
#3000= 5 (NO PROBE DEPTH)
N40
IF [ [ #1 EQ 1 ] OR [ #1 EQ 2 ] ] GOTO50
#3000= 6 (INPUT "A1" FOR BLOCK "A2" FOR POCKET)
N50
IF [ #26 GT - 0.5 ] GOTO60
#3000= 7 (PROBE DEPTH SHALL NOT EXCEED Z-.5)
N60
(IDENTIFY AND ASSIGN WORK OFFSET BETWEEN G54 AND G59)
IF [ #19 NE 54 ] GOTO100
#101= 5221
#102= 5222
#103= 5223
GOTO700
N100
IF [ #19 NE 55 ] GOTO200
#101= 5241
#102= 5242
#103= 5243
GOTO700
N200
IF [ #19 NE 56 ] GOTO300
#101= 5261
#102= 5262
#103= 5263
GOTO700
N300
IF [ #19 NE 57 ] GOTO400
#101= 5281
#102= 5282
#103= 5283
GOTO700
N400
IF [ #17 NE 58 ] GOTO500
#101= 5301
#102= 5302
#103= 5303
GOTO700
N500
IF [ #17 NE 59 ] GOTO600
#101= 5321
#102= 5322
#103= 5323
GOTO700
N600
#3000= 6 (USE OFFSETS G54 THROUGH G59)
N700
(CHECK BLOCK OR POCKET)
IF [ #1 NE 1 ] GOTO710
#110= -0.5
#111= 0.5
GOTO810
N710
#110= 0.5
#111= -0.5
N810
(APPROACH GAP)
#105= #24 + #4
#106= #25 - #5
#107= #24 - #4
#108= #25 + #5
(P99)
#15961= #[ #101 ] - #24
#15962= #[ #102 ] - #25
#15963= #[ #103 ]
(P98)
#15941= #[ #101 ] + #24
#15942= #[ #102 ] + #25
#15943= #[ #103 ]
(MAIN CODE)
G00 G90 G154 P99 X#105 Y#110
G43 H18 Z [ #26 + 0.5 ]
M78 G31 Z#26 F60.
G65 P9811 Y0 S154.99
G00 Z#18
G90 G154 P98 X#111 Y - #106
G43 H18 Z [ #26 + 0.5 ]
M78 G31 Z#26 F60.
G65 P9811 X0 S154.98
G00 Z#18
G90 G154 P98 X - #107 Y#111
G43 H18 Z [ #26 + 0.5 ]
M78 G31 Z#26 F60.
G65 P9811 Y0 S154.98
G00 Z#18
G90 G154 P99 X#110 Y#108
G43 H18 Z [ #26 + 0.5 ]
M78 G31 Z#26 F60.
G65 P9811 X0 S154.99
G00 Z#18
(RESET CENTER FOR SPECIFIED WORK OFFSET)
#[ #101 ]= [ [ #15961 - #15941 ] / 2 ] + #15941
#[ #102 ]= [ [ #15962 - #15942 ] / 2 ] + #15942
(SAVE X Y DIMENSIONS)
#600= ABS[ #15961 - #15941 ] (X MEASUREMENT)
#601= ABS[ #15962 - #15942 ] (Y MEASUREMENT)
M99
%