What's new
What's new

Writing a macro for Fanuc 16 and 18 for positive tool offsets and accounting for length of Haimer Probe

cgrim3

Cast Iron
Joined
Dec 4, 2020
Location
Baltimore
We are transitioning a part of our shop to positive tool offsets. See picture below of what we are trying to accomplish.

We have a Zoller tool setter we set our tools on. I have the Zoller setup to send the tool offsets to the machines. Most of these machines are older machines with Fanuc controllers. Since they are older, I don't want to invest money in buying Renishaw probes but would rather use Haimer or Haff & Schneider 3d tasters. So all that leaves is setting the G54 X, Y, and Z. I do not need a macro for X and Y. I do need a macro for Z though.

The macro would basically add the length of the Haimer 3d taster when needle reads zero to the Z value output by the controller.

We already know the length of the Haimer probe when needle is at zero. I just need a macro that adds it to the Z value output by the controller to eliminate arithmetic errors by our setup people. I was wondering if somebody could help me write this macro. I am not sure where to start.
1692713853898.png

Thanks,

Chris
 

PROBE

Hot Rolled
Joined
Jan 23, 2003
Location
Tel Aviv, Israel
We are transitioning a part of our shop to positive tool offsets. See picture below of what we are trying to accomplish.

We have a Zoller tool setter we set our tools on. I have the Zoller setup to send the tool offsets to the machines. Most of these machines are older machines with Fanuc controllers. Since they are older, I don't want to invest money in buying Renishaw probes but would rather use Haimer or Haff & Schneider 3d tasters. So all that leaves is setting the G54 X, Y, and Z. I do not need a macro for X and Y. I do need a macro for Z though.

The macro would basically add the length of the Haimer 3d taster when needle reads zero to the Z value output by the controller.

We already know the length of the Haimer probe when needle is at zero. I just need a macro that adds it to the Z value output by the controller to eliminate arithmetic errors by our setup people. I was wondering if somebody could help me write this macro. I am not sure where to start.
View attachment 406085

Thanks,

Chris
This is the macro I wrote in the past to allow Haimer users to benefit. Hope it is clear enough.
%
O9023 (SNR HAIMER)
(G65P9023D***S** - MEASURE BORE, D - NOMINAL DIAMETER, S - WCS 54-59)
(G65P9023X***.***S** - MEASURE X SURFACE, X - SURFACE POSITION IN NEW WCS, S - WCS 54-59)
(G65P9023Y***.*** - MEASURE Y SURFACE, Y - SURFACE POSITION IN NEW WCS, S - WCS 54-59)
(G65P9023Z***.*** - MEASURE Z SURFACE, , Z - SURFACE POSITION IN NEW WCS, S - WCS 54-59)
(G65PG023C1.Z0 - CALIBRATE HAIER LENGTH)


