G02 and G03: Clockwise and Counter-Clockwise Arcs

G02 cuts a clockwise arc and G03 a counter-clockwise arc, at the feed rate. You give the end point and either the arc's center (I, J, K) or its radius (R).

G02 and G03 cut a circular arc from the tool's current position to the end point in the X, Y and Z words, at the feed rate in F.

  • G02 goes clockwise.
  • G03 goes counter-clockwise.

Direction is judged looking from the positive end of the axis perpendicular to the active plane. In the default XY plane (G17), that means looking down at the table from above.

Like G01, both are modal and need a feed rate.

Two ways to define the arc

Every arc needs an end point and something that pins down the circle it lies on. There are two ways to give that:

I, J, K (center) R (radius)
What it gives The arc's center, as an offset from the start point The arc's radius
Full circles Yes No
Arcs over 180° Yes Use a negative R on most controls
Typical source CAM output Hand-written programs

I, J and K are the distances from the start point to the center along X, Y and Z. In the XY plane you use I and J; in G18 you use I and K; in G19, J and K.

R is the radius. Between two points there are always two arcs of the same radius, a short one and a long one. A positive R picks the arc of 180 degrees or less, and a negative R the longer one.

Arc center modes: G90.1 and G91.1

By default, I, J and K are incremental from the start point, even when the program is in G90 absolute mode. This is called G91.1. Some controls, including LinuxCNC and Mach3, also accept G90.1, which makes I, J and K absolute positions instead. Fanuc-style controls always treat I, J and K as incremental. A program written for one mode and run in the other draws arcs around the wrong center, so check which one your CAM post processor uses.

Example: a full circle and an S curve

The program cuts a full circle with I and J, then an S shape from two R arcs: a G2 that bulges left and a G3 that bulges right.

(G02 and G03 example: a full circle with I and J, then two R arcs)
G21 G17 G90 G54
T1 M6 (3 mm flat end mill)
S15000 M3
G0 Z10
(Full circle: start and end at X30 Y20, center 15 mm to the left)
G0 X30 Y20
G0 Z2
G1 Z-1 F150
G2 X30 Y20 I-15 J0 F500
G0 Z10
(Two R arcs make an S shape: G2 curves right, G3 curves left)
G0 X60 Y0
G0 Z2
G1 Z-1 F150
G2 X60 Y20 R10 F500
G3 X60 Y40 R10
G0 Z10
M5
M30
Open this example in CutViewer

Open it in CutViewer and use the Top view to see which way each arc turns.

Line by line:

  • G2 X30 Y20 I-15 J0 F500 starts and ends at X30 Y20. The center is 15 mm to the left of the start, at X15 Y20, so this is a full clockwise circle of radius 15.
  • G2 X60 Y20 R10 F500 cuts a half circle clockwise from X60 Y0 up to X60 Y20, bulging toward X50.
  • G3 X60 Y40 R10 cuts the next half circle counter-clockwise, bulging toward X70. The feed rate carries over.

Helical arcs

If an arc in the XY plane also has a Z word that differs from the start, the tool moves down (or up) while it goes around. This helical interpolation is how CAM programs ramp into pockets and cut threads with a thread mill.

How CutViewer shows G02 and G03

CutViewer draws arcs defined by I, J and K or by R, in the XY, XZ and YZ planes, and honors G90.1 and G91.1. A negative R draws the arc that's longer than 180 degrees. The pre-flight checks flag arcs that don't close, where the start and end points aren't the same distance from the center.

Frequently Asked Questions

What is the difference between G02 and G03?

Both cut an arc at the feed rate. G02 moves clockwise and G03 moves counter-clockwise, viewed from the positive end of the axis perpendicular to the active plane. In the usual XY plane (G17), that means looking down from above.

Should I use I and J or R for arcs?

I, J and K give the center exactly and work for any arc, including full circles. R is shorter to write but can't make a full circle, and for arcs over 180 degrees most controls need a negative R. CAM programs usually output I, J and K.

Are I, J and K absolute or incremental?

By default they're incremental, measured from the arc's start point to its center, even in G90 absolute mode. Some controls, such as LinuxCNC and Mach3, also have G90.1 to treat them as absolute positions. Fanuc-style controls always treat them as incremental.

How do I cut a full circle in G-code?

Use G02 or G03 with the end point the same as the start point, and I and J giving the center. For example, from X30 Y20, G2 X30 Y20 I-15 J0 cuts a full circle of radius 15 around X15 Y20. R can't be used for a full circle.

Why does my control alarm on an arc?

Usually because the distance from the center to the start point and from the center to the end point don't match, so the arc doesn't close. That often comes from rounding in the I, J or K values, or from the wrong arc center mode.

Check your own program before you cut: open it in CutViewer to see the toolpath in 3D, the run time and any problems.

Open CutViewer