CNC Milling | G12 and G13 Codes | Circular Pocket Cycles

In this article, we described how to use G12 and G13 codes for circular pocket cutting in CNC Milling (CNC Machine Centers) machines with all details and examples.


G12 and G13 Codes Introduction

Fanuc controls do not have the very useful G12 and G13 circular pocketing cycle as a standard feature. Controls that do have it, for example Yasnac, have a built-in macro (cycle), ready to be used. Fanuc users can create their own custom macro (as a special G-code cycle), with the optional User Macro (Custom Macro) feature, which can be developed to offer even more flexibility than a built-in cycle.

You may be interested also:
“CNC | G02 and G03 Codes | Circular Interpolation”

G12 and G13 Codes Format

The two G-codes are identical in all respects, except the cutting direction. Meaning of the two G-codes in a circular pocket cycle is:

G12 : Circular pocket cutting CW
G13 : Circular pocket cutting CCW

Either cycle is always programmed without cutter radius offset in effect – in G40 cancel mode – and has the following program format:

G12 I.. D.. F.. ; (Conventional Milling)
G13 I.. D.. F.. ; (Climb Milling)


I = Pocket radius
D = Cutter radius offset number
F = Cutting feedrate

Things to Know

Typically, either cycle is called in a program when cutting tool reaches the center and the bottom of a pocket to be machined. All cutting motions are arc motions, and there are three of them. There are no linear motions. The arbitrary start point (and end point) on the pocket diameter will usually be at 0 degree (3 o’clock) – Figure 33-16.

Figure 33-16
Circular pocket cycles G12 and G13

G12 and G13 Codes Examples

Program Example – 1 – G13 Code

If G12 or G13 cycle or a similar macro is available, the following program O3306 can be written, using the same tool and climb milling mode:

N1 G20
N2 G17 G40 G80
N3 G90 G54 G00 X0 Y0 S1200 M03
N4 G43 Z0.1 H01 M08
N5 G01 Z-0.25 F8.0
N6 G13 I0.75 D1 F10.0 (CIRCULAR POCKET)
N7 G28 Z-0.25 M09
N8 G91 G28 X0 Y0 M05
N9 M30

Need to More?

Our volunteers have worked together and carefully prepared the articles published here in their native language without using machine translation. You can search the entire site for more information on the subject. You can start a discussion on forums and join us to get support, ask questions, improve a published article or give your opinion.

Previous articleCNC Milling | G17 – G18 and G19 Codes | Plane Selection
Next articleCNC Lathe | G90 Cycle | Turning ( Straight and Tapered )