Does anyone out there have a good macro for doing thread sections? I have one that seems to work ok but it doesn't repeat. It will make a perfect part, and then it will make a part where the pitch on the first section is small because the threader is off in Z somehow and widens the threads out.
Here is the one I'm using now. If any of you spot the problem I would be forever grateful.
This is on a STAR SR-32J Fanuc 18i controls, but it should realistically work anywhere.
O8001(G32 CONTINUOUS THREAD CYCLE INCH)
(#500 Z START POSITION)
(#501 Z END POSITION)
(#502 MAJOR DIAMETER)
(#503 MINOR DIAMETER)
(#504 DEPTH OF FIRST CUT - RADIUS)
(#505 PITCH IN INCHES)
(#506 MINIMUM DEPTH OF CUT - RADIUS)
(MAIN PROGRAM EXAMPLE)
(5/8-20 THREAD)
(1ST TURN)
(FIRST THREAD)
(T300)
(S1000M3)
(#500=0)
(#501=.7)
(#502=.625)
(#503=.575)
(#504=.01)
(#505=.05)
(#506=.001)
(G0X.7Z-.05T3)
(M98P8001)
(SECOND TURN)
(SECOND THREAD)
(T300)
(S1000M3)
(#500=.7)
(#501=1.4)
(G0X.7Z-.05T3)
(M98P8001)
(AND SO ON)
#100=[#502+.05](X START POINT)
#101=[#502-[#504*2]](X DEPTH MONITOR)
#103=[#505*3](Z START POINT)
#104=[#504*2](DEPTH OF CUT REDUCER)
WHILE[#101GT#503]DO1
G0X#100Z[#500-#103]
#102=[#100-#101]*TAN[29.]
G32X#101W#102F#505
G32Z#501
G32X#100W#102
G0Z[#500-#103]
IF[[#104*.66]LT[#506*2]]GOTO20
#104=[#104*.66]
N20#101=[#101-#104]
END1
(FINAL PASS)
#101=#503
G0X#100Z[#500-#103]
#102=[#100-#101]*TAN[29.]
G32X#101W#102F#505
G32Z#501
G32X#100W#102
G0Z[#500-#103]
(SPRING PASS)
G0X#100Z[#500-#103]
#102=[#100-#101]*TAN[29.]
G32X#101W#102F#505
G32Z#501
G32X#100W#102
G0Z[#500-#103]
M99
Thanks Again for any help. I have a job that I am programming today and I need to do thread sections on it. I'm perfectly capable of longhanding it, but these types of parts keep coming up and I would love to be able to use a macro.
Ben