G12 and G13 are specialized CNC milling commands used to mill perfect circular pockets without needing CAM-generated spiral toolpaths. G12 cuts clockwise pockets, while G13 cuts counterclockwise pockets. These commands are extremely efficient for creating precise bores, circular recesses, O-ring grooves, counterbores, and bearing seats. Instead of generating dozens of linear and arc segments, G12/G13 handle all circular interpolation internally, reducing program size, simplifying code, and guaranteeing repeatable geometry. In 2025 machining standards, G12/G13 remain crucial for fast, consistent, high-accuracy circular pockets.
1. How G12 / G13 Work
G12 and G13 automatically generate a circular toolpath based on:
- Pocket center (X, Y)
- Pocket depth (Z)
- Pocket radius
- Tool radius
- Finishing allowance
- Feedrates for roughing and finishing
Unlike spiral interpolation, these cycles maintain a constant cutter engagement pattern.
2. Basic Syntax (Haas / Fanuc)
G12 I(radius) K(depth) Q(rough step) F(feed)
G13 I(radius) K(depth) Q(rough step) F(feed)
Where:
- I → Pocket radius
- K → Depth of cut (negative for down)
- Q → Roughing step size
- F → Feedrate
CW pocket = G12
CCW pocket = G13
3. Real Example — Ø40 mm Circular Pocket (Clockwise)
Tool: Ø10 mm endmill
G00 X50. Y40.
G12 I20. K-5. Q2. F280
Meaning:
- Radius 20 mm = Ø40 mm pocket
- Depth = 5 mm
- Roughing step = 2 mm
- CW pocket
The machine automatically generates spiral-like motion without CAM.
4. Real Example — Counterclockwise Precision Seat
G13 I12. K-3. Q1. F220
This is ideal for:
- Valve seats
- Bearing housings
- O-ring grooves
CCW produces better finish for right-hand cutters.
5. Multi-Step Pocket Strategy (Deep Pockets)
For deep pockets, use multiple passes:
G13 I18. K-4. Q2. F260
G13 I18. K-8. Q2. F260
G13 I18. K-12. Q2. F260
This maintains tool life and reduces chatter.
6. Finishing Pass With G12/G13
You can leave finishing stock:
Rough:
G12 I20. K-8. Q3. F260
Finish:
G12 I20. K-8. Q0.5 F120
Q0.5 = ultra-fine finishing step.
7. Using Tool Radius Compensation with G12/G13
Many machines allow automatic tool radius comp:
I = (pocket_radius – tool_radius)
Example:
Pocket Ø52 mm
Tool Ø12 mm
Tool radius = 6 mm
Pocket radius = 26 mm
G12 I20. K-5. Q2. F260
System handles correct internal motion.
8. Using G12/G13 for O-Ring Grooves
Perfectly suited for O-ring seats:
G13 I14. K-2. Q0.5 F180
Consistent surface finish and perfect circularity are guaranteed.
9. High-Accuracy Bearing Seat Example
Bearing housing Ø35 mm requires:
- ±0.01 mm roundness
- Smooth surface
- No scallops
Program:
G12 I17.5 K-4. Q0.4 F140
This produces extremely accurate roundness compared to linear toolpaths.
10. Avoiding Chatter in Large Pockets
For large-diameter pockets:
- Use smaller Q steps (0.5–1.0 mm)
- Increase RPM
- Use conventional milling for roughing, climb milling for finishing
- Apply finishing pass separately
Example:
G12 I35. K-10. Q1. F260
G12 I35. K-10. Q0.3 F120
11. Common Problems & Fixes
Problem: Scallop marks inside pocket
– Reduce Q value
– Use a finishing pass
Problem: Incorrect diameter
– Tool radius not subtracted correctly
– Insert tool radius compensation manually or via CAM
Problem: Poor chip evacuation
– Reduce cut depth K
– Increase Q step so chips break better
Problem: Tool rubbing noise
– Increase feedrate slightly
– Reduce finishing allowance
12. When NOT to Use G12 / G13
Avoid in:
- Non-circular pockets (use CAM or G2/G3)
- Extremely deep pockets
- Interrupted surfaces
- Rough cast surfaces requiring adaptive clearing
13. Industry Use Cases (Real Manufacturing)
- Aerospace: bearing housings, circular pockets
- Automotive: valve seats, sensor pockets
- Moldmaking: ejector pin seats, round cavities
- Medical: implant seats, instrument geometry
- Firearm: counterbores, rail pockets
- Robotics: circular interfaces, bosses
G12/G13 are widely used because they outperform CAM-generated circular toolpaths in simplicity and stability.
14. Summary
G12 and G13 offer fast, accurate, efficient pocket milling for any circular feature. They remove the need for complex CAM paths and guarantee precise circularity with adjustable roughing and finishing passes. In 2025 CNC machining—where speed, repeatability, and geometric accuracy matter—G12/G13 remain essential tools for professional CNC programmers.
Leave a comment