Understanding RS-274X Gerber Files for PCB Fabrication
RS-274X Gerber files serve as the universal blueprint for printed circuit board (PCB) manufacturing, translating digital board designs into physical hardware. This article provides a comprehensive breakdown of the specific layer definitions, aperture shapes, and X-Y coordinate data embedded within these standard electronics files. By understanding these three core components, engineers can ensure their design packages are accurately interpreted by fabrication houses to prevent costly manufacturing errors.
Layer Information in RS-274X
An RS-274X package does not put the entire PCB into a single file. Instead, each physical layer of the board is exported as its own distinct Gerber file. The file contains header parameters that tell the fabrication equipment how to process that specific layer.
The layer information includes:
- Copper Layers: Separate files for the top, bottom, and any internal signal or power planes.
- Solder Mask: Top and bottom files indicating where protective polymer coating should be absent (usually exposing pads for soldering).
- Silkscreen: Files for top and bottom component legends, logos, and text indicators.
- Solder Paste: Files used to create stencils for applying solder paste to surface-mount pads.
- Board Outline: A mechanical layer defining the physical perimeter and cutouts of the PCB.
- Layer Polarity: RS-274X utilizes two primary polarity commands: LPD (Layer Polarity Dark) and LPC (Layer Polarity Clear). LPD tells the photoplotter to add material (draw copper), while LPC tells the machine to remove material (create voids or anti-pads within a solid copper plane).
Embedded Aperture Definitions
What separates the modern RS-274X format from the obsolete RS-274D format is that RS-274X embeds aperture information directly into the file header, removing the need for an external aperture file.
In PCB fabrication, an aperture is analogous to a brush tip used by a
photoplotter to draw the board features using light. Every aperture is
assigned a specific "D-code" (ranging from D10 to D999) via the
%ADD command.
The aperture information contains:
- Standard Shapes: Circles (C), Rectangles (R), Obrounds/Ovals (O), and Regular Polygons (P), along with their exact physical dimensions.
- Aperture Macros (%AM): Complex, custom shapes constructed by combining basic geometric primitives. These are commonly used for thermal relief pads, custom land patterns, or chamfered edges.
- Function: Apertures are used in two ways. They are either dragged across the board to draw conductive traces (typically using a circular aperture) or "flashed" in a single spot to create component pads.
Coordinate Data and Operations
After the layer parameters and apertures are defined in the file header, the remainder of the RS-274X file consists of a sequential list of X and Y coordinates paired with operational commands. This tells the fabrication machine where to move and what to do with the selected aperture.
The coordinate data relies on the following structure:
- Format Specification (%FS): Located in the header, this defines how to read the numbers. It specifies whether leading or trailing zeroes are omitted and how many digits represent whole numbers versus decimals (e.g., 2.4 format means two integer digits and four decimal digits).
- Units (%MO): Explicitly defines whether the coordinate numbers represent Inches (IN) or Millimeters (MM).
- X and Y Values: The actual spatial locations on the
2D grid of the PCB. Because decimal points are omitted to save file
space, a coordinate like
X15000Y25000in a 2.4 inch format translates to X = 1.5 inches, Y = 2.5 inches. - I and J Values: Used alongside X and Y coordinates to define the center point of arcs when routing curved traces.
These coordinates are useless without action commands, which are controlled by three fundamental operational D-codes:
- D01 (Interpolate/Draw): Moves the photoplotter head to the specified X-Y coordinate with the light shutter open, drawing a continuous line (trace) from the previous location.
- D02 (Move): Moves the photoplotter head to the specified X-Y coordinate with the shutter closed. No material is exposed during this movement.
- D03 (Flash): Moves the head to the X-Y coordinate with the shutter closed, opens the shutter briefly to stamp the exact shape of the current aperture, and closes it again. This is how component pads are created.
- G-Codes: Preparatory commands inserted alongside coordinates to dictate movement style, such as G01 for linear movement, G02 for clockwise arcs, G03 for counter-clockwise arcs, and G36/G37 to turn polygon area fills on and off without needing a specific aperture.