Eating Gerbers

Gerber is the most commonly used data format for PCB manufacturing. Its maturity is a mixed bag -- on the one hand it's ubiquitous and well supported by EDA tools and fab houses, but on the other, it seems outdated and encumbered by decades of requirements and constraints that aren't relevant today. I'll let others argue which format should replace Gerber, or if any should, or if its fit for purpose. The fact remains, though, that when I considered which formats to support for PCBmodE, Gerber had to be the first.

Having accepted that, my main grievance with Gerber is that the specification document maintained by Ucmaco is atrocious; examples have typos, the writing is poor and it's badly organised. For a widely used industry "standard", it's at a shocking state.

PCBmodE generates most of its features using the 'polygon fill' command ('G36' for start and 'G37' for finish) and the 'layer polarity' command ('LPD'/'LPC') to create interesting shapes with holes in them. Here's an example:

G04 level polarity (LP): dark (D), clear (C) *
 %LPD*%
G36*
G01X39174213Y-13609615D02*
G01X39174213Y-13609615D02*
G01X39174213Y-17040379D01*
G01X41573103Y-17040379D01*
G01X41573103Y-14985449D01*
G01X40206088Y-14985449D01*
G01X40206088Y-13609615D01*
G01X39174213Y-13609615D01*
G37*
G04 level polarity (LP): dark (D), clear (C) *
%LPC*%
G36*
G01X40206088Y-15673365D02*
G01X40550046Y-15673365D01*
G01X40550046Y-16352462D01*
G01X40206088Y-16352462D01*
G01X40206088Y-15673365D01*
G37*

which produces the following shape:



In the Gerber instructions, 'LPD' indicates that this is a 'dark' shape, and 'LDC' that it's clear. So if you place the 'dark' shape and only then the 'clear' shape, you get the above; it won't work the other way round, by the way.

Gerber also has the concept of 'layers' (in the latest Gerber spec version they renamed to 'levels' to avoid the obvious confusion). Theoretically, each Gerber file may have unlimited amount of levels, and it turns out that every time you change polarity a new layer is created. This means that my Gerbers can have over a hundred 'layers/levels'! In practice, though, some CAM programs appear to not support that many layers, and I also found out that at least one fab house I contacted uses levels when they 'pool' designs into the same panel. They told me that I can't use more than three 'layers/levels' in my Gerbers!

Luckily, other fab houses I'm in touch with don't consider this is a problem. I've also learned that electrical testing is done automatically by looking at apertures, and I don't use those for pads. I might solve this in the future by adding a tiny aperture in the centre of the pad's shape, or something like that. For now, the board is simple enough not to require those apertures and testing can be done through optical recognition.

I'm waiting for a couple of quotes for manufacturing; hopefully I'll 'press the button' tomorrow.

Saar DrimerComment