Misidentified Layers-Why Not Follow Gerber X2 Standards
Misidentified Layers-Why Not Follow Gerber X2 Standards
What is Gerber X2?
Gerber X2 is the next-generation Gerber file standard, which adds new commands to the existing Gerber RS-274X format to specify the attributes of the file.
The following code snippet shows some of the new commands in Gerber X2. Lines starting with %TF and %TA are specific to the Gerber X2 format.
G04 Small example Gerber X2 file*
%FSLAX35Y35*%
%MOMM*%
%TF.FileFunction,Copper,L4,Bot,Signal*% // Indicates this file contains the bottom copper layer
%TF.Part,Single*%
%TA.AperFunction,Conductor*%
%ADD10C,0.15000*%
%TA.AperFunction,ViaPad*%
%ADD11C,0.75000*%
%TA.AperFunction,ComponentPad*%
%ADD12C,1.60000*%
%ADD13C,1.70000*%
%SRX1Y1I0.00000J0.00000*%
G75*
%LPD*%
D10*
...
The Gerber X2 format addresses many of the issues with RS-274X. Most modern EDA tools now support outputting Gerber files in the Gerber X2 format. Newer versions of EDA software might default to Gerber X2, leading to an increasing number of customer submissions in this format. Adapting to this standard is essential.
Problem Description
As shown below, several Gerber files are all recognized as copper layers despite their filenames following the recommended rules. Why are they still misidentified?
· Ser_par.GBL // Traditionally bottom copper, identified as a copper layer
· Ser_par.GBS // Traditionally bottom solder mask, identified as a copper layer
· Ser_par.GKO // Traditionally outline, identified as a copper layer
· Ser_par.GTL // Traditionally top copper, identified as a copper layer
· Ser_par.GTO // Traditionally top silkscreen, identified as a copper layer
· Ser_par.GTS // Traditionally top solder mask, identified as a copper layer
· Ser_par.XLN // Drill file
Cause of Error
These files are in Gerber X2 format. According to Gerber X2 standards, the file includes built-in layer attributes, which take precedence over the filename. This is why the files are misidentified.
Let's take a look at the content of the Gerber X2 files in the example.
Solution
There are two options; choose one:
1. Continue using Gerber X2 format: Ensure the layer attributes are correctly defined before outputting the files. Most EDA software can correctly output these attributes.
2. Use RS-274-X format: If you prefer to distinguish layer attributes by filename, output the files in RS-274-X format. This way, the Gerber X2 attributes won’t interfere. (Exceptions are noted below).
Note: RS-274X Files with Gerber X2 Attributes
The Gerber RS-274X format has been around for a long time and is widely supported. Many older systems support RS-274X but not X2. Some early versions of EDA software tried to incorporate Gerber X2 benefits while remaining compatible with RS-274X by outputting Gerber X2 commands as G04 comments (G04 indicates a comment in Gerber). Although fundamentally still RS-274X, they include Gerber X2 attributes.
In such cases, when analyzing layer attributes, we still follow Gerber X2 standards.
Note: These attribute lines are generated automatically by upstream EDA software. Do not attempt to manually modify them, as it can easily cause errors. Even a missing space or punctuation can lead to parsing failure.
G04 Small example Gerber X2 file*
%FSLAX35Y35*%
%MOMM*%
G04 #@! TF.FileFunction,Copper,L4,Bot,Signal* // Indicates this file contains the bottom copper layer
%ADD10C,0.15000*%
%ADD11C,0.75000*%
%ADD12C,1.60000*%
%ADD13C,1.70000*%
%SRX1Y1I0.00000J0.00000*%
G75*
%LPD*%
D10*
Last updated on Aug 9, 2024