← Back to CNC Programming

Circular & Helical Interpolation

Arcs are programmed with G02 (clockwise) and G03 (counterclockwise). This page covers I/J center vectors, R radius notation, and how to verify arc direction with angles.

Concept

G02 cuts clockwise arcs. G03 cuts counterclockwise. The arc is defined by: start point (current position), end point (X/Y), and either center (I/J) or radius (R). I is the center offset in X from start; J is the center offset in Y from start.

Direction is viewed looking from the positive Z axis down (G17 XY plane). Clockwise = G02, counterclockwise = G03.

Why It Matters

Getting G02/G03 backwards means the tool cuts a bulge instead of a concave — or vice versa. Wrong I/J means the arc center is off, producing a lopsided circle. Always verify: start point, center, end point, direction.

How It Works

I/J Method (center vector)

Take G90, G17, G21 as already active. Start S = (0,0), center C = (25,0), end E = (50,0), radius r = 25. I = C−S in X = 25−0 = 25. J = C−S in Y = 0−0 = 0.

Using x = Cx + r·cosθ, y = Cy + r·sinθ:

G02 (clockwise): angle decreases 180° → 90° → 0°. At 90°: x = 25 + 25·cos90° = 25, y = 0 + 25·sin90° = +25. So G02 passes through (25, +25) — the upper semicircle.

G03 (counterclockwise): angle increases 180° → 270° → 360°. At 270°: x = 25, y = −25. So G03 passes through (25, −25) — the lower semicircle.

Both are 180° arcs; arc length L = 2πr×θ/360 = 2π×25×180/360 = 78.540 mm.

X Y C(25,0) S(0,0) E(50,0) G02 CW upper G03 CCW lower
Same start (0,0) and end (50,0), center (25,0). G02 (clockwise) cuts the upper semicircle through (25,+25); G03 (counterclockwise) cuts the lower through (25,−25). Radius = 25 mm.

The two lines below are independent examples — each starts from S=(0,0) at a safe Z above the part. They must not be run as consecutive code without retracting and repositioning:

(Example A — upper semicircle, already at S=(0,0) at safe Z, G90/G17/G21 set)
G02 X50. Y0 I25. J0.        (clockwise through (25,+25), 78.54 mm)

(Example B — lower semicircle, separate program/setup)
(First retract Z to safe height, rapid to X0 Y0 at safe Z, then feed down to cut level)
G03 X50. Y0 I25. J0.        (counterclockwise through (25,-25), 78.54 mm)

R Method (radius)

G17 G03 X50. Y0 R25.

R25 = 25 mm radius. R positive for arcs ≤ 180° (the short arc, including a semicircle); R negative for arcs > 180°.

Helical Interpolation

By adding a Z (or other axis) word to a G02/G03 block, the machine interpolates a helix — an arc that simultaneously moves in Z. This is used for helical interpolation milling of circular pockets and oil grooves:

G01 X25. Y0 F300.
G03 I-25. J0 Z-5.   (helical: circle in XY while descending Z from 0 to -5)

The Z coordinate in the arc block is the end Z. Assume an independent fragment with G21/G17/G90/G94/G40 active, tool center at (25,0), Z0 established, H offset, spindle, coolant and entry clearance already set. Each turn descends 5 mm on a 25 mm tool-center radius; the helix angle is atan(5/(2π×25)) ≈ 1.82°, which must fit the tool's recommended ramp and the hole/tool diameter relation. This is how many CAM routines rough circular pockets; a center-cutting tool is required, and the tool does not start from a point-sized hole center.

Plane Selection: G17 / G18 / G19

G02/G03 direction and the center addresses depend on the active plane. G17 is the XY plane (milling); I is X center offset, J is Y center offset, direction viewed from +Z toward the origin. G18 is the XZ plane (lathe radii); I is X center offset, K is Z center offset, direction viewed from +Y. G19 is the YZ plane; J is Y, K is Z, direction viewed from +X. The startup block normally sets G17 on a mill. On this page's lathe assumption, X is programmed as diameter; the radial half of the X change is not by itself the arc radius — you still need the center or sweep angle. Confirm direction labels against your control's documentation.

