How to Generate the Gerber Files

1.Gerber Files Introduction


Gerber file format is a defacto standard used by PCB manufacturing industry. This is analogous to produce a *.pdf file after designing a graphics or text document. Almost everyone who is involved in PCB design either hobbyist or commercial designer may have used it. It is actually an ASCII file format.



Gerber file format is evolved from applications where it is used to re-create images or graphics i.e., printers and plotters industry. In the same way it is used  in electronics hardware industry to print PCB tracks, holes, clearances and all information which is contained in a *.pcb design file. The leading PCB CAD softwares are able to create gerber files as an output of PCB design file.  These softwares generally use RS-274-X Gerber file format because it is newer and easy to handle data files.


A gerber file is divided into the following four subparts:


  • Configuration Parameters
  • Aperture Definitions
  • Drawing Commands
  • X/Y Coordinates


Each file extension denotes a specific layer such as:


Top Layer => *.gtl

Bottom Layer => *.gbl

Keepout Layer => *.gko

TopOverlay Layer => *.gto

BottomOverlay Layer => *.gbo etc.


2.Generating Gerbers: An example


The softwares have a feature to execute gerber output generate command. Usually, it is a dialogue box which has enable and disable options to include and exclude certain layers and parameters to include or exclude from gerber output files. In RS-274-X file format one file is produced for each one layer of PCB design file.


For instance in protel 99se PCB design software:


The gerber files generator can be launched from (PCB editor) Tools> Generate Gerber files command.


The following CAM Options dialogue box opens:



Figure 1: Setup for Gerber output


However, every software has its own style of creating Gerbers files. They may have small differences compared to others to execute commands. Set of commands that how to generate Gerbers in specific software are best explained in the respective software manual. This example is produced to guide about the process step by step.

The dialog box in Figure 1, produces settings for location to save output gerber files. Almost all PCB designers know to set the folder and file path in a desktop computer.



Figure 2: Gerbers Settings Dialogue Box



The dialogue box in Figure 2, appears to make settings that what to include in the gerber files command, if executed. The first pane makes resolution of scan. The description below to the dialogue box is self-explanatory and can be chosen by clicking the respective radio-box. Higher resolution occupies more memory but have better data precision. There are two settings: the metric (mm) system and imperial (inches) system of units. Gerbers in both formats can be generated. However, for data clarity and to be safe side, generate Gerbers in both mm and inches format, in two separate folders with clearly mentioning their units type.


The next pane in this dialogue box is layers settings where different layers can be enabled to include or exclude in the output files. Generally, it is a good option to “enable all used layers”.


Drill drawing and mechanical layers panes make settings about drill drawing and mechanical layers respectively.


Apertures settings is used for thickness of tracks used and advanced is used some other settings. For producing gerber files it is a good practice to consult with your PCB manufacturer.



Figure 3: Settings Dialogue Box for NC drill files



The NC drill files setup produces PCB holes location and drill size information just like the gerber files i.e., location and size of drill. This also has the same settings and parameters as in Gerber files step. Produce the NC Drill files alongwith gerber files.


3.What Should Include In Gerber Files


In a gerber file following layers and information should be added:


  1. Signal layers: All signal layers which are used in the PCB design or those carry electrical signals should be enabled to produce its gerber file.
  2. Plane layers: Similar to signal layers all plane layers should also be enabled to produce gerber output files. These are solid coper layers which distribute power.
  3. Keepout layer: Keepout layer is electrical boundaries of the board. This can also be used to board cutting boundary.
  4. Mechanical layers: The used mechanical layers should also be enabled.  A mechanical layer may not have any electrical information like in signal layer or plane layers. However, they can have some information about mechanical parameter like PCB cutting or fixing in enclosures.
  5. Overlays: The top overlay and bottom overlay which have information of components designators and other PCB nomenclature notes.
  6. Dimensional Information: PCB Dimensions information should be added on top overlay or mechanical or keepout layer of  PCB design file before generating gerber files.
  7. Layer stackup: Before generating gerber files add layer stackup information in any enabled mechanical layers so that manufacturer can use information about PCB material such as base material thickness, pre-preg thickness type etc.
  8. Preferably produce time and date stamped Gerber files so that they would be back traced for any query.
  9. Recheck and verify the file types using any gerber viewer software tool.
  10. If found accurate and forward to the manufacturer.



Figure 4: Gerber files enable and disable and extensions



Figure 4 shows the enable and disable of different layers view in gerber file setup dialogue box .




The gerber file format is a defacto standard of interface between a PCB Design engineer and manufacturer. Gerber format is RS-274-X 2D ASCII file format. It includes all conductive, mechanical, text and keepout layers information of a PCB design alongwith necessary notes for manufacturing.


The RS-274-X format produces one file for each layer of PCB and is preferred by the PCB industry. It is designer's responsibility to add layers carefully to generate files. Any confusions and wrong data may cause an surprised and unwanted PCB that may be garbage only.