How to export kicad PCB to gerber files

What are Gerber Files?

Gerber is a vector image file format used by PCB Manufacturing to describe the printed circuit board images: copper layers, Solder Mask, legend, etc. Gerber files are the standard file format used by PCB fabrication companies – when you send your design to a fab house to have it manufactured, they will almost always request the Gerber files.

A Gerber file is a plain text file that contains commands that tell the fabrication machines what to draw. There are different Gerber file formats, but the most common is RS-274X, or Extended Gerber.

Each layer of the PCB Design is exported to a separate Gerber file. For example, the top copper layer will be exported to a file named something like example.gtl, while the bottom copper layer would be example.gbl. The file extensions are standardized to identify each layer.

Common Gerber file extensions include:

Extension Layer
.GTO Top Silkscreen Overlay
.GTP Top Paste Mask
.GTS Top Solder Mask
.GTL Top Copper Layer
.GP1 Inner Layer 1 (For 4+ layer boards)
.GP2 Inner Layer 2 (For 4+ layer boards)
.GBL Bottom Copper Layer
.GBS Bottom Solder Mask
.GBP Bottom Paste Mask
.GBO Bottom Silkscreen Overlay
.GM1 Board Outline

Your PCB manufacturer will specify exactly which Gerber files they require, but a typical 2-layer board will need at minimum the GTL, GBL, GTS, GBS, GTO, GBO and GM1 files.

Checking the PCB Design

Before you export the Gerber files, it’s important to thoroughly check your PCB design for any errors or design rule violations. Here are some of the key things to review:

Design Rules

Make sure your PCB complies with the design rules and capabilities of your chosen PCB manufacturer. Check trace widths, clearances, drill sizes, annular rings, etc. against your fab house’s capabilities.

Electrical Rules

Run an electrical rules check (ERC) to verify the design is electrically sound – no shorts, missing connections, etc. KiCad includes an automated ERC tool.

Silkscreen

Check that all component reference designators are positioned correctly and won’t be obscured by component bodies. Ensure any text is sized appropriately.

Solder Mask

Review the solder mask layer and ensure the correct pads are exposed. Add solder mask expansion if needed to account for mask registration tolerances.

Drill Files

Check the drill files to ensure there are no missing or incorrectly sized drill hits. Verify the hole sizes match the components.

Mechanical Constraints

Ensure any mechanical constraints are met – board dimensions, keep-out areas, Mounting holes, etc.

Documentation

Finally, check that all documentation is complete – the schematic matches the PCB, layer stackup information is provided, drill sizes and types are called out, any special instructions are noted, etc.

Exporting Gerber Files from KiCad

Once you’ve verified the PCB design is ready for manufacturing, it’s time to generate the Gerber files. In KiCad, this is done through the File > Plot menu.

Set Up the Plot Format

In the Plot window, make sure the ‘Plot format’ dropdown is set to ‘Gerber’. This tells KiCad to generate Gerber files as output.

Select Layers to Plot

Next, choose which layers you want to export Gerber files for. For a standard 2-layer board, you’ll typically need to select the following at minimum:

  • F.Cu (Front Copper)
  • B.Cu (Back Copper)
  • F.SilkS (Front Silkscreen)
  • B.SilkS (Back Silkscreen)
  • F.Mask (Front Soldermask)
  • B.Mask (Back Soldermask)
  • Edge.Cuts (Board Outline)

If your design has other layers, like inner copper layers, paste mask, etc., plot those as well.

Set Plot Options

In the ‘General Options’ section:

  • Set ‘Plot border and title block’ to off
  • Set ‘Exclude PCB edge layer from other layers’ to on
  • Set ‘Use protel filename extensions’ to on

Under ‘Gerber Options’:

  • Set ‘Use proper Gerber extensions’ to on
  • Set ‘Subtract soldermask from silkscreen’ to on

These settings ensure the exported Gerber files are generated in a format expected by PCB manufacturers.

Generate Drill Files

In addition to the Gerber files, you also need to export the drill (hole) information. In the Plot window, click the ‘Generate Drill File’ button.

In the Drill Tools window:
– Select ‘Excellent (smallest file)’ under ‘Drill File Format’
– Enable ‘Minimal header’
– Disable ‘Mirror y axis’

Then click ‘Drill File’ to generate the drill file.

Run the Plot

Once all the settings are correct, click ‘Plot’ to generate the Gerber files. KiCad will create the files in the project folder.

Inspecting Gerber Files

After exporting the Gerber files, it’s a good idea to inspect them to ensure there are no conversion errors or missing information. There are several free Gerber viewer programs available, such as:

  • KiCad’s GerberView
  • Ucamco’s free online Gerber viewer
  • Gerbv
  • ViewMate

Load the Gerber files into the viewer software and check each layer. Make sure the files match your PCB design and that no information is missing or corrupted.

It’s also a good idea to send the files to your PCB manufacturer for a pre-production check. Many fab houses will do a free manufacturability review and identify any issues before production.

Ordering PCBs

Once you have a complete set of Gerber files, you’re ready to have your PCB manufactured! Simply send the Gerber files (along with the drill files) to your chosen PCB fabrication service. They will use these files to produce the physical printed circuit board.

When placing your order, you’ll typically need to specify:

  • PCB Quantity
  • Number of layers
  • Board thickness
  • Copper weight
  • Surface finish (HASL, lead-free HASL, ENIG, OSP, etc.)
  • Soldermask color
  • Silkscreen color
  • Any special instructions or requirements

The PCB fab house will take your Gerber files and manufacture the boards to your specifications. Lead times vary, but for standard orders it’s usually 1-2 weeks.

Conclusion

Exporting Gerber files is a critical step in getting your KiCad PCB designs manufactured. By following the steps outlined in this guide, you can generate a complete set of manufacturing files that meet the requirements of PCB fabrication services.

Remember to always thoroughly check your design before generating Gerbers, and inspect the exported files to ensure no errors were introduced. Sending your Gerber files to the manufacturer for a pre-production check is also highly recommended.

With practice, generating and inspecting Gerber files will become a quick and straightforward process. You’ll be able to rapidly turn your KiCad designs into professional-quality manufactured PCBs!

FAQ

What is the difference between Gerber files and drill files?

Gerber files define the copper layers, soldermask, silkscreen legend, and board outline of the PCB. Drill files define the location, size, and type of holes (plated or non-plated) on the board. Both Gerber and drill files are required for PCB manufacturing.

What is the most common Gerber file format?

The most common Gerber file format is RS-274X, also known as Extended Gerber or X-Gerber. This is the format used by the vast majority of PCB design and manufacturing software.

How do I know which Gerber files my manufacturer requires?

Most PCB manufacturers will list their required Gerber files in their documentation or on their website. If in doubt, contact the manufacturer directly. At a minimum, most fabs require Gerbers for the copper layers, soldermask, silkscreen, and board outline, plus the drill files.

Can I view and edit Gerber files?

Yes, Gerber files are plain text and can be viewed and edited in a standard text editor, but it is not recommended. Use a dedicated Gerber viewer to inspect the files, and make any required changes in the original PCB design software before re-exporting. Modifying Gerbers directly risks introducing errors.

The fab house says my Gerber files are incorrect, what do I do?

First, double-check that you exported all required layers and that the Gerber export settings in KiCad are correct. Inspect the files in a Gerber viewer to look for any obvious errors. If you can’t identify the issue, contact your fab house for more details about the problem. You may need to make changes to your KiCad design and re-export the Gerbers.

CATEGORIES:

Uncategorized

Tags:

No responses yet

Leave a Reply

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

Latest Comments

No comments to show.