What Is Excellon Drill Format in PCB?
Excellon Format, or Excellon Drill Format, is designed to drive CNC drilling and routing machines. It is a subset of RS274D, and is considered an industry drill standard. The Gerber format has similar uses, and there are utilities to convert between the formats.
The name Excellon Format is derived from the company Excellon Automation., which was the market leader in PCB drilling and routing machines during 1980s, and whose propriety format became widely used.
Almost all PCB layout software can produce this format. However, we have noticed that many PCB layout tools do not take full advantage of the header information, which makes reading the drill file more difficult that it should be.
Header
At the beginning of the file, the first lines are typically a header. This contains general information about the job and the data to follow. While in principle the header is optional, one should never write a drill file without a header. Here are the most common header commands along with their function and use by the reading software:
Command |
Explanation |
M48 | indicates the start of the header. should always be the first line in the header |
INCH,LZ | this actually has two pieces of information; INCH indicates that coordinates that follow are in inches and LZ indicates that the leading zeros in the coordinate data are included. (This implies that the trailing zeros are suppressed. The reading software needs to know both the units and where to re-insert the decimal point; therefore one must have either leading or trailing zeros or a decimal point in the coordinate data. If the data is in millimeters then the command would be METRIC,LZ. If the trailing zeros are included then the command would be INCH,TZ. |
ICI | Incremental input of program coordinates. This is very rare nowadays; if not present assume the coordinates are absolute. |
VER,1 | Use version 1 X and Y axis layout. (As opposed to Version 2) |
FMAT,2 | Use Format 2 commands; alternative would be FMAT,1 |
T01C0.020 | Defines tool 01 as having a diameter of 0.020 inch. For each tool used in the data the diameter should be defined here. There are additional parameters but if you are a PCB designer it is not up to you to specify feed rates and such. |
M95 | End of the header. Data that follows will be drill and/or route commands. |
R# | This command drills a series of equally spaced holes from the previously specified hole. The number following the R specifies the number of repeats. An X and/or Y coordinate must be used to define the spacing between hole centers. |
M97 | It is possible to drill a series of holes that spell out words or numbers. The M97 and M98 commands allow you to program the CNC-7 to write a message on the board. This feature can be used to identify a company or product, supply a part number etc.. |
% | Rewind. This is often used instead of M95. It stops the machine and tells it to wait for a command to continue. |
There are a large number of other possible header commands but they are almost all related to the control the machine and have no effect on the actual layout data that one is trying to extract from the drill file in the software world.
Excellon Format 1 vs. Format 2
Over the years there has been some evolution of the Excellon file format and you will find knocking about files that use FMAT 1 commands and files that use FMAT 2 commands. The table below defines the command syntax for each.
FMAT 1 |
FMAT 2 |
Explanation |
G81 |
G05 |
turn on drill mode. |
M02 |
M00 |
End of Program |
M24 |
M01 |
End of Pattern |
M26 |
M02 |
Repeat Pattern Offset (this is followed by a #X#Y to indicate the number of repeats in X and Y |
M01 |
M06 |
Optional Stop |
M27 |
M08 |
End of Step and Repeat |
M00 |
M09 |
Stop for Inspection |
M26X#Y#M21 |
M02X#Y#M80 | |
M26#Y#M22 |
M02X#Y#M90 |
|
R#M26 |
R#M22 |
Each drill file requires a separate tool-file defining the diameter of the tool. In some cases, the tool-file is embedded in the header of the drill file. Your drill file should always show the finished hoe-size you require. Excellon drill format consists of a series of commands in a text file, one per line, with a header (starting with command M48 and ending with command M95; the header is optional) and a body. There are two different formats (FMAT 1 and FMAT 2) which have different commands in the body section.
A drill file without embedded tool sizes looks like:
M48
%
T01
X-001375Y-008500
X-002125Y-008750
T02
X-006625Y+018250
X-007875Y+019500
…
A drill file with embedded tool sizes:
M48
INCH
T01C00.020
T02C00.024
T03C00.035
%
M70
T01
X07292Y04884
X07292Y05071
X07380Y08123
…
Where:
- INCH/METRIC defines the unit
- T01 is the tool number
- C indicates that text numbers are the drill sizes: 00.20 = drill size 0.20’’ or 20mil or 0.50mm.
More information on the Excellon Format is available on Wikipedia.