(info: NTP Male Threads) ; Assumptions ; Z0 is the end of the pipe osub # = #1 (=1 Tool, Taper Cut) # = #2 (Max RPM, Taper Cut) # = #3 (SFM, Taper Cut) # = #4 (IPM, Taper Cut) # = #5 (=8 Coolant) # = #6 (Small End Diameter) # = #7 (Pipe OD) # = #8 (=7 Tool, Threading) # = #9 (RPM Threading) # = #10 (Thread Pitch) # = #11 (Z0 Minor Diameter) # = #12 (Thread Length) # = #13 (Depth of Cut) G7 G18 G40 G54 (Dia, XZ, Comp Off, CS1) ; Calculate start and end X positions for taper cut ; for 0.1 before and after overlap # = [# - 0.00625] # = [# + 0.00625] ; Calculate end Z position # = -[[[[#-#]/2] * TAN[88.2101]]+0.1] ; Cut Taper G96 D# S# (Constance Surface Speed) T# M6 G43 G42 (start cutter comp) M3 M# G0 X# Z0.100 F# G1 X# Z# M5 M9 G40 G97 G53 G0 X0 Z0 ;Threading # = # # = [# + [# * TAN[3.579822]]] # = -# T# M6 G43 M3 S# M# o100 do G0 X# Z0.100 G33 X# Z# K# G0 X[#+.05] Z0.100 o110 if [[# - #] GT #] ; make sure start value minus decrement will not go beyond end value # = [# - #] # = [# - #] o110 else ; last pass for odd number of divisions # = [# - #] # = [# - #] # = [# - #] o110 endif (debug,start # end #) o100 while [# ge #] G0 X[#+.05] M5 M9 Z0.100 G53 X0 Z0 oendsub