G-codeMotionModal group 1Mill · Lathe · 3D printer
G02 & G03: Cutting Arcs and Full Circles
G02 feeds the tool round a clockwise arc, G03 round an anticlockwise one, both of them in the two axes the active plane names. You hand the control an end point and then say where the centre is, either as I, J and K, the signed distance from the start point out to the centre, or as a radius word that lets the control work the centre out for itself. Clockwise is decided looking back down the axis the plane leaves out, so in G17 you are looking at the table from above. Add a move on that third axis and the same block cuts a helix instead of a flat arc.
Syntax
G02 X__ Y__ I__ J__ F__ Clockwise arc, centre as an offset from the start point
G03 X__ Y__ I__ J__ F__ Anticlockwise arc, same centre form
G02 X__ Y__ R__ F__ Clockwise arc, centre worked out from the radius
G03 I__ J__ F__ Full circle: no end point, centre form only
G03 X__ Y__ I__ J__ Z__ F__ Helix: the arc in the plane, a feed move on the third axis
Both codes are modal and both sit in group 01 with G00 and G01, so the next rapid or straight feed ends the arc mode.
Parameters
| Address | Meaning | Notes |
|---|---|---|
X Y Z | Arc end point | Read in whichever of G90 or G91 is live. Leave them off a centre-form block and the arc closes on itself as a full circle |
I J K | Signed distance from the start point to the arc centre | The plane picks the pair: I and J in G17, I and K in G18, J and K in G19. On a Fanuc they stay incremental whatever G90 or G91 is doing |
R | Radius, instead of naming the centre | Positive takes the arc of 180 degrees or less, negative takes the long way round. No full circles, and the centre is least accurate at a half circle |
F | Feed | Modal. On a helix a Fanuc holds it along the arc rather than along the helical path, under bit 5 of parameter 1403 |
Example
O0023 (CLAMP PLATE 120 X 80 X 8 6082, FROM A 130 X 90 SAWN BLANK)
G21 G17 G40 G49 G80 G90 (safe start. G17 puts the arcs in XY and reads I and J)
T06 M06 (10mm 3 flute carbide end mill, 25mm flute length)
G54 (X0 Y0 on the finished bottom left corner, Z0 on the top face)
S9500 M03 (298m/min)
G00 X55. Y40. (5mm off the bore centre at X60. Y40., so the helix clears its own middle)
G43 H06 Z25. M08 (length on well clear of the vice, flood coolant)
G00 Z1.
G01 Z0. F400 (touch the top face, ready to ramp)
G03 I5. Z-2. F700 (full circle, no end point. Centre 5mm along X, down 2mm a turn)
G03 I5. Z-4.
G03 I5. Z-6.
G03 I5. Z-8.5 (0.5mm past the 8mm plate, into the sacrificial sub-plate)
G03 I5. (one flat turn to size the 20mm bore wall)
G01 X60. Y40. F1200 (off the wall before the rapid, no witness mark)
G00 Z25.
G00 X108. Y-20. (clear of the blank, lined up on the profile lead in)
G01 Z-8.5 F400 (plunge in fresh air)
G01 Y-5. F900 (on to the tool centre path, 5mm outside the finished edge)
G01 X12. (bottom edge, travelling minus X: climb with the spindle clockwise)
G02 X-5. Y12. I0 J17. (R12 corner. Tool centre radius 17, centre 17mm up from the start point)
G01 Y68. (left edge)
G02 X12. Y85. I17. J0
G01 X108. (top edge)
G02 X125. Y68. I0 J-17.
G01 Y12. (right edge)
G02 X108. Y-5. I-17. J0 (fourth corner, back on the point the profile started from)
G03 X98. Y-15. R10. (tangential lead out, 90 degrees. R is unambiguous this far under 180)
G00 Z25. M09
G49
G91 G28 Z0. (home Z)
M30Controller differences
| Control | Behaviour |
|---|---|
| Fanuc | Write R and the centre words in the same block and R wins: I, J and K are read and thrown away, so the arc that runs is not the one you checked. The two radii the control works out, one from the start point and one from the end point, have to agree within parameter 3410 or the program stops with PS0020, over tolerance of radius. Bit 5 of parameter 1403 decides whether the F word on a helix means the feed round the arc or the feed along the path the linear axis is part of. |
| Haas | Three separate alarms instead of one, and each states its tolerance: 302 for an R smaller than half the distance from start to end, 304 for a centre whose start and end radii differ, 338 for an end point that does not sit on the arc, all to 0.010mm in metric and 0.001in in inch mode. On a helix the axis speeds are scaled so the programmed feed is held along the helical path, which is the opposite of a Fanuc at its default setting. |
| Siemens 840D | A different vocabulary in the native language. The centre words are incremental from the start point as on a Fanuc, and I=AC(...) gives the centre absolutely from the workpiece zero for that block alone. The radius is CR=, signed the same way as R and no good for a full circle; AR= replaces the end point with an opening angle; TURN= adds 0 to 999 whole circles to make a helix out of one block; CIP cuts an arc through an intermediate point written as I1=, J1=, K1=, which is the only form that handles an arc tilted in space; CT picks the arc up tangentially from the block before it. ISO dialect mode reads I, J, K and R as written. |
| Mazak | An EIA/ISO program behaves as on a Fanuc. A Mazatrol conversational program has no arc block at all: the line and arc shapes belong to the unit, and the control works out the direction from the order of the points. |
| Okuma | The radius word on an OSP lathe is L, not R. A block holding an L and no I or K is read as a radius command; put an L and an I or a K in the same block and it alarms, as does a target further from the start point than twice the radius. L takes the arc of 180 degrees or less, and CALRG in the same block asks for the bigger one. The mill manuals use R, with the sign choosing the arc, so the same geometry is written two ways across one shop. |
| Grbl | Arc distance mode is incremental only. G91.1 is in the v1.1 supported list and G90.1 is not, so an arc posted with absolute I and J centres stops the stream. Arcs are cut as a chain of straight segments, and setting $12, the arc tolerance, is the biggest gap allowed between a segment and the true circle, 0.002mm by default. Four errors land here: error:32 no axis word in the active plane, error:33 the arc cannot be generated, error:34 the radius form failed its geometry, error:35 the centre form has no I, J or K in the active plane. |
| Marlin | G2 and G3 exist only with ARC_SUPPORT compiled in, and the P word, which adds whole circles, needs ARC_P_CIRCLES on top. Mixing R with I or J is rejected, and so is an R form with no X and no Y. The dangerous one is the opposite: the end point of an I and J arc is not checked, the arc simply stops where the destination's angle lands, so a wrong end point bends the path and nothing is reported. Arcs are broken into straight segments of MM_PER_ARC_SEGMENT, 1mm by default, and the feed is held along the helical path. |
What goes wrong
The block that stops the machine most often is an arc whose two radii disagree. The control works one out from the start point and one from the end point, and a Fanuc stops with PS0020 when the difference is bigger than parameter 3410, a Haas with alarm 304, which states the limit as 0.010mm. The geometry is rarely the problem. It is a post writing three decimal places on an end point that needs four. Fix the post output, not the parameter.
Second is a positive R on an arc that goes the long way round. Positive asks for the arc of 180 degrees or less, so a 220 degree corner posted as R12 cuts the 140 degree arc on the other side of the centre. Nothing alarms. The tool leaves the profile, crosses the part and rejoins it, and the first you know is the measurement. Negative R past a half circle, or I and J and no thinking about it.
Third is a full circle with an R word in it. Start and end are the same point, so every radius in the world fits and the control has nothing to solve. The centre form with no end point is the only way to close a circle: G03 I5. and the tool comes back to where it started.
Fourth, R and the centre words in one block. A Fanuc keeps R and discards I and J, so the arc you proved on paper against the centre is not the arc the machine cuts.
Last, the hobby controls fail in opposite directions. Grbl stops the stream on error:34 rather than guess. Marlin does not check the end point at all and cuts something close to the arc you asked for.
Updated 9 Oct 2026