G02 and G03 Explained: CNC Circular Interpolation with Practical G-Code Examples
Meta Description: Learn how to program circular arcs using G02 and G03 in CNC. Includes real-world examples, IJK parameter breakdown, diagrams, and best practices for clockwise and counterclockwise arc movement.
🔄 What Is Circular Interpolation?
Circular interpolation refers to tool motion along an arc. G02 and G03 are the core G-code commands used to machine circular features such as holes, fillets, radii, and pockets.
- G02: Clockwise (CW) arc
- G03: Counterclockwise (CCW) arc
⚙️ G02 / G03 Format
G02 X__ Y__ I__ J__ F__; G03 X__ Y__ I__ J__ F__;
- X, Y: End point of the arc
- I, J: Arc center offset from current position
- F: Feedrate
Tip: All values must be in the same plane (typically XY when G17 is active).
📐 G02 Clockwise Arc Example
G17 G90 G21 G0 X0 Y0 G1 Z-2 F100 G02 X20 Y0 I10 J0 F200
This cuts a clockwise arc from (0,0) to (20,0) with a center at (10,0) — a 180° arc with radius 10 mm.
🔁 G03 Counterclockwise Arc Example
G17 G90 G21 G0 X0 Y0 G1 Z-2 F100 G03 X20 Y0 I10 J0 F200
This performs the same arc but in the counterclockwise direction.
🎯 How I and J Work (Center Point Offsets)
| Parameter | Description |
|---|---|
| I | Distance from current X to arc center X |
| J | Distance from current Y to arc center Y |
💡 Arc Example Diagram
Start: (0, 0) → End: (20, 0) → Center: (10, 0)
So: I10 J0
🔢 Using Radius Instead of IJK
Some controllers (like Fanuc, Haas) allow the use of R instead of I and J:
G02 X20 Y0 R10 F200
Note: Using R is simpler, but ambiguous when arc > 180°.
🧰 Real CNC Milling Arc Sample
G90 G21 G17 G0 X0 Y0 G1 Z-2 F150 G03 X30 Y30 I0 J15 F300 G01 X60 Y30 G02 X90 Y0 I0 J-15 F300
This code machines a “rounded U-shape” by combining arcs and lines.
⚠️ Common Mistakes
- Wrong I/J values causing the arc to loop
- Missing G17 (XY plane) declaration
- Incorrect feedrate for arc motion
- Using R on arcs > 180° can cause ambiguity
📊 Arc Interpolation Comparison
| Parameter | G02 | G03 |
|---|---|---|
| Direction | Clockwise | Counterclockwise |
| Use | Pockets, fillets | Contouring, chamfers |
| Common Format | I, J or R | I, J or R |
✅ Best Practices
- 🧪 Simulate the toolpath before running
- 🎯 Double-check your I and J values
- 🚫 Avoid negative feedrates
- 🛡 Use G17 to lock to XY plane before arc
📚 Summary
G02 and G03 are essential G-codes for efficient and precise circular tool movement in CNC programming. Mastering both the IJK method and the R method will give you full control over arcs, contours, fillets, and pockets. Always test with simulation and maintain a clean toolpath logic for safe and accurate cuts.
Leave a comment