This website requires JavaScript.

How to generate Gerber and Drill files in KiCad 7

How to generate Gerber and Drill files in KiCad 7


When you finished your design in KiCad, the last step before sending it off to the fab house is to generate the Gerber and Drill files. PCB fab houses will use these files to make your boards. Basically, 3 sets of files need to be generated:


Gerber files

Drill files

Drill map files


In this tutorial, we are using demo project Xilinx-dev-kit.. All the steps are tested in KiCad 7.0.7, there may be some minor differences if you use other KiCad versions.


Generate Gerbers

ImportantIt’s strongly recommended to run DRC check before generating Gerbers.

While using PCB editor window open File → Fabrication Outputs → Gerbers (.gbr).

(Figure 1. PCB Editor Menu)


To order PCB’s from JLCPCB, default settings CAN NOT be used, few settings changes are required.


Select output folder

After Plot window is opened, first thing to do is to select location for output files. You can click the browse icon to select/create the target directory or just type the folder name you want.

When KiCad generates Gerbers, the folder will be created automatically.

(Figure 2. PCB Select Gerber Output directory)


Select layers

On the left side of Plot window, you will see which layers from board design we want to turn into Gerber files. List of the layers that should be all checked:

F.Cu  

F.Paste

F.Silks

F.Mask

B.Cu

B.Paste

B.Silks

B.Mask


Edge.Cuts - (contain the board outline/cutouts.)

In1.Cu, In2.Cu … - (needed for 4/6 layer designs.)


In KiCad, layers are named as front and back. Layers with F. (for Front) and B. (for Back), but please note copper layer names can be changed in File → Board Setup.


General Options and Gerber Options

-Select Plot reference designators, otherwise designators will not appear on silkscreen layers.

-Select Check zone fills before plotting

-Select Use Protel filename extensions, this is recommended as JLCPCB prefers Protel filename extensions.

-Select Subtract soldermask from silkscreen, this ensures no silkscreen on pads.



Settings example:

(Figure 3. Plot Menu Output options)


Now, click the Plot button at the bottom of the window. All generated Gerbers will be put in the target folder you specified before.

If the zone fills are out of date and you forgot to refill them, when Check zone fills before plotting is ticked, KiCad will ask you to confirm, just click Refill, then the file generation will continue.

To order PCBs, the Drill files are also required.


Generate Drill Files

In the same Plot menu for Gerber files, click the Generate Drill Files… button at bottom right, this will open the dialog for drill files.

You don't need to change the Output folder because KiCad will automatically use the same folder for Gerbers.

Check these options:


-Check Use alternate drill mode for "Oval Holes Drill Mode".

-Check Absolute for "Drill Origin".

-Check Millimeters for "Drill Units".

-Check Decimal format for "Zeros Format".



Settings example:


(Figure 4. Generate Drill Files settings)

Click the Generate Drill File button, the drill files will be generated and stored in the output folder.


Generate Drill Map File

This is optional, but suggested.

This can be done in the same dialog for drill files. Just check Gerber for "Map File Format", then click Generate Map File button at bottom right of the dialog.


This drill map file provides additional information for drill holes, it is for human reading, it indicates which holes are plated and which are not, it also indicates total slotted holes. More information, less probability of error.

(Figure 5. Generate Drill Map file)


Verify the Files

Before uploading your Gerber files to JLCPCB for production, it's highly recommended to cross-check the generated files with a 3rd-party Gerber viewer.

When you are checking the file, please pay attention to the following items.


1. Does the board outline exist?

2. Is the board outline watertight(continuous/no gaps)?

3. Do all inner cutouts, unplated slots, V-cut lines show in the GM1 layer correctly?

4. Do all drilling holes shown and are aligned with other layers correctly?

5. Are vias covered or exposed as per your design?

6. And the Silkscreen, do they look good?

7. etc.

If you find any issues, fix them and export the Gerber/Drill files and check them in the Gerber viewer again.

There are some nice Gerber viewers here and there, just use the one you feel handy.

Gerbv

tracespace view

Reference gerber viewer from ucamco

If everything is OK, now you can zip the out folder and place the order.



Generate BOM and Centroid Files for SMT Service

If you also need the SMT service from JLCPCB, the BOM and centroid files need to be generated as well. Please follow How to generate the BOM and Centroid file from KiCAD for how to do it.





Last updated on Aug 18, 2023