Arc Feed and Surface Speed

In a G94/G40 tool-center-path example, the programmed F applies along the tool center path. Surface cutting speed vc is set by spindle RPM and tool diameter (vc = πDN/1000), not by F; F is feed rate. With cutter compensation on, whether the controller adjusts feed automatically is control-specific and must be checked in the manual. For an inside pocket radius of 20 mm cut with a 10 mm tool, the tool center path is radius 15 mm; an effective profile feed of 300 mm/min corresponds to a tool-center feed of about 225 mm/min, giving one revolution in 2π×15/225 = 0.419 min, ignoring acceleration/deceleration.

Quarter Circles and Corner Rounds

The most common arcs in practice are 90° corner rounds. For points S=(0,10), C=(10,10), E=(10,0), the start vector from C is (−10,0) at 180° and the end vector is (0,−10) at 270°. Increasing angle 180° to 270° is counterclockwise = G03, a 90° short arc. The other direction around the same center is G02 over 270°. Direction is set by the point order and center, not by whether the material is on one side or the other. Draw the center and start/end vectors before coding.

What Happens if I/J Is Wrong

If I/J specifies a center whose distance from start and end do not match within control tolerance, the control typically alarms rather than cutting a guessed arc. For example, start S=(0,0), end E=(50,0), wrong center C=(20,0): distances are 20 and 30 mm, which cannot be one radius, so an alarm results. Only when another circle through start and end fits within tolerance will the control cut a different (wrong) arc. Always compute I = Cx − Sx and J = Cy − Sy from the current start point.

Arc Length and Cycle Time

Arc length is L = 2πr×θ/360. A 180° semicircle of radius 25 is 78.54 mm; a 90° quarter circle of radius 20 is 31.42 mm. Cycle time on an arc cut is L/F, same as a linear cut. When estimating, remember the tool travels the arc, not the chord — programming two straight lines to approximate a radius leaves a facet and underestimates the path.

Lead-In and Lead-Out on Arcs

When cutter compensation is used on a contoured part, do not engage G41/G42 directly into an arc. Lead in on a straight line tangent to the arc, cut the arc, then lead out on a tangent straight line. This avoids a sudden tool-side offset at the arc start that leaves a witness mark. Lead-out mirrors lead-in. This is why CAM posts insert small straight moves before and after radius cuts.

Arcs on a Lathe (G18 XZ)

On a lathe, G02/G03 cut radii in the XZ plane (G18), with I in X and K in Z. X values are diameters, so a change X20 to X30 means a radial movement of 5 mm. That radial movement plus a Z movement of 5 mm gives a chord of √(5²+5²) = 7.071 mm; it does not by itself give the arc radius, which depends on the center and sweep angle. Direction convention is control-specific; verify on a dry run and do not assume the mill G02/G03 labels transfer directly.

Verifying an Arc Before Cutting

Before running an arc cut, simulate or dry-run and watch: does the tool enter on the correct side of the material? Does the bulge go inward or outward? Is the center where you intended? A 30-second visual check of the geometry catches the most common arc errors. If the screen shows the tool going the long way around, the direction or center sign is wrong.

Why I/J Is Preferred Over R

R is compact but ambiguous for arcs over 180° (hence the negative R convention) and impossible for full circles. I/J defines the center unambiguously. For hand programming, compute I and J on paper from the current start point; do not estimate them. When the start point changes between blocks, I/J must be recomputed.

Arc Blending and Tangency

For a smooth contour, adjacent linear and arc blocks must be tangent. A line that ends at an arc start should meet the arc at 90° to its radius, i.e. tangent. A corner where a line meets an arc at an angle leaves a visible step even if the geometry looks close. On a finish pass, tangency is what makes the edge look continuous. CAM posts compute this; hand programmers draw the tangent lines.

What Happens if G02/G03 Is Backwards

