NPT Thread Milling

More
09 Oct 2013 02:12 #39655 by dieselpilot
Has anyone modified this macro to use on Linuxcnc?

www.cncci.com/resources/tips/taper%20thread.htm

I'm going to give it a try if I can figure out how subroutine programming works.

Greg

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

More
09 Oct 2013 14:11 #39673 by Rick G
Replied by Rick G on topic NPT Thread Milling

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

More
09 Oct 2013 18:17 #39685 by BigJohnT
Replied by BigJohnT on topic NPT Thread Milling
What I do is first create a normal subroutine and test it out then add the code needed to use the subroutine with ngcgui.

linuxcnc.org/docs/html/gcode/o-code.html#sec:subroutines

It looks like a straight forward subroutine once you convert it to the LinuxCNC format... except the GOTO2 line which might take a bit of study to see what it does.

This gives a list of argument words and variables which makes it easier to follow.

www.cnccookbook.com/CCCNCGCodeSubprograms.htm

JT

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

More
09 Oct 2013 18:41 #39687 by BigJohnT
Replied by BigJohnT on topic NPT Thread Milling
After converting it to run in LinuxCNC I see that it does not do any arcs so how can it possibly mill a thread?
;G65 P9000 U0. W0. A.375 R5. E10. Z-.5 V18. F10.

o100 sub
;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)
#<U> = #1
#<W> = #2
#<A> = #3
#<R> = #4
#<E> = #5
#<Z> = #6
#<V> = #7
#<F> = #8
#3=0.0
#10=[360 / #<R>]
#109=#10
#110=[1 / #<V>]
#111=[0.0625 / #<V>]
#3=#<R>
G00 X#<U> Y#<W>
G01 Z#<Z> F#<F>
#19=[#<A> + #<U>]
G01 X#19 Y#<W> F#<F>
#<Z>=[#<Z> + #110 / #109]
#24=[COS[ #3 ] * #<A>]
#25=[SIN[ #3 ] * #<A>]
#24=[#24 + #<U>]
#25=[#25 + #<W>]
G01 X#24 Y#25 Z#<Z> F#<F>
#3=[#3 + #<R>]
#<A>=[#<A> + #111 / #109]
o110 if [ #3 LE 360.00000 * #<E> ]
  #<Z>=[#<Z> + #110 / #109]
  #24=[COS[ #3 ] * #<A>]
  #25=[SIN[ #3 ] * #<A>]
  #24=[#24 + #<U>]
  #25=[#25 + #<W>]
  G01 X#24 Y#25 Z#<Z> F#<F>
  #3=[#3 + #<R>]
  #<A>=[#<A> + #111 / #109]
o110 endif
G01 X#<U> Y#<W> F#<F>
G00 Z1. M09
;M99
o100 endsub

o100 call [0][0][.375][5][10][-0.5][18][10]
M2

JT

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

More
09 Oct 2013 18:48 #39688 by BigJohnT
Replied by BigJohnT on topic NPT Thread Milling
This might be a start for thread milling

www.lakeshorecarbide.com/pdf/threadmill-1.pdf

www.lakeshorecarbide.com/threadmillprogram2.aspx

This does look like a better example to try and convert.

atyourservice.haascnc.com/faaqs/thread-milling-macros/

JT

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

More
10 Oct 2013 05:30 #39714 by dieselpilot
Replied by dieselpilot on topic NPT Thread Milling
The trick here is getting a spiral toolpath. Most people writing NPT macros will break the spiral into 90° segments and use radii to approximate. I got something similar to the code above, but it interprets to a straight line. The code is kind of close to the Mach macro.

www.machsupport.com/forum/index.php?topic=12240.0;wap2

I'll write one if I have the time.

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

Time to create page: 0.136 seconds
Powered by Kunena Forum