G Code for Milling Circle: Syntax and Example
To mill a circle in G code, use
G02 for clockwise or G03 for counterclockwise arcs, specifying the circle's center with I and J offsets relative to the start point. The command moves the tool along a circular path defined by these parameters.Syntax
The basic G code syntax for milling a circle arc is:
G02- Clockwise arc movementG03- Counterclockwise arc movementX,Y- Coordinates of the arc end pointI,J- Relative offsets from the start point to the arc center on X and Y axesF- Feed rate (speed of the tool)
This command moves the tool from its current position to the specified X,Y point along a circular path defined by the center offsets I,J.
gcode
G02 X10 Y0 I5 J0 F100
Example
This example mills a full clockwise circle with a radius of 5 units, starting at X5 Y0, moving around the center at the origin (0,0).
gcode
G90 ; Absolute positioning G00 X5 Y0 ; Move to start point on circle edge G01 Z-1 F50 ; Lower tool to cutting depth G02 X5 Y0 I-5 J0 F100 ; Mill full clockwise circle G00 Z5 ; Raise tool after cut
Output
Tool moves to X5 Y0, lowers to Z-1, mills a full clockwise circle around origin, then raises.
Common Pitfalls
Common mistakes when milling circles with G code include:
- Using
IandJas absolute coordinates instead of relative offsets. - Forgetting to set the correct starting point on the circle edge before the arc command.
- Mixing up
G02(clockwise) andG03(counterclockwise) causing unexpected tool paths. - Not specifying feed rate
F, which can cause the machine to use a default speed that may be too fast or slow.
Wrong example:
G02 X10 Y0 I10 J0 F100 ; Incorrect I value (should be relative)
Corrected example:
G02 X10 Y0 I5 J0 F100
Quick Reference
| Command | Description |
|---|---|
| G02 | Clockwise arc movement |
| G03 | Counterclockwise arc movement |
| X, Y | Arc end point coordinates |
| I, J | Relative center offsets from start point |
| F | Feed rate (speed) |
Key Takeaways
Use G02 for clockwise and G03 for counterclockwise circular milling.
Specify arc center with I and J as relative offsets from the start point.
Always set the tool start position on the circle edge before milling the arc.
Include feed rate F to control cutting speed safely.
Double-check direction and offsets to avoid unexpected tool paths.