Projects »

KiCad PCB Panelization with Javascript

Simple online tool builds a framework to panelize your PCB in KiCad v5, ready for manufacture

Dimensions * mm
Panel Formatx: y:
RailsTop: 10mm with 2× 4mm NPTH holes for stencil alignment
Sides+Bottom: 5mm
Spacing3mm cutouts, max mm
Panel Size * mm

How to use it

  1. Enter the Dimensions (width * height in mm) of your PCB design
  2. Enter the Panel Format: the number of PCBs in the panel along (x), and down (y). This will calculate the total Panel Size for you, including the fixed-size rails and mousebites
  3. Click Download .kicad_pcb and save the file to your local drive
  4. Run KiCad’s Pcbnew directly, not from the KiCad launcher. This unlocks the menu option File→Append Board... and use that to import the .kicad_pcb file from inside your PCB design project folder. Click to place it anywhere
  5. Use Place→Grid Origin and click on the exact top-left corner of your PCB (in case your board isn’t already aligned with the current grid)
  6. Edit the Edge.Cuts layer lines around your design to be on the Dwgs.User layer instead: this is so that you can see the edge for aligning it inside the panel, but the lines won’t be used for cutting
  7. Use File→Append Board... to import generic-panel.kicad_pcb that you downloaded. Place it away from your PCB design
  8. Drag around your PCB design to select it, and move it to exactly match the space for it in the top-left corner of the panel. Don’t clear the selection yet. The video below shows the rest of this process, starting at +24:13
  9. Finally, right click and use Create Array... to copy your design to each space in the panel. Enter Horizontal/Vertical counts from the Panel Format values, and the Horizontal/Vertical spacing should be your x/y Dimensions + 3mm
You can then save your finished panel and export the Gerber files as usual, ready to upload to a PCB fab house for manufacturing.

If you use JLCPCB.com to order a metal stencil along with your panel, you can choose their Customized size option and enter the Panel Size values. This means the stencil is shipped within the package of panels, saving you money.

Panel manufactured by JLCPCB.com

Why panelize a PCB?

The main reason to order your PCBs in a panel is for small production runs where you want to apply solder paste (using a stencil), add components and reflow solder multiple boards at once. Fab houses can design a panel for you, but you may want to specify the exact design so that it fits your stencil jig, pick'n'place machine or reflow oven.

Some fab houses also offer slightly lower prices per PCB if you order them in panels.

3D-printed Stencil alignment jig

If you have a metal stencil (for applying solder paste) then you may want to make a jig for accurate alignment of the stencil over each panel. Below is a simple jig design written in JSCAD. Just copy'n'paste it into the OpenJSCAD.org site and press F5 to render the jig. You can then save it as an STL file ready for 3D printing.
function main() {
  return union(
    cube({size:[202,104,3]}),
    cylinder({r:1.975, h:4}).translate([10,5,3]),
    cylinder({r:1.975, h:4}).translate([202-10,5,3])
  );
}

Creating the panel by hand

You can of course create panels by hand. In this tutorial video Kevin Neubauer goes through the entire process, from creating the panel to ordering with JLCPCB.com. Note how Kevin draws thick 3mm lines in the Eco1.User layer to denote cuts instead of drawing outlines in Edge.Cuts. His method is quicker when drawing by hand, but does mean writing an explanatory note to the fab house:

Panelizing Your Circuit Design with KiCad

I’ve taken the liberty of tidying up his Panelization footprints (consistency of spacing/positions) and put them into a zip archive for easy downloading.

Other panelization software

My simple script can only panelize square/rectangular designs so you may prefer to use one of these other panelization tools, which offer far more flexibility & features. However they all require downloading & installing extra software and can have quite restrictive requirements: particular OSes, libraries, other tools, etc.

Future improvements

Changelog


Fb Share this on Facebook
Nikki Smith, September 2020. Last updated April 2021.