#10=135
WHILE[#10LE149]DO1
#[#10]=#0
#10=#10+1
END1

#118=11000(LENGTH MACRO CALL)
#119=10000(LENGTH WEAR MACRO CALL, #0 IF NOT APPLICABLE)
#120=60(PROBE OFFSET NUMBER)
#121=54(WCS FOR LENGTH CALIBRATION, SET ON Z SURFACE)

IF[#7NE#0] GOTO 1000
IF[#24NE#0] GOTO 100
IF[#25NE#0] GOTO 200
IF[#26NE#0] GOTO 300


N100 (MEASURE X)
#3006=91 (PUT THE HAIER ON X SURFACE)
G53
#135=#5041
IF[#19EQ#0]GOTO999
#[5201+[#19-53]*20]=#135-[#5041-#5021]-#24
GOTO999

N200 (MEASURE Y)
#3006=92 (PUT THE HAIER ON Y SURFACE)
G53
#136=#5042
IF[#19EQ#0]GOTO999
#[5202+[#19-53]*20]=#136-[#5042-5022]-#25
GOTO999

N300 (MEASURE Z)
IF[#3NE#0]GOTO400 (HAIER LENGTH CALIBRATION)
#3006=93 (PUT THE HAIER ON Z SURFACE)
G53
IF[#119EQ#0]GOTO310
#137=#5043-#[#118+#120]-#[119+#120]
N310
#137=#5043-#[#118+#120]
IF[#19EQ#0]GOTO999
#[5203+[#19-53]*20]=#137-[#5043-#5023]+#26
GOTO999

N400
#3006=93 (PUT THE HAIER ON Z SURFACE)
G#121
IF[#19EQ#0] GOTO 410
#[#119+#120]=0
G53
N410
#[#118+#120]=#5043
GOTO999

N1000 (MEASURE BORE)
#3006=94 (SWITCH TO JOG, PUT THE HAIER ON LEFT X SURFACE OF THE BORE, SWITCH TO AUTO, CYCLE START)
G53
#16=#5042
#14=#5041
#3006=95 (SWITCH TO JOG, PUT THE HAIER ON RIGHT X SURFACE OF THE BORE, SWITCH TO AUTO, CYCLE START)
IF[#5042EQ#16]GOTO1010
#3000=99 (WRONG AXIS MOVE)
N1010
#135=[#14+#5041]/2
IF[#19EQ#0]GOTO1100
#[5201+[#19-53]*20]=#135-[#5041-#5021]-#24

#3006=96 (SWITCH TO JOG, PUT THE HAIER ON PLUS Y SURFACE OF THE BORE, SWITCH TO AUTO, CYCLE START)
G53
#16=#5041
#14=#5042
#3006=97 (SWITCH TO JOG, PUT THE HAIER ON MINUS Y SURFACE OF THE BORE, SWITCH TO AUTO, CYCLE START)
IF[#5041EQ#16]GOTO1010
#3000=99 (WRONG AXIS MOVE)
N1010
#136=[#14+#5042]/2
IF[#19EQ#0]GOTO1100
#[5202+[#19-53]*20]=#1356-[#5041-#5021]-#25

N999
M99
%




Stefan
Cogito Ergo Sum
 
Last edited:

cgrim3

Cast Iron
Joined
Dec 4, 2020
Location
Baltimore
This is the macro I wrote in the past to allow Haimer users to benefit. Hope it is clear enough.
%
O9023 (SNR HAIMER)
(G65P9023D***S** - MEASURE BORE, D - NOMINAL DIAMETER, S - WCS 54-59)
(G65P9023X***.***S** - MEASURE X SURFACE, X - SURFACE POSITION IN NEW WCS, S - WCS 54-59)
(G65P9023Y***.*** - MEASURE Y SURFACE, Y - SURFACE POSITION IN NEW WCS, S - WCS 54-59)
(G65P9023Z***.*** - MEASURE Z SURFACE, , Z - SURFACE POSITION IN NEW WCS, S - WCS 54-59)
(G65PG023C1.Z0 - CALIBRATE HAIER LENGTH)


#10=135
WHILE[#10LE149]DO1
#[#10]=#0
#10=#10+1
END1

#118=11000(LENGTH MACRO CALL)
#119=10000(LENGTH WEAR MACRO CALL, #0 IF NOT APPLICABLE)
#120=60(PROBE OFFSET NUMBER)
#121=54(WCS FOR LENGTH CALIBRATION, SET ON Z SURFACE)

IF[#7NE#0] GOTO 1000
IF[#24NE#0] GOTO 100
IF[#25NE#0] GOTO 200
IF[#26NE#0] GOTO 300


N100 (MEASURE X)
#3006=91 (PUT THE HAIER ON X SURFACE)
G53
#135=#5041
IF[#19EQ#0]GOTO999
#[5201+[#19-53]*20]=#135-[#5041-#5021]-#24
GOTO999

N200 (MEASURE Y)
#3006=92 (PUT THE HAIER ON Y SURFACE)
G53
#136=#5042
IF[#19EQ#0]GOTO999
#[5202+[#19-53]*20]=#136-[#5042-5022]-#25
GOTO999

N300 (MEASURE Z)
IF[#3NE#0]GOTO400 (HAIER LENGTH CALIBRATION)
#3006=93 (PUT THE HAIER ON Z SURFACE)
G53
IF[#119EQ#0]GOTO310
#137=#5043-#[#118+#120]-#[119+#120]
N310
#137=#5043-#[#118+#120]
IF[#19EQ#0]GOTO999
#[5203+[#19-53]*20]=#137-[#5043-#5023]+#26
GOTO999

N400
#3006=93 (PUT THE HAIER ON Z SURFACE)
G#121
IF[#19EQ#0] GOTO 410
#[#119+#120]=0
G53
N410
#[#118+#120]=#5043
GOTO999

N1000 (MEASURE BORE)
#3006=94 (SWITCH TO JOG, PUT THE HAIER ON LEFT X SURFACE OF THE BORE, SWITCH TO AUTO, CYCLE START)
G53
#16=#5042
#14=#5041
#3006=95 (SWITCH TO JOG, PUT THE HAIER ON RIGHT X SURFACE OF THE BORE, SWITCH TO AUTO, CYCLE START)
IF[#5042EQ#16]GOTO1010
#3000=99 (WRONG AXIS MOVE)
N1010
#135=[#14+#5041]/2
IF[#19EQ#0]GOTO1100
#[5201+[#19-53]*20]=#135-[#5041-#5021]-#24

#3006=96 (SWITCH TO JOG, PUT THE HAIER ON PLUS Y SURFACE OF THE BORE, SWITCH TO AUTO, CYCLE START)
G53
#16=#5041
#14=#5042
#3006=97 (SWITCH TO JOG, PUT THE HAIER ON MINUS Y SURFACE OF THE BORE, SWITCH TO AUTO, CYCLE START)
IF[#5041EQ#16]GOTO1010
#3000=99 (WRONG AXIS MOVE)
N1010
#136=[#14+#5042]/2
IF[#19EQ#0]GOTO1100
#[5202+[#19-53]*20]=#1356-[#5041-#5021]-#25

N999
M99
%




Stefan
Cogito Ergo Sum
Thanks so much for this. I have the Haimer in tool 23. For this particular macro, I assume I should put the length of the Haimer in the length offset page for tool 23? Also, where in this macro should I put the tool number (23) of the Haimer probe?

Additionally, for (G65PG023C1.Z0 - CALIBRATE HAIER LENGTH), is there a G023 macro program that the G65 is calling up here for the haimer length calibration? What purpose does this line serve exactly?

Also, if I am trying to measure Z with the probe and want the macro add the length of the probe to the Z, what value do I put in the Z line here (G65P9023Z***.*** - MEASURE Z SURFACE, , Z - SURFACE POSITION IN NEW WCS, S - WCS 54-59) prior to running the macro?

Thanks,

Chris



Thanks,
Chris
 
Last edited:

Vancbiker

Diamond
Joined
Jan 5, 2014
Location
Vancouver, WA. USA
……Additionally, for (G65PG023C1.Z0 - CALIBRATE HAIER LENGTH), is there a G023 macro program that the G65 is calling up here for the haimer length calibration? What purpose does this line serve exactly?…….

It’s a comment and a typo. Since it’s a comment the control won’t barf on it. Pretty certain it should say P9023.
 

cgrim3

Cast Iron
Joined
Dec 4, 2020
Location
Baltimore
Yeah I figured that out. I got the macro to work. I put the following in MDI:

G65 P9023 Z0. S54 and it worked. I had the 3d taster length set in the tool offsets and the macro updated my G54 Z successfully.

Thanks,

Chris
 

PROBE

Hot Rolled
Joined
Jan 23, 2003
Location
Tel Aviv, Israel
Yeah I figured that out. I got the macro to work. I put the following in MDI:

G65 P9023 Z0. S54 and it worked. I had the 3d taster length set in the tool offsets and the macro updated my G54 Z successfully.

Thanks,

Chris
I presume the length of the Haimer was already set.
If not:
1. The probe tool number should be set in #120 at the beginning of the O9023 program.
2. The WCS for calibration (G54 in your case, but can be any) should be set in #121.
3. Before calibration process of the probe, take a thin path on piece of metal using measured end tool.
4. Set the Z G54 (or the other chosen) on this surface.
5. Place the Haimer on the surface.
6. Dial in MDI: G65P9023C1.Z0 and execute. The Haimer length should be loaded in offset register.

Stefan
Cogito Ergo Sum
 








 
Top