Panelize Kicad PCB

Making PCBs is fun these days. Years ago I always paid a lot of money and got one single layer PCB without mask or silk screen. Now there are many PCB manufacturers which make prototyping PCBs for reasonable prices. But normally they don’t allow you to make panels (putting multiple circuits on one PCB). At least two manufacturers exist which allow you to create up to 5 panels per PCB: seeedstudio.com and iteadstudio.com (their PCB options look so similar that I think it’s the same manufacturer).

But how do you create the panelized production files?

Doing it by hand is too cumbersome. It could be done with the gerber files. But I chose to write a little python script panelize.py which duplicates the specified parts in a kicad PCB file (.brd). The advantage is that the panelized version is still editable with kicad and I still can run the checks.

The usage is pretty easy. First create a PCB. Here I also created the final PCB outline and some silk screen lines which separate the boards. This could also be done after panelizing. But if it is done before panelizing nothing gets lost if the script is run again.

Then I ran the following command:

panelize.py leddriver.brd leddriverp.brd \
        source-area 19350/25850 32750/30350 \
        copy 19350/30750 \
        copy 19350/35650 \
        copy 19350/40550 \
        rotate 33150/25850 bottom-left 270

First it expects input and output file, after that the commands are following.

source-area specifies the source for following copies, it obviously needs two x/y coordinates to get a rectangle. It can be changed between copies.

copy copies the parts, tracks, zones and texts in the source area to the specified coord.

rotate makes a rotated copy. It needs to know the destination coordinate, which corner of the source are has to be put there, and the angle.

There is only one more command: help.

And then the result is:

It looks nice and passes the checks. Since the tool also clones the nets (wire names) no ratsnest shows up between the boards. So far I am happy with this tool but obviously it needs a few more features…

Edit: panelize.py got a permanent place here.

8 thoughts on “Panelize Kicad PCB

  1. Pingback: Automated PCB panelization

  2. Pingback: Automated PCB panelization | Daily IT News on

  3. Pingback: Automated PCB panelization | Siecurity.com

  4. Pingback: Automated PCB panelization | Cool Internet Projects

  5. Pingback: – Automated PCB panelization

  6. Thanks for publishing panelize.py which is exactly the tool I need. However, in KiCAD the resulting file looks identical to the input file – the PCB has not been copied. In the terminal, everything looks good:
    $ ./panelize-2012-12-12.py input.brd output.brd \
    > source-area 11940/12380 49000/29147 \
    > copy 11940/30000 \
    > copy 11940/40000 \
    > copy 11940/50000
    loaded.
    source-area.
    copy.
    copy.
    copy.
    saved.

    The command “diff” shows only minor difference between input and output file:
    > # Created by panelize.py V0.1
    618c618
    At SMD
    695c695
    At SMD
    1156c1156
    At SMD

    Any idea how to get it working?

  7. Hello,
    I’ve been trying to ge this working and I keep getting this error:

    File “./panelize”, line 348, in add_line
    self.position = Coord( int(words[1]), int(words[2]) )
    ValueError: invalid literal for int() with base 10: ’129.1′

    What are thsoe co-ords you ahve with large int numbers? Mine are all like this, 100.000 84.450 etc. I tried many different uses but it always errors out. Even with just the filenames in out it gives same error. Seems to be bad code as far as I can tell. Was kind of hoping to use this today.

    • Hello Chris,

      just leave the dot away so 84.450 becomes 84450. The coordinates must be in inch, not metric.

      HTH, Martin

Leave a Reply

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


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>