Total Pageviews

Tuesday 10 February 2015

Know everything about gerber files generated using Eagle software

Cadsoft Eagle .brd to Gerber conversion guidelines

Eurocircuits preferred input format is still Gerber (RS-274X).Nowadays we also offer the possibility to upload Eagle CAD data (.BRD files) which we convert internally to Gerber before starting the normal flow.
Be advised that this conversion is automated and based on the Eagle layer names and functions.In case you have
designed the board while respecting the normal Eagle layers , the conversion should lead to a correct printed circuit
board. In case you have used layers for other functions then the ones prescribed in the Eagle manual, the conversion
could lead to a non-functional board.

Layer conversion rules - syntax:

Layer function (.file extension) consists of Eagle layer(s) : Eagle layer number & function + ….
Solder stop Component side (.STC) = 20 Dimension layer + 29 tStop laye
Silkscreen Component side (.PLC) = 20 Dimension layer + 21 tPlace layer + 25 tNames layer
Componentside (.CMP) = 1 Top layer + 17 Pads layer + 18 Vias layer + 20 Dimension layer
Inner layers (.Lox) = x Inner layer + 17 Pads layer + 18 Vias layer + 20 Dimension layer
Solderside (.SOL) = 16 Bot layer + 17 Pads layer + 18 Vias layer + 20 Dimension layer
Solder stop Solder side (.STS) = 30 bStop layer + 20 Dimension layer
Silkscreen Solder side (.PLS) = 22 bPlace layer + 26 bNames layer + 20 Dimension layer
Milling (.MILING) = 46 Milling layer + 47 Measures layer + 20 Dimension Layer
Excellon drill (.DRD) = 44 Drills layer + 45 Holes laye
Cream frame Componentside(.PMC) =31 tCream layer + 20 Dimension layer
Cream frame Solderside (.PMS) = 32 bCream layer + 20 Dimension layer
The conversion is fully automated because of this Eurocircuits cannot take any customer specific requests into consideration.
If the above rules don’t suit your needs,simply convert the .BRD project yourself into Gerber and supply the set of gerberfiles for further processing.

Generate Gerber and Excellon files in Eagle

Generating Gerber- en Excellon files in Eagle is easy. Simply follow these steps:
  1. Open the CAM Processor
  2. Select under File -> Open for Job
  3. In the window that now opens you select the correct .cam-file, in this case gerb274x.cam (in the Eagle subdirectory cam).
    For a 4-layer PCB select gerb274x-4layer.cam
  4. The job opens itself in the CAM processor window. . In the right-hand panel the necessary items are already selected.
    You do not need to do anything here.
  5. Activate in every(!) layer the Dimension by clicking on it. This shows the outline of the PCB.
    The tick box next to Mirror needs to be un-ticked each time.
  6. The final step is carrying out the job. This is simply done by clicking the button Process Job
  7. The CAM Processor places the Gerber files in the folder of your opened project.
    There are quite a few files there (six for a two-layer board).
  8. To create an Excellon filethat contains the information for drilling the holes, you select the excellon.cam file when opening the .cam-file (steps 2 and 3).
    You then click process job and the Excellon file will be generated.
  9. You now simply combine all these files into a single zip file and upload it via the Eurocircuits website.

Data to be uploaded with your PCB order.

Provide us ONLY with the data files needed for production. These are :
  • Gerber files for the copper layers, soldermask and legend layers, mechanical layer and SMD paste layers. Plus
    carbon, peel-off and via-fill layers as needed.
  • Excellon drill file(s) for drilling.
  • If you want us to prepare a customer panel (“array”, “matrix” or “biscuit”) from the single board data to your individual specification,
    the panel plan can be supplied as a Gerber or DPF file.
Please DO NOT provide any additional files such as original CAD data (other than Eagle), Graphicode GWK files,
PDF files, Word files (doc), Excel files (xls), part lists, placement and assembly information, etc.
Where possible check your generated output data (Gerbers & Excellon) with a Gerber viewer before you send it on to production.
Make sure that all instructions or other necessary input needed for making the boards are included in the Gerber and Excellon files.

Preferred data formats

Supply only ASCII-encoded files. These files are man-readable so that our engineers can check them if needed during data preparation. We cannot accept formats such as EIA or EBCDIC.

CAD Design data.

We do accept CADSOFT Eagle .brd.files. ( use the Eurocircuits Eagle DRU files )
  • Submitted .brd files will be converted in gerberformat automatically using a script. The script supposes that the drawing was made
    using the layers as described in the manual.
  • Which layer in Eagle is used to create which Gerber layer is described in the .brd to Gerber conversion guidelines
Other CAD PCB design data are not accepted because:
  • converting CAD data into production data may lead to errors which we cannot cross-check.
  • It is impossible to have legal copies of every CAD PCB design package in the market, and to have the necessary knowledge to use them all correctly. As designers do not all use the same software version of a package we would need to have a whole range of update patches as well.
  • Gerber is clear and unambiguous. It has been the industry-standard format for PCB manufacture for many years. Nearly every PCB design package can output Gerber data and the process will be fully described in your CAD PCB design package handbook or help-files.
  • You can check the accuracy of the Gerber output data by downloadiing one of the many free Gerber viewers available on the internet. We recommend ( and use ) the freeware viewer " PCB-Preview" from Graphicode.
Remark for our PCB proto pooling service : For reasons of automated analysis the PCB proto service only accepts Extended Gerber (RS-274X)or Cadsoft Eagle .brd files as input data.

Drill files : Excellon or Sieb & Meyer format

The Excellon and Sieb & Meyer drill formats are designed to drive CNC drilling and routing machines. They are broadly
similar, differing only in minor details.
Each drill file requires a separate tool-file giving the diameter of the tool ( in some cases the tool-file is embedded in the header of the drill file).
Your drill file should always show the finished hole-size you require.
A drill file without embedded tool sizes looks like this:
M48
%
T01
X-001375Y-008500
X-002125Y-008750
T02
X-006625Y+018250
X-007875Y+019500
...
A drill file with embedded tool sizes:
M48
INCH
T01C00.020
T02C00.024
T03C00.035
%
M70
T01
X07292Y04884
X07292Y05071
X07380Y08123
...
Where:
  • INCH/METRIC defines the unit
  • T01 is the tool number
  • C indiates that the text numbers are the drill sizes :
    00.020 = drill size 0.020" or 20 mil or 0.50 mm.
More information on the Excellon format is available on Wikipedia.

RS-274X (Extended Gerber)

RS-274X includes many high level commands and controls that let the creator of the Gerber data specify the PCB (photoplot) very precisely. The file contains all critical information.
RS274X is an extension to standard RS-274D (commonly known as Gerber) that includes:
  • Embedded format, unit and data information
  • Embedded apertures
  • Custom aperture definitions
  • Film control statements
  • Multiple layers embedded in a single file
  • Special polygon definitions
The RS-274X specification was originally developed by Gerber Systems.

Determine if your Gerber files are in RS-274X format or RS-274D format.

Open a Gerber file with a text file editor like ( Notepad, Wordpad,... )
If the files are in RS-274X format the aperture definitions will be embedded at the beginning of your file. There will also be a header which shows the coordinate format and other options you have selected when generating the Gerber output.
Example: %FSLAX24Y24*% this means : Format Statement Leading Zeros Suppression, Absolute Coordinates format=2.4.
The syntax is defined in the following image:
RS-274X Format statement
where:
L = leading zeros omitted
T = trailing zeros omitted
D = explicit decimal point ( meaning that no zeros are omitted)
A = absolute coordinate mode
I = incremental coordinate mode
Nn = sequence number, where n is number of digits ( rarely used)
Gn = preparatory function code ( rarely used)
Xa = format of input data ( 5.5 is max)
Yb = format of input data
Zb = format of input data ( Z is rarely, if ever seen)
Dn = draft code
Mn = misc code

Example of embedded aperture list:

