G Code for Face Milling: Syntax, Example, and Tips
Face milling in G code typically uses
G01 for linear cutting moves combined with spindle commands like M03 to start the spindle. The tool moves across the surface in straight passes to create a flat finish.Syntax
Face milling uses linear moves with controlled feed rates and spindle control. Key parts include:
- G01: Linear interpolation for cutting moves.
- M03: Spindle on clockwise.
- F: Feed rate (speed of tool movement).
- S: Spindle speed (RPM).
- X, Y, Z: Coordinates for tool position.
gcode
M03 S1200 ; Start spindle clockwise at 1200 RPM G01 Z-5.0 F100 ; Move tool down to cutting depth at 100 mm/min G01 X50 Y0 F200 ; Cut in X direction at 200 mm/min G01 X50 Y50 ; Move in Y direction G01 X0 Y50 ; Move back in X G01 X0 Y0 ; Return to start M05 ; Stop spindle
Example
This example shows a simple face milling operation on a 50x50 mm surface at 5 mm depth. The spindle starts, the tool moves down, and then cuts a square path to mill the face.
gcode
M03 S1500 ; Spindle on clockwise at 1500 RPM G00 X0 Y0 Z5 ; Rapid move above workpiece G01 Z-5 F120 ; Move down to 5 mm depth at 120 mm/min G01 X50 Y0 F250 ; Cut along X axis G01 X50 Y50 ; Cut along Y axis G01 X0 Y50 ; Cut back along X G01 X0 Y0 ; Complete square G00 Z5 ; Retract tool M05 ; Stop spindle
Common Pitfalls
Common mistakes in face milling G code include:
- Not setting spindle speed (
S) before starting spindle (M03). - Moving tool too fast or too deep causing tool damage.
- Forgetting to retract tool (
G00 Z5) after cutting. - Using rapid moves (
G00) at cutting depth which can damage the tool.
Correct use of feed rates and spindle control is essential for good surface finish and tool life.
gcode
Wrong: M03 ; Spindle on without speed G01 Z-10 F500 ; Too deep and fast G00 X50 Y50 ; Rapid move at cutting depth Right: M03 S1200 ; Spindle on with speed G01 Z-5 F150 ; Proper depth and feed G00 Z5 ; Retract before rapid move
Quick Reference
| Command | Description |
|---|---|
| M03 Sxxx | Start spindle clockwise at xxx RPM |
| M05 | Stop spindle |
| G00 Xx Yy Zz | Rapid move to position (no cutting) |
| G01 Xx Yy Zz Ff | Linear cut move at feed rate f |
| Ff | Set feed rate (mm/min) |
| Sxxx | Set spindle speed (RPM) |
Key Takeaways
Use G01 with proper feed rate for controlled face milling cuts.
Always set spindle speed with S command before M03 to start spindle.
Avoid rapid moves (G00) at cutting depth to prevent tool damage.
Retract tool safely after milling using G00 Z moves.
Plan tool paths to cover the entire face evenly for a flat finish.