Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (Rectangular Spiral Pocket)
- O<hassretpocket> sub (circular groove, good for milling through holes too)
- #<tooldia> = #1 (tooldiameter)
- #<PocketLengthx> = #2 (rectangular Pocket X length)
- #<PocketLengthy> = #3 (rectangular Pocket Y length)
- #<centerx> = #4 (centerX)
- #<centery> = #5 (centerY)
- #<FinalDepth> = #6 (Final Depth)
- #<safez> = #7 (safeZ)
- #<stepoverxy> = #8 (stepover XY)
- #<stepoverz> = #9 (stepover Z)
- #<feedratez> = #10 (feedrateZ)
- #<feedratexy> = #11 (feedrateXY)
- (calculate How many times into while)
- O100 if [#<PocketLengthx> GT #<PocketLengthy>]
- #20 = FIX[[[#<PocketLengthx>-#<tooldia>]/#<stepoverxy>/2.0]]
- O100 else
- #20 = FIX[[[#<PocketLengthy>-#<tooldia>]/#<stepoverxy>/2.0]]
- O100 endif
- (calculate Stepover New)
- #15 = [[#<PocketLengthx>-#<tooldia>]/[#20*2]] (New X-Stepover)
- #16 = [[#<PocketLengthy>-#<tooldia>]/[#20*2]] (New Y-Stepover)
- G17 (XY Plane)
- G90 (Absolute)
- G61 (Exact Path)
- (Rectangular Spiral)
- G0 X#<centerx> Y#<centery> (Move Center)
- G0 Z#<safez>
- G1 Z0 F#<feedratez>
- (Depth Cycle Control)
- O95 while [#<FinalDepth> lt 0]
- O97 If [#<FinalDepth> lt #<stepoverz>]
- G1 G91 Z#<stepoverz>
- O97 else
- G1 G91 Z#<FinalDepth>
- O97 endif
- #<FinalDepth>=[#<FinalDepth>-#<stepoverz>]
- #21 = 1 (start value for while)
- #30 = #15
- #31 = #16
- O100 while[#21 lt #20]
- F#<feedratexy> G91 X#30
- Y#31
- #30 = [#30 + #15]
- #31 = [#31 + #16]
- X-#30
- Y-#31
- #30 = [#30 + #15]
- #31 = [#31 + #16]
- #21 = [#21 + 1]
- O100 endwhile
- X[#30 -#15]
- (finish Rect)
- G1 G90 X[#<centerx>+[#<PocketLengthx>/2.0]-[#<tooldia>/2.0]] Y[#<centery>+[#<PocketLengthy>/2.0]-[#<tooldia>/2.0]]
- X[#<centerx>-[#<PocketLengthx>/2.0]+[#<tooldia>/2.0]]
- Y[#<centery>-[#<PocketLengthy>/2.0]+[#<tooldia>/2.0]]
- X[#<centerx>+[#<PocketLengthx>/2.0]-[#<tooldia>/2.0]]
- Y[#<centery>+[#<PocketLengthy>/2.0]-[#<tooldia>/2.0]]
- G1 G90 X#<centerx> Y#<centery>
- O95 endwhile
- G0 G90 Z#<safez>
- M5
- M30
- O<hassretpocket> endsub
- M2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement