We use technical and security cookies and, only if you accept, analytics with no cross-site tracking. More in the Cookie policy and Privacy policy.
We use first-party cookies and technical storage to make the site work, Google reCAPTCHA security technology and, only if you accept, Vercel analytics (no cookies, no cross-site tracking). You can accept or reject analytics; both options are equivalent and you can change your choice at any time. More info: Cookie policy, Privacy policy, Legal notice and Terms and conditions.
G02 cuts a circular arc clockwise, from wherever the tool is to the end point you program, in the active plane and at feedrate F. You give the control the center of the arc in one of two ways: with I, J and K, which are the distance from the start point to the center measured axis by axis, or with R, which is the radius. And clockwise is always judged looking from the positive side of the axis perpendicular to the plane: in G17, from +Z looking down.
For reference only: syntax changes with the control, the post-processor and the machine parameters. Check the official manual and run a simulation before cutting. Legal notice.
Family
Movement
Machine
Milling, Turning, Mill-turn
Risk
Medium
Example
G02 X20 Y0 I10 J0
G02 vs G03: which way does the arc turn?
G02
Clockwise circular interpolation in the active plane, at the programmed feed F.
I and J are incremental from the start point toward the center, even when the program is in G90. Only G90.1 changes that and makes them absolute: a mode best left alone, because an arc written for one does not work in the other.
Haas (milling)
G02X20.Y60.R20.F350
Same syntax as Fanuc. With R, the control picks the arc smaller than 180 degrees if R is positive and the larger one if it is negative. R is no good for a full circle: there you have to use I and J.
Fanuc / Haas (turning)
G02X40.Z-5.R2.F0.15
On a lathe you work in the G18 plane, so the pair of center letters is I (in X) and K (in Z). Watch out for I: it is measured in radius even though the program X values are in diameter. For small corner radii almost everyone uses R.
Siemens 840D / 828D
G2X20Y60CR=20F350
Siemens uses G2 and writes the radius as CR=. It also takes I/J for the center, AR= to give the opening angle, and polar programming. A negative CR selects the arc larger than 180 degrees, just like a negative R on Fanuc.
Heidenhain TNC (Klartext)
CCX+20Y+40/CX+20Y+60DR-
In Klartext you declare the center first with CC and then the arc with C and the direction: DR- clockwise and DR+ counterclockwise. CR lets you give the radius directly, and RND rounds the corner between two straight lines without working any point out.
Address letters used with it
Letter
What it sets
Unit
X Y Z
End point of the arc, in absolute coordinates under G90. If you write the third axis on top of the two plane coordinates, the arc stops being flat and becomes a helix.
mm / in
I J K
Distance from the start point to the center of the arc, measured axis by axis: I in X, J in Y, K in Z. They are signed and only the two of the active plane are used (I and J in G17, I and K in G18, J and K in G19); the one that is zero can be left out.
mm / in, incremental from the start point
R
Radius of the arc, an alternative to I J K. Positive for the short arc (180 degrees or less) and negative for the long one. It is no good for a full circle.
mm / in
F
Feedrate along the arc. It is modal, just like in G01, so leave it out and it is inherited from the previous block.
mm/min under G94, mm/rev under G95
G17 / G18 / G19
Plane the arc is cut in. It decides which pair of I J K is used and from which axis the clockwise direction is judged. The wrong plane is the commonest cause of an arc alarm.
modal, no units
Worked example
Finish pass around the outside profile of an 80 x 60 mm aluminum plate with a 20 mm radius in the top left corner. A 12 mm cutter with offset D01 = 6.0 mm, compensation to the left active and the path running clockwise seen from above, which with M03 is climb milling. The same arc is shown written with I J and with R so you can see the two are equivalent.
O0102(ESQUINA EN R20 CON G02)
( Program header. )
G21G17G40G49G80
( Millimeters and XY plane. Declaring the plane before an arc is not a formality: the center letters and the direction of rotation both hang off it. )
G91G28Z0.
( Z to the reference point before the change. )
T1M06
( 12 mm cutter. )
G90G54G00X-20.Y20.
( Positioning clear of the part, on the extension of the left wall. )
G43H01Z50.M03S3500
( T1 length offset and spindle on. )
G00Z-4.M08
( Drops to the depth of cut while still clear of the material. )
G01G41D01X0.Y20.F400
( Turns compensation on to the left in a 20 mm straight lead-in, well above the 6 mm cutter radius. )
G01Y40.
( Climbs the left wall X0 up to where the radius starts. The arc begins right here, at X0 Y40. )
G02X20.Y60.I20.J0.F350
( The arc. I20 and J0 say the center sits 20 mm to the right and 0 in Y from the start point, that is at X20 Y40. It ends at X20 Y60 turning clockwise seen from +Z. )
(G02 X20. Y60. R20. F350)
( The same arc written with a radius. Since it spans 90 degrees, less than 180, R is positive. Both forms give exactly the same path. )
G01X80.
( Top wall Y60 toward +X. )
G01X100.
( Leads out along the extension of the wall, already clear of the material. )
G01G40X120.
( Cancels compensation in a linear move and clear of the part. )
How you tell whether an arc is clockwise or counterclockwise
The direction is defined looking at the active plane from the positive side of the axis that is missing: in G17 from +Z downward, in G18 from +Y and in G19 from +X. In milling that matches what you see standing in front of the machine looking at the table, so hardly anyone gets G17 wrong. G18 is a different story: the normal on-screen view of an XZ plane, with X to the right and Z up, is the view from -Y, that is, the opposite one, and that is why the same arc looks like it turns the other way. On a lathe you add to that the fact that on rear turret machines positive X points to the other side.
I J K against R: when to use each one
R is short and convenient, and for corner radii and ordinary corners it is perfect. The problem shows up with big arcs: for one radius and the same two points there are two possible arcs, the short and the long one, and the only thing telling them apart is the sign of R, positive for the short one and negative for the long one. Near 180 degrees the center calculation turns unstable, because an error of a micron in the end point moves it a long way, so semicircles get written with I J K. And for a full circle R is no use at all: the end point matches the start point and defines nothing.
Helical arcs and arcs on the lathe
If you add the third axis coordinate to the arc, the control interpolates the arc in the plane while it moves that axis proportionally: that is helical interpolation, and it is what lets you open holes bigger than the cutter, thread mill, or drop into a circular pocket without plunging. The lead of the helix is how far Z drops in each full turn. On a lathe, G02 shows up mostly in corner radii and ball noses inside the G18 plane, with I and K or, more usually, with R, and always with tool nose radius compensation set up properly.
Mistakes that cost you a part (or a tool)
Writing I and J as if they were the absolute coordinates of the center: on Fanuc and Haas they are incremental from the start point, even when the program is in G90.
Programming the arc without checking the active plane: with an inherited G18 or G19, the center letters change meaning and the control either alarms or cuts the arc on the wrong face.
Using R for a full circle: since the end point matches the start point, the control cannot resolve the center and alarms.
Trusting R for a semicircle: any rounding in the end point moves the center and the arc comes out bellied or straight into an alarm.
Giving the end point with fewer decimals than the radius demands: you get the end of arc error, which is not fixed by raising the tolerance but by recalculating the center.
Mirroring a contour and leaving the arcs as G02: flipping the geometry flips the direction too, and the cutter eats the part from the wrong side.
Turning cutter compensation on or off in the arc block itself: Fanuc and Haas want it in a linear move.
Frequently Asked Questions (FAQ)
How do I know whether an arc is G02 or G03?
Look at the active plane from the positive side of the axis that does not take part. In G17, stand over the part looking down: if the arc turns the way the hands of a clock do, it is G02. If the plane is G18 or G19, that view is not the one on the screen, and that is where everybody gets it wrong.
Are I and J absolute or incremental?
On Fanuc, Haas and most ISO controls they are incremental from the start point of the arc toward the center, and they stay that way even when the program is in G90. They only change if somebody turns G90.1 on, a mode hardly anyone uses and that is best left alone.
When do I use R and when I J?
R for arcs clearly smaller than 180 degrees: it is shorter and it reads better. I and J for semicircles, for arcs over 180 degrees and always for full circles. If the arc comes out of a CAM system the post processor already picks for you, normally I J.
Can you cut a full circle with G02?
Yes, but only with I and J: you program the center and leave the end point the same as the start point, or simply do not write X and Y at all. The control then goes all the way around. With R it is impossible, because there is no way to know which circle you mean.
Why do I get an end of arc error alarm?
Because the control checks that the distance from the center to the start point and to the end point match within a very small tolerance, and they do not. The usual causes are rounding CAD coordinates, flipping the sign of an I or a J, or hand editing the end point after the arc was worked out.