G15 CNC Code | Polar Coordinate Cancellation

G15 on CNC Lathes and Mills: Polar Coordinate Cancellation and Coordinate System Management

The G15 G-code is often associated with coordinate system manipulation in CNC programming. However, its function is not universal across all control systems. While some online resources might suggest it’s used for selecting a “secondary coordinate system,” this is generally incorrect for modern CNC lathes and mills. Instead, G15 is most commonly used to cancel polar coordinate mode, a feature primarily found on machining centers and lathes with live tooling.

This article will:

  • Clarify the most common function of G15: Polar Coordinate Cancellation.
  • Explain the correct way to manage multiple coordinate systems (using work offsets).
  • Provide examples for both CNC lathes and machining centers.
  • Briefly discuss control-specific variations (Fanuc, Siemens, Haas, Mazak, and Mitsubishi).
  • Offer troubleshooting and best practices.

Crucial Note: Always consult the programming manuals for your specific CNC control system and machine tool. Never assume a G-code’s function without verification.

1. Polar Coordinate Mode and G15 (The Most Common Use)

On many CNC control systems, especially Fanuc and those that are Fanuc-compatible, G15 is used to cancel polar coordinate mode. This mode is typically enabled by G16.

  • G16 (Polar Coordinate Mode On): This command tells the control to interpret subsequent coordinate values as polar coordinates (radius and angle) instead of Cartesian coordinates (X, Y, Z).
  • G15 (Polar Coordinate Mode Off): This command cancels polar coordinate mode and returns the control to standard Cartesian coordinate programming.

Why Use Polar Coordinates?

  • Simplified Programming for Circular Features: Things like bolt hole circles, radial slots, and features on the face of a turned part are often easier to program using polar coordinates.
  • Engraving:

Example (Fanuc Mill - Bolt Hole Circle):

O0001 (Bolt Hole Circle - Polar)
G21 G17 G90 ; Metric, XY plane, Absolute
T01 M06 ; Select tool
G00 G54 X50.0 Y50.0 Z10.0 ; Rapid to center of circle (using G54)
S2000 M03 ; Spindle on

G16 ; Enter Polar Coordinate Mode  <-- IMPORTANT

; Drill 6 holes around a circle with radius 25mm
G81 Z-5.0 R2.0 F100 ; Drilling canned cycle
X25.0 Y0.0  ; First hole (radius 25, angle 0)
Y60.0   ; Second hole (radius 25, angle 60)
Y120.0  ; Third hole
Y180.0  ; Fourth hole
Y240.0  ; Fifth hole
Y300.0  ; Sixth hole
G80 ; Cancel drilling cycle

G15 ; Cancel Polar Coordinate Mode  <-- ESSENTIAL!

G00 Z10.0 ; Rapid retract
M30 ; Program end
%

Key Points about Polar Coordinate Mode:

  • Plane Selection (G17, G18, G19): The active plane determines which axes are used for radius and angle. G17 (XY plane) is most common for milling. On lathes, check your manual.
  • Absolute vs. Incremental Angle (G90/G91): The angle can be programmed in absolute (G90) or incremental (G91) mode. The radius is almost always absolute from the defined origin.
  • Origin: The origin (pole) for polar coordinates is usually the current work offset (e.g., G54).
  • G15 is Essential: Always cancel polar coordinate mode with G15 when you’re finished using it. Failing to do so will lead to misinterpretation of subsequent coordinate values.

2. Coordinate System Management: Work Offsets (G54-G59, G10)

The articles you provided seem to confuse G14/G15 with the concept of selecting different work offsets. Work offsets are the standard and correct way to manage multiple part zero locations.

  • G54 - G59: These are the standard G-codes for selecting the first six work offsets. Each work offset stores the distance and direction from the machine’s home position to the part’s zero point.
  • Extended Work Offsets: Many controls offer extended work offsets (e.g., G54.1 P1, G54.1 P2, etc.).
  • G10: Used to programmatically set work offset values (and other data) within your part program.

You do not need (and should not use) a hypothetical G14/G15 pair for selecting work offsets.

Example (Switching Between Work Offsets - Lathe or Mill):

; Part 1 (using G54)
G54 ; Select work offset #1
; ... machining operations for Part 1 ...

; Part 2 (using G55)
G55 ; Select work offset #2
; ... machining operations for Part 2 ...

M30; Program End

3. G15 on Specific Control Systems

Now, let’s break down the likely function of G15 on different control systems:

  • Fanuc (Lathes and Mills): G15 is most commonly used to cancel polar coordinate mode (G16). This is consistent across many Fanuc controls.
  • Siemens (Lathes and Mills): Siemens controls do not typically use G15 in the same way as Fanuc. Siemens has different commands for polar programming and coordinate transformations.
  • Haas (Lathes and Mills): Haas controls may use G15 for polar coordinate cancel, similar to Fanuc, but always check the Haas manual. They may use different codes.
  • Mazak:
    • Mazatrol: Mazatrol uses a conversational programming interface. Polar coordinate cancellation, if needed, would be handled within that interface, not with a G15 G-code.
    • EIA/ISO: The function of G15 (if any) would be specific to the Mazak control and machine model. Consult the documentation.
  • Mitsubishi:
    • MELDAS: The function of G15 is control-series specific. It is best to avoid using, unless documentation confirms.
  • Other Controls: Always consult your documentation.

4. CNC Lathe Applications and Examples (with Correct G-Codes)

