RS-274D : Standard Gerber with separate aperture tables

Posted by

What is the RS-274D Gerber Format?

RS-274D, also known as Standard Gerber or Gerber X format, is a file format used to describe the printed circuit board (PCB) layers in the manufacturing process. It was developed by the Gerber Systems Corp., now Ucamco, and has become the de facto standard for PCB design data exchange.

The RS-274D format is an extension of the older RS-274X format, adding support for aperture wheels and aperture macros. This allows for more complex pad shapes and reduces the file size compared to the older format.

Key Features of RS-274D

  • Uses separate aperture list files (wheel files) to define pad shapes
  • Supports aperture macros for custom pad shapes
  • Specifies the PCB layer image as vector data (lines and arcs)
  • Can include optional embedded attributes for layer stackup, materials, etc.
  • ASCII-based format that is human-readable

Gerber File Structure

A Gerber file in RS-274D format consists of a sequence of commands that describe the image of a single PCB layer. These commands are encoded as ASCII text, with each command on a separate line terminated by an asterisk (*).

Typical RS-274D Commands

Command Description
D01 Interpolate (draw line or arc)
D02 Move tool (light off)
D03 Flash aperture (light on)
G01 Linear interpolation mode
G02 Clockwise circular interpolation mode
G03 Counterclockwise circular interpolation mode
G04 Comment block
G36 Turn on polygon area fill
G37 Turn off polygon area fill
G54 Select aperture
G70 Specify inches as units
G71 Specify millimeters as units
M02 End of file

Here’s an example snippet of a Gerber file:

G04 Layer: Top Copper*
G04 Holesize: 0.008*
%FSLAX34Y34*%
%MOMM*%
%ADD10C,0.300000*%
%ADD11C,0.500000*%
G01*
G54D10*
X10160Y7620D03*
X10680Y7620D03*
G54D11*
X15760Y13720D03*
X16240Y13720D03*
M02*

Aperture Definitions

One key difference in RS-274D compared to older Gerber formats is the use of separate aperture definition files, often called wheel files. These files define the shapes and sizes of the flash apertures used in the Gerber file.

An aperture definition consists of:
%ADD command to assign a D-code to the aperture
– Aperture type (e.g. C for circle, R for rectangle, O for obround)
– Comma-separated list of modifiers (size, hole diameter, etc.)

For example:

%ADD10C,0.3*%

This defines D-code 10 as a circular aperture with a diameter of 0.3 units.

Aperture Macros

RS-274D also introduced the concept of aperture macros, which allow you to define custom aperture shapes using a set of drawing primitives. This is useful for creating complex pad shapes that are not covered by the standard aperture types.

An aperture macro definition consists of:
%AM command to start the macro definition
– Macro name
– Comma-separated list of primitive commands
* to end the macro definition

The primitives available for defining macros include:

Primitive Description
1 Circle
2 Line (vector)
20 Line (vector, with rotation)
21 Rectangle
4 Outline
5 Polygon
6 Moire
7 Thermal

Here’s an example of defining a custom cross-shaped aperture using a macro:

%AMCROSS*
6,0,0,0.050,0.050,0.050,0,0*
21,0.025,0,0,0.200,0.050,0*
21,0.025,0,0,0.050,0.200,0*
%

This macro defines a cross shape consisting of a small central circle and four rectangular arms.

Gerber File Creation

Creating Gerber files for PCB manufacturing typically involves the following steps:

  1. Design the PCB using EDA (Electronic Design Automation) software
  2. Generate Gerber files for each layer (e.g. Top Copper, Bottom Copper, Silkscreen, Solder Mask)
  3. Generate the aperture list file(s) defining the D-codes used
  4. Generate the drill file containing information about holes and vias
  5. Package the Gerber, aperture list, and drill files together for manufacturing

Most modern EDA tools have built-in Gerber export functionality that handles generating compliant RS-274D files with the appropriate aperture definitions. It’s important to carefully review the generated files to ensure they match your design intent before sending them for manufacturing.

Best Practices for Gerber File Creation

  • Use a consistent naming convention for your Gerber files that clearly identifies the board and layer
  • Include a README file explaining the contents of your Gerber package
  • Verify that your Gerber files match the design by reviewing them in a Gerber viewer
  • Double-check that all necessary layers, aperture lists, and drill files are included
  • Communicate clearly with your manufacturer about any special requirements or nonstandard features in your design

Advanced Topics

Attributes

RS-274D supports adding attributes to provide additional information about the PCB design. Attributes are embedded in the Gerber file as special comment commands.

Some commonly used attributes include:

Attribute Description
.Part Name of the part being manufactured
.FileFunction Purpose of the file (e.g. Copper, Soldermask)
.GenerationSoftware Software used to create the Gerber file
.CreationDate Date the file was generated
.ProjectId Identifier for the project

Here’s an example of embedding attributes:

G04 Part: ABC123 Rev 2*
G04 FileFunction: Copper,L1,Top*
G04 GenerationSoftware: Super EDA-2000*
G04 CreationDate: 2023-05-25*
G04 ProjectId: 2357-8*

Step and Repeat

The RS-274D standard includes commands for step and repeat, which allow you to define a section of the image and repeat it at regular intervals. This is useful for designs with repeating patterns, like a panel of multiple identical PCBs.

The step and repeat commands are:
SR – Step and repeat
IR – Ignore step and repeat for next block

Here’s an example of using step and repeat:

%SRX3Y2I5.08J3.81*%
G01*
G54D11*
X1905000Y1905000D03*
X8890000D03*
G54D12*
X3810000Y3810000D03*
%IR*%
X6350000Y6350000D03*

This will create a 3×2 array of the image block, with an X spacing of 5.08 units and Y spacing of 3.81 units. The IR command is used to exclude a feature (in this case an extra flash at X6350000 Y6350000) from the step and repeat.

FAQ

What is the difference between RS-274X and RS-274D?

RS-274X is an older Gerber format that included aperture definitions inline with the image data. RS-274D is an extension that moves the aperture definitions to separate files and adds support for more complex shapes via aperture macros.

Are Gerber files only used for PCBs?

While Gerber files are most commonly associated with PCBs, the format can actually be used to describe any 2D vector image. Some applications include flat panel displays, signs, and microfluidics.

What is the current version of the Gerber format standard?

As of 2023, the current version of the Gerber format is known as X2, which adds new commands for specifying layer stackup, materials, and other design data. However, RS-274D remains in widespread use and is still considered an active standard.

How can I view and verify my Gerber files?

There are many free and commercial Gerber viewer programs available, including online viewers that don’t require any software installation. These allow you to visually check your Gerber data to ensure it matches your PCB design. Some popular options are Gerbv, ViewMate, and Ucamco’s reference viewer.

What other files are typically needed in addition to Gerbers for PCB manufacturing?

In addition to the Gerber files describing the copper layers, soldermask, legend, etc., you’ll usually need to provide a drill file (typically in Excellon format) that specifies the locations and sizes of drilled holes. A pick and place file describing the component positions is also helpful for assembly.

Conclusion

The RS-274D Standard Gerber format has proven to be a robust and reliable way to exchange PCB design data for manufacturing. By understanding the key concepts of this format, including aperture definitions, macros, and attributes, you can ensure that your PCB design is accurately communicated to your manufacturer and reduce the risk of production issues.

While newer formats like Gerber X2 and ODB++ offer additional capabilities, RS-274D remains a widely supported standard throughout the electronics industry. Taking the time to properly generate and verify your Gerber files is an essential step in bringing your PCB design to life.

Leave a Reply

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