Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2013
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.95 KB | None | 0 0
  1. o200 sub
  2. (slot cutting, load tool and set feed first, then use like so:)
  3. (o200 call [x1] [y1] [x2] [y2] [width] [depth] [safety height] [tool dia])
  4. #10=[#5/2] (radius)
  5. #11=[[atan [#4-#2]/[#3-#1]] + 180] ("backward" direction)
  6. #12=[#11 + 90] ("right" side direction)
  7. #13=[#10 * [cos [#11]]]
  8. #14=[#10 * [sin [#11]]]
  9. #15=[#10 * [cos [#12]]]
  10. #16=[#10 * [sin [#12]]]
  11. g0 z#7
  12. g0 x[#1+#13+#15] y[#2+#14+#16]
  13. g41 g0x[#1+#15] y[#2+#16]
  14. #17=[#8/2] (depth per cut is half tool dia)
  15. #18=[#7-#17] (z)
  16. (down toward the specified depth a bit at a time)
  17. o201 while [#18 GT [0-#6]]
  18. g1 x[#3+#15] y[#4+#16] z#18
  19. g3 x[#3-#15] y[#4-#16] r#10
  20. g1 x[#1-#15] y[#2-#16]
  21. g3 x[#1+#15] y[#2+#16] r#10
  22. #18=[#18-#17]
  23. o201 endwhile
  24. (down to the actual depth and one more cut)
  25. g1 x[#3+#15] y[#4+#16] z[0-#6]
  26. g3 x[#3-#15] y[#4-#16] r#10
  27. g1 x[#1-#15] y[#2-#16]
  28. g3 x[#1+#15] y[#2+#16] r#10
  29. g1 x[#3+#15] y[#4+#16]
  30. g0 z#7
  31. g40
  32. o200 endsub
  33.  
  34.  
  35. o100 sub
  36. (helical hole milling, load tool and set feed first, then use like so:)
  37. (o100 call [x pos] [y pos] [safety height] [hole depth] [hole dia] [tool dia])
  38. (tool dia doesn't have to be specified exactly.)
  39. #4=[0 - #4]
  40. #7=[#6 / 2] (#7 is depth per circle = half of tool diameter)
  41. #8=[#3 - #7] (#8 is current depth step)
  42. g0 z#3
  43. (start above and right so we make a convex corner for entry to the ccw arcs)
  44. g0 x[#1 + #6] y[#2 + [#5 / 2]]
  45. g41 g0 x#1 y[#2 + [#5 / 2]]
  46. o101 while [#8 GT #4]
  47. (down toward the specified depth a bit at a time)
  48. g3 x#1 y[#2 + [#5 / 2]] i0 j[0 - [#5 / 2]] z#8
  49. #8=[#8 - #7]
  50. o101 endwhile
  51. (down to the actual depth)
  52. g3 x#1 y[#2 + [#5 / 2]] i0 j[0 - [#5 / 2]] z#4
  53. (full circle at the actual depth)
  54. g3 x#1 y[#2 + [#5 / 2]] i0 j[0 - [#5 / 2]]
  55. g0 z#3
  56. g40
  57. o100 endsub
  58.  
  59. #100= 1.1378 (LIQUID FIRST HOLE)
  60. #101= 0.5 (LIQUID SPACING)
  61. #102= -.25 (LIQUID Y LOCATION)
  62. #103= 7 (QTY LIQUID HOLES)
  63. #200= .9409 (AIR FIRST HOLE)
  64. #201= 0.5 (AIR SPACING)
  65. #202= -0.75 (AIR Y LOCATION)
  66. #203= 7 (QTY AIR HOLES)
  67.  
  68. #301= .2 (SLOT DEPTH)
  69. #302= .15 (SLOT WIDTH)
  70. #303= .22 (HOLE DIAM)
  71.  
  72. #601= .1 (SAFTEY HEIGHT)
  73. #602= 7 (TOOL NUMBER)
  74. #666= 0 (COUNTER)
  75.  
  76. (BEGIN PREAMBLE)
  77. G40 G49 (TURN OFF CUTTER RADIUS + LENGTH COMP)
  78. G90 (ABS MOVEMENT)
  79. G17 (XY PLANE)
  80. G80 (KILL CANNED CYCLES)
  81. G20 (INCHES)
  82. G94 (UNITS PER MINUTE)
  83. (END PREABLE)
  84. G55
  85.  
  86. (o200 call [x1] [y1] [x2] [y2] [width] [depth] [safety height] [tool dia])
  87. (o100 call [x pos] [y pos] [safety height] [hole depth] [hole dia] [tool dia])
  88. G0 Z.25 x.15 y-.5
  89. T5 M6
  90. G01 X0 Y0 F13
  91. G0 X1 Z.1
  92. O200 call [.9803][-.25][4.1575][-.25][#302][#301][#601][#603]
  93. O200 call [.7835][-.75][4.0984][-.75][#302][#301][#601][#603]
  94. o500 while [#666 LT #103]
  95. (LIQUID HOLES)
  96. O100 call [#100] [#102] [#601][#301][#303][#603]
  97. #100=[#100+#101] (INCREMENT HOLE LOCATION)
  98. #666=[#666+1]
  99. o500 endwhile
  100. #666=0
  101. o501 while [#666 LT #203]
  102. (AIR HOLES)
  103. O100 call [#200] [#202] [#601][#301][#303][#603]
  104. #200=[#200+#201] (INCREMENT HOLE LOCATION)
  105. #666=[#666+1]
  106. o501 endwhile
  107. #666=0
  108. %
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement