Taper OD

More
02 Sep 2013 18:19 #38423 by BigJohnT
Taper OD was created by BigJohnT
This subroutine is for tapering the OD of a part in my lathe.

If you place the attached png image in the same directory as the subroutine it will show up in ngcgui.
(info: Taper OD, multi-pass)
o<taper-od> sub
#<diameter>    = #1  (= 0.750 Stock Dia)
#<final-depth> = #2  (= 0.120 Taper Depth)
#<doc>         = #3  (= 0.025 Depth of Cut)
#<angle>       = #4  (= 45 Angle of Taper)
#<z-start>     = #5  (= 0.000 Z Start)
#<feed>        = #6  (= 2 Feed Rate)
#<tool>        = #7  (= 1 Tool Number)
#<max-rpm>     = #8  (= 2000 Max RPM)
#<sfm>         = #9  (= 100 SFM)
#<coolant>     = #10 (= 8 Flood=8, Off=9)

G7 G18 G40 G54 F#<feed>
G96 D#<max-rpm> S#<sfm>
T#<tool> M6 G43
G42 (start cutter comp)
M3 M#<coolant>

#<current-depth> = 0
o100 while [#<current-depth> LT #<final-depth>]
  o110 if [[#<current-depth> + #<doc>]LT #<final-depth>]
    #<current-depth> = [#<current-depth> + #<doc>]
  o110 else
    #<current-depth> = #<final-depth>
  o110 endif
#<current-x> = [#<diameter> - [#<current-depth> * 2]]
G0 X#<current-x> Z[#<z-start> + .1]
G1 Z[#<z-start>]
G1 X#<diameter> Z[#<z-start> - [#<current-depth> * TAN[90 - #<angle>]]]
G1 X[#<diameter> + 0.1]
G0 Z[#<z-start> + .1]
o100 endwhile

M5 M9
G0 Z[#<z-start> + .1]
G40 G97
G53 G0 X0.000 Z0.000

o<taper-od> endsub

JT
Attachments:

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

Time to create page: 0.052 seconds
Powered by Kunena Forum