All pastes #732594 Raw Edit

thread_mill

public text v1 · immutable
#732594 ·published 2007-10-11 03:08 UTC
rendered paste body
o300 sub
  (o300 call 	[1 x pos] [2 y pos] [3 safety height] [4 top] [5 depth] ) 
  (		[6 tool diam] [7 minor diam] [8 thead depth] [9 turns per unit length] ) 
  (		[10 start angle] [11 right/left thread] )
  (		[12 helical infeed / radial infeed] )

#11 = [#11+2]		(0 for right hand, 1 for left hand)
#15 = [#7/2+#8-#6/2]	(distance from center to cut depth of thread)
#16 = [#1+COS[#10]*#15]	(set x start)
#17 = [#2+SIN[#10]*#15]	(set y start)
#18 = [1/#9] 		(depth per revolution)
#19 = [#4-#18]		(reset depth stop)

g0 z#3			(rapid to saftey height)
g0 x#1y#2 		(rapid to center)

g1 z#4 		
g1 x#16y#17

o301 while [#19 ge [#4-#5]]
	g[#11] x#16 y#17 i[#1-#16] j[#2-#17] z#19
	#19 = [#19-#18]
	o303 if [#19 lt [#4-#5]]
		#20 = [#5*#9*360-#10]
		#21 = [#1+COS[#20]*#15]
		#22 = [#2+SIN[#20]*#15]
		#23 = [#4-#5]

		g[#11] x#21 y#22 i[#1-#16] j[#2-#17] z[#4-#5]

	o303 endif

o301 endwhile

g0 x#1y#2
g0 z#3

o300 endsub

(1.25" diameter hole centered on 1.5,1)
(0.5" diameter tool saftey height of 2.25")
(Right hand 18 pitch screw with 0.01" deep thread 3" long)
(Thread starts 45 degrees clockwise from the 12:00 position)

F30
o300 call [0] [0] [.5] [0] [.27] [0.5] [1.25] [0.01] [18] [45] [1]

m30