What is a Gerber File in PCB Design?

Posted by

Introduction

Gerber files are the standard format used to transfer printed circuit board (PCB) design data to manufacturers for fabrication and assembly. Also referred to as “photoplotter files”, Gerber files contain vector image data describing the PCB layers, drill holes, and other fabrication details.

Gerber files were originally designed for use with photoplotters, which image each layer onto film for lithographic PCB production. Today, Gerber files remain the de-facto file format supported by PCB software, assembly houses, and manufacturers for taking a design into production.

This article provides an in-depth look at Gerber file formats, their role in the PCB design process, and how to work with them effectively to produce quality boards.

What is a Gerber File?

A Gerber file is a 2D vector image file used for PCB fabrication data transfer. The file contains drawing commands describing the PCB images in each layer:

  • Copper layers – conductor patterns, pads, vias
  • Soldermask layers – solder resist openings
  • Silkscreen layers – component legends, markings
  • Drill files – locations of holes to be drilled
  • Other fabrication data – board outline, tooling marks, etc.

By convention, Gerber files use the .gbr extension. Each PCB layer is exported as a separate Gerber file for processing. The set of Gerber files provides all the fabrication details the PCB manufacturer needs to replicate the design.

The Gerber format was developed by Gerber Systems Corporation in the 1960s-1980s for controlling photoplotter machines used to image PCB layers onto film. Today, Gerber files are generated from CAD programs and processed digitally rather than using film. However, the legacy Gerber file format persists as the industry standard for PCB fabrication data.

Gerber File Format Specification

Gerber files use ASCII text to describe a 2D image in vector format. The file consists of commands like:Copy code

%FSLAX26Y26*% %MOMM*% %LPD*% ... D10* X10000000Y10000000D02* X20000000Y20000000D01* X30000000Y10000000D01* ... M02*

Each line represents a command:

  • %FS... – Format settings
  • %MO... – Units (MM or IN)
  • %LPD*% – Layer Polarity Dark
  • D10* – Choose D10 flash aperture tool
  • X1... – Move to position X1…
  • X2... – Draw straight line to X2…
  • M02* – End of file

This vector drawing style allows PCB images to be scaled without loss of resolution. The aperture commands define flashes and polygons to expose. Line widths are controlled by selecting different aperture sizes.

The complete Gerber file format specification is published by Ucamco and details all the supported commands and syntax rules.

The Role of Gerber Files in PCB Manufacturing

Gerber files bridge the handoff between PCB design and manufacturing. Here is how they fit into a typical fabrication workflow:

  1. PCB Layout – The board is designed using CAD software. The engineer completes routing, verifies DRC checks, and prepares output files.
  2. Gerber File Generation – The PCB design software exports a set of Gerber files containing fabrication data for each layer.
  3. Gerber File Verification – The files are visually checked to ensure proper data is output as expected.
  4. Data Transfer – The Gerber files are sent to the PCB manufacturer or assembly house to produce the boards.
  5. CAM Processing – The manufacturer imports the Gerber files into CAM software to convert the data into machine instructions.
  6. Fabrication – The PCB layers, soldermask, legend, etc. are fabricated based on the Gerber file data.
  7. Assembly – Components are placed and soldered onto the finished PCBs.
  8. Testing – The completed boards are electrically and functionally tested against specifications.
  9. Delivery – The PCBs are sent to the customer or joined with other components in final product assembly.

The Gerber format standardized the file transfer between design, fab, and assembly to streamline manufacturing handoff. Prior to Gerber, PCB manufacturers had to work directly from CAD plots, schematics, or design prints leading to errors and inconsistencies. Adoption of the Gerber file format improved design-to-fabrication workflow and helped enable automated PCB production.

Design Data Included in Gerber Files

A complete set of Gerber files provides all the fabrication data needed to fully replicate the PCB design layers. Here are the most common file layers:

Copper Layers

  • Top Copper – Contains conductor traces, pads, and vias on the top surface.
  • Bottom Copper – Conductors on the bottom surface. Also called “bottom solder” or “solder side”.
  • Internal Plane Layers – Power, ground, or signal planes buried within the PCB stackup.

The copper layers define the conductive pattern that will be etched onto the raw PCB core material.

Soldermask Layers

  • Top Soldermask – Open areas define where soldermask is to be removed for soldering to top surface pads.
  • Bottom Soldermask – Soldermask openings for bottom side pads.

