Skip to content

G16 and G15: programming with radius and angle

G16 turns on polar coordinate programming and G15 cancels it. With G16 active, the two letters of the plane stop being Cartesian coordinates: in the XY plane, X becomes the radius from the pole and Y the angle, measured from the positive X axis and increasing counterclockwise. It is the natural way to write anything laid out on a circle, from a bolt circle to the slots in a flange, because the print already gives you the data that way and there is not a single sine to calculate.

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.

The brands and control names mentioned belong to their owners and are used only to identify the equipment. GetGCode is not affiliated with or endorsed by any manufacturer, ISO or ASME: this is our own content, not official documentation. Legal notice.

Family
Coordinates
Machine
Milling, Mill-turn
Risk
Medium
Example
G16 X50 Y45 / G15

Syntax by control

Fanuc (milling)
G17 G90 G16 / G81 X60. Y45. Z-15. R3. F200 / G15
With G17 active, the first letter of the plane is the radius and the second the angle. The plane has to be declared first: in G18 or G19 the letters that act as radius and angle change.
Haas (milling)
G70 I... J... L... (bolt circle) / precomputed X Y
Haas NGC has no G15/G16 in its G code list. For a bolt circle use its own G70 cycle (see Haas G70/G71/G72 mill) or write the X/Y coordinates already calculated. On a Haas lathe, G15 is a different function for the secondary spindle.
Siemens 840D / 828D
G111 X50 Y50 / G1 RP=60 AP=45
Siemens does not use G16: it defines the pole with G110, G111 or G112 depending on whether it is relative to the last point, the current origin or the last pole, and then programs with RP= for the radius and AP= for the angle.
Heidenhain TNC (Klartext)
CC X+50 Y+50 / LP PR+60 PA+45 R0 FMAX
In Klartext the pole is declared with CC and polar moves carry a P in front: LP for lines and CP for arcs, with PR as the radius and PA as the angle.

Address letters used with it

LetterWhat it setsUnit
X (in G17)Radius from the pole, not a dimension on the X axis. It is the distance from the pole to the point you want to reach.mm / in
Y (in G17)Angle measured from the positive X axis, increasing counterclockwise. Most controls accept negative values and values above 360 degrees.degrees
ZThe third axis stays Cartesian and is not affected by polar mode. It can be written in the same block with no problem.mm / in
G90 / G91They decide where the pole is. With G90 the pole is the active part zero; with G91 the pole is the current tool position. It is the part of polar mode that causes the most confusion.modal, no units
G17 / G18 / G19Plane the radius and angle apply in. It determines which two letters change meaning and which axis the angle is measured from.modal, no units

Worked example

Six Ø10 holes on a 120 mm diameter circle, with the first one at 30 degrees. This is the case where polar mode shines: the print gives a radius and angles, and with G16 you write them as they are. The pole is part zero, which here coincides with the center of the circle; if it did not, the normal thing is to shift the origin with G52 or use another work offset so that it does.

O0116 (SEIS AGUJEROS EN POLAR)
( Program header. )
G21 G17 G40 G49 G80
( Millimeters, XY plane and a clean state. The plane matters: it decides which letters will be radius and angle. )
G91 G28 Z0.
( Z to the reference point before the change. )
T8 M06
( Ø10 drill. )
G90 G54 G00 X0. Y0.
( Still in Cartesian: positions over the center of the circle, which is part zero and will be the pole. )
G43 H08 Z50. M03 S2200
( T8 length and spindle on. )
M08
( Coolant. )
G16
( Turns on polar mode. From here on, X is radius and Y is angle. Since we are in G90, the pole is part zero. )
G99 G81 X60. Y30. Z-18. R3. F200
( First hole: radius 60, in other words the Ø120 circle, and an angle of 30 degrees. Z and R stay Cartesian and do not change meaning. )
Y90.
( Second hole. Only the angle changes: the radius is modal and stays at 60. )
Y150.
( Third hole. )
Y210.
( Fourth hole. )
Y270.
( Fifth hole. )
Y330.
( Sixth hole. Six blocks of one letter each, against six pairs of coordinates worked out with sine and cosine. )
G80 G15
( Cancels the cycle and leaves polar mode. Leaving G16 active is the classic mistake: the next positioning move would be read as radius and angle. )
G00 Z50. M09
( Moves up and turns the coolant off, back in Cartesian now. )
G91 G28 Z0. M05
( Z to the reference point and spindle stopped. )
G90 M30
( Back to absolute and end. )
Open the simulator to check the example

