Guest User

SinkStrainer

a guest
Nov 6th, 2012
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.26 KB | None | 0 0
  1. (Drill & mill sink drain strainer)
  2. (Ed Nisley KE4ZNU -- Digital Machinist 5.1 Spring 2010)
  3. (polycarbonate or acrylic sheet)
  4. (External clamps at -x-y and +x-y corners)
  5. (Origin at center of sheet)
  6. (**** Metric units ****)
  7.  
  8. #<_PI> = 3.141592659265359 (comes in handy here and there)
  9.  
  10. (--------------------)
  11. (-- Section Controls)
  12.  
  13. #<_DoDrilling> = 1
  14. #<_DoEdge> = 1
  15. #<_DoTabs> = 1
  16.  
  17. (--------------------)
  18. (-- Tool change position for G28 command)
  19. (all tools must be manually aligned to same Z value!)
  20.  
  21. #<_ToolX> = 0 (X)
  22. #<_ToolY> = 0 (Y)
  23. #<_ToolZ> = 2 (Z drill touching a 2" block)
  24.  
  25. #5161 = [#<_ToolX> / 1] (X)
  26. #5162 = [#<_ToolY> / 1] (Y)
  27. #5163 = [#<_ToolZ> / 1] (Z)
  28.  
  29. #<_TraverseZ> = .04 (traverse clearance level)
  30.  
  31. (-- Piece dimensions and sizes)
  32.  
  33. #<_PlateSizeZ> = .189 (Z sheet thickness)
  34.  
  35. #<_DrillDia> = .094 (actual drill dia)
  36. #<_DrillRPM> = 1000 (Must use 3k rpm head)
  37. #<_DrillFeed> = [#<_DrillRPM> * #<_DrillDia> / 60] (was 40 )
  38. #<_DrillDepth> = [#<_PlateSizeZ> + #<_DrillDia> / 3] (Z travel including drill tip)
  39. #<_OutsideDia> = 2.44 (OD of finished strainer)
  40. #<_OutsideRadius> = [#<_OutsideDia> / 2] (outside radius)
  41.  
  42. #<_Ring1Radius> = [#<_OutsideRadius> - 2.46933 * #<_DrillDia>] (radius of outer ring of holes)
  43. #<_Ring2Radius> = [#<_Ring1Radius> - 2.46933 * #<_DrillDia>] (radius of 2nd ring)
  44. #<_Ring3Radius> = [#<_Ring2Radius> - 2.46933 * #<_DrillDia>] (radius of 3rd ring)
  45. #<_Ring4Radius> = [#<_Ring3Radius> - 2.46933 * #<_DrillDia>] (radius of 4th ring)
  46.  
  47.  
  48. #<_FeedTraverse> = 30 (was 500 alignment moves - no material contact!)
  49.  
  50. (------------------------)
  51. (-- Useful functions)
  52.  
  53. (----- Drill holes around circle)
  54. ( Parameters: #1=Circle radius, #2=Hole dia, #3=Phase)
  55. ( Phase = 0.0 - hole on +X axis)
  56. ( 1.0 - space on +X axis)
  57.  
  58. O9000 SUB
  59.  
  60. #<HoleWidthAngle> = [2 * ASIN [#2/[2 * #1]]] (angle subtended by hole dia)
  61. #<NumHoles> = FIX[360 / [2 * #<HoleWidthAngle>]] (integer number of holes + spaces)
  62. #<HoleAngle> = [360 / #<NumHoles>] (angle between successive holes)
  63.  
  64. #<DrillAngle> = [#3 * #<HoleAngle> / 2] (starting angle for drilling)
  65.  
  66. O9010 DO
  67.  
  68. #<HoleX> = [#1 * COS[#<DrillAngle>]] (find hole coordinates)
  69. #<HoleY> = [#1 * SIN[#<DrillAngle>]]
  70. G81 X#<HoleX> Y#<HoleY> Z[0 - #<_DrillDepth>] R#<_TraverseZ> F#<_DrillFeed>
  71.  
  72. #<DrillAngle> = [#<DrillAngle> + #<HoleAngle>] (step to next hole)
  73. O9010 WHILE [360 GT #<DrillAngle>]
  74.  
  75. O9000 ENDSUB
  76.  
  77.  
  78. (------------------------)
  79. (----- The Main Event!)
  80.  
  81. G17 G20 G40 G49 G54 G80 G90 G94 (force everything to start properly...)
  82.  
  83. M5 (spindle off)
  84.  
  85. (msg,Verify origin at center-surface, then hit Continue)
  86. M0 (wait for resume)
  87. G0 Z#<_ToolZ> (to tool change)
  88. G28
  89.  
  90. (debug,Load #<_DrillDia> drill, set #<_DrillRPM> rpm, then hit Continue)
  91. M0 (wait for resume)
  92. M3 (spindle CW)
  93.  
  94. G0 X0 Y0 (to safe center point)
  95.  
  96. (-- Drill hole circles)
  97.  
  98. O990 IF [#<_DoDrilling>]
  99.  
  100. O9000 CALL [#<_Ring1Radius>] [#<_DrillDia>] [0.0]
  101.  
  102. O9000 CALL [#<_Ring2Radius>] [#<_DrillDia>] [0.0]
  103.  
  104. O9000 CALL [#<_Ring3Radius>] [#<_DrillDia>] [0.0]
  105.  
  106. O9000 CALL [#<_Ring4Radius>] [#<_DrillDia>] [0.0]
  107.  
  108.  
  109. (G81 X0 Y0 Z[0 - #<_DrillDepth>] R#<_TraverseZ> F#<_DrillFeed>)
  110.  
  111. O990 ENDIF
  112.  
  113.  
  114.  
  115. G40 (comp off)
  116.  
  117. G0 Z#<_ToolZ> (to tool change)
  118. G28
  119.  
  120. M30 (done!)
Advertisement
Add Comment
Please, Sign In to add comment