jario_
Back to overview

CNC Basics · Chapter 10

Milling and Excellon

Drilling is like a stamp: the tool goes straight down and back up. Milling is like drawing with a pen: the tool moves through the material and leaves a trace. In this chapter you learn slots, contours and circular arcs. You also meet a second language: Excellon, the format in which circuit boards are drilled.

A straight slot

For milling you use the end mill (T6). It cuts with its face and its side. The steps:

  1. Change the tool and switch on the spindle (T6 M6, S3000 M3).
  2. Rapid to the start, just above the surface.
  3. Plunge to cutting depth with G01.
  4. Move along the slot with G01.
  5. Rapid back up.

The mill runs with its centre on the line, so the slot is as wide as the mill. Sideways in the material only G01 may be used, never G00.

G90 G21 G17T6 M6                  ; end millS3000 M3G00 X15 Y50            ; start of the slotG00 Z2G01 Z-4 F100           ; plunge 4 mmG01 X75 F300           ; cut along the slotG00 Z50M5M30

A rectangle contour

A contour is a line made of several segments. You mill it by moving to the corner points one after another with G01. The feed F stays valid until you change it. For a closed contour you move back to the start point at the end.

G90 G21 G17T6 M6S3000 M3G00 X40 Y10G00 Z2G01 Z-3 F100G01 X70 F300           ; side 1G01 Y30                ; side 2G01 X40                ; side 3G01 Y10                ; side 4, back to the startG00 Z50M5M30

Circular arcs with G02 and G03

You mill curves with a circular arc:

  • G02 runs clockwise,
  • G03 counterclockwise.

You give the end point (X Y) and the centre. The centre comes as I and J: that is the distance from the start point to the centre, in X and in Y, with a sign. The radius must be the same at the start and the end, and the arc block has no Z.

G90 G21 G17T6 M6S3000 M3G00 X50 Y20G00 Z2G01 Z-2 F100; Start X50 Y20, centre X50 Y35: I = 0, J = +15; clockwise to X65 Y35 (a quarter circle to the right)G02 X65 Y35 I0 J15 F300G00 Z50M5M30

Tip: check in the top view whether the arc runs in the direction you want. If not, you have swapped G02 and G03.

Excellon: header and tool table

Circuit boards are drilled on a drilling machine that reads Excellon. It is not G-code. The file has a header and a main part.

The header stands between M48 and %. It names the unit (METRIC for millimetres) and the tool table: T01C0.8 means tool 1 with diameter (C) 0.8 mm. In the main part you select a tool with T01 and give the holes after it as X..Y... If an axis is missing, the last value applies. At the end comes M30.

There is no Z, no spindle speed and no feed: the machine always drills all the way through the board.

M48METRICT01C0.8T02C1.2%T01X10.0Y10.0X20.0Y10.0T02X10.0Y30.0M30

Numbers in Excellon

Always write numbers with a decimal point, for example X12.5. Without a point the machine reads the number in a fixed format. With METRIC,TZ and the standard format 3.3 the leading zeros are left out: X12500 is 12.500 mm. This is the source of many mistakes when reading other people's files.

In a real drill file you group the holes by tool and select each tool only once.

; Without a decimal point the number has a fixed format.; METRIC,TZ with 3.3 digits: the leading zeros are left out.M48METRIC,TZT01C0.8%T01X12500Y8000M30

Common mistakes

  • Rapid traverse in the material

    While the mill is in the material only G01, G02 or G03 may be used. A G00 causes an alarm. Lift the mill out of the material with G00 Z.. first.

  • Wrong direction of the arc

    G02 is clockwise, G03 counterclockwise. With the wrong direction the mill cuts the long way round the circle.

  • I and J measured from the wrong point

    I and J measure from the start point to the centre, not from the zero point. If the radius does not fit at the end, the machine raises an alarm.

  • Excellon without unit or without decimal point

    If METRIC is missing, the machine raises an alarm. If the decimal point is missing, the hole ends up almost at the zero point. Always write X10.0, not X10.