Advertisement
Guest User

annulus

a guest
Jan 1st, 2014
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.53 KB | None | 0 0
  1. (Vlad's annulus milling subroutine for ngcgui)
  2. (takes a position and a few parameters to mill an annulus)
  3. (tool number and feedrates should be defined prior to calling)
  4.  
  5. (arguments: 1[x center] 2[y center] 3[ID] 4[OD] 5[depth] 6[start of cut height])
  6. ( 7[z safe] [depth of cut per pass] [stepover percent] [feedrate])
  7.  
  8.  
  9. F23
  10.  
  11. #1 = 0
  12. #2 = 0
  13. #3 = .9
  14. #4 = 2
  15. #5 = -.2
  16. #6 = .05
  17. #7 = .1
  18. #8 = 25
  19. #9 = 30
  20. #10 = 24
  21.  
  22. #<x> = #1 (=0)
  23. #<y> = #2 (=0)
  24. #<id> = #3
  25. #<od> = #4
  26. #<z_end> = #5
  27. #<zstart> = #6 (=.05: height to ramp in from, above material sugg)
  28. #<z_safe> = #7 (=.1)
  29. #<doc_p> = #8 (=25 : percent depth per pass)
  30. #<sop> = #9 (=30 : percent stepover)
  31. #<feed> = #10 (=24)
  32.  
  33. #<tool_diam> = #5410
  34. #<doc> = [#<tool_diam>*#<doc_p>/100]
  35. #<step> = [#<tool_diam>*#<sop>/100]
  36. #<z_curr> = [#<zstart>-#<doc>] (convenient var for Z height)
  37. (if depth can be done in one pass, reset z_curr)
  38. o10 if [#<z_curr> lt #<z_end>]
  39. #<z_curr> = #<z_end>
  40. o10 endif
  41. o20 if [#<tool_diam> eq 0]
  42. (msg, YOU MUST LOAD A NON 0 TOOL PRIOR TO USING ANNULUS)
  43. m2
  44. o20 endif
  45.  
  46. G40
  47. F#<feed> (set feedrate)
  48. G00 Z#<z_safe>
  49. G00 X#<x> Y#<y> (go to center)
  50. G92 X0 Y0 (set temp coordinate around center)
  51. g4 p2
  52. G00 X[#<tool_diam>/2] (prime for simple leadin 3 oclock park)
  53. G41 (cut starts inside, left comp CW cutter and CW 02 arc)
  54. g4 p2
  55.  
  56. #<rad> = [#<id>/2+#<step>] (convenient dim holder)
  57.  
  58. (o<passes> sub)
  59. G00 X-#<rad> Z#<zstart> (lower to 9 start pos, also leadin)
  60. G02 I#<rad> Z#<z_curr> P1 (ramp down in and cut circle)
  61. G02 I#<rad> (clean cut)
  62. G02 X0 Y[#<id>/2] I#<rad> J[[#<id>*#<id>/4-#<rad>*#<rad>]/#<id>] (arc into inner surface)
  63. G02 J-[#<id>/2] P1 (clean inner surface)
  64. #<rad>= [#<rad>+#<tool_diam>]
  65. G01 X0 Y#<rad> (moves to fresh surface)
  66.  
  67. o<expandingbulk> while [#<rad> lt [#<od>/2]] (keep pushing out)
  68. #<startRad> = #<rad> (save old value to shorten eqs)
  69. #<rad> = [#<rad>+#<step>]
  70. G03 X-#<rad> Y0 I[[#<rad>*#<rad>-#<startRad>*#<startRad>]/[-2*#<rad>]] J-[#<startRad>] (arc out to 9)
  71. G03 X0 Y#<rad> I#<rad> (3/4 circle to 12)
  72. o<expandingbulk> endwhile
  73. (G03 X-#<rad> Y-#<rad> J-#<rad> finsh last cut)
  74.  
  75. (o<passes> endsub)
  76.  
  77. #<zstart> = #<z_curr>
  78. #<z_curr> = [#<z_curr>-#<doc>]
  79.  
  80. G00 Z#<z_safe>
  81. G00 X#<x> Y#<y>
  82. G92.1 G40
  83.  
  84. m2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement