EyeEmTrash
Aluminum
- Joined
- Feb 24, 2023
I am making a Macro Program for the first time. I think I am starting to understand it a little bit better. At my job we make a certain part that is pretty much the same, just in different OD's and some minor changes in other dimensions. I was thinking that Macro Programming would be perfect for this as I can just change variables instead of writing 12 different programs. I just started to write it and I will have other variables added when I think of them. I am hoping someone could give me advice and tell me if my program is good so far and whether or not I am on the right track in doing this the best way. Any tips would be appreciated.
Edit: I should also add that the parts I make are pretty simple. I am probably making the program more complicated then it has to be. I just figured that the more variables I add at the top, the less I have to go digging through the program to make changes. The parts come pretty much cut to length, I just have to trim around 3/16 off every piece but they do vary depending on who cuts them. I can have 2 different parts with the same OD, with a different length and different drill length as well.
#100=1.5(SIZE OF MATERIAL)
#101=1.5(OD TOP)
#102=1.495(OD BOTTOM)
#103=1.5(DEPTH OF BOTTOM SOCKET)
#104=[#100+.2](OD X SAFE HEIGHT)
#106=.04(OD ROUGH DOC)
#107=.005(OD FINISH DOC)
#108=.01(ROUGH OD FEED)
#109=.005(FINISH OD FEED)
#110=.125(HOW MUCH TO FACE)
#111=.02(RADIUS/CHAMFER TOP)
#112=.02(RADIUS/CHAMFER BOTTOM)
#113=.900(OD THREAD LENGTH)
#114=.0438(OD THREAD HEIGHT)
#115=.0767(OD THREAD FEED RATE)
#116=5.5(TOP DRILL DEPTH)
#117=.3(TOP DRILL POINT OFFSET)
#118=.2(TOP DRILL DOC)
#119=
G80G00M09
G28U0W0
M05
M01
N1(STOP)
G80G00M09
G28U0W0
M05
M01
T1010
G50S800
G99G97G42G00X[#100-.2]Z#110
M00
(PULL MATERIAL TO STOP)
Z[#110+1.0]
N2(ROUGH FACE AND CHAMFER)
G80G00M09
G28U0W0
M05
M01
T1010
G50S800
G99G96G42
G00X3.0Z1.0
#150=[#110-#106](Z FACING)
N3
IF[#150LE[#106+#107]]GOTO4
G00X#104
Z#150
G01X0.0F#108
G00Z[#150+.2]
#150=[#150-#106]
GOTO3
N4
G00X#104
Z#107
G01X0.0F#108
G00Z[#150+.2]
Edit: I should also add that the parts I make are pretty simple. I am probably making the program more complicated then it has to be. I just figured that the more variables I add at the top, the less I have to go digging through the program to make changes. The parts come pretty much cut to length, I just have to trim around 3/16 off every piece but they do vary depending on who cuts them. I can have 2 different parts with the same OD, with a different length and different drill length as well.
#100=1.5(SIZE OF MATERIAL)
#101=1.5(OD TOP)
#102=1.495(OD BOTTOM)
#103=1.5(DEPTH OF BOTTOM SOCKET)
#104=[#100+.2](OD X SAFE HEIGHT)
#106=.04(OD ROUGH DOC)
#107=.005(OD FINISH DOC)
#108=.01(ROUGH OD FEED)
#109=.005(FINISH OD FEED)
#110=.125(HOW MUCH TO FACE)
#111=.02(RADIUS/CHAMFER TOP)
#112=.02(RADIUS/CHAMFER BOTTOM)
#113=.900(OD THREAD LENGTH)
#114=.0438(OD THREAD HEIGHT)
#115=.0767(OD THREAD FEED RATE)
#116=5.5(TOP DRILL DEPTH)
#117=.3(TOP DRILL POINT OFFSET)
#118=.2(TOP DRILL DOC)
#119=
G80G00M09
G28U0W0
M05
M01
N1(STOP)
G80G00M09
G28U0W0
M05
M01
T1010
G50S800
G99G97G42G00X[#100-.2]Z#110
M00
(PULL MATERIAL TO STOP)
Z[#110+1.0]
N2(ROUGH FACE AND CHAMFER)
G80G00M09
G28U0W0
M05
M01
T1010
G50S800
G99G96G42
G00X3.0Z1.0
#150=[#110-#106](Z FACING)
N3
IF[#150LE[#106+#107]]GOTO4
G00X#104
Z#150
G01X0.0F#108
G00Z[#150+.2]
#150=[#150-#106]
GOTO3
N4
G00X#104
Z#107
G01X0.0F#108
G00Z[#150+.2]
Last edited: