Cutting a tapered thread with G76

More
28 Jan 2021 07:47 #196902 by RotarySMP
I whiped up this to do a multi pass tapered thread. It starts by cutting the taper. You should be able to modify it pretty easily to your needs. It is written for metric.

;Weird thread
;Why? Because a CNC lathe can!

;Tapered 3 start RH thread 23/57"OD x Pi TPcm, 11/7 Chi long, with a 23/19e taper angle.
;Z0 is end of stock.

#<_pi> = 3.2654
#<_e> = 2.71828
#<_chi>= 30.3

#<_starts> = 3
#<_OD> = [23/57*25.4]
#<_Z_LeadIn> = [#<_pi>*4]
#<_Pitch> = [#<_pi>]
#<_ThreadDepth> = [#<_pi> /3 ]
#<_ThreadLength> =-[#<_chi>*11/7]
#<_TaperAngle> = [23/19*#<_e>]
#<_NumThreadPasses> = ROUND[#<_ThreadDepth>/0.1]

#<_SmallDia> = [#<_OD> - [SIN[#<_TaperAngle>*2]] *[#<_Z_LeadIn> + ABS[ #<_ThreadLength>]]]
#<_DiaChange> = [#<_OD> - #<_SmallDia>]
#<_NumCuttingPasses> = ROUND[#<_DiaChange>]

#<_feedrate> = 200
#<_Speed> = 300
#1 = 1 ; Index start passes
#2 = 1 ; Index threading passes
#3 = 1 ; Index cutting passes

O110 sub ;Cut taper
O110 while [#3 LE #<_NumCuttingPasses>]
G0 Z[#<_Z_LeadIn>]
X[#<_SmallDia> + #<_NumCuttingPasses> - #3] * [#<_DiaChange> / #<_NumCuttingPasses>]
G01 Z[#<_ThreadLength>] X[#<_OD> + #<_NumCuttingPasses> - #3] * [#<_DiaChange> / #<_NumCuttingPasses>] F#<_Feedrate>
G0 X[#<_OD> + #<_DiaChange>]
#3 = [#3 +1]
O110 Endwhile
O110 endsub

O111 sub ; Cut Thread

O100 while [#1 LE #<_starts>]
O101 while [#2 LE#<_NumThreadPasses>]
G0 Z[#<_Z_LeadIn> + #1 - 1] * [#<_Pitch>/#<_starts>]
X[#<_SmallDia> - #2]*[#<_ThreadDepth> / #<_NumThreadPasses>]
G33 Z[#<_ThreadLength>] X[#<_OD> - #2 - 1] * [#<_ThreadDepth>/ #<_NumThreadPasses>] K#<_Pitch>
G0 X[#<_OD> + #<_DiaChange>]
#2 = [#2 + 1]

O101 endwhile
M5
G4 P2
M3
G4 P2
#2 =1
#1 = [#1 +1]
#<_SmallDia> = [#<_SmallDia> - [SIN[#<_TaperAngle>]*[#1 -1] * [#<_Pitch>/#<_starts>]]]
O100 EndWhile
O111 endsub

;Main
G18 G21 G40 G49 G54 G80 G94 G90 G7
F#<_Feedrate> S#<_Speed>
M3
G4 P2
O110 call
M5
G4 P2
M3
O111 call
M9 M5
M2

Please Log in or Create an account to join the conversation.

More
28 Jan 2021 16:28 #196960 by mooser
Surprising how little of that I actually understand.... :(
M

Please Log in or Create an account to join the conversation.

More
29 Jan 2021 01:50 #197023 by mooser
Not the best thread I've ever cut but it's tapered and seems to work on the fitting so somewhat of a success (did it the hard way with multiple g33)


Now to figure out how to make that go into a 5/16 straight
M
Attachments:

Please Log in or Create an account to join the conversation.

More
29 Jan 2021 08:29 #197041 by andypugh

Now to figure out how to make that go into a 5/16 straight


You can even run the thread through, changing the angle (and possibly the pitch)

wiki.linuxcnc.org/cgi-bin/wiki.pl?JMKsFusee

Please Log in or Create an account to join the conversation.

More
26 Feb 2021 16:02 - 26 Feb 2021 16:04 #200200 by joekline9
I have a subroutine to cut tapered threads. John Thorton helped me write it a few years ago.
the sub uses G33.
I use it a lot to cut pipe threads.
See attached files for 1/8" and 1/4" pipe.

At that time I looked at the source code for G76. I think it could easily be modified to do tapered threads.
Attachments:
Last edit: 26 Feb 2021 16:04 by joekline9.

Please Log in or Create an account to join the conversation.

Time to create page: 0.092 seconds
Powered by Kunena Forum