So I'm attempting to muddle my way thru a macro program on a Haas TM3P. But I totally got stuck trying to use cutter comp in a macro subprogram. Can you call G41/G42 in the main program, then go into the macro thru G65? I also put the cutter comp in the macro subprogram, but that didn't do anything. I ran basically the same g-code just with real numbers in the main program, and it ran fine. But the machine just won't do it when it calls up the macro... Errors out that the Tool is too large, which doesn't make sense mathmatically with the size of the tool I'm using
Would another way be to call up something like G65 P5997 D___ as a variable to put into the macro subprogram? I attempted to read the Haas manual/Smid's book on that stuff but it went way over my head.
Hell, I could have just screwed my arithmetic up...
Heres what I have now:
(SLEEVE DIA) #100 = 4.075
#101= [ #100 - 2.5 ]
(Z-DEPTH) #103 = 1.035
(2 ROUGHING PASSES FOR SLEEVE)
T11 (1IN HSS ROUGHING EMILL)
M06
G90 G59 G00 X0. Y0.
S285 M03
G43 H11 Z2. M08
Z0.2
Z - #103
G65 P5997
G90 G59 M09
G00 Z0.2 M05
G28 G91 Z0.
M01
O05997
G90 G59 G00 X0. Y0.
G00 G41 D11 X [ [ #101 - 0.08 ] / 2 ] Y0.
G03 X [ [ #100 - 0.08 ] / 2 ] Y0. R [ [ #100 / 2 ] - [ #101 / 2 ] / 2 ] F10.
G03 X [ [ #100 - 0.08 ] / 2 ] Y0. I - [ [ #100 - 0.08 ] / 2 ]
G03 X [ [ #101 - 0.08 ] / 2 ] Y0. R [ [ #100 / 2 ] - [ #101 / 2 ] / 2 ]
G03 X [ [ #100 - 0.02 ] / 2 ] Y0. R [ [ [ #100 - 0.02 ] / 2 ] - [ [ #101 - 0.08 ] / 2 ] / 2 ]
G03 X [ [ #100 - 0.02 ] / 2 ] Y0. I - [ [ #100 - 0.02 ] / 2 ]
G03 X [ [ #101 - 0.02 ] / 2 ] Y0. R [ [ #100 / 2 ] - [ #101 / 2 ] / 2 ] M09
G00 G40 X0. Y0.
M99
I know its ugly and bastardized, but hey its one way to learn.
Thanks for the help.
Ha never mind, I made the program easier to read/shortened it and I found a mathmatical error. That would throw everything out![]()