0
0
Embedded-cHow-ToBeginner · 4 min read

How to Generate Drill Files for PCB: Step-by-Step Guide

To generate drill files for a PCB, use your PCB design software's export or fabrication output feature to create Excellon drill files. These files specify hole locations and sizes for manufacturing and are usually generated alongside Gerber files.
📐

Syntax

Generating drill files typically involves selecting the drill output option in your PCB design software. The key parts are:

  • Drill file format: Usually Excellon format, which is standard for PCB drilling machines.
  • Tool definitions: Defines hole sizes and tool numbers.
  • Drill coordinates: X and Y positions for each hole.
  • Output settings: Units (inches or mm), zero suppression, and file naming.
embedded_c
Export Drill Files Syntax Example:
1. Open PCB design software.
2. Go to File > Fabrication Outputs > Drill Files.
3. Select Excellon format.
4. Choose units (mm or inches).
5. Set zero suppression (leading or trailing).
6. Export the drill file (.drl or .txt).
💻

Example

This example shows how to generate drill files in KiCad, a popular free PCB design tool.

Steps:

  • Open your PCB layout in KiCad's PCB Editor.
  • Click on File > Fabrication Outputs > Drill Files.
  • In the dialog, select Excellon format, choose units (mm), and enable Generate drill map file.
  • Click Generate Drill Files and save the files.
plaintext
Example drill file snippet (Excellon format):

M48
;Layer_Color=9474304
;FILE_FORMAT=2:4
;TYPE=PLATED
T01C0.800
T02C1.000
%
X012700Y025400
X012700Y030480
M30
Output
Drill file (.drl) created with tool definitions and hole coordinates for manufacturing.
⚠️

Common Pitfalls

Common mistakes when generating drill files include:

  • Not selecting the correct units (mm vs inches), causing holes to be drilled in wrong sizes.
  • Forgetting to define tool sizes properly, leading to missing or incorrect hole diameters.
  • Not enabling zero suppression, which can confuse manufacturing machines.
  • Mixing plated and non-plated holes without proper settings.
  • Failing to generate drill map files that help verify hole placement.

Always double-check your drill file in a Gerber viewer before sending to fabrication.

plaintext
Wrong way (missing tool definitions):
M48
;FILE_FORMAT=2:4
%
X012700Y025400
X012700Y030480
M30

Right way (with tool definitions):
M48
;FILE_FORMAT=2:4
T01C0.800
T02C1.000
%
X012700Y025400
X012700Y030480
M30
📊

Quick Reference

StepDescription
Open PCB design softwareLoad your PCB layout file.
Select Drill File ExportUsually under Fabrication Outputs or CAM processor.
Choose Excellon formatStandard drill file format for PCB manufacturing.
Set units and zero suppressionMatch your design units and machine requirements.
Define tool sizesSpecify hole diameters and tool numbers.
Generate and save filesExport .drl or .txt files for fabrication.
Verify filesUse a Gerber viewer to check drill locations and sizes.

Key Takeaways

Always export drill files in Excellon format for PCB manufacturing.
Set correct units and zero suppression to avoid drilling errors.
Define all tool sizes clearly to specify hole diameters.
Generate drill map files to verify hole placement visually.
Check drill files in a viewer before sending to fabrication.