%ADD10C,0.0060*%
%ADD11C,0.0050*%
%ADD12R,1.0375X0.1125*%
%ADD13C,0.0040*%
%ADD14C,0.0010*%
The synax is:
%ADD{code}C,{$1}X{$2}X{$3}*%
where:
AD - aperture description parameter
D{code} d-code to which this aperture is assigned (10-999)
C tells 274X this is a circle macro
R tells 274X this is a rectangle macro
$1 value (inches or mm) of the outside diameter
$2 optional, if present defines the diameter of the hole
$3 optional, if present the $2 and $3 represent the size of
a rectangular hole.
If you see the aperture macros present in your files then you definitely have files in RS-274X format.
A free Gerber & DPF viewer ( GC-Preview) can be downloaded from Graphicode. We have experience with this viewer, so we can help you if needed.
A complete description of the Extended Gerber format RS-274X can be found in the download section of the UCAMCO website : RS-274X Extended Gerber Format Specification

DPF (Dynamic Process Format)

The DPF information is part of Ucamco’s JOB database structure. Each JOB contains reference to one or more DPF files.
(Ucamco, formerly Barco ETS, is a manufacturer of laser plotting systems and digital workstations for printed circuit board
production).
DPF is the data format developed by Ucamco to represent layer information of a Printed Circuit Board. This format not
only describes the image of the layer such as pads, tracks, holes, power and ground planes but also includes electrical net
list information as well as additional product information represented with attributes.
Developed specially for the Electronics Manufacturing industry, DPF offers a variety of powerful features such as:
  • embedded aperture definitions
  • reverse objects
  • contour for outline description
  • block apertures to represent Step & Repeat items.
More information about this data format can be found in the download section of the Ucamco site: DPF v7 Format Description.

X,Y coordinates - Decimal point and Zero suppression

Coordinate data make up the bulk of Gerber files. It is difficult to manually follow the table motion from a printout because the Gerber format
uses several techniques to minimize the number of bytes required to represent the data. These suppression techniques are :
  • Suppress the decimal point in the x,y data
  • Suppress either the leading or the trailing zeros
  • Only output changes in coordinate data
  • Only output changes in commands

a. Decimal point suppression

The decimal point is redundant if you know in advance where it will be. The decimal point needs to be reinserted by the photo-plotter control software
in the correct location. Consider the following Gerber commands:
X00560Y00320D02*
X00670Y00305D01*
X00700Y00305D01*
The table moves along X from 00560 to 00670 during the first two commands. But what does 00560 represent? It
could be 5.6 inches, 0.56 inches, 0.056 inches or even 0.0056 inches. No way to tell. If the designer tells you that
there are two integers before the decimal point and 4 integers after the decimal point then you know that 00560
represents 0.56 inch.
b. Leading and Trailing Zero Suppression
The designers of the Gerber database didn't rest after eliminating the decimal point. They must have looked at a
printout and thought, "What good are all those extra zeros in front? Suppose we cut them off. You can still figure
out the coordinate value if you count decimal points from the right side of the number".
No Zero Suppression Leading Zero Suppression
X00560Y00320D02* X560Y230D2*
X00670Y00305D01* X670Y305D1*
X00700Y00305D01* X700Y305D1*
Without zero suppression 48 bytes are used. With leading zero suppression 33 bytes are required to represent the same information.
Depending on the data you might be better off leaving the leading zeros on and suppressing the trailing zeros.
No Zero Suppression Trailing Zero Suppression
X00560Y00320D02* X0056Y0023D2*
X00670Y00305D01* X0067Y00305D1*
X00700Y00305D01* X007Y00305D1*
To correctly interpret the data you must count from the left side of the number to locate the decimal point. Today leading zero
suppression is more commonly encountered.

c. Modal Data Coordinates

After eliminating the decimal point and suppressing the redundant zeros you might expect the database designers would rest on their success.
Not at all. One sharp eyed programmer noticed that the same coordinate would appear over and over again when the table moved only along
X or Y, so " Why not remember the last value of X and Y, and output a coordinate only if it changes?"
All coordinates Modal coordinates
X560Y230D2* X560Y230D2*
X670Y305D1* X670Y305D1*
X700Y305D1* X700D1*
The concept that the plotter remembers the last value of coordiinates is called 'modality'. PC boards often have hundreds of pads in a row
along X or Y and a properly sorted Gerber file will be much smaller when the redundant coordinate is eliminated.

