The Gerber Guide: by Karel Tavernier
The Gerber Guide: by Karel Tavernier
What does a PCB fabricator do with jobs on it, as well as a border for plating,
CAD fabrication data? test coupons, etc. This is illustrated in Figures
PCBs are typically fabricated in about 22 1–3.
steps, many of which are digitally controlled It follows that the fabricator can do nothing
and require dedicated data modules called pro- with production tools for a single job: he ne-
duction tools. eds films and drill files for panel production.
Some designers believe that their PCB fabri- Another reason is that deviations are inevitably
cation data will drive the fabricator’s production introduced by the fabrication processes, such
machines directly; that the Gerber files will be as layer distortion during lamination and line
used directly on the PCB fabricator’s photoplot- width reduction during etching. These must be
ter; that Excellon drill files will go straight onto compensated for prior to manufacture. A third
the fabricator’s drilling machines; and that IPC- reason is that the production tools driving the
D-356A netlist will go right into electrical test fabricator’s equipment must fit the fabricator’s
machines. specific requirements so must often be conver-
Not so. Fabricators never use the Gerber or ted to a proprietary format associated with the
Excellon files directly on their equipment. machine.
There are many reasons for this, the sim- For all these reasons, the production tools
plest of which is panelization. Even though that will drive the fabricator’s equipment are
the designer’s data describes a single PCB or generated by the fabricator’s CAM department.
maybe an array, the job is never manufactu- PCBs cannot be professionally fabricated wi-
red as such. It is always put on a production thout this step: no CAM, no fabrication. It’s as
panel, which will typically have multiple simple as that.
• Create the production panel (a.k.a. system which analyses, reworks and transfor-
working panel). ms the image and drill information into pro-
• Compensate for deviations in the duction tools. This is a very different proposi-
manufacturing processes (e.g., scaling to tion from using the designer’s datasets directly
compensate for distortions during as production tools in two aspects:
lamination). At this stage CAM has a
model of the production panel as it will • The data files are not treated as
be manufactured. standalone items, but must be viewed
“
• Send fabrication data to ERP. as an interconnected dataset that,
• Output dedicated digital pro- together, describes a PCB.
duction tools to drive the • PCB CAM needs to “know”
NC fabrication equipment more about a PCB than just the
(photoplotting, direct To generate the image. CAM needs to know,
imaging, legend printing, production tools, for example, which pads are
drilling, routing, scoring, edge connectors, because
AOI, electrical test files, the CAM operator these need to be gold plated;
AVI). The content of needs a perfect CAM needs to know which
these production tools drill holes are vias, because
is very specific to the fa- physical model of the solder mask is treated dif-
bricator’s and customer’s ferently for via pads than for
the bare PCB.
”
setups, as the informa- component pads, and so on.
tion needed and format
used are often proprietary These two points affect the
and specific to the equipment way in which the designer’s PCB fa-
brand and model, while the equipment brication data should be structured. The designer
must “know” customer-specific details need not worry whether his or her files will be
such as the location of the fiducials for re- able to drive NC production machines; it is the
gistration on the direct imager and “don’t job of the fabricator’s CAM to manipulate the de-
care” zones for the AOI system. sign data so that it will run on real production
equipment. The designer’s focus should be on
To generate the production tools, the CAM specifying the end product accurately, comple-
operator needs a perfect physical model of the tely and unequivocally.
bare PCB. As we have said, the client’s incoming Remember: CAD output is CAM input and
fabrication data is used as digital data to recon- not machine input. When creating fabrication
struct that physical model. data from CAD, do not ask, “What can I do to
It may at first sight seem strange that machi- create better production tools?”
ne files such Gerber, Excellon and IPC-D-56A are Instead, ask, “What can I do to create better
used for this, but it actually makes perfect sense. CAM input?”
The Gerber format has evolved way beyond its
origins as a photoplotter driver to become the Part 2 of this series will be published next
perfect vehicle with which to transfer digital month. PCBDESIGN
image and drill information from CAD to CAM.
And it is precisely because of those origins that Karel Tavernier is managing
Gerber files are so perfectly suited to their current director of Ucamco. Karel has 30
role of accurately representing where copper and years’ experience in software and
other materials are. Similarly, Excellon drill files imaging equipment for the PCB
correctly specify where the drill holes are. Which and electronic printed packaging
makes these formats capable of describing a PCB. industry, including sales, service
So the incoming Gerber, Excellon and other and R&D at Barco, Belgium.
data is always read into the fabricator’s CAM
will do the rest: it will optimise and panelise the physical part of the PCB) to any accompanying
PCB and on output of the final, panelised data, drawings.
it will mirror, rotate, shift and scale as required Sometimes, registration is resolved by ad-
by production. Any designer that mirrors layers ding alignment targets to the images. Don’t do
can only hope that the CAM engineer notices this. CAM engineers must manually move the
this and ‘unmirrors’ them. layers around until the targets align, and then
Sometimes the drill/rout files use comple- manually remove the superfluous alignment
tely different coordinates from those used by marks, both of which take time on the CAM sy-
the copper layers, typically because the copper stem and are a far cry from automatic, standar-
layers are output in Gerber and the drill files in dized data transfer. Eliminate complications by
Excellon. (We will look at this in more detail in using the same coordinates, and register your
Chapter 4.) This results in misalignment, whi- data files.
ch the CAM engineer must then correct. This Your favorite Gerber viewer will no doubt
is generally relatively easy as the pattern of allow you to verify that they are aligned. Re-
drill holes and pads is quite characteristic, but member: Output all layers in the same coordi-
it’s less easy with very symmetrical jobs. Easy nate system.
or not, the goal is to take the guesswork out of Next month we’ll look into Chapter 3. See
data transfer, and deliver aligned drill files. The you then. PCBDESIGN
simplest remedy is to output drill and rout files
in Gerber so that the same coordinates are used
for both file types. Karel Tavernier is managing
In fact, all physical layers should be aligned, director of Ucamco.
so those same coordinates should be applied
to the solder mask, legend, board outline, and
peelable layer, and for the sake of clarity, even
though it’s not mandatory (as they are not a
It is possible to fabricate PCBs from the fa- Chapter 3: The PCB Profile (or Outline)
brication data sets currently being used; it’s being The profile defines the extent of the PCB.
done innumerable times every day all over the It separates the PCB from what is not the PCB
globe. But is it being done in an efficient, reliable, and is an essential part of PCB fabrication data.
automated and standardized manner? At this Without the profile, the PCB simply cannot be
moment in time, the honest answer is no, because fabricated. The profile must be properly and
there is plenty of room for improvement in the precisely defined.
way in which PCB fabrication data is currently The profile defines a simple region in the
transferred from design to fabrication. 2D plane. The proper way to do this is to speci-
This is not about the Gerber format, which fy a closed contour: The inside of the contour
is used for more than 90% of the world’s PCB is the PCB, and the outside is not. It is that
production. There are very rarely problems with simple.
Gerber files themselves; they allow images to be Note that such a simple region is solid, wi-
transferred without a hitch. In fact, the Gerber thout holes. By definition then, a profile cannot
format is part of the solution, given that it is the have holes intentionally placed within it. These
most reliable option in this field. The problems are superfluous and represent an unnecessary
actually lie in which images are transferred, how and complicated duplication given that drill
the format is used and, more often, in how it is holes are well defined in the drill/rout file. One
not used. can view cut-outs in a PCB as still part of the
In this monthly series, I will explain in detail PCB, just as much as the drill holes are.
how to use the newly revised Gerber data format A contour is defined by the Gerber spec as
to communicate with your fabrication partners follows:
clearly and simply, using an unequivocal yet ver- “A contour is a sequence of connected draw
satile language that enables you and them to get or arc segments. A pair of segments is said to
the very best out of your design data. Each month connect only if they are defined consecutively,
we’ll look at a different aspect of the design to fa- with the second segment starting where the first
Figure 1: Profile defined by G35/G37 region. Figure 2: Profile stroked with a thin aperture.
one ends. Thus the order in which the segments with the profile. However, this is not a substitute
of a contour are defined is significant. Non-con- for digital data.
secutive segments that meet or intersect fortui- Corner marks are sometimes used to indicate
tously are not considered to connect. A contour the profile. Again, corner marks are meant for vi-
is closed: The end point of the last segment must sual interpretation and do not constitute digital
connect to the start point of the first segment.” data. Therefore, they are not a valid specification
The Gerber format regions are defined by of the profile.
contours using the G36/G37 commands. This is What is definitely unacceptable is to take a
precise and unequivocal, and is the recommen- copper layer and add a crude manually-drawn
ded way to specify the profile. The filled contour line that, to make matters worse, is drawn with
covers the PCB exactly. the same aperture as the copper tracks.
If this is not possible, the profile can be spe- Next month we’ll move on to Chapter 4. See
cified by drawing the contour with a zero size you then. PCBDESIGN
or very small size aperture. If the aperture is This column has been excerpted from the
not zero size, the profile is the center line of the Guide to PCB Fabrication Data: Design to Fabrica-
stroked line; in other words, do not compensa- tion Data Transfer.
te for aperture size. You are transferring an ima-
ge, not a production tool for a drill machine. Karel Tavernier is managing
The profile layer is not copper. It is more akin to a director of Ucamco.
drill or rout file as it affects all layers. The outline
should therefore be put into a separate file, and
not shoved into a copper layer.
It is helpful to provide a mechanical drawing
which are essential for automated CAD to CAM rounding and resolution in the Gerber and NC
data transfer. Attributes specify the span and drill files. To overcome this issue, the CAM en-
plating of a file, the function of a drill hole— gineer may “snap” the copper pads to the drill
that it is, say, a via hole—and the drill toleran- holes. This manual operation takes time and
ces. Gerber is the only format that supports at- carries risk, forcing the CAM engineer to mani-
tributes. NC formats do not. pulate the design, which is something the desi-
In addition, CAM departments often face gner does not want. The simplest solution is to
the following problems with NC files: output the drill files in Gerber at the same re-
solution as the copper layers. Then everything
• Drill files and copper layers are not matches perfectly.
registered as they use a different datum
point • Incomplete NC file
This occurs in nearly 50% of all job data sets. All too often—in a whopping 75% of PCB
Where this happens, the CAM engineer has to data sets, in fact—the NC files are incomplete
work the data, shifting and rotating each drill and require manual input of scale, unit and
file to register it with the copper layers. This is tool diameters. Such incomplete files relate to
a medieval way of working. The only secure so- a complete NC file as the (obsolete) Standard
lution is for the CAD professional to generate Gerber relates to a proper Extended Gerber file.
the drill and copper layers in perfect register, If you use Extended Gerber for image layers, it
preferably using the coordinates of the CAD sy- is not terribly consistent to stick to incomplete
stem on all layers, to facilitate communication drill files. (See Chapter 21.) You must use com-
between designer and fabricator. The under- plete drill files; the question is how to do this.
lying reason for misregistration is that copper Although it may be possible to set up the NC
layers are output in Gerber and the drill data in output of your CAM system to generate com-
an NC format. The NC output in CAD can pos- plete NC files, but the simplest solution is to
sibly be set up to register with the Gerber data, output in Extended Gerber, which is guaranteed
but the simplest way to guarantee registration is to be complete.
to output both in Gerber.
• Limited resolution of Excellon file
• Drill holes are not centered on the The Excellon format suffers from severe li-
copper pads mitations on resolutions, so while it is quite
When this occurs, part of the drill toleran- adequate for drilling, it is not recommended for
ce is gone before drilling even starts, increasing design transfer. There is no such limitation in
the risk of breakout. The root cause is different Gerber.
Figure 1: Drill and copper both in the same Figure 2: Drill and copper in different formats,
format, centered. not centered.
“
Copper layers and legends are also produced
by different processes for that matter, but no
There is not a single one claims they must be described by different
image formats. The only difference between
disadvantage in using Gerber drill and copper layers is that the drill file ap-
rather than an NC format to plies to a range of layers, the span, and not to a
single layer, and of course, the span must be cle-
express CAD-to-CAM drill data. arly specified, in both Gerber and NC formats.
On the contrary, it brings Here too, Gerber is better: NC formats have no
inherent mechanism for describing spans, whi-
many advantages in terms of le Gerber’s attributes allow span to be specified
”
completeness, accuracy, in a standard, machine-readable manner.
Conclusion: Gerber is far superior to the NC
consistency and simplicity. formats for transferring drill and rout data from
design to fabrication. Output your drill and
rout files in Gerber.
Example:
GJ01911Rev2.1_Legend$Top.gbr
GJ01911Rev2.1_Soldermask$Top.gbr
GJ01911Rev2.1_Copper$L1$Top.gbr
GJ01911Rev2.1_Copper$L2$Inr$Plane.gbr
…
GJ01911Rev2.1_Copper$L10$Inr$Plane.gbr
…
So what should you do if your PCB layout This column has been excerpted from the
software is not capable of outputting the current Guide to PCB Fabrication Data: Design to Fabri-
Gerber version with attributes? This is a pro- cation Data Transfer.
blem, and indeed the temptation is to suggest
that you consider switching to layout software
that supports up-to-date Gerber output. Karel Tavernier is managing
X2 is the Gerber standard to transfer the director of Ucamco.
layer structure. If you cannot output X2, you
will need to use an informal method to defi-
ne the layer structure in a legible form that the
Table 1.
plated. The diameter is easily specified by the Sometimes both plated and non-plated
aperture (tool) diameter in the Gerber drill holes are lumped together in a single file.
file, or the NC drill file for that matter. Span Some argue that this is OK because the drill
and plating are transferred in Gerber with the map indicates which holes are plated. The drill
‘.FileFunction’ attribute. To quote from the map does indeed indicate this (usually). But it
Gerber format specification (see Table 1). is not OK.
As can be seen from this excerpt, the Drill data must be standardized and machine-
Gerber format provides unequivocal language readable. Drill maps are neither standardized
to describe drill span and plating. It should be nor machine readable; they must be read
clear from this that any one file will describe offline by CAM operators, who must work out
one drill span and one plating instruction, the drill coordinates visually and then indicate
so different spans and plating instructions manually which holes are plated and which are
must be put into separate files. A typical PCB not. This terrible practice is bad enough if the
fabrication data set will therefore contain plated and non-plated holes are specified using
several drill files: one for PTH holes, another different tool numbers. But where plated and
for NPTH holes, and others for the different non-plated holes have the same diameter and
blind and buried spans. By creating data sets the file is “optimized” by using the same tool
in this way, we can ensure that the whole for both, it becomes really excruciating work for
drill file structure is standard and can be read the CAM engineer, and risky for the successful
automatically. outcome of CAM and production. This is why
If you are not able to add attributes to plated and non-plated holes should always be
the file in this way, the CAM operator must put in separate files. If this is not possible, at
manually determine the file function on his least use separate tools for them.
CAM system. In this case, you will be providing One more thing. In some cases, fabrication
the information informally, but it should still data comes in with just a drill map, and
be as simple and unequivocal as possible. The no digital drill data at all. This is simply
best way to achieve this is to make the function unacceptable. Drill machines cannot read a
clear in the file name (e.g., NPTH.GBR). A more drill map: drill machines have been using CNC
indirect method is to list the files and their data for decades. Without digital drill data, the
functions in a text file. CAM operator must pore over the drill map,
Figure 1: A drill map. It may be useful, but it’s not a substitute for drill data.
measuring and manually reconstructing the well nibble a slot in a rout file, or rout a large
drill data from it, in a laborious and error-prone hole. In conclusion, the fabrication data must
process. Don’t do this—have mercy on the poor specify what the fabricator must fabricate. The
CAM engineer! fabricator will decide how to fabricate it.
Note that the considerations in this chapter And remember: Put plated and non-plated
apply whether the drill files in your fabrication holes in separate files.
data sets are in NC or Gerber format. (In Chapter
4 in this series, we argue that Gerber is by far the This column has been excerpted from the
best choice). Whatever format you choose, the Guide to PCB Fabrication Data: Design to Fabri-
bare minimum is that you create a separate file for cation Data Transfer.
each span, and for plated and non-plated holes,
and that you clearly indicate which is which.
These requirements for drill data also hold
true for rout data. Even though drilling and Karel Tavernier is managing direc-
routing are very different fabrication processes, tor of Ucamco. Karel has 30 years’
the difference between them is largely irrelevant experience in software and imaging
when they are viewed as fabrication image equipment for the PCB and electro-
data: both simply indicate where material nic printed packaging industry, in-
is removed. Indeed, the fabricator may very cluding sales, service and R&D.
drawing is often absolutely essential. A technical data in Gerber does not automatically make
drawing is intended not for digital processing, but them drawings—or purely digital files.
for humans to look at, and it is made according Use only pure data files, without junk or
to time-hallowed rules as shown in Figure 1, and embellishments. You may object that the title
includes a frame, title block, notes and legends. block contains useful information. This may well
As drawings are images, they too are best be—if so, the solution is to put that information
transferred in Gerber (more in Chapter 10). in a separate text file or a true drawing. The data
Alas, sometimes digital data and drawings are is then pure and can be used without manual
confused and a drawing frame is added to digital cleanup and the information intended for the
data, resulting in a copper layer (Figure 2). human operator is conveniently available in a
While the frame is essential in a drawing that separate file.
is made for people, it becomes junk when added Remember, put only data in data files.
to a digital data file such as a copper layer that is
to be digitally processed by CAM software—and Chapter 8: Always Include the Netlist
this junk must be removed manually by the CAM Basically, a netlist is a set of nets, where each
operator before the data can be used. Digital net has a name and a set of nodes identified
data does not automatically become a drawing by their XY coordinates. Nodes on the same
because it represents graphic information. And net must be electrically connected. Nodes on
expressing both drawings and graphical digital different nets must be isolated.
Including the netlist in the PCB fabrication extends the regular netlist check performed
data set increases the security of data transfer by the CAM operator to encompass not only
by an order of magnitude. The first thing a the CAM process, but the complete CAD-to-
fabricator does after reading a fabrication fabrication data transfer.
data set into his CAM system is to generate a Now, errors in the transfer of image data
netlist—the reference netlist—from the image. from CAD to CAM are rare, but they do happen.
During the CAM process the CAM engineer And they are very costly when they happen.
will regularly check the job data against the Without the netlist, the fabricator cannot know
reference netlist to protect against operator or he is working from a wrong image. He will
software errors. When a netlist is present in the faithfully manufacture the wrong PCB, which
incoming fabrication data set, he will also check will pass his electrical test as it is tested against
his reference netlist against the supplied netlist. the netlist created from the wrong data. The
Any serious errors in the images or drill files error will only become apparent after the PCB
will inevitably result in netlist differences and is loaded with components, at which point the
set off an alarm. The presence of the netlist in the costs are staggering. All deadlines are missed,
fabrication data sets protects against mistakes in recriminations fly, and the search for the guilty
data transfer, whether these are due to software starts. Simply including a netlist largely protects
or operator error, in CAD output or CAM input. against such a rare but dramatic event – it is like
Adding the netlist to the fabrication data sets installing smoke detectors and sprinklers. Fires
do not occur often either but everyone takes A professional PCB fabrication data set must
steps to protect against them. include a netlist. Omitting it amounts to a self-
The netlist is a powerful check on the image inflicted competitive disadvantage.
data; it is akin to the checksums that are widely Because the inclusion of a netlist is so simple
used to make data transfer reliable. Including and is such a powerful security check on the
the netlist is simple. It is sufficient to include data, Ucamco’s position is that if a data transfer
an IPC-D-356A file in the data set. IPC-D-356A error occurs that would have been flagged by
contains all the necessary information, and checking back to a netlist, the responsibility lies
more. Virtually all manufacturers can read IPC- at least partially with the party that has neglected
D-356A and most CAD systems can output it. to include a netlist, or that has neglected to use
It is sometimes claimed that comparing a supplied netlist.
netlist and image data throws up many false Remember, always include an IPC-D-350A
errors. This is largely a problem of the past netlist file in the PCB fabrication data set.
when implementations were new and buggy.
Nowadays most netlist files are OK. This column has been excerpted from the
There is another way to view this: the netlist Guide to PCB Fabrication Data: Design to Fabri-
is the basis of any PCB layout, and the essential cation Data Transfer. PCBDESIGN
function of a PCB is to physically implement
that netlist. The PCB fabricator is expected to
electrically test the fabricated boards and to
guarantee that the shipped boards’ netlist is Karel Tavernier is the managing
correct. It is therefore of paramount importance director of Ucamco.
that the fabricator works from the correct netlist,
so it is an obvious requirement that the netlist
be supplied to the fabricator rather than leaving
him to reverse engineer it from the images.
which needs CNC data that has been generated Chapter 10:
by CAM. If the fabricator only has a drill map, Use only the Gerber Format
how do you expect him to generate the drill for your Image Data
data? Visually, by measuring the drill map on Keep data formats to a minimum, using only
an XY table and typing in the coordinates? those that are truly needed. Every extra format
Another example is the excellent profile used adds output and input processing require-
drawing in Figure1. This drawing defines and il- ments and increases the risk of bugs and version
lustrates the profile perfectly. The profile draw- problems. Mixing formats also increases the risk
ing may still be useful as a check, but it does of misalignment between files (see Chapter 2 in
not replace digital data specifying the profile, this series).
which can be read in automatically (see Chap- Copper layers must be expressed in Gerber,
ter 3 in this series). Note that while the draw- so Gerber is a given. Consequently, what can
ing does not specify the exact position of the reasonably be expressed in Gerber must be ex-
profile with regard to the copper layout, profile pressed in Gerber.
digital data does. Drawings are images, so they can—and
Remember, drawings are no substitute for must—be transferred in Gerber. Other formats
digital data. are often used for drawings: PDF, HPGL, DXF,
DWG etc. These may be fine formats, and DPF
is definitely a first-rate data exchange format,
but for PCB fabrication data drawings, Gerber is
the better choice: Your fabricator needs to read
your drawings into his Gerber-capable CAM sys-
tem to relate it to, and shed light on, the image
data—which is, after all, the very reason why
you sent the drawings at all. His CAM system
is definitely proficient in handling Gerber data
but it was not designed to handle other formats.
So, although PDF may be a better choice for
other workflows, Gerber is the format for draw-
ings in the PCB workflow.
Avoid complicated formats such as DXF
and DWG like the plague. You cannot expect
your professional CAM operator, who is highly
skilled in the Gerber format, to have access to,
and be familiar with, the high-end profession-
al software that would be necessary to handle
such formats. Simpler software is often of mixed
quality, and not safe or reliable enough to faith-
fully transfer your professional work.
Definitely do not use DXF or DWG for data
files such as copper layers. These formats were
neither designed for, nor suitable for, PCB
data. Indeed, such files are loathed by CAM
operators.
In fact, the number of formats needed is very
limited. Copper, drill, rout, solder mask, legend
must all be expressed in Gerber, and so must
the drawings. The netlist cannot be expressed
in Gerber, IPC-D-356A must be used. The infor-
Figure 1: A profile drawing.
mal data intended for human eyes—delivery
info, for example, can be expressed in plain text This column has been excerpted from the
or PDF files. More formal data is expressed in Guide to PCB Fabrication Data: Design to Fabri-
structured text files such as CSV, XML or YAML. cation Data Transfer. PCBDESIGN
Consequently the only formats you need are:
• Gerber
• IPC-D-356A Karel Tavernier is the managing
• Text files director of Ucamco.
• PDF, possibly
PDF is a fine and widely supported format; hope then that the CAM engineer notices this
however it is too complex for automatic data and “snaps” the via pads to the drill holes. This
extraction. Remarkably enough, the best option of course changes the copper image, which is
for PCB fabrication data is a plain text format, something the CAM engineer is not supposed to
as many fabricators have software that can do, but he is also supposed to deliver a perfectly
automatically extract information from such aligned PCB. So he’s damned if he does, and he’s
files. Formal information is best expressed in damned if he doesn’t.
structured text files: comma-separated values Misalignment sometimes arises even when
(CSV), XML, JSON or preferably YAML. YAML is the same resolution is applied to all layers. This
well structured and human readable, and YAML is usually because the output processors for
files are the easiest and safest to automate. Gerber and for Excellon round differently. As
Please do not use Excel, Word or PowerPoint for other issues mentioned above, the simplest
formats. Firstly, by doing so you introduce yet solution is to output the drill/rout layers in
more formats for your manufacturing partners Gerber. (See Chapter 2 in this series.)
to deal with. More importantly, they are not Ideally, Gerber files use six decimal places in
open formats: They are proprietary application inches and five or six decimal places in mm. If your
formats whose specifications are rightfully software cannot produce these resolutions then
closely-guarded secrets. They are not, therefore, get as close as you can. Some recommend the use
data exchange formats, and their use adds of lower resolutions, probably to save a few bytes.
unnecessary complications as automated data Who cares about saving a few bytes? Don’t follow
extraction is well-nigh impossible. They require this recommendation: lower resolution increases
dedicated interactive applications and cannot rounding errors. This not only affects alignment,
be built into automated workflows; what’s but, more importantly, it increases the risk of
more, version problems abound (e.g., between serious problems because these rounding errors
open source and Microsoft software). If you can make contours self-intersect, which is invalid
must choose between such formats and PDF, and result in invalid arcs.
choose PDF without hesitation, but plain text Low resolution is the root cause of most of
files are best. the few image errors in Gerber files; it does not
Often, general PCB data is delivered in happen often but it makes no sense to take this
drawings. This is an excellent and time-honored risk to save a few bytes. Another reason given to
practice in all fabrication industries, but here use low resolution is that the drilling machine
too, data cannot realistically be extracted from may not be able to handle big files. This may
drawings. Again, as automation protects against well be true but it is irrelevant: as we have
operator error, it is advisable to put all your already seen, the CAM system will output drill
general data in text files, even if it is already in files exactly as the driller needs them.
a drawing. Remember: Use the maximum precision
Always place all of your general data for co-ordinates, and output all layers with the
in human-readable text files, informally or same precision. PCBDESIGN
structured as in CSV, XML and YAML. Do not
use Excel, Word or Power Point formats for this This column has been excerpted from the Guide
purpose. to PCB Fabrication Data: Design to Fabrication Data
Transfer.
Chapter 12: Number of Digits Used
for Coordinates
Use the same resolution and number of digits Karel Tavernier is the managing
(resolution) for all data layers. If you use different director of Ucamco.
resolutions for different layers, the position of the
different elements will be rounded differently.
The result is that, say, via pads and drill pads
end up being out of alignment. You can only
The
Gerber Guide
Chapters 13 & 14
by Karel Tavernier yet versatile language that enables you and them
UCAMCO to get the very best out of your design data.
It is possible to fabricate PCBs from the fa- Chapter 13: The File Extension
brication data sets currently being used; it’s being Wikipedia states, “A filename extension is
done innumerable times every day, all over the a suffix (separated from the base filename by a
globe. But is it being done in an efficient, reliable, dot or space) to the name of a computer file ap-
automated and standardized manner? At this plied to indicate the encoding (file format) of its
moment in time, the honest answer is no, becau- contents or usage. Examples of filename exten-
se there is plenty of room for improvement in the sions are .png, .jpeg, .exe, .dmg and .txt.”
way in which PCB fabrication data is currently Microsoft states, “A file name extension is
transferred from design to fabrication. a set of characters added to the end of a file
This is not about the Gerber format, which name that determine which program should
is used for more than 90% of the world’s PCB open it.” The advantage of this rule is that the
production.There are very rarely problems with file format is clear without first opening the
Gerber files themselves; they allow images to be file, and, consequently, so is the preferred ap-
transferred without a hitch. In fact, the Gerber plication for the file.
format is part of the solution, given that it is the To quote from the Gerber format specification:
most reliable option in this field. The problems The Gerber Format has a standard file name
actually lie in which images are transferred, how extension a registered mime type and a UTI def-
the format is used and, more often, in how it is inition.
not used. Standard file extension: .gbr or .GBR.
Each month we look at a different aspect of Use the standard file extension .gbr or .GBR
the design to fabrication data transfer process. In on all Gerber files.
this monthly column, Karel Tavernier explains in All too often, names such as pn674847.
detail how to use the newly revised Gerber data top are used, meaning the top layer of job
format to communicate with your fabrication PN674846. This idea dates from the 1980s, the
partners clearly and simply, using an unequivocal days of MS-DOS, the first Microsoft operating
system. The file names in MS-DOS were restrict- the pen’s light beam which was switched on and
ed to a measly eight characters. Abusing the file off as the image dictated. Every movement was
extension to gain a few extra characters may governed by commands in input Gerber files.
have made sense in those days, but it makes no This was fine for drawing tracks. The prob-
sense today. lem started with planes, or anything with large
File extensions such as .ger, .pho, etc. are copper pours such as that shown in Figure 2.
also sometimes used. They do indeed express This is because vector plotters created these
the format, but in a proprietary, non-standard large copper pours using a technique called
way. Always use the standard extension .gbr or “vector-fill,” “painting,” or “stroking.” This in-
.GBR. volved repeatedly moving the table back and
One may object that the supply chain is used forth under the pen, just as a child moves a
to a file name convention such as in pn674847. crayon back and forth over an area until it is
top and it is not possible to simply throw it completely filled, as in Figure 3.
overboard. Fine: give this file its full name, in In principle, this worked. But in practice,
this case, pn674847.top.gbr. This is valid and the input Gerber file, containing the zillions of
the old file name is still prominent. draws that were needed for the vector fill, was
Remember: Always use the standard file ex- huge. More importantly, it took ages—easily an
tension “.gbr” for Gerber files. entire shift—to plot a plane, so it was highly
impractical.
Chapter 14: Negative Copper Layers The solution was to plot in negative, in oth-
Negative layers are a relic of the 1960s and er words, creating the clearances rather than the
1970s and the age of the vector photoplotter, copper pours, as shown in Figure 4.
which are now as obsolete as the mechanical This eliminated the need for painting, and
typewriter. The vector photoplotter was similar the Gerber file size and plotting times were kept
to a pen plotter, but instead of using ink and to a minimum. The negative film thus created
paper, it wrote onto photosensitive film using a was then used in the photolab as a phototool,
stationary light “pen.” The film was held firm on to generate the positive film that was necessary
a flat table that moved in the X-Y plane under for downstream production processes. Althou-
gh this added a step and involved manual work,
it was infinitely better than blocking the expen-
sive photoplotter for a whole shift with impa-
tient customers breathing down one’s neck and
demanding their plots. Negative films made a
lot of sense in the days of vector photoplotters.
But time has moved on since then, and so
Figure 4: A plane layer in negative. This gives CAM clear and unequivocal infor-
mation which is robust, numerically accurate,
and the anti-pads will register with the drill
files. And it’s as compact as a negative file, and
have printing devices. For decades, plotters and clearly defines the extent of the copper. Perfect.
direct imagers have used raster-scan technol- There is no longer any benefit in transfer-
ogy, whose speed depends solely on image area ring the data in negative. On the contrary: It is a
and resolution. Image content no longer dic- relic from the bad old days that adds confusion,
tates throughput so same-size planes and signal manual work, and risk.
layers take exactly the same time to plot. Always use positive copper layers. PCBDESIGN
So, negative files no longer offer benefits.
On the contrary, they introduce some serious This column has been excerpted from the
disadvantages: Guide to PCB Fabrication Data: Design to Fabrica-
tion Data Transfer.
• While positive layers have clearly defined
limits, negative layers do not, so arbitrary limits
must be imposed.
• In a mixed data set, there is no standard- Karel Tavernier is the managing
ized method by which to define which layers director of Ucamco.
are negative, so manual reverse engineering is
necessary. When all layers are positive there is
no problem.
the file. To quote from the Gerber specification: The only safe solution is to fix the
The responsibilities are obvious and plain. Wri- bugs in the Gerber output software. It is
ters must write valid and robust files and readers therefore essential that you provide detailed
must process such files correctly. Writers are not information of the problem to your software
responsible for navigating around problems in supplier so that the bug can be fixed for the
the readers, nor are readers responsible for sol- future. That said, the chances are that your
ving problems in the writers. board cannot wait for this fix and you have
It is therefore extremely important that you no way to output a valid file. This is then a
check that your files are valid. Invalid files can conundrum. You could send the invalid data
cause viewers to throw error messages like the with the necessary caveats and hope that your
one in Figure 1, taken from GC-Prevue: fabricator’s software, like your reader, will
These messages clearly indicate that there reverse engineer the intended image correctly.
is something very wrong with the file. The If it does, all is well. But this is a risk, so if you
question is, what you do if you see such errors? decide to do this, always include a netlist as
It’s not easy. Low resolution is often the root a safeguard, as advised in Chapter 8 in this
cause of problems, so it is worth trying to series. You can also ask your fabricator to send
output the file at the resolution recommended you the images he generates in CAM, so that
in Chapter 10 in this series. you can check them for errors.
Check the error messages of your Gerber Standard Gerber does not support attributes.
viewer and act on them. Extended Gerber files are machine readable,
they do not require painting, and they do support
Chapter 16: Standard Gerber attributes. Virtually all software reads Extended
To quote from the Gerber format Gerber and many new implementations no
specification: longer support Standard Gerber. There is not a
Standard Gerber is revoked and superseded single good reason left to use Standard Gerber.
by Extended Gerber, which is the current Ger- The use of Standard rather than Extended Gerber
ber format. Consequently, Standard Gerber no is a self-inflicted competitive disadvantage.
longer complies with the Gerber specification. To quote from the specification once more:
Files in that format can no longer be correctly Warning: The responsibility of errors or mis-
called Gerber files. Standard Gerber files are not understandings about the wheel file when pro-
only deprecated, they are no longer valid. cessing a Standard Gerber file rests solely with
Please use Extended Gerber for all of your the party that decided to use revoked Standard
operations. Standard Gerber is technically Gerber, with its informal and non-standardized
obsolete. If you are still using it, you are wheel file, rather than Extended Gerber, which
putting your business and that of your clients is unequivocally and formally standardized.
and business partners at a useless risk, without More information can be found in the Open
benefit. Letter on Standard Gerber, which is on the
Despite its name, Standard Gerber is not a download page at www.ucamco.com. PCBDESIGN
defined standard for PCB data transfer: Units
and aperture definitions, rather than being This column has been excerpted from the
governed by a recognizable standard, are in Guide to PCB Fabrication Data: Design to Fabrica-
an informal document, the interpretation of tion Data Transfer.
which is unavoidably subjective. As a result,
Standard Gerber files cannot be machine-read
in a standardized, reliable way.
Standard Gerber requires aperture painting Karel Tavernier is the managing
and copper pours, both of which create manual director of Ucamco.
work in CAM, adding cost, delay and risk to the
PCB manufacturing process.
production tolerances, as tolerances on pads are SMD pad, or an SMD pad on a copper pour).
often tighter than those on conductive copper. Image-wise these pads have no effect; whether
Thus CAM needs to know not only where they are present or absent, the image remains
and what the pads are, but must also be able to the same. However, CAM must know where and
edit them efficiently. Consequently, pads must what the pads are, and a valid Gerber file will
be differentiated from other copper features, but convey that information. The embedded pads
they must also be classified separately by type, must be present in your Gerber file; don’t “opti-
size and function so that they can be modified mize” your output by removing them!
separately.
The way to do this is in Gerber is simple: Do not use donuts!
All pads are represented using the flash of an Sometimes pads on a plated hole are repre-
aperture, with different apertures representing sented by a donut rather than a solid pad (Figu-
different types of pads, even if they are similar re1). Presumably, this is to make room for the
in size and shape. So a component pad and a drill hole or to indicate that copper will be re-
via pad that are the same size will have diffe- moved. And it is true, copper will be removed.
rent aperture numbers, making them easy to se- However the donut is very impractical because
lect and treat according to their different needs. it does not fit how the copper is removed. The
Pads should only be made using flashes, and fla- copper is not removed by imaging. First a solid
shes should only be used to make pads. pad is created by imaging, and then the pad is
Painted (stroked) pads are evil because they drilled. Consequently, CAM must laboriously re-
are so hard to edit. If a Gerber file served merely place all the donuts with solid pads to prepare
as an image, painted pads would be fine. Howe- for imaging. Furthermore with non-plated pads
ver, a Gerber file must also be editable, which, which typically truly are donuts, plated donuts
as we said, is not possible for painted pads. are confusing. Drill plated pads must be solid
Remember: All pads must be flashes, and all (Figure 2). Whatever you want to express by
flashes must be pads. using a donut is better expressed in another way.
pertaining to one single PCB. Putting more than This rule is violated every time that only one
one PCB in an archive is confusing; even if you solder mask is provided “because top and bot-
use a clever file naming scheme or comprehen- tom are identical.” This obnoxious habit may
sive explanatory note, you are potentially crea- save a few bytes but then questions arise about
ting a lot of confusion by putting different PCBs whether a mask was forgotten and which masks
in the same archive. must now effectively must be on the board.
Remember: one PCB, one archive. Confusion. The space saving is illusory anyway
The question is what must and must not be as the first thing the CAM operator must do is
included in the fabrication data set. Obviou- to create two masks from the single file. A big-
sly, the archive must contain all data needed ger archive is better than a confusing archive,
to fabricate the board, in a standard and une- and when both masks are present, even if they
quivocal format and manner. Less obviously, are identical, everything is clear.
the archive must not contain other files, super- Also mandatory are all fabrication drawin-
fluous data or duplicates. The reason is that the gs—in Gerber format—and fabrication in-
manufacturer must check each file to see if it structions such as finishes, ROHS etc. If it is not
contains relevant instructions. Superfluous fi- mandatory, it must not be there.
les waste his time and increase the risk that he Finally, and even if this seems like a su-
misses something essential. Aperture list files perfluous duplication of data, the CAD netlist
are superfluous, for example, as all the required should always be included (Chapter 8 in this
aperture information is in the Gerber files. CAD series). This genuinely original data provides a
data is also useless as it requires CAD software powerful and essential checksum on the data,
to handle it. Duplicate information is even wor- and is far better than a netlist generated from
se as the fabricator must compare the different the image data, which is only a reverse-engine-
files to check whether they contain conforming ered approximation.
instructions, and conflicts raise questions about Make the fabrication data set as simple as
what is now valid. Duplicate image information possible, but no simpler. PCBDESIGN
(e.g., in Gerber and ODB++ format) is especially
aggravating as images are complex and hard to
compare—which tolerances apply?
It is mandatory that one single Gerber file Karel Tavernier is managing
should be provided for each patterned layer director of Ucamco.
(copper, solder mask, legend, etc.) and for each
drill sequence present.