What is the difference between Gerber and Gerber X2 files?

Posted by

Introduction to Gerber Files

Gerber files are the standard file format used in the electronics industry to describe the printed circuit board (PCB) design for manufacturing. Developed by Gerber Systems Corp. in the 1960s, Gerber files are now widely used to transfer PCB design data between PCB design software and manufacturing equipment.

A Gerber file is a 2D vector image file format containing information about a PCB layer, such as copper traces, solder mask, legend, drills, etc. Each layer of the PCB is represented by a separate Gerber file.

Anatomy of a Gerber File

A Gerber file consists of a sequence of commands that describe shapes, apertures, and flashes at specific coordinates. Here are the main elements that make up a Gerber file:

  • Apertures: The building blocks that define pad and trace shapes (e.g. circles, rectangles, octagonal pads, etc.)
  • D-Codes: Refer to specific aperture shapes used
  • G-Codes: Prepare the plotter to draw (e.g. move to coordinates, flash an aperture, start/stop polygon fill)
  • Coordinates: The X,Y locations on the PCB where apertures are flashed or traces are drawn
  • Polarity: Indicates whether to add or remove material (e.g. clear vs dark in image polarity)
  • M-Codes: Provide extra metadata about units, file name, etc.

Limitations of Gerber Files

While Gerber files have been the PCB industry standard for decades, the format has some notable limitations:

  • No net list data: Gerber contains no information about how traces and pads interconnect between layers
  • Lack of layer stackup data: The layer order, materials, and thicknesses are not conveyed
  • No version control: Changes are not tracked between Gerber file versions
  • Ambiguous data: Gerber has multiple ways to convey the same information
  • Incomplete data: Certain aspects may be undefined or missing
  • Difficult to parse: The Gerber format can be complex to interpret correctly

To address these shortcomings and modernize the aging Gerber format, a new specification called Gerber X2 was introduced in 2014.

Introducing Gerber X2

Gerber X2, also known as Extended Gerber or Gerber X2 format, is an enhanced version of the Gerber format that includes additional metadata to better describe the PCB design intent to manufacturers.

Advantages of Gerber X2 vs Gerber

Gerber X2 offers several key improvements over traditional Gerber files:

  1. Validation: X2 files can be checked for errors and missing information before production, reducing delays
  2. CAD netlist: X2 includes a complete netlist describing the connections between components and traces on the PCB
  3. Layer stackup: The layer structure, materials, thickolds and dielectrics are clearly defined in X2
  4. Attributes: X2 can flag conductive/non-conductive pads, via protection, pins, SMD vs through-hole, etc.
  5. Clarity: The X2 format was designed to be unequivocal and complete to avoid misinterpretation

What’s Included in Gerber X2?

In addition to the graphical image data from standard Gerber, X2 files include three extra streams of information:

  1. Attributes: Tags for features like pads, vias, component type, pin numbers, polarity, etc.
  2. Aperture definitions: Custom shapes with specific sizes are embedded in X2 rather than using D-codes referring to external aperture lists
  3. Netlist: A complete blueprint of the PCB’s electrical connectivity

This extra data is conveyed through new X2 commands such as %TA (attributes), %TD (aperture definitions), %TO (net list begin), and %TF (end of file).

Gerber X2 Example

Here is a sample of what Gerber X2 source code looks like compared to standard Gerber:

%FSLAX2Y2*%
%MOMM*%
%ADD100C,1*%
%TA.AperFunction,ComponentPad*%
%ADD101C,0.8*%
%TA.AperFunction,SolderMask*%
%TF.Part,Single*%
%TF.FileFunction,Copper,L1,Top*%
%TF.FilePolarity,Positive*%
%TF.ProjectId,Sample_Board,rev3*%
%TF.CreationDate,2023-05-06*%

G01*
%TO.P,J3,1,C\R1,2\C6*%
D100*
X1000Y1000D03*

%TO.N,GND,i:J3_5_GND*%
D101*
X2000Y500D03*

M02*

In this example, we can see the new X2 commands for attributes (%TA), file metadata (%TF), and netlist (%TO) that provide additional context about the PCB design data beyond just the image primitives.

Benefits of Using Gerber X2

Utilizing Gerber X2 files in your PCB design and manufacturing workflow offers several important benefits:

1. Improved Communication

X2 files paint a clearer and more complete picture of the designer’s intent compared to traditional Gerber. By providing richer metadata in an unambiguous format, X2 helps ensure that the manufactured PCB matches exactly what the engineer envisioned.

The embedded netlist and layer stackup data act as a contract between designer and manufacturer, eliminating guesswork and reducing the risk of misinterpretation that can lead to scrap and delays.

2. Faster Validation

With a complete netlist and attributes included in the X2 data, manufacturers can quickly run automated checks to flag potential issues early in the process. Common errors like copper-to-copper spacing violations, missing solder mask openings, or incorrect hole sizes can be caught and corrected before production begins.

This streamlines the quoting and engineering questions phase and reduces time-consuming and costly back-and-forth between fab houses and designers. According to Ucamco, the creators of the Gerber format, X2 allows manufacturers to get jobs running on the production floor 25-30% faster on average.

3. Fewer Manufacturing Defects

The detailed, contextual design data in X2 files acts as a virtual “traveler” that accompanies the PCB through every stage of production. At each step, the extra information helps operators select the right materials, settings, and inspection criteria with less ambiguity.

