Suggested by Glenn J. Doutrich Sr. of Inside Development Systems, Inc.
I’ve had several requests recently for this custom macro – so, here it is! This custom macro performs a face milling operation and allows the percentage of overlap to be specified. It provides for two methods of milling, climb milling (assuming a right hand cutter is used) and zig-zag milling in both directions.
The letter address M specifies which type of milling will be done. Leaving M out of the G65 command – or setting it to M1.0 will cause the machine to climb mill. Setting M to M2.0 will cause the machine to zig-zag mill back and forth until the milling is complete. This custom macro assumes the X length of the workpiece is longer than the Y length. That is, it makes passes along the X axis only.
The illustration shows the variable meanings:
Here is an example calling program followed by the custom macro.
O0001 (EXAMPLE MAIN PROGRAM)
N005 T01 M06 (4" FACE MILL)
N010 G54 G90 S500 M03
N015 G00 X0 Y0
N020 G43 H01 Z2.0
N025 G65 P1000 X0 Y0 Z0 C0.15 M2.0 U40.0 V33.0 D4.0 Q20.0 F15.0
N030 G91 G28 Z0 M19
N035 M30
Line N025 calls the face milling custom macro. X and Y specify the lower left corner. Z specifies the surface to be milled. C specifies the amount of clearance for the cutter (approach and escape distance). U and W specify the length and width of the part to be milled. D specifies the cutter diameter. Q specifies the overlap percentage (percentage of cutter diameter for overlap). F specifies the feedrate.
O1000 (FACE MILLING CUSTOM MACRO)
#100 = 1 (CURRENT PASS [COUNTER])
#101 = FUP[#121/#120] (NUMBER OF PASSES)
#103 = [#121-#7] / [#101-1] (Y STEP AMOUNT)
IF[#13 EQ 2.0]GOTO 20 (TEST IF ZIG-ZAG)
(CLIMB MILLING)
N1 IF[#100 GT #101] GOTO 99
G00 X[#24-#3-#7/2] Y#102
Z#26
G01 X[#24+#21+#3+#7/2] F#9
G00 Z[#26+1.0]
GOTO 1 (GO BACK TO TEST)
(ZIG-ZAG MILLING)
N20 IF[#100 GT #101] GOTO 99
G90 G00 X[#24-#3-#7/2] Y#102
Z#26
G01 X[#24+#21+#3+#7/2] F#9
IF[[#25-[#7-#120]+#7/2]-0.02 GT #104] GOTO 25 (TEST IF ZAG PASS IS NEEDED)
G00 G91 Y-#103
G90 G01 X[#24-#3-#7/2]
GOTO 20 (GO BACK TO TEST)
N99 G00 Z[#26+1.0]
M99