Practical keys to using G15/G16 in the workshop

Where the pole is: the G90 and G91 trap

Polar mode needs a point to measure the radius from, and that point depends on absolute or incremental mode. With G90 the pole is the active part zero, so radii are measured from the G54 origin or whichever origin is selected. With G91 the pole is the current tool position, which turns each block into a polar jump from wherever the tool is. Both are useful, but mixing them by accident gives toolpaths that are impossible to make sense of. If the center of the circle does not coincide with part zero, the cleanest fix is to shift the origin so that it does.

What you can and cannot write in polar

Rapids, straight lines and canned cycles all work in polar mode, and canned cycles are where you get the most out of it. Arcs are another story: G02 and G03 need a center given with I, J or with R, and how they combine with polar mode depends on the control, so a lot of people leave polar for the arcs and go back in afterward. Tool radius compensation does work, but it is best to turn it on and cancel it outside polar mode so the approach moves are easy to read. Before mixing polar with arcs or compensation, do a dry run.

The modal that stays on

G16 is modal and does not cancel itself: it stays active until a G15 appears, until the control is reset or until the program ends, depending on how the machine is configured. A forgotten G16 makes the next Cartesian positioning move read as radius and angle, and a block like G00 X150. Y80. turns into a point 150 mm from the pole, rotated 80 degrees, which can land anywhere. The safe habit is to write G15 in the same block that cancels the canned cycle, as in the example, and never to carry polar mode across a tool change.

Mistakes that cost you a part (or a tool)

  • Leaving G16 active when you finish the circular pattern: the next positioning move is read as radius and angle and the tool ends up at an unpredictable point.
  • Not checking the active plane: in G18 or G19 the letters that act as radius and angle are different, and the pattern ends up on the wrong face.
  • Mixing G91 with polar mode without realizing that the pole becomes the current position: each block is measured from the one before.
  • Programming the circle with the pole in one place and the center of the circle in another: the whole pattern comes out shifted consistently, which is the worst way to fail because it looks correct.
  • Writing the radius as a diameter: the value the control wants is the radius, so a Ø120 bolt circle is programmed with 60.
  • Trying to write arcs with I and J inside polar mode without checking how the control behaves: the combination depends on the model.
  • Converting a G15 from an Okuma program as if it were the polar cancel: on Okuma, G15 with H selects the work offset, which is something completely different.

Frequently asked questions

Which letter is the radius and which is the angle?

In the XY plane with G17, X is the radius and Y the angle, measured from the positive X axis and increasing counterclockwise. If the active plane is G18 or G19, the letters change following the same logic of first and second axis of the plane.

Where is the center of the polar coordinates?

It depends on the mode: with G90 the pole is the active part zero and with G91 it is the current tool position. If the center of the pattern does not coincide with part zero, the easiest thing is to shift the origin with G52 or use another work offset so that it does.

Can polar mode be used with canned cycles?

Yes, and it is its best application: you turn on G16, write the cycle with radius and angle, and the following blocks change only the angle. The cycle's Z and R stay Cartesian and are not affected by polar mode.

How do you do polar coordinates on Siemens?

With a different mechanism: first you declare the pole with G110, G111 or G112 depending on the reference you want, and then you write the moves with RP= for the radius and AP= for the angle. There is no G16 in the Fanuc sense.

What happens if I forget to write G15?

Polar mode stays active and all later moves are read as radius and angle. It is a failure that can send the tool a long way from the expected point, so it is best to cancel it in the same block that closes the pattern.

Related codes

G17/G18/G19G90/G91G52/G92G81Okuma G15 H

Other codes in Coordinates

See the full list of G and M codes

Related apps