The soldermask or “solder resist” is the green/red epoxy layer that coats the PCB surface providing insulation and exception areas for soldering.

Silkscreen Layers

  • Top Silkscreen – Component legends, reference designators, markings to print on top surface.
  • Bottom Silkscreen – Legends and markings for bottom side.

The silkscreen print identifies components and provides visual information printed on the finished board.

Drill Files

  • Plated Drills – Holes to be metallized for connections between layers.
  • Non-Plated Drills – Holes that do not require plating – usually for mounting hardware.

The Excellon drill files specify hole sizes and locations to drill for vias, pads, and mounting holes.

Other Fabrication Layers

  • Board Outline – Shape of finished boards to be routed from panel.
  • Profile – Routing details and edge treatments outside board outline.
  • Cutouts/Slots – Non-plated openings that penetrate entirely through the PCB.
  • Keepouts – Areas that must remain free of copper for isolation or access.
  • Tooling Holes – Fiducial markers used for alignment and registration during fabrication.
  • Assembly Drawings – Silkscreen markings to guide component placement.
  • Fabrication Notes – Design notes, polarity markers, layer stackup diagrams, etc.

Gerber File Extensions

Since a complete PCB dataset requires multiple Gerber files, standard file extensions are used to identify each layer:

  • .GTL – Top copper
  • .GBL – Bottom copper
  • .GTS – Top soldermask
  • .GBS – Bottom soldermask
  • .GTO – Top silkscreen legend
  • .GBO – Bottom silkscreen legend
  • .GD1 – Drill file for plated holes
  • .GG1 – Drill file for non-plated holes
  • .GM1 – Board outline
  • .GKO – Keepouts

Using descriptive extensions makes the file purpose clear when handling a complete Gerber dataset. The increasing complexity of PCBs has resulted in additional specialized Gerber files beyond the standard set.

Generating Gerber Files

All PCB design software is capable of exporting a set of Gerber files from a board layout. While the specific export process varies by CAD tool, the overall procedure is similar:

  1. Open the PCB design project to export.
  2. Select the output option to generate manufacturing/fabrication files. This is variously called “CAM Output”, “Plot to File”, or “Generate Photoplotter Files” in different software tools.
  3. Specify the location to save the Gerber files. A new folder is usually created to contain the full set.
  4. Configure the Cam processor. Ensure all required layers are enabled for output. Select Gerber RS-274X file format.
  5. Set layer mapping. Associate each design layer with a specific Gerber file.
  6. Choose file naming and extensions. Select recognizable file extensions for the output layers.
  7. Set aperture conversion options. Determine how CAD drawing objects map to Gerber apertures.
  8. Generate files. Run the export to produce the set of Gerber files.
  9. Inspect files. Visually verify all layers exported correctly without errors.

The PCB tool documentation provides specific export instructions. While the steps vary by software, the end result is the same – a set of Gerber files representing the design.

Gerber File Viewers

Since Gerber files contain vector image data, they require specialized software tools for viewing and inspection. Gerber file viewers render the 2D PCB layer images from the drawing commands and apertures.

Many free and commercial Gerber viewers are available including:

  • Gerbv – Open source viewer for Linux and BSD
  • ViewMate – Free viewer for Windows
  • GC-Prevue – Low cost Windows viewer
  • Ucamco Layer Visualizer – Free online Gerber viewer
  • KiCad – Can view Gerber files
  • CAD Software – Most PCB tools can import and display Gerber files

Gerber viewers allow designers and engineers to inspect the exported fabrication data before release. Verification of the layered data versus the CAD PCB layout ensures design intent is properly captured.

Validating Gerber Files

Since Gerber files are generated from the PCB CAD tool, they must be carefully checked to avoid errors being propagated to manufacturing. Some key areas to validate:

  • Layer Content – Verify all required layers were exported and contain the correct data.
  • Polarity – Confirm copper layers are dark polarity and soldermask clear polarity.
  • Apertures – Flashes, pads, and traces must have proper drawings selected.
  • Text Legibility – Silkscreen markings should be clear and legible when viewed in Gerber viewer.
  • Alignment – Ensure drill holes, pads, and other features align across layers.
  • Annular Rings – Soldermask openings must provide sufficient clearance around pads.
  • No Missing Copper – All board areas should be covered to avoid open circuits.

Thorough Gerber file inspection identifies potential issues early and prevents costly fabrication errors. The files should match the CAD layout exactly or else be corrected before release.

Gerber File Workflow Tips

Following best practices when working with Gerber files helps avoid problems:

  • Store all Gerber files for a board in one folder using standard extensions
  • Archive released Gerber datasets in case future PCB revisions are needed
  • Generate a fabrication drawing PDF to accompany Gerber files
  • Provide a layer stackup diagram showing the PCB build materials
  • Only export final Gerber files – avoid sending work-in-progress versions
  • Use current Gerber format RS-274X and standard apertures
  • Confirm critical settings like polarity and annular rings
  • Visually inspect all layers at sufficient magnification
  • Cross-check alignments between layers
  • Review and verify Gerber files on multiple viewers
  • Only release Gerber data that matches finished CAD design

Following standardized file naming, layer usage, and quality assurance checks makes the handoff of Gerber data smooth and minimizes errors. Coordinating closely with the PCB manufacturer ensures the files meet their specific requirements.

The Future of Gerber Files

While Gerber format has been the entrenched standard for PCB fabrication data since the 1980s, there are some challenges emerging with the continued reliance on this dated file format:

  • Limited Detail – Gerber files lack the richness of native CAD representations and can lose design intent.
  • Verification Overhead – Manual inspection and validation of Gerber files is time consuming and can miss errors.
  • Ambiguity – Subtle differences in interpretation of the sparse Gerber format can cause problems.
  • Revision Control – No native revision tracking or identification within Gerber files.
  • Lack of Automation – Manual processing limits capabilities for analysis, checking, and optimization.
  • Proprietary Extensions – Some manufacturers adopt de-facto extensions beyond the standard format.

To overcome these limitations, updated file formats have been introduced that embed more complete design semantics and allow greater automation.

IPC-2581

The IPC-2581 standard defines an open neutral design data exchange format based on a XML schema. It captures the full layer stackup, fabrication details, and provides revision control. Adoption is still limited but increasing.

ODB++

The ODB++ format developed by Mentor Graphics stores PCB design information in a hierarchical database structure within a zip file. It contains a full representation of the board geometry. Used by some manufacturers.

Other Formats

Alternative formats like GenCAD, EDIF, IDX, and ZGL have not seen widespread adoption. However, momentum is building to transition away from Gerber files due to the improvements in design data fidelity, validation, and automation possible with newer PCB exchange formats.

Conclusion

Gerber files have been the cornerstone of PCB fabrication data transfer for decades, providing a standardized interface between design and manufacturing. The layered vector image format originated from photoplotter systems but remains entrenched in the industry despite limitations. Manufacturers and CAD tools continue to support Gerber files even as new formats emerge.

Understanding the role of Gerber files in the fabrication process, how to generate, inspect, and exchange them effectively is an essential skill for PCB designers and engineers. Careful validation remains imperative to avoid propagating errors. While there is a gradual transition underway to more robust formats, Gerber file usage is likely to continue for some time due to the inertia of such an established standard.

Frequently Asked Questions

What is the difference between Gerber and drill files?

Gerber files define the PCB copper, soldermask, and silkscreen layers in 2D vector format. Drill files specify the hole sizes and locations to be drilled for vias and mounting holes. Excellon is the most common drill file format.

What are common Gerber file errors?

Issues like incorrect polarity, misaligned layers, wrong text size or orientation, insufficient annular rings, and missing design data can occur in Gerber files if not carefully validated. Visual inspection and cross-checking against source CAD design is necessary to avoid errors.

Do manufacturers accept different Gerber file formats?

Yes, there are two common Gerber file format variants – RS-274D and RS-274X. The RS-274X format has additional capabilities vs. the older D version. Most manufacturers accept both but RS-274X is recommended as the modern standard.

How can you tell if Gerber files are properly formatted?

Use a Gerber viewer like Gerbv or GC-Prevue to inspect files. The images should match the PCB design layers, have clean lines at correct widths, contain all required details without gaps, and follow proper polarity conventions. The file headers define format like %FS...*%.

What is the difference between pads and vias in Gerber files?

Pads are the surface mount landings for component leads and traces. Vias are plated through-holes that connect between layers. Pads are flashed apertures while vias are drawn as clearance openings in soldermask layers and plated holes in drill files. Both provide soldered PCB connections.

Leave a Reply

Your email address will not be published. Required fields are marked *