G02 and G03 CNC Arc Programming: IJK, R, Full Circles and Arc Error Troubleshooting
The Complete Guide to Circular Interpolation for FANUC, Haas, CNC Milling and CNC Turning
G02 and G03 are among the most important commands in CNC programming.
They allow a CNC machine to move along a circular path instead of a straight line.
Circular interpolation is used for:
- Circular pockets
- Rounded corners
- Circular profiles
- Hole interpolation
- Counterbores
- Toolpath transitions
- Circular grooves
- Helical milling
- CNC turning radii
- Complex contour machining
Although the basic concepts are straightforward, arc programming creates many common CNC alarms.
Typical problems include:
- Incorrect arc radius
- Wrong IJK center values
- Incorrect G02/G03 direction
- Wrong active plane
- Unsupported full-circle syntax
- Incorrect R sign
- Arc endpoint mismatch
- Postprocessor rounding errors
- Absolute versus incremental arc-center confusion
This guide explains how circular interpolation works, how to calculate arc centers, how to write correct examples, and how to diagnose common errors.
Safety and compatibility notice: All G-code examples are educational geometry fragments, not complete production programs. Controller-specific arc-center modes, radius conventions, planes, and turning-axis conventions must be verified. Do not run these fragments on a physical machine without appropriate setup, simulation, and approved prove-out.
PART 1 — G02 AND G03 BASICS
1. What Is G02 in CNC?
On many CNC controls, G02 commands clockwise circular interpolation.
The direction is evaluated in the active interpolation plane using the controller’s documented viewing convention.
In the common XY plane, the motion follows a clockwise circular path when viewed from the positive Z direction toward the XY plane.
2. What Is G03 in CNC?
G03 commands counterclockwise circular interpolation on compatible controls.
It is used when the desired circular path follows the opposite direction from G02.
3. G02 vs G03
| Code | Common meaning |
| G02 | Clockwise circular interpolation |
| G03 | Counterclockwise circular interpolation |
The active plane determines how the circular motion is interpreted.
4. Why CNC Arcs Need More Than an Endpoint
A straight line can be defined by a start point and an endpoint.
A circular arc needs additional geometry.
A controller typically requires either:
- Arc-center information, often using I, J, and K
- A radius value, commonly using R
The start point is usually the current position.
5. Basic G03 Example
Consider a quarter circle:
Start point:
X10 Y0
End point:
X0 Y10
Center:
X0 Y0
Radius:
10 mm
Illustrative G-code for a controller using incremental I/J center offsets:
G17 G90
G00 X10. Y0.
G03 X0. Y10. I-10. J0. F200.
This describes a counterclockwise quarter circle.
The center offset from the start is:
I = 0 − 10 = -10
J = 0 − 0 = 0
PART 2 — UNDERSTANDING I, J AND K
6. What Does I Mean in G-Code?
In many arc programming formats, I describes the X component of the arc-center location or offset.
Its exact interpretation depends on the controller and active arc-center mode.
7. What Does J Mean in G-Code?
J commonly describes the Y component of the arc center or offset.
8. What Does K Mean in G-Code?
K commonly describes the Z component of the arc center or offset.
9. Incremental IJK Center Offsets
In a common incremental center-offset format:
I = Center X − Start X
J = Center Y − Start Y
K = Center Z − Start Z
These offsets are measured from the arc start point.
10. Absolute vs Incremental Arc Centers
Do not confuse:
- Absolute/incremental endpoint programming
- Absolute/incremental arc-center programming
G90 and G91 commonly control endpoint positioning.
They do not universally determine whether IJK values are absolute or incremental.
Some controllers provide separate arc-center mode settings or commands, such as G90.1/G91.1 in supported dialects.
Always check the target controller.
PART 3 — G17, G18 AND G19
11. G17 XY Plane
G17 commonly selects the XY interpolation plane.
In this plane, circular interpolation uses X and Y coordinates.
Arc centers are commonly specified with I and J.
12. G18 XZ Plane
G18 commonly selects the XZ interpolation plane.
It is important in turning and some milling operations.
Arc-center components commonly involve I and K.
13. G19 YZ Plane
G19 commonly selects the YZ interpolation plane.
Arc-center components commonly involve J and K.
14. Why Plane Selection Matters
A geometrically correct XY arc can fail if the controller is operating in G18 or G19.
The active plane changes the interpretation of the circular motion.
15. Plane Reference Table
| Plane | Typical plane axes | Typical center components |
| G17 | X and Y | I and J |
| G18 | X and Z | I and K |
| G19 | Y and Z | J and K |
Exact control behavior may vary.
PART 4 — CALCULATING IJK VALUES
16. IJK Calculation Formula
For an XY arc using incremental center offsets:
I = Xc − Xs
J = Yc − Ys
Where:
- Xc = Center X
- Yc = Center Y
- Xs = Start X
- Ys = Start Y
17. Example: Center at X0 Y0
Start:
X20 Y0
Center:
X0 Y0
I = 0 − 20
I = -20
J = 0 − 0
J = 0
Result:
I-20. J0.
18. Example: Offset Center
Start:
X30 Y20
Center:
X20 Y20
I = 20 − 30 = -10
J = 20 − 20 = 0
Result:
I-10. J0.
19. Example: Positive I and J
Start:
X10 Y10
Center:
X20 Y20
I = 20 − 10 = 10
J = 20 − 10 = 10
Result:
I10. J10.
The radius is:
R = √(10² + 10²)
R ≈ 14.142 mm
20. Verify Arc Radius at Both Ends
A valid circular arc must have the same radius at the start and endpoint.
For incremental IJK:
Start radius:
Rs = √(I² + J²)
End radius:
Re = √((Xend − Xcenter)² + (Yend − Ycenter)²)
For valid circular geometry:
Rs ≈ Re
The permitted mismatch tolerance depends on the controller.
PART 5 — G02 CLOCKWISE EXAMPLES
21. Clockwise Quarter Circle
Start:
X0 Y10
End:
X10 Y0
Center:
X0 Y0
Using incremental center offsets:
G17 G90
G00 X0. Y10.
G02 X10. Y0. I0. J-10. F200.
This is a clockwise quarter circle.
22. Clockwise Half Circle
Start:
X10 Y0
End:
X-10 Y0
Center:
X0 Y0
For the clockwise semicircle, the path travels through the negative Y side.
G17 G90
G00 X10. Y0.
G02 X-10. Y0. I-10. J0. F200.
23. Clockwise Arc With Offset Center
Start:
X30 Y20
End:
X20 Y10
Center:
X20 Y20
G17 G90
G00 X30. Y20.
G02 X20. Y10. I-10. J0. F200.
The path moves clockwise from the right side of the circle to the bottom.
PART 6 — G03 COUNTERCLOCKWISE EXAMPLES
24. Counterclockwise Quarter Circle
Start:
X10 Y0
End:
X0 Y10
Center:
X0 Y0
G17 G90
G00 X10. Y0.
G03 X0. Y10. I-10. J0. F200.
25. Counterclockwise Half Circle
Start:
X10 Y0
End:
X-10 Y0
Center:
X0 Y0
G17 G90
G00 X10. Y0.
G03 X-10. Y0. I-10. J0. F200.
This semicircle travels through the positive Y side.
26. Counterclockwise Arc With Offset Center
Start:
X20 Y10
End:
X30 Y20
Center:
X20 Y20
G17 G90
G00 X20. Y10.
G03 X30. Y20. I0. J10. F200.
This moves counterclockwise from the bottom of the circle to the right side.
PART 7 — RADIUS PROGRAMMING WITH R
27. What Does R Mean in G02/G03?
R commonly specifies the radius of an arc.
Example:
G03 X0. Y10. R10.
When used from the appropriate starting point, this defines a circular arc with radius 10.
The controller determines the center from the start point, endpoint, radius, and direction.
28. G03 R Example
Start:
X10 Y0
End:
X0 Y10
Radius:
10 mm
G17 G90
G00 X10. Y0.
G03 X0. Y10. R10. F200.
On controllers following the common minor-arc convention, this describes the counterclockwise quarter circle.
29. G02 R Example
Start:
X0 Y10
End:
X10 Y0
Radius:
10 mm
G17 G90
G00 X0. Y10.
G02 X10. Y0. R10. F200.
30. Positive vs Negative R
On many controls supporting signed R conventions:
- Positive R selects an arc of 180 degrees or less.
- Negative R selects an arc greater than 180 degrees.
But this behavior is not universal.
Always confirm the controller’s arc-radius convention.
31. Why R Programming Can Be Ambiguous
For many combinations of two endpoints and a radius, more than one circle center is geometrically possible.
The controller uses direction and radius conventions to choose the intended arc.
This is one reason IJK programming can be preferable for certain complex arcs.
32. R Programming and Full Circles
A full circle cannot generally be defined unambiguously by a start point, identical endpoint, and radius alone.
For compatible controls, center-offset programming is commonly used for full circles.
PART 8 — FULL CIRCLE PROGRAMMING
33. G02 Full Circle
Suppose the start point is X10 Y0 and the center is X0 Y0.
On a controller supporting full-circle IJK programming:
G17 G90
G00 X10. Y0.
G02 I-10. J0. F200.
This illustrates a clockwise full circle.
Some controllers require a different format or explicit endpoint.
34. G03 Full Circle
G17 G90
G00 X10. Y0.
G03 I-10. J0. F200.
This illustrates a counterclockwise full circle on compatible controls.
35. Why Full Circle Programs Fail
Potential causes:
- Unsupported full-circle syntax
- Missing required axis words
- Incorrect center offsets
- Wrong arc-center mode
- Controller-specific limitations
36. Two Semicircles as an Alternative
A full circle can sometimes be represented by two semicircular arcs.
Example:
G17 G90
G00 X10. Y0.
G03 X-10. Y0. I-10. J0. F200.
G03 X10. Y0. I10. J0.
The first arc travels through positive Y.
The second travels through negative Y.
Together they form one complete counterclockwise circle.
The exact syntax must still be verified.
PART 9 — HELICAL INTERPOLATION
37. What Is Helical Interpolation?
Helical interpolation combines circular motion in one plane with simultaneous linear movement along another axis.
It is commonly used for:
- Helical hole milling
- Circular pocket entry
- Thread milling
- Helical boring
38. G03 Helical Example
For a controller supporting simultaneous Z movement during XY circular interpolation:
G17 G90
G00 X10. Y0.
G03 X0. Y10. I-10. J0. Z-1. F150.
This combines a counterclockwise quarter-circle XY path with a Z movement of -1 mm.
The example is a geometric fragment and assumes an appropriate initial Z position and safe setup.
39. Full Helical Revolution
On controllers supporting full-circle helical interpolation, a complete revolution can include a simultaneous Z change.
Exact syntax and limitations vary.
Some systems require the revolution to be divided into multiple arcs.
40. Helical Pitch
For a helix:
Pitch = Axial movement per full revolution
Example:
Axial descent:
2 mm
Angular travel:
360 degrees
Helical pitch:
2 mm/revolution
41. Helical Motion Feedrate
Helical toolpaths contain both circular and axial movement.
The relationship between programmed feedrate, tool-center path length, and surface cutting conditions depends on the controller and machining strategy.
Use CAM or controller-aware calculations for advanced applications.
PART 10 — ARC GEOMETRY CALCULATIONS
42. Arc Radius From Center Offsets
For XY incremental center offsets:
R = √(I² + J²)
Example:
I = -6
J = 8
R = √(36 + 64)
R = 10 mm
43. Arc Length Formula
For an arc with radius R and sweep angle θ in radians:
Arc length = R × θ
If the angle is in degrees:
Arc length = π × R × θ / 180
44. Quarter Circle Arc Length
Radius:
10 mm
Angle:
90 degrees
Arc length:
π × 10 × 90 / 180
Arc length ≈ 15.708 mm
45. Half Circle Arc Length
Radius:
10 mm
Angle:
180 degrees
Arc length:
π × 10
Arc length ≈ 31.416 mm
46. Full Circle Length
Radius:
10 mm
Circumference:
2 × π × 10
Length ≈ 62.832 mm
47. Chord Length Formula
For radius R and central angle θ:
Chord = 2 × R × sin(θ/2)
Example:
R = 10 mm
θ = 90 degrees
Chord ≈ 14.142 mm
48. Minimum Radius for Two Endpoints
For two points separated by chord length C:
R must be at least C/2
If R is smaller than half the chord length, no real circle of that radius passes through both points.
This is a common cause of invalid R-programmed arcs.
PART 11 — CALCULATING ARC CENTERS FROM R
49. Arc Center Geometry
Given:
- Start point S
- End point E
- Radius R
First calculate the chord length:
C = √((Xe − Xs)² + (Ye − Ys)²)
Then calculate the chord midpoint:
Mx = (Xs + Xe)/2
My = (Ys + Ye)/2
The perpendicular distance from the midpoint to either possible center is:
h = √(R² − (C/2)²)
50. Two Possible Centers
For non-degenerate geometry, two possible circle centers may exist.
Define:
dx = Xe − Xs
dy = Ye − Ys
C = √(dx² + dy²)
A unit perpendicular vector is:
(-dy/C, dx/C)
Possible centers:
Cx = Mx ± h × (-dy/C)
Cy = My ± h × (dx/C)
The appropriate center depends on the desired sweep direction and arc-size convention.
51. Arc Center Calculation Example
Start:
X10 Y0
End:
X0 Y10
Radius:
10
Chord:
√((-10)² + 10²)
C ≈ 14.142
Midpoint:
X5 Y5
h = √(100 − 50)
h ≈ 7.071
The two possible centers are approximately:
X0 Y0
and
X10 Y10
For the desired counterclockwise minor arc from X10 Y0 to X0 Y10, the center is X0 Y0.
PART 12 — CNC ARC ERROR TROUBLESHOOTING
52. CNC Arc Radius Error
A radius error may indicate that the start and end points are not consistent with the specified center or radius.
Potential causes:
- Incorrect IJK
- Incorrect endpoint
- Incorrect R
- Rounding error
- Wrong plane
- Wrong arc-center mode
53. Arc Center Error
An arc center error may occur when the center-offset values produce inconsistent geometry.
Check:
- Arc start point
- Arc endpoint
- IJK values
- Active plane
- Arc-center mode
- Numeric precision
54. Radius Mismatch Test
For an XY arc:
Start:
Xs, Ys
End:
Xe, Ye
Center:
Cx, Cy
Calculate:
Rs = √((Xs − Cx)² + (Ys − Cy)²)
Re = √((Xe − Cx)² + (Ye − Cy)²)
Then compare:
Mismatch = |Rs − Re|
If the mismatch exceeds the controller’s permitted tolerance, the control may reject the arc.
55. Example of Invalid Arc Geometry
Start:
X10 Y0
Center:
X0 Y0
End:
X0 Y9
Start radius:
10 mm
End radius:
9 mm
Mismatch:
1 mm
The geometry does not describe a single circle with the specified center.
56. Incorrect G02/G03 Direction
A program may contain valid circular geometry but follow the wrong side of the circle.
Check:
- Active plane
- Intended direction
- Arc center
- Selected sweep
A wrong-direction arc may still be accepted by the controller.
That makes graphical verification essential.
57. Wrong G17/G18/G19 Plane
If the intended arc is in XY but the active plane is XZ, the control may interpret the coordinates incorrectly or raise an alarm.
Verify the active plane before the arc.
58. Incorrect Absolute/Incremental Center Mode
A controller expecting incremental IJK offsets may interpret absolute center coordinates incorrectly.
This can create a radius mismatch or unexpected arc.
Do not assume G90 automatically makes IJK absolute.
59. Postprocessor Arc Rounding
CAM postprocessors may round coordinates.
If start point, endpoint, and center values are rounded inconsistently, the resulting arc may exceed the controller’s radius tolerance.
Use appropriate postprocessor precision and verified arc-output settings.
60. Unsupported Arc Format
Some controls restrict:
- Full circles
- Radius-format arcs
- Helical arcs
- Arc planes
- Center modes
- Maximum or minimum radii
Consult the exact controller documentation.
PART 13 — G02/G03 IN CNC TURNING
61. Circular Interpolation on a Lathe
CNC lathes commonly use arcs for:
- Fillets
- Radii
- Grooves
- Contours
- Profile transitions
The active plane is often XZ.
62. G18 Turning Arcs
On compatible controls, G18 selects the XZ plane.
Arc centers commonly use I and K.
However, turning conventions require special attention.
63. Diameter Programming vs Radius Programming
Many CNC lathes use diameter programming for the X axis.
The displayed X coordinate may represent diameter rather than physical radial position.
This affects how arc geometry must be interpreted.
Controller-specific rules determine the correct I/K values.
64. Why Milling Arc Examples May Not Work on Lathes
A milling example typically assumes Cartesian XY coordinates.
A lathe may use:
- XZ interpolation
- Diameter-mode X coordinates
- Different arc-center conventions
- Different feed modes
Never transfer a milling arc example directly to a lathe without adapting and verifying the geometry.
PART 14 — CNC ARC PROGRAMMING BEST PRACTICES
65. Use Explicit Plane Selection
Set the intended interpolation plane according to the controller and program structure.
Do not rely on an unknown previous modal state.
66. Verify Start Position
The current position is normally the start point of the arc.
An incorrect approach move can make an otherwise valid arc incorrect.
67. Check Endpoint Geometry
Confirm the endpoint belongs to the intended circle.
68. Check IJK Center Values
Calculate center offsets from the actual arc start point when using incremental IJK conventions.
69. Verify Radius Format
When using R:
- Confirm radius magnitude
- Confirm sign convention
- Confirm intended minor or major arc
- Check chord length
70. Avoid Ambiguous Full-Circle R Programming
Use a supported center-offset format or another verified representation for full circles.
71. Use Sufficient Numeric Precision
Insufficient precision can create arc closure errors.
Excessive precision may also be unnecessary or unsupported.
Use a format validated for the target controller.
72. Simulate the Final NC Program
A CAM preview is not always equivalent to simulation of the posted G-code.
Verify the actual output.
PART 15 — G02/G03 FREQUENTLY ASKED QUESTIONS
73. What Is G02 in CNC?
G02 commonly commands clockwise circular interpolation.
74. What Is G03 in CNC?
G03 commonly commands counterclockwise circular interpolation.
75. What Is the Difference Between G02 and G03?
They specify opposite circular interpolation directions.
76. What Does I Mean in G02?
I commonly specifies the X component of the arc center or center offset.
77. What Does J Mean in G03?
J commonly specifies the Y component of the arc center or center offset.
78. What Does K Mean in CNC Arc Programming?
K commonly specifies the Z component of the arc center or center offset.
79. What Does R Mean in G02/G03?
R commonly specifies arc radius.
80. Can G02 Make a Full Circle?
On compatible controllers, full-circle interpolation is often possible using center-offset programming.
81. Can G03 Make a Full Circle?
Yes, on compatible controllers using supported syntax.
82. Can G02/G03 Move in Z?
Helical interpolation can combine circular motion with movement along another axis on supported controls.
83. Why Does My CNC Show an Arc Radius Alarm?
Possible causes include incorrect endpoints, incorrect center offsets, wrong plane, incompatible center mode, or rounding errors.
84. Is IJK Better Than R?
Neither is universally better.
IJK explicitly defines the center in supported formats.
R is convenient for many arcs but may involve center-selection ambiguity.
85. Does G90 Make IJK Absolute?
Not universally.
Arc-center mode can be independent of endpoint positioning mode.
86. Does G91 Make IJK Incremental?
Not universally.
Verify the control’s arc-center programming convention.
87. Why Does G02 Work in a Simulator but Not on the CNC?
Possible reasons include controller dialect differences, arc-center conventions, tolerance settings, or unsupported formats.
88. How Do I Calculate I and J?
For incremental XY center offsets:
I = Center X − Start X
J = Center Y − Start Y
89. How Do I Calculate Arc Length?
Arc length = Radius × Angle in radians.
90. How Do I Check Whether an Arc Is Valid?
Calculate the distance from the specified center to both endpoints.
The distances should agree within the controller’s permitted tolerance.
PART 16 — G02/G03 QUICK REFERENCE
91. Core Commands
| Command | Common purpose |
| G02 | Clockwise arc |
| G03 | Counterclockwise arc |
| G17 | XY plane |
| G18 | XZ plane |
| G19 | YZ plane |
| I | Arc center X component |
| J | Arc center Y component |
| K | Arc center Z component |
| R | Arc radius |
| F | Feedrate |
92. Common Geometry Formulas
Incremental center offsets
I = Xc − Xs
J = Yc − Ys
K = Zc − Zs
Radius from IJK in XY
R = √(I² + J²)
Arc length
L = R × θ
Chord length
C = 2R sin(θ/2)
Arc validity
Distance(start, center) ≈ Distance(end, center)
93. Quarter Circle Example
G17 G90
G00 X10. Y0.
G03 X0. Y10. I-10. J0. F200.
94. Half Circle Example
G17 G90
G00 X10. Y0.
G03 X-10. Y0. I-10. J0. F200.
95. Full Circle Example
G17 G90
G00 X10. Y0.
G03 I-10. J0. F200.
Supported full-circle syntax varies by controller.
96. Radius Format Example
G17 G90
G00 X10. Y0.
G03 X0. Y10. R10. F200.
97. Helical Quarter Circle Example
G17 G90
G00 X10. Y0.
G03 X0. Y10. I-10. J0. Z-1. F150.
This is a geometry illustration, not a safe approach or complete machining program.
PART 17 — FINAL CNC ARC TROUBLESHOOTING CHECKLIST
98. Before Running an Arc
Confirm:
- Correct controller dialect
- Correct active plane
- Correct start position
- Correct endpoint
- Correct G02/G03 direction
- Correct IJK or R format
- Correct center mode
- Correct feedrate
- Correct tool compensation state
- Verified tool clearance
99. When an Arc Alarm Appears
Check in this order:
- Exact alarm message
- Active plane
- Current start point
- Programmed endpoint
- Arc-center convention
- IJK or R values
- Start and end radius mismatch
- Numeric precision
- Postprocessor settings
- Controller-specific limitations
100. The Professional Arc Programming Workflow
DEFINE THE START POINT
↓
DEFINE THE END POINT
↓
IDENTIFY THE CIRCLE CENTER OR RADIUS
↓
SELECT G02 OR G03
↓
SELECT THE CORRECT PLANE
↓
CALCULATE IJK OR R
↓
VERIFY THE GEOMETRY
↓
SIMULATE THE FINAL G-CODE
↓
COMPLETE APPROVED MACHINE PROVE-OUT
CONCLUSION
G02 and G03 are essential commands for CNC circular interpolation.
Correct arc programming requires more than memorizing clockwise and counterclockwise directions.
A programmer must understand:
- The active interpolation plane
- The current arc start point
- The desired endpoint
- Arc-center offsets
- Radius conventions
- Arc sweep direction
- Full-circle limitations
- Helical interpolation
- Controller-specific syntax
- Geometric verification
The most useful troubleshooting principle is simple:
A VALID ARC MUST HAVE CONSISTENT GEOMETRY.
When a CNC reports an arc error, verify the actual start point, endpoint, center, radius, and active plane before changing random values.
THE GOLDEN RULE OF G02/G03 PROGRAMMING:
CHECK THE PLANE. CHECK THE CENTER. CHECK THE RADIUS. VERIFY THE PATH.
Complete CNC Circular Interpolation Reference — G02, G03, IJK, R, Full Circles, Helical Interpolation, FANUC, Haas and Arc Error Troubleshooting.
Leave a comment