Advertisement
Guest User

Untitled

a guest
Nov 9th, 2011
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.91 KB | None | 0 0
  1. (Rectangular Spiral Pocket)
  2.  
  3. O<hassretpocket> sub (circular groove, good for milling through holes too)
  4. #<tooldia> = #1 (tooldiameter)
  5. #<PocketLengthx> = #2 (rectangular Pocket X length)
  6. #<PocketLengthy> = #3 (rectangular Pocket Y length)
  7. #<centerx> = #4 (centerX)
  8. #<centery> = #5 (centerY)
  9. #<FinalDepth> = #6 (Final Depth)
  10. #<safez> = #7 (safeZ)
  11. #<stepoverxy> = #8 (stepover XY)
  12. #<stepoverz> = #9 (stepover Z)
  13. #<feedratez> = #10 (feedrateZ)
  14. #<feedratexy> = #11 (feedrateXY)
  15.  
  16.  
  17.  
  18. (calculate How many times into while)
  19. O100 if [#<PocketLengthx> GT #<PocketLengthy>]
  20. #20 = FIX[[[#<PocketLengthx>-#<tooldia>]/#<stepoverxy>/2.0]]
  21. O100 else
  22. #20 = FIX[[[#<PocketLengthy>-#<tooldia>]/#<stepoverxy>/2.0]]
  23. O100 endif
  24. (calculate Stepover New)
  25. #15 = [[#<PocketLengthx>-#<tooldia>]/[#20*2]] (New X-Stepover)
  26. #16 = [[#<PocketLengthy>-#<tooldia>]/[#20*2]] (New Y-Stepover)
  27.  
  28. G17 (XY Plane)
  29. G90 (Absolute)
  30. G61 (Exact Path)
  31. (Rectangular Spiral)
  32. G0 X#<centerx> Y#<centery> (Move Center)
  33. G0 Z#<safez>
  34. G1 Z0 F#<feedratez>
  35. (Depth Cycle Control)
  36. O95 while [#<FinalDepth> lt 0]
  37. O97 If [#<FinalDepth> lt #<stepoverz>]
  38. G1 G91 Z#<stepoverz>
  39. O97 else
  40. G1 G91 Z#<FinalDepth>
  41. O97 endif
  42. #<FinalDepth>=[#<FinalDepth>-#<stepoverz>]
  43. #21 = 1 (start value for while)
  44. #30 = #15
  45. #31 = #16
  46. O100 while[#21 lt #20]
  47. F#<feedratexy> G91 X#30
  48. Y#31
  49. #30 = [#30 + #15]
  50. #31 = [#31 + #16]
  51. X-#30
  52. Y-#31
  53. #30 = [#30 + #15]
  54. #31 = [#31 + #16]
  55. #21 = [#21 + 1]
  56. O100 endwhile
  57. X[#30 -#15]
  58. (finish Rect)
  59. G1 G90 X[#<centerx>+[#<PocketLengthx>/2.0]-[#<tooldia>/2.0]] Y[#<centery>+[#<PocketLengthy>/2.0]-[#<tooldia>/2.0]]
  60. X[#<centerx>-[#<PocketLengthx>/2.0]+[#<tooldia>/2.0]]
  61. Y[#<centery>-[#<PocketLengthy>/2.0]+[#<tooldia>/2.0]]
  62. X[#<centerx>+[#<PocketLengthx>/2.0]-[#<tooldia>/2.0]]
  63. Y[#<centery>+[#<PocketLengthy>/2.0]-[#<tooldia>/2.0]]
  64. G1 G90 X#<centerx> Y#<centery>
  65. O95 endwhile
  66. G0 G90 Z#<safez>
  67. M5
  68. M30
  69. O<hassretpocket> endsub
  70. M2
  71.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement