Example program · Mill

Outside Contour with Cutter Compensation (G41) — G-Code Example

Profiles an 80 × 50 mm rectangle with R10 corners using G41 so the size can be adjusted through the D offset.

By cnccode · Updated

Profiles an 80 × 50 mm rectangle with R10 corners using G41 so the size can be adjusted through the D offset.

ItemValue
MachineCNC mill / machining centre (Fanuc-style)
UnitsMetric (G21)
Lines24

Program

G-code
O1002 (CONTOUR 80 X 50 R10)
G21 G17 G40 G49 G80 G90
T2 M06 (10 MM END MILL)
G54 G00 X-15. Y-15.
S6000 M03
G43 H02 Z25. M08
Z2.
G01 Z-5. F300.
G41 D02 X0 Y-5. F800.
Y40.
G02 X10. Y50. R10.
G01 X70.
G02 X80. Y40. R10.
G01 Y10.
G02 X70. Y0 R10.
G01 X10.
G02 X0 Y10. R10.
G01 Y15.
G40 X-15. Y15.
G00 Z25.
M09
G91 G28 Z0
G90
M30

▶ Simulate in the G-code viewer

How it works

  • The lead-in from Y-15 to Y-5 is longer than the tool radius (5 mm).
  • Clockwise travel around the outside with G41 gives climb milling with a right-hand cutter.
  • Put the tool radius (5.0) in D02 and fine-tune size with the wear offset.

Codes used in this program

Always check feeds, speeds, offsets and clearances for your own machine and tooling, and prove new programs with single block and reduced rapid.

More milling programs