CNC Slot Milling G-Code Programming Example for Beginners
Short and standard G-code CNC program example for slot milling (often called pocket milling or slotting with a flat end mill).
This example using an 8 mm flat end mill to cut a slot that is 10 mm wide, 50 mm long, and 5 mm deep in a workpiece made of aluminum or steel.

O1001
M03 S3000
G00 X0 Y0 Z5.0
G01 Z-2.0 F200
G01 X50.0 F500
G00 Z5.0
M05
G28 Z50.0
G28 X0 Y0
M30
M03 S3000 – Spindle ON clockwise at 3000 RPM.
G00 X0 Y0 Z5.0 – Rapid move to starting position above the slot, clear of material.
G01 Z-2.0 F200 – Feed down to first depth of cut (2 mm deep) at 200 mm/min.
G01 X50.0 F500 – Feed linearly along the X-axis to length of 50 mm at 500 mm/min.
G00 Z5.0 – Rapid retract above the workpiece.
G28 Z50.0 – Return Z to home position.
G28 X0 Y0 – Return XY to home position.
M30- Program end.

One Comment