What's new
What's new

MACRO - Updating SPC tool offset with Renishaw Probe (O9835)

TChaseEngineer

Plastic
Joined
Jul 3, 2018
Hello,

Machine - Doosan DNM5700
Control - Fanuc Oi
Cam - Edgecam 2018R2

I have been using the OMP60 Renishaw probe for a while now and have come familiar with using it on our machine. Right now I am only using it to update my work offsets but I know it is capable of much more. One thing that I would like to figure out is how to use the probe to update my wear offsets. For example, if I have a part with a critical bore I would like to run the part, probe the bore, then have the machine look at the info on the size of the bore, and if the bore is undersized to have it run another skim pass, or finish if it is within tolerance. I would eventually like to be able to do this for all critical features.

I have been working on some code and wondering if I am going down the right path.

#138 - variable output that holds bore measurement
#2000 - I believe is the system variable for X axis tool wear. #2001 - tool 1, #2002 - tool 2, #2003 - tool 3, ect.


In this example I will machine a 1in hole +-.002, probe the hole and decide if I need to update the offset and re machine or just end program.


N10
T0909 (Hole Program)

N20 T40 M6 (PROBE)
G65 P8501 (PROBE MODE ON)
G43 H40
M165 P9810 X1. Y-1. F20.
M165 P9810 Z-0.25 F20.
M165 P9814 D1. H0.002
M165 P9835 T9. M50. V.1 C4
M165 P9810 Z0.25 F20.
M9
G91 G28
G28 Y0.
G90
M1

#100=.998 (Min. expected finish diameter (1in+-.002)
IF[#138LE#100]THEN GOTO10 (if less than .998 go back and cut again with the updated offset)
IF[#138GE#100]THEN GOTO30 (if greater than end program)

N30
M30

Questions
P9835 - Does this macro actually update the tool offset (variable #2009)?
Or do I have to calculate the wear value from what I measured in the probing cycle and then plug that into #2009 so that it updates?
Do I need to add a counter?

Does anyone have a sample macro that does something like this that I could look at?

I am new to Macros any help is greatly appreciated.
 
For anyone who needs something like this.

Machine - Doosan DNM5700
Control - Fanuc Oi

The program below machines a 0.995 (purposely small)
Hole tolerance is 1.000 +-0.002
This will probe the hole after machining. Update the tool wear offset by looking at the previous measurement and then re cut the hole to size. It will then measure again and if it is in tol. then it will end program. If it is out of tolerance it will alarm out.


G00 G17 G20 G40 G49 G54 G80 G98 G90

G17 G20 G40 G80 G90 G94
N10 T8 M6 (1/2 DIA MULTI FLUTE END MILL)
G54 G0 X1.75 Y-0.625 S6200 M3
G43 Z0.25 H8 T8 M9
G1 Z0. A0. F36.
X1.9975
G2 X1.9975 Y-0.625 Z-0.05 I-0.2475 J0.
X1.9975 Y-0.625 Z-0.1 I-0.2475 J0.
X1.9975 Y-0.625 Z-0.15 I-0.2475 J0.
X1.9975 Y-0.625 Z-0.2 I-0.2475 J0.
X1.9975 Y-0.625 Z-0.25 I-0.2475 J0.
X1.9975 Y-0.625 Z-0.3 I-0.2475 J0.
X1.9975 Y-0.625 Z-0.35 I-0.2475 J0.
X1.9975 Y-0.625 Z-0.4 I-0.2475 J0.
X1.9975 Y-0.625 Z-0.45 I-0.2475 J0.
X1.9975 Y-0.625 Z-0.5 I-0.2475 J0.
X1.9975 Y-0.625 I-0.2475 J0.
G1 X1.75
G0 Z0.25
G91 G28 Z0.
G28 Y0.
G90
M1

G0 G17 G20 G40 G80 G90 G94
N20 T8 M6 (1/2 DIA MULTI FLUTE END MILL)
G54 G0 X1.75 Y-0.625 S6200 M3
G43 Z0.25 H8 T40 M9
G1 Z-0.5 F18.
X1.745 Y-0.8415
G41 D8 X1.72
Y-0.8425
G3 X1.75 Y-0.8725 R0.03
X1.75 Y-0.8725 I0. J0.2475 F36.
X1.78 Y-0.8425 R0.03 F18.
G1 Y-0.8415
G40 X1.755
X1.75 Y-0.625
G0 Z0.25
G91 G28 Z0.
G28 Y0.
G90
M1

G0 G17 G20 G40 G80 G90 G94
N30 T40 M6 (21.00-T30/6-HM-M3)
G43 H40
G65 P8501 (PROBE MODE ON)
M165 P9810 X1.75 Y-0.625 F50.
M165 P9810 G43 Z-0.25 F50.
M165 P9814 D1. V.002 T8.
#102=#138

M165 P9810 Z0.25 F30.
#100=0.998
#101=1.002

IF[#102LT#100]THEN GOTO20
IF[#102GT#101]THEN GOTO40

GOTO50

N40
#3000=100(OUT*OF*TOL*1.002*EXCEEDED)

N50

M9
G91 G28
G28 Y0.
G90
M1
M30
%
 
BTW, if you are noticing some deflection on the finish cut and the exact wear adjustment is too much for the subsequent cut (overcutting on last cut), you can tell it to adjust a percentage of the difference using Ff.

M165 P9814 D1. V.002 T8. F.7

For 70% adjustment. Instead of changing wear by .001 it would do .0007
 








 
Back
Top