When you need a PCB assembled by a machine, you can generate a position file for the machine to know where to place your parts. This process in KiCAD can be a little tricky, so I wanted to write an article to help you generate a position file.
First you need to place a ‘Place File Origin’. Go to ‘Place’ and pick ‘Drill/Place File Origin’.
Place the origin in the lower left hand corner of your board. If it isn’t exactly perfect in the corner it is okay as long as it is close.
In PCBNew go to ‘File’ and then ‘Fabrication Outputs’ – From there select Component Placement (.pos)…
When generating these files, please ensure that you have the following settings:
- Format: ASCII
- Units: Millimeters
- Files: Separate files for front, back
- Check – Use drill/place file origin
There will be two ‘.pos’ files generated. One for the top of the board and one for the bottom of the board. These are the files that we need.
Let’s take a look at what the file includes.
- Ref: The designator for the component. This is usually set in the schematic builder.
- Val: The component value. This is usually set in the schematic builder.
- Package: Footprint used when laying out the PCB.
- PosX: X-Position in reference to the place origin.
- PosY: Y-Position in reference to the place origin.
- Rot: How many degrees should the part be rotated by the machine in assembly.
- Side: Which side of the board is this part on. You should have two separate files for the top and bottom.
If you find that you need to change the ‘.pos’ file, it is important to not change the file that is created. Make the changes in your layout and generate a new ‘.pos’ file. The file that is generated gets fed into our pick and place machines and if you change the format, it may not work correctly.
Taking your time to get this process correct will make your assembly process smoother all around.