For example, knowing which holes are vias and which are mounting holes, or which SMD pads have pin 1 markers enables more intelligent DFM analysis and better automated optical inspection (AOI) coverage. This attention to detail helps catch more defects and improve yields.

4. Easier Revision Control

Another advantage of X2 is that the version and modification history is tracked in the file metadata. This allows designers to easily manage changes between board spins and ensure manufacturers are always working from the latest design revision.

Gerber X2 also supports portable job archives called “zip bundles” that pack all the fabrication and assembly data, plus a manifest.xml describing the contents, into a single zip file. This makes it convenient to store and transfer a complete snapshot of the design between parties.

5. Foundation for Industry 4.0

Gerber X2 is more than just an improvement over standard Gerber – it is setting the stage for a more intelligent, automated, and connected PCB fab ecosystem.

With the rich, machine-readable data in X2 files, manufacturers can feed complete PCB design intent into smart factory systems for optimization. Real-time data from production equipment can be associated back to the original design for traceability.

The additional context of X2 can also streamline the flow from PCB design to assembly by allowing centroid files, BOM, CPL, and other pick-and-place data to be generated automatically. As Industry 4.0 trends like these take off, X2 will be a key enabler.

Challenges of Adopting Gerber X2

Despite the clear benefits, Gerber X2 adoption has been relatively slow since the specification was introduced in 2014. Several factors are contributing to the sluggish uptake:

Legacy Inertia

Many of today’s PCB design and manufacturing tools were built around standard Gerber and lack native support for X2 features. Updating software and workflows to take advantage of X2 can require significant investment.

Designers may be hesitant to switch to X2 if they are unsure whether their manufacturer can accept the format. Likewise, manufacturers may not feel pressure to upgrade their processes to handle X2 if customers are not requesting it.

Until there is a stronger “pull” from the industry for intelligent features, the momentum of legacy Gerber flows built over decades will be hard to overcome. However, as new tools emerge and more users see the benefits, this chicken-and-egg problem should eventually sort itself out.

Partial Adoption

Another challenge is that some companies are only partially adopting Gerber X2 rather than utilizing its full capabilities. For example, a designer may export X2 files from their CAD tool but not include net information. Or a manufacturer may accept X2 files but ignore the embedded attributes and net data, treating it like plain Gerber.

In these cases, users are missing out on the true power and efficiencies that X2 enables. The industry will need continued education and tooling support to take full advantage of X2 as it was intended.

Competing Standards

Finally, the emergence of alternative data transfer formats is putting pressure on Gerber X2 adoption. In particular, the IPC-2581 standard, which is openly published by the IPC consortium, is paving a different path towards intelligent, “single-file” design data handoff to manufacturing.

While Gerber X2 took an incremental, backward-compatible approach, IPC-2581 is a more complete rethinking of how PCB design data is structured and exchanged. It will be interesting to see how these two formats evolve and compete in the coming years.

FAQ

What is a Gerber file?

A Gerber file is a 2D vector image file format used to describe the printed circuit board (PCB) copper layers, solder mask, legend, and other manufacturing information. It was developed by Gerber Systems Corp. in the 1960s and has been widely adopted as the de facto standard for PCB fabrication data.

What is Gerber X2?

Gerber X2, also known as Extended Gerber or Gerber X2 format, is an enhancement to the Gerber file format that includes additional metadata and constructs to better convey PCB design intent for manufacturing. It was introduced by Ucamco in 2014 to address some of the limitations and ambiguities of the original Gerber format.

What is the main difference between Gerber X2 and Gerber?

The main difference is that while standard Gerber files contain only basic image data (copper shapes, apertures, flashes), Gerber X2 includes additional information such as a attributes, a complete netlist, and layer stackup data. This extra context makes it easier for manufacturers to understand and validate the PCB design.

Does my PCB design software support Gerber X2?

Many of the major PCB design tools now have the ability to output Gerber X2 files, although the feature may not be enabled by default. Check with your software vendor for specific instructions on generating X2 as part of your manufacturing data package.

How can I check if a manufacturer accepts Gerber X2?

Most PCB fabrication and assembly shops will specify the CAD file formats they accept, including Gerber X2 if supported. If in doubt, contact the vendor directly to confirm. Some manufacturers may accept X2 files but not leverage the enhanced features, so clarify how they handle X2 attributes and other metadata.

Conclusion

Gerber X2 represents a significant step forward in the way PCB design data is conveyed to manufacturers. By providing a complete “contract” with attributes, a netlist, a materials stackup and more, X2 files enable a faster, less ambiguous, and more automated fabrication and assembly flow.

While adoption of X2 has been slower than hoped since it was introduced in 2014, the momentum is growing as more users recognize the benefits and tooling support improves. The Gerber format overall has been resilient over decades and the X2 extensions should give it plenty of life for years to come.

Ultimately, the PCB industry will continue marching towards more intelligent data exchange that allows design intent to drive manufacturing automation, traceability, and optimization. Gerber X2 is poised to play a key role in that revolution.

Feature Standard Gerber Gerber X2
Image data (copper, solder mask, etc.) Yes Yes
Apertures and D-Codes Yes Yes
Netlist No Yes
Attributes No Yes
Complete layer stackup No Yes
Validation / DFM checks Manual Automatic
Unambiguous data format No Yes

Leave a Reply

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

Categories

Tag Cloud

There’s no content to show here yet.