Not a member of Pastebin yet?
                        Sign Up,
                        it unlocks many cool features!                    
                - (Drill & mill sink drain strainer)
 - (Ed Nisley KE4ZNU -- Digital Machinist 5.1 Spring 2010)
 - (polycarbonate or acrylic sheet)
 - (External clamps at -x-y and +x-y corners)
 - (Origin at center of sheet)
 - (**** Metric units ****)
 - #<_PI> = 3.141592659265359 (comes in handy here and there)
 - (--------------------)
 - (-- Section Controls)
 - #<_DoDrilling> = 1
 - #<_DoEdge> = 1
 - #<_DoTabs> = 1
 - (--------------------)
 - (-- Tool change position for G28 command)
 - (all tools must be manually aligned to same Z value!)
 - #<_ToolX> = 0 (X)
 - #<_ToolY> = 0 (Y)
 - #<_ToolZ> = 2 (Z drill touching a 2" block)
 - #5161 = [#<_ToolX> / 1] (X)
 - #5162 = [#<_ToolY> / 1] (Y)
 - #5163 = [#<_ToolZ> / 1] (Z)
 - #<_TraverseZ> = .04 (traverse clearance level)
 - (-- Piece dimensions and sizes)
 - #<_PlateSizeZ> = .189 (Z sheet thickness)
 - #<_DrillDia> = .094 (actual drill dia)
 - #<_DrillRPM> = 1000 (Must use 3k rpm head)
 - #<_DrillFeed> = [#<_DrillRPM> * #<_DrillDia> / 60] (was 40 )
 - #<_DrillDepth> = [#<_PlateSizeZ> + #<_DrillDia> / 3] (Z travel including drill tip)
 - #<_OutsideDia> = 2.44 (OD of finished strainer)
 - #<_OutsideRadius> = [#<_OutsideDia> / 2] (outside radius)
 - #<_Ring1Radius> = [#<_OutsideRadius> - 2.46933 * #<_DrillDia>] (radius of outer ring of holes)
 - #<_Ring2Radius> = [#<_Ring1Radius> - 2.46933 * #<_DrillDia>] (radius of 2nd ring)
 - #<_Ring3Radius> = [#<_Ring2Radius> - 2.46933 * #<_DrillDia>] (radius of 3rd ring)
 - #<_Ring4Radius> = [#<_Ring3Radius> - 2.46933 * #<_DrillDia>] (radius of 4th ring)
 - #<_FeedTraverse> = 30 (was 500 alignment moves - no material contact!)
 - (------------------------)
 - (-- Useful functions)
 - (----- Drill holes around circle)
 - ( Parameters: #1=Circle radius, #2=Hole dia, #3=Phase)
 - ( Phase = 0.0 - hole on +X axis)
 - ( 1.0 - space on +X axis)
 - O9000 SUB
 - #<HoleWidthAngle> = [2 * ASIN [#2/[2 * #1]]] (angle subtended by hole dia)
 - #<NumHoles> = FIX[360 / [2 * #<HoleWidthAngle>]] (integer number of holes + spaces)
 - #<HoleAngle> = [360 / #<NumHoles>] (angle between successive holes)
 - #<DrillAngle> = [#3 * #<HoleAngle> / 2] (starting angle for drilling)
 - O9010 DO
 - #<HoleX> = [#1 * COS[#<DrillAngle>]] (find hole coordinates)
 - #<HoleY> = [#1 * SIN[#<DrillAngle>]]
 - G81 X#<HoleX> Y#<HoleY> Z[0 - #<_DrillDepth>] R#<_TraverseZ> F#<_DrillFeed>
 - #<DrillAngle> = [#<DrillAngle> + #<HoleAngle>] (step to next hole)
 - O9010 WHILE [360 GT #<DrillAngle>]
 - O9000 ENDSUB
 - (------------------------)
 - (----- The Main Event!)
 - G17 G20 G40 G49 G54 G80 G90 G94 (force everything to start properly...)
 - M5 (spindle off)
 - (msg,Verify origin at center-surface, then hit Continue)
 - M0 (wait for resume)
 - G0 Z#<_ToolZ> (to tool change)
 - G28
 - (debug,Load #<_DrillDia> drill, set #<_DrillRPM> rpm, then hit Continue)
 - M0 (wait for resume)
 - M3 (spindle CW)
 - G0 X0 Y0 (to safe center point)
 - (-- Drill hole circles)
 - O990 IF [#<_DoDrilling>]
 - O9000 CALL [#<_Ring1Radius>] [#<_DrillDia>] [0.0]
 - O9000 CALL [#<_Ring2Radius>] [#<_DrillDia>] [0.0]
 - O9000 CALL [#<_Ring3Radius>] [#<_DrillDia>] [0.0]
 - O9000 CALL [#<_Ring4Radius>] [#<_DrillDia>] [0.0]
 - (G81 X0 Y0 Z[0 - #<_DrillDepth>] R#<_TraverseZ> F#<_DrillFeed>)
 - O990 ENDIF
 - G40 (comp off)
 - G0 Z#<_ToolZ> (to tool change)
 - G28
 - M30 (done!)
 
Advertisement
 
                    Add Comment                
                
                        Please, Sign In to add comment