Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- o200 sub
- (slot cutting, load tool and set feed first, then use like so:)
- (o200 call [x1] [y1] [x2] [y2] [width] [depth] [safety height] [tool dia])
- #10=[#5/2] (radius)
- #11=[[atan [#4-#2]/[#3-#1]] + 180] ("backward" direction)
- #12=[#11 + 90] ("right" side direction)
- #13=[#10 * [cos [#11]]]
- #14=[#10 * [sin [#11]]]
- #15=[#10 * [cos [#12]]]
- #16=[#10 * [sin [#12]]]
- g0 z#7
- g0 x[#1+#13+#15] y[#2+#14+#16]
- g41 g0x[#1+#15] y[#2+#16]
- #17=[#8/2] (depth per cut is half tool dia)
- #18=[#7-#17] (z)
- (down toward the specified depth a bit at a time)
- o201 while [#18 GT [0-#6]]
- g1 x[#3+#15] y[#4+#16] z#18
- g3 x[#3-#15] y[#4-#16] r#10
- g1 x[#1-#15] y[#2-#16]
- g3 x[#1+#15] y[#2+#16] r#10
- #18=[#18-#17]
- o201 endwhile
- (down to the actual depth and one more cut)
- g1 x[#3+#15] y[#4+#16] z[0-#6]
- g3 x[#3-#15] y[#4-#16] r#10
- g1 x[#1-#15] y[#2-#16]
- g3 x[#1+#15] y[#2+#16] r#10
- g1 x[#3+#15] y[#4+#16]
- g0 z#7
- g40
- o200 endsub
- o100 sub
- (helical hole milling, load tool and set feed first, then use like so:)
- (o100 call [x pos] [y pos] [safety height] [hole depth] [hole dia] [tool dia])
- (tool dia doesn't have to be specified exactly.)
- #4=[0 - #4]
- #7=[#6 / 2] (#7 is depth per circle = half of tool diameter)
- #8=[#3 - #7] (#8 is current depth step)
- g0 z#3
- (start above and right so we make a convex corner for entry to the ccw arcs)
- g0 x[#1 + #6] y[#2 + [#5 / 2]]
- g41 g0 x#1 y[#2 + [#5 / 2]]
- o101 while [#8 GT #4]
- (down toward the specified depth a bit at a time)
- g3 x#1 y[#2 + [#5 / 2]] i0 j[0 - [#5 / 2]] z#8
- #8=[#8 - #7]
- o101 endwhile
- (down to the actual depth)
- g3 x#1 y[#2 + [#5 / 2]] i0 j[0 - [#5 / 2]] z#4
- (full circle at the actual depth)
- g3 x#1 y[#2 + [#5 / 2]] i0 j[0 - [#5 / 2]]
- g0 z#3
- g40
- o100 endsub
- #100= 1.1378 (LIQUID FIRST HOLE)
- #101= 0.5 (LIQUID SPACING)
- #102= -.25 (LIQUID Y LOCATION)
- #103= 7 (QTY LIQUID HOLES)
- #200= .9409 (AIR FIRST HOLE)
- #201= 0.5 (AIR SPACING)
- #202= -0.75 (AIR Y LOCATION)
- #203= 7 (QTY AIR HOLES)
- #301= .2 (SLOT DEPTH)
- #302= .15 (SLOT WIDTH)
- #303= .22 (HOLE DIAM)
- #601= .1 (SAFTEY HEIGHT)
- #602= 7 (TOOL NUMBER)
- #666= 0 (COUNTER)
- (BEGIN PREAMBLE)
- G40 G49 (TURN OFF CUTTER RADIUS + LENGTH COMP)
- G90 (ABS MOVEMENT)
- G17 (XY PLANE)
- G80 (KILL CANNED CYCLES)
- G20 (INCHES)
- G94 (UNITS PER MINUTE)
- (END PREABLE)
- G55
- (o200 call [x1] [y1] [x2] [y2] [width] [depth] [safety height] [tool dia])
- (o100 call [x pos] [y pos] [safety height] [hole depth] [hole dia] [tool dia])
- G0 Z.25 x.15 y-.5
- T5 M6
- G01 X0 Y0 F13
- G0 X1 Z.1
- O200 call [.9803][-.25][4.1575][-.25][#302][#301][#601][#603]
- O200 call [.7835][-.75][4.0984][-.75][#302][#301][#601][#603]
- o500 while [#666 LT #103]
- (LIQUID HOLES)
- O100 call [#100] [#102] [#601][#301][#303][#603]
- #100=[#100+#101] (INCREMENT HOLE LOCATION)
- #666=[#666+1]
- o500 endwhile
- #666=0
- o501 while [#666 LT #203]
- (AIR HOLES)
- O100 call [#200] [#202] [#601][#301][#303][#603]
- #200=[#200+#201] (INCREMENT HOLE LOCATION)
- #666=[#666+1]
- o501 endwhile
- #666=0
- %
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement