What is a Gerber file in PCB?

Posted by

Introduction to Gerber Files

Gerber files are the standard file format used to describe the printed circuit board (PCB) layers and drilling information needed for manufacturing. Developed by Gerber Systems Corp. in the 1960s, Gerber files precisely define the copper traces, solder mask, legend, and drill holes of a PCB design. The files are used by PCB fabrication houses to manufacture the physical board.

Gerber files are sometimes called “the universal language of PCBs” because they allow PCB designers to communicate their board designs to manufacturers in a clear, industry-standard way, regardless of the PCB design software used to create the design. Understanding Gerber files is essential for anyone involved in PCB design and manufacturing.

What Information is Contained in Gerber Files?

A complete set of Gerber files fully describes the PCB layers and drilling data so that the board can be fabricated. The main types of information contained in Gerber files include:

Copper Layers

Gerber files define the copper traces, planes, pads, and vias on each layer of the PCB. The copper features are “drawn” using simple shapes like lines and flashes. Positive copper features (i.e. the copper that should remain, like traces) are defined, while negative areas denote where copper should be removed. A separate Gerber file is generated for each copper layer of the board (e.g. top, bottom, inner layers).

Solder Mask

The solder mask is the protective lacquer coating applied on top of the copper layers, covering the areas that should not be soldered. Openings in the solder mask expose the copper pads for component soldering. The board’s solder mask layers (top and bottom) are defined in their own Gerber files.

Silkscreen/Legend

The silkscreen or legend is the text and graphics printed on the PCB, typically to label components, show company logos, or add other visual elements. Silkscreen Gerber files define these decorative markings for the top and bottom of the board.

Drill Data

In addition to the PCB layers, Gerber files also contain drilling information denoting the location and size of drill holes needed for vias, through-hole pads, and mounting holes. The drill data is either contained in a separate Excellon file or embedded in the Gerber files.

Board Outline

The physical shape and dimensions of the board, including cutouts and internal edges, are defined in an outline Gerber layer. This data is used to route or cut out the shape of the pcb panel.

Gerber File Format

Gerber files are plain ASCII text files that use a small set of commands to draw the shapes and features of the PCB layers. The file format is designed to be compact, easy to parse, and human-readable.

File Extensions

Standard file extensions are used to identify each Gerber file according to the layer it represents:

Extension Layer
.GTL Top (outer) copper layer
.GBL Bottom (outer) copper layer
.G1 – .Gn Inner copper layers (1 up to n)
.GTO Top silkscreen overlay
.GBO Bottom silkscreen overlay
.GTS Top solder mask
.GBS Bottom solder mask
.GM1 Board outline
.DRL Drill/Excellon file

Gerber Commands

Gerber files use a basic command set to define the copper and other features of the PCB:

  • Apertures: shapes like circles, rectangles or polygons used to “flash” pads and draw traces
  • D-Codes: associate an aperture shape and size to a D-code number (e.g. D10, D11)
  • Flashes: stamping of a D-code shape at a specific XY location
  • Line Draws: traces drawn by moving a D-code shape from one XY point to another
  • Polygons: complex copper pour areas defined by multiple XY points

Here’s an example of some Gerber commands defining a trace and circular pad:

D10*
X1000Y1000D02*
X2500Y1000D01*
D11*
X3000Y2000D03*

This code selects aperture D10 (a line), draws a trace from (1000, 1000) to (2500, 1000), then flashes a circular pad D11 at location (3000, 2000).

Creating Gerber Files

Gerber files are generated from a PCB design during the output stage, once the board layout is complete. The PCB design software used will have settings to configure how the Gerber files are generated.

Gerber Generation Settings

When generating Gerber files, you’ll need to select settings like:

  • Format: Standard Gerber RS-274X format is recommended
  • Units: Specify imperial (inches) or metric (mm) units and the resolution (e.g. 2:4, 3:3)
  • Coordinate Format: Absolute or incremental coordinates
  • Aperture Table: Include aperture definitions in Gerber file
  • Layers: Select which board layers to generate Gerber files for

Consult with your PCB manufacturer for their recommended Gerber output settings. Many manufacturers provide “Gerber generation templates” with their preferred settings to ensure compatibility with their processes.

Gerber File Verification

Before sending the Gerber files to a manufacturer, it’s critical to carefully review them for any errors. Common issues to check for include:

  • Incorrect board outline causing wrong board shape or dimensions
  • Overlapping or missing traces due to incorrect apertures
  • Solder mask errors exposing areas that should be masked
  • Drill misalignment caused by incorrect drill file units or offset

Many PCB design tools include a Gerber file viewer for inspecting the generated files. There are also dedicated Gerber viewer software packages that provide additional verification and analysis capabilities to ensure Gerber file integrity.

Sending Gerber Files to a PCB Manufacturer

Once you’ve generated a complete and verified set of Gerber files, you’re ready to send them to the PCB manufacturer for fabrication.

Zipping Gerber Files

Gerber files should always be compressed into a single ZIP file before sending to the manufacturer. This keeps all the files neatly together and avoids issues with file corruption or missing layers. Be sure to clearly name the ZIP file so the manufacturer knows what design it contains.

Uploading Gerber Files

Most PCB manufacturers allow you to easily upload your zipped Gerber files through their website. During the upload process, you’ll typically need to specify key parameters about your design, such as:

  • PCB Quantity – Number of boards to produce
  • Layers – Number of copper layers (2, 4, 6, etc.)
  • Dimensions – Length and width of the board
  • Thickness – Overall board thickness
  • Material – FR-4, metal core, flex, etc.
  • Surface Finish – HASL, ENIG, OSP, etc.
  • Additional Requirements – Any special needs like tight tolerances, controlled impedance, etc.

Providing this data along with your Gerber files allows the manufacturer to accurately quote your project and identify any design issues early in the process.

Conclusion

In summary, Gerber files are the essential data package that allows a PCB design to be manufactured. By accurately defining the copper layers, drill data, solder mask and other aspects of the board in a universal format, Gerber files act as the bridge between design and fabrication.

Generating complete, error-free Gerber files and providing them to your manufacturer is a critical step in bringing a PCB to life. With a solid understanding of Gerber files, PCB designers can ensure their designs are efficiently and correctly fabricated.

FAQ

What software is used to view Gerber files?

There are many free and paid Gerber viewer programs available. Popular options include Gerbv, ViewMate, GC-Prevue, and CAM350. Most PCB design software also has built-in Gerber viewing and verification capabilities.

Are Gerber files secure? Can they be reverse engineered?

Gerber files are not encrypted or secure by default. It is theoretically possible to import a set of Gerber files into PCB design software and reverse engineer the board design. However, this is uncommon and requires significant effort. If IP security is a major concern, discuss options like secure file transfer and non-disclosure agreements with your manufacturer.

What happens if there’s an error in the Gerber files?

If an error in the Gerber files is caught before production, the manufacturer will typically notify you and request revised files. If a Gerber error makes it to production, it will likely result in scrap boards that are non-functional or fail testing. Costs of scrap and delays are typically the designer’s responsibility if Gerber files were provided with errors. This highlights the importance of thoroughly reviewing Gerber files before releasing them for manufacturing.

Can I use Gerber files for 3D printing or other manufacturing processes?

No, Gerber files are specific to the PCB fabrication process and are not used for other manufacturing methods like 3D printing or CNC machining. Those processes use 3D model files (STL, STEP, etc.) rather than the 2D layer data of Gerber files.

The manufacturer says they need my design in “ODB++” format instead of Gerber. What is this?

ODB++ (aka “Original Design format ++”) is an alternative to Gerber that packages the PCB layer data along with bill of materials and component placement information into a unified database. Some manufacturers prefer ODB++ for its added capabilities, but it is less common than Gerber. Most PCB design tools can also export to ODB++ if needed.

Leave a Reply

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

Categories

Tag Cloud

There’s no content to show here yet.