The tool cuts the other arc between the same two points. On a pocket corner, this means a bulge on the wrong side of the part, often removing material it should leave. The fix is swapping G02 for G03 (or vice versa) for that block, not changing coordinates. Because G02/G03 are modal, after changing one direction word you must check every following block that omits a motion G-code — it inherits the new direction — until another explicit G00/G01/G02/G03 re-establishes the mode. Blocks that explicitly state their own direction are not affected.

Arc Feed Rate on Inside vs Outside

On an external radius the tool center path is longer than the part arc; on an internal radius it is shorter. In the G94/G40 example above (inside radius 20 mm, tool radius 5 mm), the tool center path is 15 mm and F = 225 mm/min corresponds to an effective profile feed of about 300 mm/min. This is tool-center feed, not spindle surface speed; the latter is set by RPM and tool diameter.

Full Circles and R Limitation

A full circle has identical start and end coordinates. R alone cannot determine the center; I/J specifies it directly. Use start at (25,0), center (0,0), I = −25, J = 0. For pocket finishing, a full circle followed by a small outward step and another circle is standard.

Feed on a Small Radius

On a very small internal radius with a large cutter, engagement geometry changes sharply and the tool can rub or chatter. Reduce feed or use a smaller cutter for tight internal radii. Whether the chip is thinner or thicker than nominal depends on engagement; consult the cutter manufacturer's guidelines rather than assuming chip thinning.

Center-Distance Check Before Cutting

A quick way to catch a wrong I/J on paper is to check that the computed center is the same distance from both the start point and the end point. For S=(0,0), E=(50,0), correct C=(25,0) gives distances 25 mm and 25 mm, so a semicircle of radius 25 is geometrically possible. If you typed I=−25 by mistake instead of I=+25, C=(−25,0): distance to S is 25 mm but distance to E is 75 mm, which cannot be one radius, so the control alarms. Running this arithmetic once on paper catches the most common I/J sign and magnitude errors before the controller does.

Reading a Cycle Time Estimate on an Arc

When you estimate cycle time by hand, use the arc length L, not the chord. For a 90° corner round of radius 10 mm the arc length is 2π×10×90/360 = 15.71 mm, while the chord between tangent points is 14.14 mm. The difference is about 10 percent; on a long contour with many radii this accumulates. At F = 300 mm/min the corner takes 15.71/300 = 0.052 min, not 14.14/300. This does not change the program, but it does change how well you predict how long the part will run.

Example

Full circle: start at (25,0), center at (0,0). I = 0 − 25 = −25. J = 0. G03 counterclockwise. R cannot do a full circle (start = end); you must use I/J.

G01 X25. Y0 F300.
G03 I-25. J0  (full circle, ends back at start)

Short 90° arc example: start S=(0,0), center C=(0,20), end E=(20,20). Start vector from C = (0,−20) at 270°. End vector = (20,0) at 0°. Going 270° → 360°/0° counterclockwise (increasing angle) is a 90° arc = G03. Arc length L = 2πr×θ/360 = 2π×20×90/360 = 31.416 mm. G02 would take the long 270° way around: 2π×20×270/360 = 94.248 mm.

X Y C(0,20) S(0,0) E(20,20) G03 90° L = 31.416 mm
Short 90° arc S(0,0) → E(20,20) around C(0,20), r=20. G03 counterclockwise. Length = 2π×20×90/360 = 31.416 mm.

Common Mistakes

Practice

1. Start S=(0,0), center C=(30,0), end E=(30,30). G02 or G03?

Ans

G02. Start vector from C = (−30,0) at 180°. End vector = (0,30) at 90°. Angle decreases 180° → 90° = clockwise = G02. Short 90° arc length L = 2π×30×90/360 = 47.124 mm. (G03 would take the 270° long way around: 2π×30×270/360 = 141.372 mm.)

2. Start (25,0), center (0,0). What is I?

Ans

I = Cx − Sx = 0 − 25 = −25.

3. R positive vs negative?

Ans

R+ = arc ≤ 180° (short arc, including semicircle). R− = arc > 180° (long arc).

When verifying arcs on the controller's graphics, compare the displayed center, start point, and end point against your hand sketch before running feed.

Sources