A Circle Milling Custom Macro | Modern Machine Shop

Plastics Technology
  • Basics 9 Feb 2026 Why Manufacturing Leaders Shouldn't Wait for “Normal” to Come Back
  • Basics 6 Feb 2026 Defining Key Concepts of Smart Manufacturing
  • Workforce Development 4 Feb 2026 How Manufacturing CEOs Are Rebuilding Strategy Amid Tariffs and Talent Gaps
  • Measurement 2 Feb 2026 How Confocal Technology Revolutionizes Optical Metrology
  • Turning Tools 30 Jan 2026 Durable Tooling Cuts Cycle Times for Tough Turn-Peeling Job
  • Five-Axis 28 Jan 2026 High-End Machines Deserve High-End Support: Inside DMG MORI’s Cleveland Facility
  • 26 Jan 2026 Production Machining Turns 25!
  • Top Shops 26 Jan 2026 Modern Machine Shop’s 2026 Top Shops Benchmarking Survey Goes Live Feb. 1
  • Inspection and Measurement 23 Jan 2026 Putting the "Plate" Gage to Use
  • 21 Jan 2026 Troubleshooting Processes Experiencing Drift or Shift
Published 02/05/2005 A Circle Milling Custom Macro

Older model Fanuc controls and some current model Fanuc-compatible controls have a feature to help you machine round counterbores with an end mill (G12 and G13). For some reason, Fanuc stopped providing these helpful G codes.

Mike Lynch Mike Lynch Founder and President, CNC Concepts Inc.

Share

Leaders-In background Leaders-In logo GROB Systems, Inc. GROB Systems, Inc. VISIT SITE VISIT SHOWROOM

GROB Systems, Inc.

For almost 100 years, GROB has been known worldwide for the development and manufacturing of machines and production lines. GROB is a family-owned com...READ MORE

Featured Content
View More
Featured Videos
View More PrecisionX Group PrecisionX Group VISIT SITE VISIT SHOWROOM

PrecisionX Group

PrecisionX Group is a leading custom contract manufacturer specializing in precision metal fabrication for critical-use applications across growth-ori...READ MORE

Featured Content
View More Phillips Corporation - Education Phillips Corporation - Education VISIT SITE VISIT SHOWROOM

Phillips Corporation - Education

Featured Content
View More Komo Machine, Inc. VISIT SITE VISIT SHOWROOM

Komo Machine, Inc.

Komo Machine, Inc. is a leading U.S. manufacturer of advanced, precision CNC machining systems engineered for demanding manufacturing applications. Wi...READ MORE

Featured Content
View More
Featured Videos
View More Haitian Precision USA Haitian Precision USA VISIT SITE VISIT SHOWROOM

Haitian Precision USA

Haitian Precision USA has been selling industrial machine tools since 2000 under the Absolute Group of Companies. Absolute started by selling and s...READ MORE

Featured Content
View More
Featured Videos
View More Jergens, Inc. Jergens, Inc. VISIT SITE VISIT SHOWROOM

Jergens, Inc.

Manufacturing Efficiency for 75 Years In 1942, Jergens Inc. opened its doors and began its journey to grow into one of the world’s largest m...READ MORE

Featured Content
View More
Featured Videos
View More Phillips Corporation Phillips Corporation VISIT SITE VISIT SHOWROOM

Phillips Corporation

Featured Content
View More Mayfran International Mayfran International VISIT SITE VISIT SHOWROOM

Mayfran International

Mayfran International is the world’s leading provider of quality material handling, filtration, and chip removal solutions. With an unrivaled...READ MORE

Featured Content
View More
Featured Videos
View More G65 Command

Older model Fanuc controls and some current model Fanuc-compatible controls have a feature to help you machine round counterbores with an end mill (G12 and G13). For some reason, Fanuc stopped providing these helpful G codes. If your control has custom macro B, you can get them back. This column shows one of these custom macros—the clockwise circle milling custom macro (like G12). With minor modifications, you can create the counter-clockwise version. This drawing shows the arguments to be used in the G65 command.

Here is a calling program that uses the circle milling custom macro:

O0001 (Main program) . (Machine hole) .N075 T04 M06 (1.0 END MILL)N080 G54 G90 S1200 M03 T05 (Start spindle)N085 G00 X2.5 Y2.0 (Rapid to hole-center)N090 G43 H04 Z0.1 (Rapid approach in Z)N095 M08 (Turn on coolant)N100 G65 P1000 X2.5 Y2.0 D3.0 R0.1 Z-1.0 A1.25 T1.0 F5.0 H1.0(Mill circle)N105 G91 G28 Z0 M19 (Return to tool change position)N110 M01 (Optional stop) . (Program continues) .N200 M30 (End of main program)

The H word is used to specify whether a hole currently exists in the center of the circle to be milled. If it does, the end mill will fast feed to the work surface in Z. If not, it will feed at half the specified feed rate (F word in G65 command).

Here is the custom macro:

O1000 (Circle milling custom macro) (TEST FOR MISSING ARGUMENTS)N1 IF [#24 EQ #0] GOTO 95 (X) IF [#25 EQ #0] GOTO 95 (Y) IF [#26 EQ #0] GOTO 95 (Z) IF [#18 EQ #0] GOTO 95 (R) IF [#7 EQ #0] GOTO 95 (D) IF [#20 EQ #0] GOTO 95 (T) IF [#9 EQ #0] GOTO 95 (F) IF [#1 EQ #0] GOTO 95 (A) IF[#11 EQ #0] GOTO 95 (H)(A MUST BE BIGGER THAN HALF OF T)IF [#1 GT [#20/2 +0.1]] GOTO 2 #3000=101(APPROACH RADIUS TOO SMALL) (RAPID TO APPROACH POSITION)N2 G00 X#24 Y#25] Z#18 

(TEST FOR HOLE IN CENTER)IF[#11 EQ 1.0] GOTO 5 G01 Z#26 F#9 GOTO 6 N5 G01 Z#26 F[#9 * 5] 

(MOTIONS TO MILL CIRCLE)N6 G01 Y[#25 + #7/2 - #1] F#9 X[#24 - #1 + #20/2] G02 X#24 Y[#25 + #7/2 - #20/2] R[#1 - #20/2] J-[#7/2 - #20/2] X[#24 + #1 - #20/2] Y[#25 + #7/2 -#1] R[#1 - #20/2] G00 Z#26 X#24 Y#25 GOTO 99 N95 #3000=100 (INPUT VALUE MISSING) N99 M99 (End of custom macro)

PTXPO 26 Convey Metal Powders Register Ahead to Save $200 IMTS 2026 5 Free Shrinkfit Toolholders Grinding Wheel Adapters YCM Alliance IMCO M935 PTXPO 26 Loading Close Next Up

Từ khóa » G12 Y G13 Cnc