This section focuses on lathe operations, using the correct G-codes for the described tasks.

  • Standard Circular Interpolation: Use G02 (clockwise) and G03 (counterclockwise).
G00 X20.0 Z5.0 ; Rapid to start
G01 Z0.0 F0.1 ; Feed to surface
G03 X40.0 Z-20.0 R15.0 F0.08 ; Counterclockwise arc
G01 X50.0 ; Continue
  • Polar Coordinate Interpolation (Fanuc, with live tooling): Use G16 to enter polar mode, and G15 to cancel. This is for milling operations on the face of the part.
; Milling a slot on the *face* of a turned part.
G28 U0 W0; Home
T0101 M06 ; Select milling tool
G97 S2000 M03 ; Spindle on (constant RPM)
G00 X0 Z0.1 C0 ; Rapid to a safe position
G16 ; Enter polar coordinate interpolation mode
G01 X1.0 C45.0 F5.0 ; Mill the slot (X = radius, C = angle)
G00 Z0.1 ; Rapid retract
G15 ; Cancel polar coordinate interpolation mode  <-- ESSENTIAL
G28 U0 W0; Home
M30 ; Program end
  • Cylindrical Interpolation (Lathe with Live Tooling): Use G07.1 (on some Fanucs), TRANSMIT/TRACYL (Siemens), or the appropriate code for your control. This is for milling on the circumference.
  • Switching Between Work Offsets: Use G54 - G59

5. CNC Machining Center Applications and Examples (with Correct G-Codes)

  • Standard Circular Interpolation: Use G02 (clockwise) and G03 (counterclockwise).
G00 X0 Y0 Z0.1 ; Rapid to start
G01 Z-0.25 F100 ; Feed to depth
G02 X20.0 Y10.0 R10.0 F50 ; Clockwise arc
  • Polar Coordinate Interpolation (Milling):
O0001 (Bolt Hole Circle - Polar);
G21 G17 G90; Metric, XY Plane, Absolute
T01 M06; Select Tool
G00 G54 X50.0 Y50.0 Z10.0; Rapid to Center
S2000 M03; Spindle on
G16; Enter Polar Coordinate Mode
; Drill 6 holes around a circle with radius 25mm
G81 Z-5.0 R2.0 F100; Drilling canned cycle
X25.0 Y0.0 ; First hole (radius 25, angle 0)
Y60.0  ; Second hole (radius 25, angle 60)
Y120.0 ; Third hole
Y180.0 ; Fourth hole
Y240.0 ; Fifth hole
Y300.0 ; Sixth hole
G80 ; Cancel drilling cycle
G15 ; Cancel Polar Coordinate Mode <-- ESSENTIAL!
G00 Z10.0; Rapid retract
G28 G91 Z0;
M30;
%
  • Circular Pocket Milling (Fanuc Mills): Use G12 (clockwise) and G13 (counterclockwise) with cutter compensation.
O0001 (Circular Pocket with G12 - Mill)
G21 G17 G90 ; Metric, XY plane, Absolute mode
T01 M06 ; Tool change (e.g., 10mm end mill)
G00 X50.0 Y50.0 Z10.0 ; Rapid to center of pocket location
S2000 M03 ; Spindle on
G42 D01 ; Cutter compensation RIGHT
G01 Z-5.0 F100 ; Feed down to cutting depth
G12 I25.0 D01 F150 ; Mill circular pocket (radius 25mm) - CLOCKWISE
G40 ; Cancel cutter compensation
G00 Z10.0 ; Rapid retract
G28 G91 Z0;
M30 ; Program end
  • Switching Between Work Offsets: Use G54 - G59 (or extended work offsets).

6. Troubleshooting

  • Unexpected Movements:
    • Incorrect work offset selected (G54-G59).
    • Incorrect offset values (check manual entry or G10 usage).
    • Forgetting to cancel polar coordinate mode (G15 after G16).
  • Circular Interpolation Errors (G02/G03):
    • Incorrect endpoint coordinates.
    • Incorrect radius (R) or center point offsets (I, J, K).
  • Circular Pocket Errors (G12/G13 - Fanuc Mills):
    • Cutter compensation not used or used incorrectly (G41/G42, D value).
    • Tool not positioned at the pocket center before the G12/G13 command.

7. Frequently Asked Questions (FAQ)

  • Q: What is G15 used for on most CNC machines?
    • A: On many Fanuc controls (and some others), G15 cancels polar coordinate mode (G16). On other controls, it might have a different function or no function at all.
  • Q: How do I switch between different part zero locations?
    • A: Use work offsets (G54-G59 or extended work offsets).
  • Q: How do I program a circular arc?
    • A: Use G02 (clockwise) or G03 (counterclockwise).
  • Q: How do a create a circular pocket?
    • A: On a Fanuc Mill, you can use G12/G13. Otherwise, use CAM software, or check for canned cycles.
  • Q: Where can I find the correct information about G-codes for my machine?
    • A: In the programming manual for your specific CNC control system and machine tool.

8. Conclusion

G15 is not a standard G-code for selecting coordinate systems on modern CNC lathes or mills. Its most common function, especially on Fanuc controls, is to cancel polar coordinate mode (G16). To manage multiple part zero locations, use the standard work offset commands (G54-G59). For complex geometries, and often even for simpler tasks like circular pocketing or polar/cylindrical interpolation, CAM software is the recommended approach. Always consult your machine’s documentation for the definitive guide to its G-code implementation.