- Posts: 1635
- Thank you received: 595
Cutting a tapered thread with G76
- RotarySMP
- Offline
- Platinum Member
-
Less
More
6 years 2 months ago #178048
by RotarySMP
Replied by RotarySMP on topic Cutting a tapered thread with G76
Thanks for the quick response Andy,
Bummer. Now I have to write a subroutine to do it with G33, and you have seen how careless my code is
I will take me an hour to write it and two to debug. Good practice.
Mark
Bummer. Now I have to write a subroutine to do it with G33, and you have seen how careless my code is
Mark
Please Log in or Create an account to join the conversation.
- mooser
- Offline
- Elite Member
-
Less
More
- Posts: 211
- Thank you received: 15
5 years 9 months ago #196872
by mooser
Replied by mooser on topic Cutting a tapered thread with G76
Just wondering if this was ever resolved as I need to cut a 1/8-pipe thread on some parts? (tried a 2 line G76 but it complained about missing move axis)
Thanks
M
Thanks
M
Please Log in or Create an account to join the conversation.
- tommylight
- Online
- Moderator
-
Less
More
- Posts: 22011
- Thank you received: 7491
5 years 9 months ago #196874
by tommylight
Replied by tommylight on topic Cutting a tapered thread with G76
Please Log in or Create an account to join the conversation.
- mooser
- Offline
- Elite Member
-
Less
More
- Posts: 211
- Thank you received: 15
5 years 9 months ago #196879
by mooser
Replied by mooser on topic Cutting a tapered thread with G76
I don't think I've ever used a G33 in my life...
I need to make a 1/8-27 npt go up and then become a 5/16- 24 straight so maybe it's time to learn
M
I need to make a 1/8-27 npt go up and then become a 5/16- 24 straight so maybe it's time to learn
M
Please Log in or Create an account to join the conversation.
- RotarySMP
- Offline
- Platinum Member
-
Less
More
- Posts: 1635
- Thank you received: 595
5 years 9 months ago #196902
by RotarySMP
Replied by RotarySMP on topic Cutting a tapered thread with G76
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
;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
The following user(s) said Thank You: rdtsc
Please Log in or Create an account to join the conversation.
- mooser
- Offline
- Elite Member
-
Less
More
- Posts: 211
- Thank you received: 15
5 years 9 months ago #196960
by mooser
Replied by mooser on topic Cutting a tapered thread with G76
Surprising how little of that I actually understand.... 
M
M
Please Log in or Create an account to join the conversation.
Time to create page: 2.871 seconds