The pick and place file, is basically a list of all the components on the design and their respective x-y coordinates and rotation. Most PCB design software can extract the component location and orientation directly from the board layout file to make the pick and place file. Example pick and place file (.POS file. Either find them in the exported CSV file (because they are already based on the origin), or write down footprint coordinates from the kicad and subtract origin coordinates, inverting Y (X = footprint.X - origin.X, Y = origin.Y - footprint.Y). Add new chip and set it to Skip. First component is used as an offset for all other components.
There’s a new Python-based script that will panelize your KiCad circuit boards from the command line. The project by [Jan Mrázek] is called KiKit and works on
.kicad_pcb
files to arrange them in a grid with your choice of mousebites or v-cuts for separating the boards after production.Select the required file (left click to highlight) from the options shown and click 'Run' to generate the CSV file. The second option will generate a text file. The Component Position files will list the absolute positions, these files will be processed by the manufacturer to be referenced to their placement jig and for this reason the CSV is.
When working with smaller boards it’s common practice to group them together into panels. This is done to speed up PCB assembly as multiple boards can have solder paste applied, go through a pick and place machine, and be sent into the reflow oven as a single unit. Often this is done manually, but in many cases this script will save you the time while delivering the results you need.
Let’s say you really wanted to make a whole bunch of those Xling open source Tamagotchi-like key fobs we saw a couple of weeks back. Using KiKit you can gang up six of the boards at a time, using “mousebites” to keep them together during production but make it easy to separate them after all the components are soldered:
/usr/local/bin/kikit panelize grid --space 3 --gridsize 2 3 --tabwidth 3 --tabheight 3 --htabs 2 --vtabs 1 --mousebites 0.5 1 0.25 --radius 1 Xling/hardware/xling.kicad_pcb xling_panel.kicad_pcb
You can see that the parameters let you set space between the boards, number of boards in the grid, width of the tabs, tab dimensions, number of tabs between boards, and even the radius of the curve where the tabs meet the board. These settings were pulled from the examples page, which demonstrates outcomes for many different settings options.
If you want to give this a try, we suggest installing directly from the repository, as improvements are ongoing and the pip3 version didn’t have all of the options shown in the examples. For us this was as easy as
sudo python3 setup.py install
and then calling the script with the full path /usr/local/bin/kikit
.Results from this board are both impressive and cautionary. You can see the top edge of the design is recessed yet the most up-to-date version of KiKit was still able to make the connection. However, how this affects the USB connector on the bottom of the board design may be something to consider before pulling the trigger on your panel order.
In the summer of 2014, Wayne and Layne purchased a Pick-and-Place machine, specifically the Neoden TM-240A. After doing a few small prototype production runs, we decided to create a presentation at the 2014 World Maker Faire in NYC, to share the tips and tricks we’ve learned about working with this PnP machine, as well as an honest analysis of its capabilities, strengths, and limitations. You can also download our slides (PDF). The PDF slides don’t include the embedded video, but that video has been posted to YouTube.
The Pick-and-Place machine needs to know where to place each part, and we have created some software to help convert the PCB design data from our favorite ECAD tool, KiCad, into the proper file format needed for these PnP machines. The documentation for this software is below. We hope that it’s useful for your needs.
Die Pick And Place
tm2x0
tm2x0 is a Python package for working with Neoden TM220A and TM240A pick and place machines.
It currently has a script for generating a .CSV input file for the PnP from a KiCad .pos file, using an interactive command-line menu.
It was developed by Adam Wolf and Matthew Beckler of Wayne and Layne, LLC, with no affiliation with Neoden other than we own one of their machines.
Installation
tm2x0 is a Python module. You should be able to install it through pip or however you normally install Python modules.
Let us know if you have problems.
Mac OS X / Linux
If you already have special Python stuff set up, use that–otherwise, you can try
If you already have special Python stuff set up, use that–otherwise, you can try
easy_install http://www.wayneandlayne.com/files/tm2x0-0.1.zip
Windows
We haven’t tested this tool on Windows at all, but it should work. Try easy_install or pip.
We haven’t tested this tool on Windows at all, but it should work. Try easy_install or pip.
Usage
Generate a .pos file from pcbnew, through the File->Generate Fabrication Output menu.
Run tm2x0-kicad-convert with those .pos files.
tm2x0-kicad-convert --kicad-file myfile.pos
The general workflow is to assign parts to reels by number, and then configure each reel.
After that, you export the output for the machine. If you have reels configured in a CSV
file already, you can feed that into the program so it will reuse those configurations,
but you still have to assign each part to a reel. You can pull in general settings
for some package types through the autoset menu.
After that, you export the output for the machine. If you have reels configured in a CSV
file already, you can feed that into the program so it will reuse those configurations,
but you still have to assign each part to a reel. You can pull in general settings
for some package types through the autoset menu.
If you don’t specify an output file, or if there’s issues writing to the file, the
converter will output the machine CSV instructions to the console.
converter will output the machine CSV instructions to the console.
Kicad Generate Pick And Place File
Example Usage
Roadmap and TODOs
- KiCad integration as a graphical plugin
- Python 3 support.
- Increase test coverage
- Test on Windows
- Package Windows executable
- Write Windows documentation
- It might be better if you could get actual reel object for a part, rather than a reel index.
- Be more consistent with reel/reel_number/stack.
- Supporting setting nozzle (head) per part/reel
- Let folks set output filename in Save to File menu
- Document the describe script.
- Add more package types for autoset.
- Create an autoset config file so they’re not coded in the script.
Please let us know if there’s something on this list, or not on this list, that you’d like to see.
Developing
First, you need the source code. You already have it if you’re reading this.
You probably want to make a virtual environment. I like to do this in parallel with the package directory, next to the README. (You only need to do this once.)
virtualenv venv
Pick And Place File Kicad Extension
Then, you’ll need to activate the virtualenv.
Pick And Place Definition
source venv/bin/activate
You should see (venv) at the beginning of your bash prompt. (To eventually exit this virtualenv, type “deactivate” at the bash prompt.).
Next, you need to install the package. How you do this slightly depends on if you are installing for development or not.
If you want to be able to easily develop on the package *in situ*, then install the package with:
pip install -e $PATH_TO_DIRECTORY_CONTAINING_SETUP.PY
This basically runs “setup.py develop”, which sets up some symlinks so your package stays where it is, but is symlinked into your PYTHONPATH. This works in and out of a virtualenv. The cool part about this is that you can edit your files keep working with your source control, and yet it still ends up on your PYTHONPATH so you don’t have to be in a certain directory to be able to import properly.
To install the test dependencies and run the tests, run
python setup.py test
Changelog
- v0.1:
- Initial release.
- This release was developed primarily while listening to the Diablo 2 soundtrack.
Acknowledgements
![Pick And Place File Kicad Pick And Place File Kicad](/uploads/1/1/9/8/119876100/739489402.png)
This tool was developed starting with the Dangerous Prototypes Wiki page, the public documentation from Neoden, and testing on our own TM-240A.