When it comes to printed circuit board (PCB) manufacturing, Gerber files serve as the universal language between PCB designers and manufacturers. KiCad, as one of the most popular open-source PCB design software packages, provides comprehensive tools for generating high-quality Gerber files that meet industry standards. This detailed guide will walk you through every aspect of exporting Gerber files from KiCad, ensuring your PCB designs are ready for professional manufacturing.
Understanding Gerber Files and Their Importance
Gerber files are industry-standard file formats used to describe the printed circuit board images: copper layers, solder mask, legend, and drill data. Named after the Gerber Scientific Corporation, these files contain precise geometric information about each layer of your PCB design. Modern PCB manufacturers rely on these files to understand exactly how your board should be fabricated.
What Makes Gerber Files Essential
The significance of Gerber files in PCB manufacturing cannot be overstated. They serve as the primary communication medium between your design software and the manufacturing equipment. Each layer of your PCB design is translated into a separate Gerber file, containing vector graphics data that describes the copper traces, pads, vias, and other features.
KiCad generates Extended Gerber files (RS-274X format), which are the current industry standard. These files are self-contained and include all the information needed to interpret the layer data, making them more reliable than older Gerber formats that required separate aperture files.
Prerequisites and Project Preparation
Before diving into the Gerber export process, ensure your KiCad project is complete and properly configured. Your PCB design should be finalized with all routing completed, design rule checks (DRC) passed, and electrical rule checks (ERC) resolved.
Verifying Your PCB Design
Start by opening your project in KiCad's Pcbnew (PCB Layout Editor). Navigate through each layer to verify that all components are properly placed and all traces are correctly routed. Pay special attention to:
- Component placement and orientation
- Trace routing and width consistency
- Via placement and sizing
- Ground plane connections
- Silkscreen text legibility and placement
- Solder mask openings
Running Design Rule Checks
Execute a comprehensive DRC by accessing Tools > Design Rules Checker. This critical step identifies potential manufacturing issues such as trace spacing violations, drill size problems, or clearance errors. Address all DRC violations before proceeding with Gerber generation, as these issues will translate directly into manufacturing problems.
Step-by-Step Gerber Export Process
The Gerber export process in KiCad is straightforward but requires attention to detail to ensure optimal results. Follow these detailed steps to generate professional-quality Gerber files.
Accessing the Plot Dialog
Begin by opening your PCB file in Pcbnew. Navigate to File > Plot from the main menu. This opens the Plot dialog, which serves as the central hub for configuring all Gerber export parameters.
The Plot dialog presents numerous options that directly impact the quality and compatibility of your Gerber files. Understanding each setting ensures your exported files meet both your design requirements and manufacturer specifications.
Configuring Plot Options
The Plot Options section contains several critical settings that affect how your Gerber files are generated:
Plot Format Selection: Ensure "Gerber" is selected as the plot format. KiCad also supports other formats like PostScript and PDF, but Gerber remains the industry standard for manufacturing.
Output Directory: Specify where your Gerber files will be saved. Creating a dedicated "Gerber" folder within your project directory helps maintain organization and makes file management easier when communicating with manufacturers.
General Options Configuration: Enable "Plot footprint values" and "Plot footprint references" if you want component identifiers included in your silkscreen layers. The "Exclude PCB edge layer from other layers" option should typically be enabled to prevent edge cuts from appearing on other layers.
Layer Selection and Configuration
The layer selection area displays all available layers in your PCB design. Carefully select which layers to include in your Gerber export based on your PCB stackup and manufacturing requirements.
| Layer Type | KiCad Layer Name | Typical File Extension | Purpose |
|---|---|---|---|
| Top Copper | F.Cu | .GTL | Top copper traces and pads |
| Bottom Copper | B.Cu | .GBL | Bottom copper traces and pads |
| Inner Copper 1 | In1.Cu | .G2L | First inner copper layer |
| Inner Copper 2 | In2.Cu | .G3L | Second inner copper layer |
| Top Solder Mask | F.Mask | .GTS | Top solder mask openings |
| Bottom Solder Mask | B.Mask | .GBS | Bottom solder mask openings |
| Top Silkscreen | F.SilkS | .GTO | Top component legend |
| Bottom Silkscreen | B.SilkS | .GBO | Bottom component legend |
| Edge Cuts | Edge.Cuts | .GKO | Board outline |
Advanced Gerber Settings
Click on "Gerber Options" to access advanced settings that fine-tune your Gerber file generation:
Coordinate Format: The default setting of 4.6 (4 integer digits, 6 decimal digits) provides excellent precision for most PCB designs. This format supports coordinates up to 999.9999 inches with micron-level precision.
Units Selection: Choose between inches and millimeters based on your design preferences and manufacturer requirements. Most modern manufacturers accept either unit system, but consistency throughout your design files is important.
Aperture Macros: Enable "Use Gerber aperture macros" for more compact files and better compatibility with modern manufacturing equipment. This option creates more efficient Gerber files by defining reusable shape templates.
Gerber Precision: The "Use Gerber X2 format" option enables the latest Gerber standard, which includes enhanced metadata and improved compatibility with modern CAM software. Enable this option unless you have specific compatibility requirements with older systems.
Drill File Configuration
Drill files require separate configuration through the "Generate Drill Files" button in the Plot dialog. This opens the Drill Files Generation dialog, where you'll configure settings specific to drilling operations.
Drill Map Generation: Enable drill map generation to create a visual reference showing drill locations and sizes. This helps manufacturers verify drill placement and serves as a quality control reference.
Drill File Format: Choose between Excellon and Gerber X2 formats. Excellon remains the most widely supported format for drill files, though Gerber X2 offers enhanced capabilities for complex drilling requirements.
Drill Units and Precision: Match these settings to your Gerber file configuration for consistency. Using the same units and precision across all files reduces the chance of interpretation errors during manufacturing.
Executing the Export
After configuring all settings, click "Plot" to generate your Gerber files. KiCad will create individual files for each selected layer in your specified output directory. The export process typically completes within seconds for most PCB designs.
Monitor the message panel for any warnings or errors during export. Address any issues before proceeding, as they may indicate problems with your PCB design or export configuration.
Understanding Generated Files
KiCad generates multiple files during the Gerber export process. Understanding the purpose and content of each file ensures proper communication with your PCB manufacturer.
Gerber File Types and Naming
KiCad uses descriptive file extensions that clearly identify each layer's purpose:
| File Extension | Layer Content | Manufacturing Use |
|---|---|---|
| .GTL | Top copper layer | Etching top copper traces |
| .GBL | Bottom copper layer | Etching bottom copper traces |
| .G2L, .G3L, etc. | Inner copper layers | Etching internal copper layers |
| .GTS | Top solder mask | Top solder mask application |
| .GBS | Bottom solder mask | Bottom solder mask application |
| .GTO | Top silkscreen | Top legend printing |
| .GBO | Bottom silkscreen | Bottom legend printing |
| .GKO | Board outline | Mechanical cutting/routing |
| .TXT | Drill file | Drilling operations |
| .DRL | NC drill file | CNC drilling program |
File Content Verification
Each generated Gerber file contains ASCII text with specific formatting that describes the geometric features of your PCB layer. Modern Gerber files include header information that describes the file format, units, and coordinate precision.
Examine the header section of your Gerber files to verify correct settings:
- Format specification (RS-274X)
- Unit declaration (MOIN for inches, MOMM for millimeters)
- Coordinate format specification
- Aperture definitions
Quality Assurance and Verification
Proper verification of your exported Gerber files is crucial for ensuring manufacturing success. Several tools and techniques help validate your files before sending them to production.
Using Gerber Viewers
Gerber viewers allow you to visualize your exported files exactly as they will appear to manufacturing equipment. KiCad includes a built-in Gerber viewer (GerbView) that provides comprehensive viewing capabilities.
Open GerbView and load all your exported Gerber files. The viewer displays each layer with appropriate colors and allows you to toggle layer visibility, examine individual features, and verify proper layer alignment.
Layer Alignment Verification
Proper layer alignment is critical for multi-layer PCBs. Use your Gerber viewer to verify that:
- All copper layers align correctly with drill holes
- Via locations match across all layers
- Component pads align with solder mask openings
- Silkscreen elements don't interfere with component placement
Drill File Validation
Examine your drill files to ensure all holes are properly defined and located. Verify that:
- All component holes are present and correctly sized
- Via drill sizes match your design specifications
- No duplicate or overlapping drill locations exist
- Drill sizes fall within your manufacturer's capabilities
Common Export Issues and Solutions
Even experienced designers encounter occasional issues during Gerber export. Understanding common problems and their solutions helps maintain project momentum and ensures manufacturing success.
Missing Layer Data
Sometimes layers appear empty in the Gerber viewer despite containing data in your PCB design. This typically occurs when:
- Layer visibility is disabled in Pcbnew
- Objects are placed on incorrect layers
- Silkscreen elements extend beyond the board outline
- Zero-width traces or objects are present
Solution: Return to Pcbnew and verify that all objects are properly placed on their intended layers. Check layer visibility settings and ensure all traces have appropriate widths.
Aperture Definition Problems
Aperture errors manifest as missing or incorrectly sized features in your Gerber files. Common causes include:
- Custom pad shapes that don't translate properly
- Complex aperture macros that exceed manufacturer capabilities
- Inconsistent aperture usage across layers
Solution: Simplify complex pad shapes where possible and verify that your aperture definitions fall within standard manufacturing capabilities.
Coordinate Precision Issues
Insufficient coordinate precision can cause feature misalignment or loss of fine detail. This typically occurs when:
- Legacy coordinate formats are used
- Precision settings don't match design requirements
- Unit conversions introduce rounding errors
Solution: Use the recommended 4.6 coordinate format and maintain consistent units throughout your export process.
Manufacturer Communication and File Delivery
Effective communication with your PCB manufacturer ensures smooth production and helps avoid costly delays or errors. Proper file organization and documentation facilitate this process.
File Organization Best Practices
Create a well-organized file package that includes:
- All necessary Gerber files with clear, descriptive names
- Drill files in appropriate formats
- Assembly drawings and fabrication notes
- Bill of materials (BOM) for component procurement
- Pickup and placement files for automated assembly
Use a consistent naming convention that clearly identifies each file's purpose. Many manufacturers prefer standard file extensions that immediately identify layer types.
Documentation Requirements
Comprehensive documentation helps manufacturers understand your design requirements and make appropriate manufacturing decisions. Include:
PCB Stackup Information: Specify layer count, material types, thickness requirements, and impedance control needs.
Drill Schedule: Provide a complete list of drill sizes, hole counts, and any special drilling requirements such as back-drilling or controlled depth holes.
Fabrication Notes: Include special requirements such as:
- Surface finish specifications (HASL, ENIG, OSP)
- Solder mask and silkscreen colors
- Controlled impedance requirements
- Special tolerances or specifications
Quality Control Checklist
Before sending files to manufacturing, complete this comprehensive checklist:
| Verification Item | Status | Notes |
|---|---|---|
| All required layers exported | ☐ | Verify copper, mask, and silkscreen layers |
| Drill files generated | ☐ | Include both drill and map files |
| DRC violations resolved | ☐ | Zero errors in design rule check |
| Layer alignment verified | ☐ | Checked in Gerber viewer |
| File naming consistent | ☐ | Clear, descriptive file names |
| Documentation complete | ☐ | Stackup, notes, and specifications included |
| Manufacturer requirements met | ☐ | Verified against manufacturer capabilities |
Advanced Export Configurations
For complex PCB designs or specialized manufacturing requirements, KiCad offers advanced export options that provide greater control over the Gerber generation process.
Custom Aperture Management
Advanced users may need to customize aperture definitions for specific manufacturing requirements. KiCad allows manual aperture definition through custom aperture files, though this is rarely necessary with modern manufacturing processes.
When custom apertures are required:
- Define apertures in a separate aperture list file
- Ensure aperture sizes fall within manufacturer capabilities
- Verify aperture usage consistency across layers
- Test custom apertures with your Gerber viewer before production
Multi-Board Panel Exports
When designing panels containing multiple PCBs, special consideration is required for Gerber export:
Panel Outline Management: Ensure the panel outline is properly defined and doesn't interfere with individual board features.
Drill File Consolidation: Panel drill files must include all holes from individual boards plus any panel-specific holes such as tooling holes or mouse bites.
Layer Alignment: Verify that all boards within the panel maintain proper layer alignment and that panel features don't interfere with board functionality.
Impedance Control Considerations
For high-speed designs requiring controlled impedance, additional documentation may be necessary:
- Specify trace width and spacing requirements for controlled impedance traces
- Provide stackup details including dielectric materials and thicknesses
- Identify critical nets requiring impedance control
- Include test coupon requirements if necessary
File Format Compatibility and Standards
Understanding Gerber file formats and industry standards ensures maximum compatibility with manufacturing equipment and CAM software.
RS-274X Standard Compliance
KiCad generates RS-274X compliant Gerber files, which represent the current industry standard. This format provides:
- Self-contained files with embedded aperture definitions
- Enhanced coordinate precision
- Improved compatibility with modern CAM systems
- Support for complex aperture shapes and macros
Gerber X2 Enhancements
The newer Gerber X2 standard offers additional capabilities:
- Enhanced metadata inclusion
- Improved layer identification
- Better support for advanced manufacturing processes
- Automatic layer type recognition by CAM software
Enable Gerber X2 support in KiCad unless you have specific compatibility requirements with legacy systems.
Industry Best Practices
Follow these industry-standard practices for maximum manufacturing compatibility:
Coordinate Precision: Use 4.6 format (4 integer, 6 decimal places) for optimal precision without unnecessary file size.
Unit Consistency: Maintain consistent units (inches or millimeters) across all files in your design package.
Layer Identification: Use standard file extensions that clearly identify layer purposes.
Documentation Standards: Follow IPC standards for documentation and communication with manufacturers.
Troubleshooting Common Export Problems
Even with careful preparation, issues can arise during Gerber export. This troubleshooting guide addresses the most common problems and their solutions.
File Generation Errors
Problem: Gerber export fails with error messages Causes: Invalid objects in PCB design, corrupted project files, insufficient disk space Solutions:
- Run DRC to identify and fix design violations
- Check available disk space in output directory
- Verify project file integrity
- Restart KiCad and attempt export again
Missing Features in Gerber Files
Problem: Expected features don't appear in exported Gerber files Causes: Objects on wrong layers, zero-width traces, disabled layer visibility Solutions:
- Verify object layer assignments in Pcbnew
- Check trace widths and via sizes
- Ensure all required layers are enabled for export
- Verify aperture definitions for custom shapes
Layer Misalignment Issues
Problem: Layers don't align properly in Gerber viewer Causes: Inconsistent coordinate systems, precision errors, corrupted export Solutions:
- Verify consistent units and precision settings
- Re-export all layers with identical settings
- Check for objects placed on incorrect layers
- Validate drill file alignment with copper layers
Drill File Problems
Problem: Drill files missing holes or contain errors Causes: Incorrect drill settings, missing via definitions, corrupted drill data Solutions:
- Verify drill file format settings
- Check via and hole definitions in PCB design
- Ensure all drill sizes are within manufacturer capabilities
- Re-generate drill files with verified settings
Optimizing Files for Manufacturing
Optimize your Gerber files to reduce manufacturing costs and improve production reliability.
File Size Optimization
Large Gerber files can slow production and increase processing costs:
- Use appropriate coordinate precision (4.6 format is usually sufficient)
- Enable aperture macros to reduce file size
- Remove unnecessary precision from simple shapes
- Consolidate similar aperture sizes where possible
Manufacturing-Friendly Design Practices
Design practices that translate well to Gerber files:
- Use standard via sizes and drill increments
- Maintain consistent trace widths where possible
- Avoid unnecessarily complex pad shapes
- Design with manufacturer capabilities in mind
Cost Reduction Strategies
Optimize your Gerber files to minimize manufacturing costs:
- Minimize the number of unique drill sizes
- Use standard PCB thicknesses and materials
- Design within manufacturer's standard capabilities
- Consider panelization for small boards to reduce setup costs
Integration with Manufacturing Workflow
Understanding how your Gerber files integrate into the manufacturing workflow helps optimize the entire production process.
CAM Processing
Once received by the manufacturer, your Gerber files undergo CAM (Computer-Aided Manufacturing) processing:
- File Import and Verification: CAM software imports and validates all Gerber files
- Layer Stackup Assignment: Each Gerber file is assigned to appropriate manufacturing layers
- Panelization: Individual boards may be arranged into manufacturing panels
- Toolpath Generation: Manufacturing programs are generated for each production step
- Final Verification: Complete manufacturability check before production begins
Quality Control Integration
Well-prepared Gerber files facilitate quality control throughout manufacturing:
- Automated optical inspection (AOI) programs use Gerber data for reference
- In-circuit testing fixtures reference drill and netlist data
- Final inspection processes compare finished boards to Gerber specifications
Communication Protocol
Establish clear communication protocols with your manufacturer:
- Provide complete file packages with all necessary documentation
- Include contact information for technical questions
- Specify acceptable manufacturing tolerances and variations
- Request confirmation of file receipt and manufacturability review
FAQ Section
Q: What's the difference between Gerber and Extended Gerber files?
A: Standard Gerber files (RS-274D) require separate aperture files to define shapes and sizes, while Extended Gerber files (RS-274X) contain all aperture definitions within the file itself. KiCad generates RS-274X files by default, which are self-contained and more reliable for modern manufacturing. Extended Gerber files eliminate the possibility of aperture file mismatches and are the current industry standard.
Q: How many layers should I include in my Gerber export?
A: Include all layers necessary for your PCB manufacturing: all copper layers used in your design, solder mask layers (top and bottom), silkscreen layers with component legends, and the edge cuts layer for board outline. For a typical 2-layer board, you'll export 6-7 files: top copper, bottom copper, top solder mask, bottom solder mask, top silkscreen, bottom silkscreen, edge cuts, plus drill files. Multi-layer boards require additional inner copper layer files.
Q: Why do my Gerber files look different in different viewers?
A: Different Gerber viewers may display the same files with varying colors, layer ordering, or rendering styles, but the actual manufacturing data remains identical. Variations in display are cosmetic and don't affect manufacturing outcomes. However, if features appear missing or significantly different between viewers, this may indicate file corruption or export errors that require investigation. Always verify files using multiple viewers when in doubt.
Q: Can I edit Gerber files after export from KiCad?
A: While technically possible using specialized CAM software, editing Gerber files directly is not recommended and can introduce errors or corruption. Any design changes should be made in your original KiCad project and new Gerber files exported. Direct Gerber editing requires expertise in the file format and can easily compromise manufacturing quality. Maintain your KiCad project as the master source for all design modifications.
Q: What should I do if my manufacturer reports problems with my Gerber files?
A: First, verify that you've provided all required files including all copper layers, mask layers, silkscreen layers, drill files, and documentation. Check that your files open properly in a Gerber viewer and compare them against your original PCB design. Common issues include missing drill files, incorrect layer assignments, or non-standard file naming. Communicate with your manufacturer to understand the specific problem and provide corrected files promptly. Most issues can be resolved through proper file regeneration with correct settings.
Conclusion
Exporting Gerber files from KiCad is a critical skill for anyone involved in PCB design and manufacturing. This comprehensive guide has covered every aspect of the process, from initial project preparation through final file verification and delivery to manufacturers.
The key to successful Gerber export lies in understanding both the technical requirements and the manufacturing implications of your file generation choices. By following the detailed procedures outlined in this guide, you'll consistently produce high-quality Gerber files that facilitate smooth manufacturing processes and reliable PCB production.
Remember that Gerber files serve as the primary communication medium between your design intent and the manufacturing reality. Invest time in understanding the export process, verifying your files, and maintaining clear communication with your manufacturers. This attention to detail pays dividends in reduced manufacturing errors, faster turnaround times, and higher-quality finished products.
As PCB manufacturing technology continues to evolve, staying current with Gerber standards and best practices ensures your designs remain compatible with the latest manufacturing capabilities. KiCad's robust Gerber export capabilities, combined with proper understanding and application of the techniques described in this guide, provide everything needed for professional-quality PCB manufacturing preparation.
The investment in mastering Gerber export processes ultimately contributes to more successful projects, reduced manufacturing costs, and improved design reliability. Whether you're working on simple hobby projects or complex professional designs, the principles and procedures outlined in this guide will serve as a reliable foundation for all your PCB manufacturing endeavors.

No comments:
Post a Comment