Turning

More
02 Sep 2013 18:10 #38418 by BigJohnT
Turning was created by BigJohnT
This is my OD turning subroutine for ngcgui.
(info: OD Turning)
o<od> sub
#<material-dia>  = #1  (=0.750 Start Diameter)
#<final_dia>     = #2  (=0.700 Finish Diameter)
#<rough-doc>     = #3  (=0.020 Roughing DOC)
#<final-doc>     = #4  (=0.010 Finish DOC)
#<surface-speed> = #5  (=100 Surface Speed)
#<rough-feed>    = #6  (=2 Rough Feed)
#<finish-feed>   = #7  (=1 Finish Feed)
#<max_rpm>       = #8  (=1500 Max RPM)
#<z-end>         = #9  (=-0.5 End of Cut)
#<z-start>       = #10 (=0.100 Start of Cut)
#<rough-tool>    = #11 (=1 Roughing Tool)
#<finish-tool>   = #12 (=1 Finishing Tool)
#<coolant>       = #13 (=8 Flood=8, Off=9)

#<roughing> = 0
G7 G96 D#<max_rpm> S#<surface-speed>

; Rough the OD if needed
o100 if [[#<material-dia> - #<final_dia>]/2 GT #<final-doc>]
  #<roughing> = 1
  #<rough-diam> = [#<final_dia> + [#<final-doc> * 2]]
  #<rough-passes> = FUP[[[[#<material-dia> - #<rough-diam>]/2]/#<rough-doc>]]
  #<rough-cut> = [[#<material-dia> - #<rough-diam>]/#<rough-passes>]
  T#<rough-tool> M6 G43

  M3 M#<coolant>
  G0 X#<material-dia> Z#<z-start>
  #1=#<material-dia>

  F#<rough-feed>
  o110 repeat[#<rough-passes>]
    #1 = [#1 - #<rough-cut>]
    X#1
    G1 Z#<z-end>
    X[#1 + #<rough-cut> + 0.025]
    G0 Z#<z-start>
  o110 endrepeat

  M9
o100 endif

o120 if [#<roughing> EQ 1]
  o130 if [#<rough-tool> NE #<finish-tool>]
    (msg,rough)
    T#<finish-tool> M6 G43
  o130 endif
o120 else
  (msg,no rough)
  T#<finish-tool> M6 G43
o120 endif

;Final Cut
M3 M#<coolant>
F#<finish-feed>
#1 = #<final_dia>
G0 X#1 Z#<z-start>
G1 Z#<z-end>
X[#<material-dia> + 0.025]
G0 Z#<z-start>

G0 X[#1+0.025]
M5 M9
Z#<z-start>
G97
G53 G0 X0 Z0
o<od> endsub

JT
The following user(s) said Thank You: cjlear

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

Time to create page: 0.169 seconds
Powered by Kunena Forum