Milling Tapered Threads

More
11 May 2015 10:58 #58555 by fc60
fc60 created the topic: Milling Tapered Threads
Greetings,

Does anyone have a macro for milling tapered threads with a single point tool?

I found an interesting Macro on the "web"; but, LinuxCNC does not like the G65 code.

Below is what I found....

G65 P9000 U0. W0. A.375 R5. E10. Z-.5 V18. F10.

O9000 (PIPE THREADS)
(U IS X LOCATION)
(W IS Y LOCATION)
(A=STARTING RADIUS)
(R=NUMBER OF MOVES PER CIRCLE)
(Z=DEPTH)
(E=NUMBER OF PASSES [thickness / pitch])
(V=THREADS PER INCH)
(F=FEED)
#3=0.0
#10=360 / #18
#109=#10
#110=1 / #22
#111=0.0625 / #22
#3=#18
G00 X#21 Y#23
G01 Z#26 F#9
#19=#1 + #21
G01 X#19 Y#23 F#9
N2 #26=#26 + #110 / #109
#24=COS[ #3 ] * #1
#25=SIN[ #3 ] * #1
#24=#24 + #21
#25=#25 + #23
G01 X#24 Y#25 Z#26 F#9
#3=#3 + #18
#1=#1 + #111 / #109
IF [ #3 LE 360.00000 * #8 ] GOTO2
G01 X#21 Y#23 F10.
G00 Z1. M09
M99

Cheers,

Dave
More
11 May 2015 17:52 #58559 by ArcEye
ArcEye replied the topic: Milling Tapered Threads
Hi

Your code presumably came from here?
www.cncci.com/resources/tips/taper%20thread.htm

G65 is just a gcode used on some controllers for user macros, as distinct from built in canned cycles.

Linuxcnc does not use macros, rather it uses subroutines for this sort of thing
www.linuxcnc.org/docs/devel/html/gcode/o-code.html

If you can disentangle the horrible style numbered parameter stuff, you can just put it inside a sub, but you might have a bit of trouble.

I would have expected line numbers but there is just one, which is the return point for a GOTO.
The passed parameter numbering does not obviously match the arguments

eg
From the first moves of
G00 X#21 Y#23
G01 Z#26 F#9

you would assume that
#21 is X
#23 is Y
#26 is Z
#9 is F

In what way does that match the listed parameters?

This one might be easier to disentangle and convert, but does involve understanding the programming, which essentially will be describing a descending spiral, where the spiral controls the taper and the
rate of Z movement will be the thread pitch

www.practicalmachinist.com/vb/haas/help-...gram-my-haas-119456/

The alternative is probably to buy a proper thread mill and use the manufacturers program for cutting the thread.

good luck
The following user(s) said Thank You: fc60
More
11 May 2015 22:04 #58562 by fc60
fc60 replied the topic: Milling Tapered Threads
Greetings ArcEye,

Thanks for the link to the alternative program. I need to machine a rather odd tapered thread in the future and I must bone up on my programming. It has been six years since I retired from the Programming World and little by little the "little gray cells" are coming back to life.

With kind regards,

Dave

By the way, AndyPugh sent me a tip to get my machine running. It is not perfect; but, I can turn on the spindle and zoom around with no faults.
More
11 May 2015 23:03 #58564 by andypugh
andypugh replied the topic: Milling Tapered Threads

fc60 wrote: Does anyone have a macro for milling tapered threads with a single point tool?


I am not 100% sure what you mean. Most thread-milling is done with multi-point tools.

I have single-point threaded on my mill using G33.1 but there is no easy way to move the workpiece to create a taper with that setup.
There are not-easy ways to do it. A HAL component could precess the X and Y axes according to current Z depth and the spindle position.

If you actually need a reducing-radius spiral then I don't think that there is any alternative to writing the spiral as a series of reducing-radius arcs. I think I would be writing this as a subroutine and using polar coordinates.
linuxcnc.org/docs/html/gcode/overview.html#_polar_coordinates

A spiral in polar coordinates is rather easier to code than one in cartesian coordinates. You might even get acceptable results with only one move per turn.
More
14 May 2015 00:52 - 15 May 2015 08:48 #58652 by johns00056
johns00056 replied the topic: Milling Tapered Threads
I have two programs to thread mill internal tapered pipe threads with a single row thread milling cutter.
The first uses polar coordinates , the second program uses rectangular coordinates and both use many short linear 3 axis moves to create the thread.

I have not actually cut metal with these, but they look good cutting air. ( famous last words! )


(o<nptthreads>)
(subprogram to thread mill internal tapered pipe threads with a single row cutter 4/20/15 john seward) ( polar coordinates)(NOT TESTED)

(start with cutter at bottom center of hole, must be at program zero for polar coordinates to work)
(spindle must be on) (the first move of the subprogram puts the cutter at the 3:00 position and then spirals up in a counterclockwise direction)

(use #3 to adjust the diameter,no cutter comp.)
(subprogram ends with the cutter at the end point of the spiral,which should be above the top of the workpiece.)

( o<nptthreads> call [ 14 ] [10] [0.5] [3] )
( o<nptthreads> call [threads per inch] [number of revolutions of thread] [start position ,bottom dia-cutter dia /2] [feed rate] )



(#1 = 14) ( 14 threads per inch)
(#2 = 10 ) ( 10 number of revolutions)
(#3 = .5 ) (x start position) (g1 g91 movement from program zero in x + direction to start point of thread)(adjust size here)(no cutter comp.)
(#4 = 25 ) (feed rate)

o<nptthreads> sub

#11 = .0044 (.0044 diameter increase per revolution)(npt 3/4 inches per foot included angle taper)(1-16 included angle)(1' 47" per side)(NOT TESTED )

(I should add some math to the program to calculate the above value from #1 threads per inch. 0.0625 taper per inch/#1=#11 5/13/15)


#5 = 2.0 (^ angle increment)(small increments make a better profile)


#7 = [1/#1] ( thread pitch)
#8 = [360/#5] (increments per circle)
#9 = [#7/#8] (z= pitch/number of increments per circle)
#6 = #9 (z movement per increment)
#10 = [#8*#2] (repeat number= revolutions * increments per circle)
#12 = [#11/#8] (@ diameter increase per increment)(taper amount per revolution / #8 increments per circle)

g91
g64 p.001 (g64 p.001 path following, blend with tolerance of .001 inch)
g1 f#4 x#3 y0 (starting position of spiral,at bottom of hole)


(repeat incremental moves in x y z using polar coordinates)
o100 repeat [#10]
g91 g1 f#4 @#12 ^#5 z#6 (repeat number= revolutions * increments per circle)(z= pitch/number of increments per circle)
o100 endrepeat
g90 (back to absolute positioning)
o<nptthreads> endsub



( o<nptthreads> call [ 14 ] [10] [0.5] [3] )
( o<nptthreads> call [threads per inch] [number of revolutions of thread] [start position ,bottom dia-cutter dia /2] [feed rate] )
(m30)




(o<npt2>)
(subprogram to thread mill an internal tapered pipe thread with a single row cutter,without using cutter diameter compensation)
(start with the spindle on and a safe distance above the workpiece)
(cutter rapids to the thread location and feeds f20 down to the bottom of the starting hole)
(the cutting starts at the bottom of the start hole at the x+, 3:00 , position )
(and moves in a counter clockwise and z + direction using many short three axis linear moves)
(when the thread is complete the cutter moves to the center of the hole then to z+ 1.0 f20)
(4/21/15 John Seward . based on work of Big John T. and Mitchell Callan)


(o<npt2> call [0] [0] [0.125] [2] [10] [-.5] [14] [3.0])
(o<npt2> call [x] [y] [start r.] [degrees per increment] [revolutions] [-z start position] [tpi] [feed])

o<npt2> sub
g90
(g64 p.001 path following, blend with tolerance of .001 inch)
g64 p.001
#<U> = #1 ( X LOCATION of hole) (rapids to this location)
#<W> = #2 ( Y LOCATION of hole) (rapids to this location)
#<A> = #3 (A=STARTING RADIUS.500) (adjust diameter here)( [major thread dia. at bottom - cutter dia.] /2 )
#<R> = #4 (R=NUMBER degrees per increment 2) (small increments make a better thread form)
#<E> = #5 (E=NUMBER OF PASSES 10)(revolutions)([thickness / pitch])
#<Z> = #6 (Z=DEPTH)(start at bottom of hole -.5) (f20 feed to bottom of hole)
#<V> = #7 (V=THREADS PER INCH 14)
#<F> = #8 (F=FEED)
#3=0.0 (start position 0 degrees, 3:00)
#10=[360 / #<R>] (number of increments per revolution 180)
#109=#10 (180 )
#110=[1 / #<V>] (thread pitch)(for one thread.0714)
#111=[0.0625 / #<V>] (calculate diameter increase per revolution for npt pipe threads .0044)
#3=#<R> (number of degrees first move 2)

G00 X#<U> Y#<W> (rapid linear move to center of hole)
G01 Z#<Z> F20 (linear move to bottom of hole f20)
#19=[#<A> + #<U>] (calculate spiral start position)(cutter centerline, no cutter comp.)
G01 X#19 Y#<W> F#<F> (linear move in x plus direction to start point of spiral, 3:00)
#<Z>=[#<Z> + #110 / #109] (calculate z end position per increment , absolute)
#24=[COS[ #3 ] * #<A>]
#25=[SIN[ #3 ] * #<A>]
#24=[#24 + #<U>] (updated x end point)
#25=[#25 + #<W>] (updated y end point)
G01 X#24 Y#25 Z#<Z> F#<F> (3 axis linear movement)
#3=[#3 + #<R>] (updated degrees of rotation ?)
#<A>=[#<A> + #111 / #109] (.500 + .0044/36 = .00012 diameter increase per increment)
o110 while [ #3 LE 360.00000 * #<E> ] (stop when number of revolutions is complete 10 ,1800 increments )
#<Z>=[#<Z> + #110 / #109] (updated z end point)
#24=[COS[ #3 ] * #<A>] (calculate x end point)
#25=[SIN[ #3 ] * #<A>] (calculate y end point)
#24=[#24 + #<U>] (add end point to last x end point)
#25=[#25 + #<W>] (add end point to last y end point)
G01 X#24 Y#25 Z#<Z> F#<F> (three axis linear move)
#3=[#3 + #<R>] (update #3 )
#<A>=[#<A> + #111 / #109] (update diameter increase per increment)
o110 endwhile
G01 X#<U> Y#<W> F#<F> (move to center of circle )
G01 Z1.0 f20 (z up to 1 inch absolute f20)
g90
o<npt2> endsub

( o<npt2> call [0] [0] [.250] [5] [10] [-.5] [14] [10])
(o<npt2> call [x] [y] [start r.] [degrees per increment] [revolutions] [-z start position] [tpi] [feed])
(m30)
Last Edit: 15 May 2015 08:48 by johns00056.
Moderators: Rick G
Time to create page: 0.226 seconds
Powered by Kunena Forum