Printed from Kezuriba (kezuriba.net/en/nc/g12.1-g13.1/)
G12.1–G13.1
Machining center, LatheModalPolar coordinate interpolation (ON with G12.1, OFF with G13.1)
Format and notes
G12.1 ; (on a line of its own. The C position at this moment becomes 0°) G01 G42 X_ C_ F_ ; (C is written as a length, as a virtual Y axis) … G40 … ; G13.1 ; (on a line of its own)
- Lets you write the motion of a linear axis (X) and a rotary axis (C) in virtual Cartesian coordinates (X and Y) on the end face. Used on a lathe with a rotating tool to cut flats (across-flats), hexagons and keyways on the end face
- Why it is useful: when X and C move together, 1° of C is a longer distance the farther you are from the center, so the combined feed rate changes with position. With polar coordinate interpolation, the NC does this conversion, so you can write F in Cartesian coordinates as is. Previously the program was broken into many small blocks and the feed was calculated by hand (this is cited as the problem in a Hitachi Seiki patent)
- Return the C axis to its origin first. The C position at the moment G12.1 is commanded is treated as 0° (Siemens ISO dialect)
- Write G12.1 and G13.1 each on a line of its own, with no other commands. A reset also cancels it (Siemens ISO dialect)
- Turn on tool radius compensation (G41, G42) after G12.1 and cancel it before G13.1
- The plane specification (G17, etc.), whether X is written as a diameter or a radius, and the name of the virtual axis differ by model (in the Siemens ISO dialect for milling, G12.1 cancels the previous plane specification). The format above is only a skeleton, so always check the operator's manual
- Watch out for mixed-up numbers: G12 and G13 without a decimal point are circular pocket milling on Haas machining centers. In Mitsubishi Electric lathe G-code lists 2–5, G12.1 and G13.1 themselves are a different function (milling interpolation)
Diagram: polar coordinate interpolation: programming the end face in X–Y coordinates
Differences between controls and machines
The same code can be written or assigned differently depending on the CNC control and the machine builder. Always check your machine’s manual.
| Source | Machine | Item | Detail |
|---|---|---|---|
| Siemens (ISO dialect) | Lathe | Group | 21. Equivalent to TRANSMIT among Siemens functionsThe note in ISO Turning 2007 mixes up TRANSMIT and TRACYL (the correspondence in ISO Milling 2007 is correct) |
| Mitsubishi Electric | Lathe | Code | G12.1/G13.1 or G112/G113 in G-code lists 6 and 7 (both group 19) |
| Mitsubishi Electric | Lathe | Meaning | In G-code lists 2–5, G12.1/G13.1 is “milling interpolation” (a different function) |
| Haas | Lathe | Code | G112 (XY to XC interpolation, group 04). Cancel with G113 |
| Haas | Machining center | Meaning | On machining centers, G12 and G13 are circular pocket milling, and G112 and G113 are work coordinate systems #9 and #10 (not polar coordinate interpolation) |
| Siemens (native) | Lathe | Format | ON with TRANSMIT, OFF with TRAFOOF |
| LinuxCNC | — | Availability | There is no code equivalent to polar coordinate interpolation |
Sources
The meaning of this code agrees in two or more sources from different publishers. Explanations are written in our own words.
- Siemens AG — SINUMERIK 802D sl/840D/840D sl/840Di/840Di sl/810D Programming Manual ISO Turning, 04.2007 Edition cache.industry.siemens.com
- Siemens AG — SINUMERIK 802D sl/840D/840D sl/840Di/840Di sl/810D Programming Manual ISO Milling, 04.2007 Edition (6FC5398-7BP10-0BA0) cache.industry.siemens.com
- Mitsubishi Electric — MITSUBISHI CNC 700/70 Series Programming Manual (Lathe System) (IB-1500057) mitsubishielectric.com
- Haas Automation, Inc. — G112 XY to XC Interpolation (Group 04) (lathe, per-code explanation page) haascnc.com
- Haas Automation, Inc. — Lathe Operator's Manual – 16 Lathe G-Codes (online version) haascnc.com
- Haas Automation, Inc. — Mill Operator's Manual – 17 Mill G-Codes (online version) haascnc.com
- Siemens AG — SINUMERIK 840D sl/840D/840Di sl/810D Fundamentals, Programming Manual, Edition 08/2005 (6FC5398-1BP10-0BA0) cache.industry.siemens.com
- LinuxCNC project — G-Codes (LinuxCNC Documentation) linuxcnc.org
- Hitachi Seiki (inventor: Toru Ogawa) — Interpolation method for linear and rotary axes of a numerical control device (Japanese Unexamined Patent Publication H4-322301, Japanese Patent No. 2566180) patents.google.com