Lesson 4: Arcs G02 and G03
Updated
G02 is a clockwise arc and G03 a counter-clockwise arc, viewed from the positive end of the axis perpendicular to the plane (from +Z in G17). An arc is defined by its end point and either radius R (negative R for arcs over 180°) or centre I, J, K, which Fanuc controls read as incremental from the start point; a full circle can only be programmed with I and J.
In this lesson you will learn:
- how to determine arc direction G02 and G03;
- how to program an arc with radius R and the limits of that format;
- how to calculate the arc centre I, J, K;
- how to mill a full circle;
- what the G18 and G19 planes are for.
Direction: G02 and G03
G02 is circular interpolation clockwise, G03 counter-clockwise. Direction is judged looking from the positive end of the axis perpendicular to the plane towards its negative end. In G17 you look from above (from +Z), the way the operator sees the plate. Both codes are modal and belong to the same group as G00 and G01, so after an arc a straight line needs G01 again.
| Plane | Axes | Viewed from | Centre addresses |
|---|---|---|---|
| G17 | X, Y | +Z | I, J |
| G18 | Z, X | +Y | I, K |
| G19 | Y, Z | +X | J, K |
Arc block with R
Format: G02/G03 X_ Y_ R_ F_. X and Y are the end point (in G90, from the zero), R is the radius. Through two points, two arcs of a given radius are possible: the short one and the long one. Fanuc rule: positive R – arc up to 180°, negative R – arc over 180°. A full circle cannot be programmed with R: when start equals end, Fanuc reads a 0° arc and the tool does not move. For arcs close to 180°, I and J are safer because the centre position calculated from R becomes sensitive to rounding.
Arc block with I, J, K
I, J and K are the distances from the start point to the arc centre in X, Y and Z: I = X centre − X start, J = Y centre − Y start. On Fanuc controls these values are incremental by default, even in G90 (some controls can switch to absolute centre by parameter – check the manual). Zero values may be omitted. If the start and end distances to the centre differ by more than a parameter allows, the control raises an alarm – a useful error check.
Example: rectangle with R10 corners
We use the same 80 × 40 mm centre-line rectangle as in Lesson 3 (X10–X90, Y10–Y50), with the corners rounded to R10. The contour runs counter-clockwise, so every arc is G03. Arc centres: X80 Y20, X80 Y40, X20 Y40, X20 Y20.
%
O1004 (LESSON 4 - CONTOUR R10)
N10 G21 G17 G40 G49 G80 G90
N20 T1 M06 (END MILL D10 3FL)
N30 G54 G00 X20.0 Y10.0 S6000 M03
N40 G43 H1 Z50.0 M08
N50 Z5.0
N60 G01 Z-1.0 F300
N70 X80.0 F1200
N80 G03 X90.0 Y20.0 R10.0
N90 G01 Y40.0
N100 G03 X80.0 Y50.0 R10.0
N110 G01 X20.0
N120 G03 X10.0 Y40.0 R10.0
N130 G01 Y20.0
N140 G03 X20.0 Y10.0 R10.0
N150 G00 Z5.0
N160 Z50.0 M09
N170 G91 G28 Z0
N180 G90
N190 M05
N200 M30
%
| Block | Start | End | Centre | I, J |
|---|---|---|---|---|
| N80 | X80 Y10 | X90 Y20 | X80 Y20 | I0 J10.0 |
| N100 | X90 Y40 | X80 Y50 | X80 Y40 | I-10.0 J0 |
| N120 | X20 Y50 | X10 Y40 | X20 Y40 | I0 J-10.0 |
| N140 | X10 Y20 | X20 Y10 | X20 Y20 | I10.0 J0 |
The same arcs can be written with I and J, e.g. N80 G03 X90.0 Y20.0 I0 J10.0 – the centre is 10 mm above the start point X80 Y10.
Example: a full Ø30 circle
A separate example: the tool centre follows a Ø30 mm circle round the plate centre X50 Y30. We start at the right-hand point X65 Y30, so the centre is 15 mm to the left: I-15.0 J0. X and Y are omitted because the end equals the start. Since the tool centre is programmed, the result is a 10 mm wide ring groove between Ø20 and Ø40 mm. It would intersect the contour of the previous example, so do not put both in one program.
(CIRCLE D30, CENTRE X50 Y30)
G54 G00 X65.0 Y30.0
G43 H1 Z50.0
Z5.0
G01 Z-1.0 F300
G03 I-15.0 J0 F1200
G00 Z5.0
G18 and G19 in brief
In milling, G18 and G19 are used for arcs in a vertical plane, for example a radius blend with a ball nose end mill. On lathes the main plane is G18, and the visible G02/G03 direction depends on whether the turret is in front of or behind the spindle centre line (see Fanuc lathe cycles).
Exercise
The tool is at X70 Y30. Mill a quarter circle to X50 Y50 with its centre at X50 Y30. Determine the direction (G02 or G03), calculate I and J, and write the same arc with R. Extra: how do you reach the same end point along the long 270° arc?
G90 G01 X70.0 Y30.0 F1200
G0? X50.0 Y50.0 I? J?
The answer is in the FAQ.
Next lesson: Lesson 5. For a summary of the basics, see G-code basics.
Frequently asked questions
How do I tell G02 from G03?
In the G17 plane, look at the part from above (from +Z): a clockwise move is G02, a counter-clockwise move is G03.
When is R written with a minus sign?
On Fanuc controls a negative R means an arc larger than 180°. A positive R means an arc of up to 180°.
Why can a full circle not be programmed with R?
When start equals end, the radius does not define a unique centre. Fanuc reads it as a 0° arc, so full circles use I and J.
Do I and J depend on G90 and G91?
On Fanuc controls, by default no – I, J and K are always the distance from the start point to the centre. Some controls can change this by parameter.
Exercise answer
The start is to the right of the centre and the end above it, so the move is counter-clockwise: G03 X50.0 Y50.0 I-20.0 J0 (I = 50 − 70, J = 30 − 30) or G03 X50.0 Y50.0 R20.0. The long 270° arc: G02 X50.0 Y50.0 R-20.0 or G02 X50.0 Y50.0 I-20.0 J0.
Looking for someone to do this job? Find a manufacturer on the marketplace or post a request.
Services offered I need a service