Main Content

PCBServices

Customize PCB file generation for PCB manufacturing service

Description

Use the PCBServices object to customize printed circuit board (PCB) file generation for a PCB manufacturing service.

Creation

Description

w = PCBServices.servicetype creates a Gerber file based on the type of service specified in servicetype.

example

Input Arguments

expand all

Type of manufacturing service from PCB services list, specified as one of the following:

  • AdvancedCircuitsWriter – Configure Gerber file generation for Advanced Circuits manufacturing.

  • CircuitPeopleWriter – Configure Gerber file generation for CircuitPeople online viewer.

  • DirtyPCBsWriter – Configure Gerber file generation for Dirty PCBs manufacturing.

  • EuroCircuitsWriter – Configure Gerber file generation for EuroCircuits online viewer.

  • GerberLookWriter – Configure Gerber file generation for GerbLook online viewer.

  • GerberViewerWriter – Configure Gerber file generation for GerberViewer online viewer.

  • MayhewWriter – Configure Gerber file generation for Mayhew Labs online 3-D viewer.

  • OSHParkWriter – Configure Gerber file generation for OSH Park PCB manufacturing.

  • PCBWayWriter – Configure Gerber file generation for PCBWay PCB manufacturing.

  • ParagonWriter – Configure Gerber file generation for Paragon Robotics online viewer.

  • SeeedWriter – Configure Gerber file generation for Seeed Fusion PCB manufacturing.

  • SunstoneWriter – Configure Gerber file generation for Sunstone PCB manufacturing.

  • ZofzWriter – Configure Gerber file generation for Zofz 3-D viewer.

Example: w = PCBServices.SunstoneWriter creates Gerber files configured to use Sunstone PCB manufacturing service.

Output Arguments

expand all

PCB manufacturing service, returned as an object.

Properties

expand all

File type for board profile, specified as 'legend' or 'profile'.

Example: w = PCBServices.SunstoneWriter; w.BoardProfileFile = 'profile'.

Data Types: char | string

Width of line, specified as a positive scalar in mils.

PCB manufacturers vary on board profile. The most common line width is zero of a fraction width in the chosen unit, for example, 0.1 mil.

Example: w = PCBServices.SunstoneWriter; w.BoardProfileLineWidth = 0.1

Data Types: double

Precision of X and Y coordinates written to file, specified as a 1-by2 vector [I F], where,

  • I – Number of digits in the integer part, 0<=I<=6.

  • F – Number of digits in the fractional part, 4<=F<=6.

Example: w = PCBServices.SunstoneWriter; w.CoordPrecision = [1 3]

Data Types: double

Units of X and Y coordinates, specified as inches or millimeters.

Example: w = PCBServices.SunstoneWriter; w.CoordUnits = 'mm'

Data Types: char | string

Creates single archive file with all Gerber files, specified as 1 or 0.

Example: w = PCBServices.SunstoneWriter; w.CreateArchiveFile = 0

Data Types: logical

Via drill diameter, specified as a positive scalar in meters. PCB manufacturers also call it minimum drilling hole diameter.

Example: w = PCBServices.SunstoneWriter; w.DefaultViaDiameter = 0.1

Data Types: double

Force arcs to be drawn using lines, specified as 1 or 0.

Example: w = PCBServices.SunstoneWriter; w.DrawArcsUsingLines = 0

Data Types: logical

Feature content for Gerber file format, specified as:

  • 1 - Extension 1 is the most compatible setting for downstream PCB manufacturing tools.

  • 2 - Extension 2 adds file attributes %TF.<attr>*%" to the header and footer of Gerber files.

Example: w = PCBServices.SunstoneWriter; w.ExtensionLevel = 2

Data Types: double

Name of all files containing Gerber design, specified as a character vector.

Example: w = PCBServices.SunstoneWriter; w.Filename = 'antenna_design'.

Data Types: char | string

Define stack of PCB files, specified as a character vector. This definition includes:

  • Multiples files describing one PCB.

  • A "file" as a memory object containing buffers that describe or hold the file content before the file is written.

  • Cell vector of Gerber.FileFunction objects, one per file.

Data Types: cell | char | string

Include top-level folder in zip archive, specified as 1 or 0.

Example: w = PCBServices.SunstoneWriter; w.IncludeRootFolderInZip = 0

Data Types: logical

Function to invoke after a successful write operation, specified as a function handle. In this case, it is the sendTo function. This property makes sure that the location of the Gerber files and the website of the manufacturing service is open after a successful write function.

Example: w = PCBServices.SunstoneWriter; w.PostWriteFcn = @(obj)sendTo(obj)

Data Types: function_handle

Use .gbr to be file extension for all Gerber files, specified as 0 or 1.

Example: w = PCBServices.SunstoneWriter; w.SameExtensionForGerberFiles = 1

Data Types: logical

Generate Excellon drill files, specified as 0 or 1.

Example: w = PCBServices.SunstoneWriter; w.UseExcellon = 1, generates Gerber format drill files with 'x2' extension.

Data Types: logical

Examples

collapse all

Create a coplanar inverted F antenna.

fco = invertedFcoplanar(Height=14e-3,GroundPlaneLength=100e-3,...
                  GroundPlaneWidth=100e-3);

Use this antenna in creating a PCB stack object.

p = pcbStack(fco);
figure
show(p)

Figure contains an axes object. The axes object with title pcbStack antenna element, xlabel x (mm), ylabel y (mm) contains 3 objects of type patch, surface. These objects represent PEC, feed.

Use a Mayhew Writer with a profile board for viewing the PCB in 3D.

s = PCBServices.MayhewWriter;
s.BoardProfileFile = "profile"
s = 
  MayhewWriter with properties:

               BoardProfileFile: "profile"
          BoardProfileLineWidth: 1
                 CoordPrecision: [2 6]
                     CoordUnits: 'in'
              CreateArchiveFile: 0
                 DefaultViaDiam: 3.0000e-04
             DrawArcsUsingLines: 1
                 ExtensionLevel: 1
                       Filename: 'untitled'
                          Files: {}
         IncludeRootFolderInZip: 0
                   PostWriteFcn: @(obj)sendTo(obj)
    SameExtensionForGerberFiles: 0
                    UseExcellon: 1

Create an antenna design file using PCBWriter.

PW = PCBWriter(p,s);

Use the gerberWrite method to create Gerber files from the antenna design files.

gerberWrite(PW)

The location of the folder and the Mayhew labs website opens automatically.

To view the board, drag and drop the files. Click Done.

Version History

Introduced in R2017b