G2 cuts an arc clockwise, G3 counter-clockwise, from the current
position to the endpoint given in the block. Direction is judged looking at
the active plane from the positive side — for the default XY plane (G17),
that's the view from above.
Every arc needs two things besides the endpoint: which plane it lives
in (set by G17/G18/G19), and where its center is — given either
as center offsets (I/J/K) or a radius (R).
#IJK format: center offsets
I, J, K are the distances from the start point to the arc center,
measured along X, Y, Z. On nearly every control they are incremental by
default, even in G90 absolute mode:
G17 G90 ; XY plane, absolute endpoints
G0 X10 Y0
G2 X0 Y10 I-10 J0 F400 ; quarter circle: center at (0,0), radius 10
Start (10,0), center = start + (I,J) = (0,0), end (0,10), clockwise
— a 90° arc. Add a Z word and the arc becomes a helix, the standard way
CAM ramps into a pocket:
G2 X10 Y0 I-10 J0 Z-2 ; full turn spiraling down 2 mm
A block whose endpoint equals its start point cuts a full circle in IJK
format (Mach3/4 also offer G12/G13, which treat the current position as
the center — nonstandard, avoid in portable code).
#R format: radius
G2 X0 Y10 R10 says "get there on a radius-10 arc." Shorter to write, but
ambiguous: two arcs of the same radius connect any two points — a minor
(<180°) and a major (>180°) one. Positive R picks the minor arc, negative R
the major. Full circles are impossible in R format, and near-180° arcs
amplify rounding error, which is why CAM posts overwhelmingly emit IJK.
| Operation | LinuxCNC | GRBL | Centroid | FANUC | Mach3 | Mach4 | Notes |
|---|---|---|---|---|---|---|---|
| Clockwise arc / helix | G2 |
G2 |
G2 |
G2 |
G2 |
G2 |
I/J/K center offsets or R radius, in the active plane. Add a Z move for a helix. |
| Counter-clockwise arc / helix | G3 |
G3 |
G3 |
G3 |
G3 |
G3 |
Same conventions as the CW arc, opposite direction. |
| Full-circle CW (current pos as center) | — | — | — | — | G12 |
G12 |
Mach3: partial |
| Full-circle CCW | — | — | — | — | G13 |
G13 |
Mach3: partial |
— means the control has no equivalent code. Full cross-control tables: the complete G-code & M-code reference.
#Common mistakes
- Wrong plane active. An arc programmed for XY while
G18is active either alarms or cuts a completely different curve. StateG17in the preamble; the plane matters even if you never cut in ZX or YZ. - Absolute vs incremental centers. LinuxCNC, Mach and Centroid support
G90.1(absolute IJK). A program posted for absolute centers, run on a control expecting incremental ones, produces radius errors or wild arcs. If arcs look insane in simulation, this is the first suspect. - Trusting R near 180°. Tiny endpoint rounding flips which arc R selects or fails the radius check. Use IJK for anything close to a half circle.
- Feeding arcs like lines.
G2/G3are feed moves — they need an activeF, and on inside corners the effective tool-edge feed is higher than the programmed centerline feed. That's a machining detail, but it starts in the G-code.