d. Modal Commands

Modality is a good concept for data and works equally well for commands. For example, if you have a string of draw commands,
why repeat the D01 command again and again? Let it stay in effect until another command (D02 or D03) occurs to change it.
D1 not modal D1 modal
X560Y230D2* X560Y230D2*
X670Y305D1* X670Y305D1*
X700D1* X700*
X730D1* X730*
X760D1* X760*

RS-274D : Standard Gerber with separate aperture tables

We can illustrate the structure and the content by using a very simple Gerber file:
G90* 1
G70* 2
G54D10* 3
G01X0Y0D02* 4
X450Y330D01* 5
X455Y300D03* 6
G54D11* 7
Y250D03* 8
Y200D03* 9
Y150D03* 10
X0Y0D02* 11
M02* 12

The line numbers at the right side are not part of the file.
How to understand this Gerber file :
  • Just by simply looking at the file, we can easily see that each (*) asterisk defines the end of the line (EOL).
  • Further we can see that there are different kinds of commands:
    • instructions beginning with G, D, M
    • X,Y coordinates
  • Explanation of the commands
    1. G-Codes: initialization codes
    2. D01, D02, D03: Draw and Flash Commands
    3. D10-D999: Apertures or D-codes
    4. M Codes: Miscellaneous

1. G-Codes : Initialization codes

The G-commands are initialization commands. They are mostly used to indicate to the plotter which data format is used.
We can recognize the following G-codes:

G90/G91 Incremental vs. Absolute Coordinates: ( line 1)

  • The G90 command in line 1 tells the machine that data coordinates are absolute. Each set of coordinates is referenced
    to the table's origin (0,0).
  • The alternative to absolute is incremental - each coordinate is measured relative to the previous coordinate value and is set
    by issuing the G91 command.

G70/G71 Inches versus millimeters ( line 2)

  • The G70 command (line 2) indicates that the unit of measurements for the data to follow is inches
  • The G71 command indicates that the unit is millimeters

G54 optional demand - don't panic if you don't find it back (line 3)

  • The Tool select (G54) instructs the plotter to select the shape and line width described as Dxx immediately following the D54 command.

2. D01,D02,D03 : Draw and flash commands

D-codes are instructions to the photo-plotter. The first three D-codes control the movement of the x-y table.
  • D01 (D1) - line 4 : move to the x-y location specified with the shutter open
  • D02 (D2) - line 5 : move to the x-y location specified with the shutter closed
  • D03 (D3) - line 6 : move to the x-y location specified with the shutter closed; then open and close the shutter, known as flashing.
D01 is the command that "draws" lines, D02 is the command to move the table without exposing any film. D01 and D02 correspond to
moving the paper on a pen plotter with the pen down (D01) and the pen up (D02).
D03 is the flash command. The table is moved with the shutter down. When the desired X-Y coordinates are reached, the shutter
opens and closes leaving the image of the aperture on the film. The flash introduction is an efficient way to image the thousands
of pads present on most circuit boards.
The commands D01-D02-D03 follow the coordinate data - lines 4,5,6 would move the table position first to 0,0 with the shutter closed,
then draw a line from 0,0 to 450,330 and position a flash on 455,300.

3. Apertures or D-codes

Unlike D01,D02 and D03, the D-codes with values from 10 till 999 are data, not commands.
They represent the line thickness and the shape used to make flashes or draws.

4. Miscellaneous M-codes.

At the end of the file we see the command M02*. Gerber calls the M-codes "miscellaneous codes".
The only commonly used M-codes are the stop commands at the end of a file. M00,M01 and M02 are all different types of program stop commands.

5. X,Y coordinates - Decimal point and Zero suppression


Reference: http://www.eurocircuits.com/Indicating-slots-milling-contour-and-routouts-in-your-PCB-design
 

No comments:

Post a Comment