Author Topic: New tool auto-rotates components in PnP files to match fab, panelizes PnP data  (Read 1059 times)

0 Members and 1 Guest are viewing this topic.

Offline pastaclubTopic starter

  • Contributor
  • Posts: 28
  • Country: th
I've developed a free open source tool to make life easier from exporting pick&place data to getting boards fabricated. Here's an excerpt from the description:

PnPPP - Pick & Place Pre-Processor

PnPPP is a tool for automatically converting PCB assembly files to the format required by your fab or machine, automatically rotate parts to the correct orientation and duplicate pick-and-place data with new positions for the purpose of panelization. All required meta data can be maintained directly within the CAD project. The tool was developed to process output files from Altium CircuitStudio for use with JLCPCB's self-service PCBA interface, but it can be configured flexibly and potentially be used with other CAD programs and different fabs.

Features
  • Parse and re-generate BOM (bill of materials) and PNP (pick and place) files in CSV format
  • Continuously scan sub directories of a given file path for changes and automatically process changed files
  • Auto-rotation: further rotate parts in pick-and-place file based on per-component setting in the BOM file
  • Panelization: duplicate pick-and-place information with adjusted coordinates to generate PCB panels from a single board
  • Rename, re-order and delete columns in BOM and PNP files
  • Remove extra lines not conforming with the CSV format (what were you thinking, Altium?)
  • Move output files to alternate destination path
  • All meta data (for auto-rotation, panelization etc.) can be managed from within the CAD project
  • Input and output format customizable through a JSON config file (needed only once, not per project)
Auto-Rotation

I frequently ran into the problem that orientation of a part in my library was different than what the fab expected. As a result, the rotation of the part was wrong in the fab's preview. There were two ways to fix this: either rotating the graphics in the footprint (which breaks the design) or manually editing the generated pick-and-place file (tedious, error-prone and needed to be done again everytime the files were re-exported).

PnPPP solves this problem once and for all: it automatically rotates components as needed and generates a modified pick-and-place file in the format the fab expects. In order to do this, PnPPP first needs to know which components need to be rotated and by what offset. Other tools rely on seperate files cotaining that information... however, from a logical point of view, this information is associated with the definition of a component, so I found it more logical to manage it where the component is defined: in the schematic library itself. To achieve this, I am using a custom parameter named JlcRotation on every schematic symbol that needs rotation. This parameter is automatically added by PnPPP to the rotation of all instances of the respective component.

Note that Rotation is a mandatory per-instance parameter (i.e. it can be different for each instance of a component on the PCB), while JlcRotation is an optional per-symbol parameter (i.e. it is set only once per each schematic symbol and applied to all instances of the part). CircuitStudio does not let users configure which fields to export as part of a pick-and-place file, therefore PnPPP pulls this information out of the BOM and then applies it on the pick-and-place data.

So whenever you find the rotation of a part to be incorrect, you can simply open the schematic symbol in your library, add a JlcRotation parameter, and let PnPPP do the work. From then on, whenever you use the Generate outputs feature, PnPPP will know what to do and automatically fix your pick-and-place files, in your current project as well as in all future projects until the end of days.

By the way: you don't have to use the name JlcRotation for the parameter. You can configure a custom parameter name in config.json so your library could even contain different rotation offsets for different fabs.

Panelization

The optional panelization feature in PnPPP enables you to automatically generate BOM and pick-and-place files for 1- or 2-dimensional PCB panels. If using this feature, PnPPP automatically duplicates all components multiple times and adjusts the position of the copies to accomodate for a panel with multiple instances of the same PCB. The meta-data required can be edited conveniently within your schematic file.

This feature is useful if you want to manually panelize a PCB. While CircuitStudio supports embedded board arrays (which allows you to generate gerbers for a panel), CircuitStudio can still only export BOM and pick-and-place files for a single PCB and not the whole panel. This is where PnPPP comes in: it takes the files for a single PCB as an input and outputs files for the panel.

In order to use this feature, PnPPP requires 6 values: the number of columns and rows, the x and y offset of the bottom-leftmost PCB within the panel and the x and y spacing between boards. Since it makes a lot of sense to maintain this information within the CAD project instead of an external configuration file, PnPPP retrieves this information from a single special item within the BOM, named PnPPP_Panel. It is recommended that you create a schematic symbol with the default designator PnPPP_Panel and the type Mechanical (which puts the item in the BOM but not on the PCB). You can then place this symbol in your schematic file and set its Comment to the comma-seperated 6 values.

Check it out!

See repository for more info: https://github.com/pastaclub/PnPPP
And please let me know what you think!
 

Offline SMTech

  • Frequent Contributor
  • **
  • Posts: 846
  • Country: gb
I haven't looked but this sounds like a very good idea for machines that don't have software that dos this for you (Essemtec does). If I ever work out how to use Github properly, I may chip in some time. One feature Essemtec is missing that people often use a 3rd party tool for on all sorts of machines is combining the BOM containing proper part numbers for each RefId with a pick and place field that might be missing any part numbers or values at all. The most common tool to use is a piece of Freeware called SMT-Maestro which no longer officially exists.
 

Offline pastaclubTopic starter

  • Contributor
  • Posts: 28
  • Country: th
For the ID of the components in the fab, I use a custom parameter per component and simply export it as a column of the BOM with no extra tool needed. That works fine with fabs like JLCPCB which have unique IDs that never change. If you need to manage feeder IDs of your own machine (which could be loaded with different parts depending on the project), a mapping tool can make sense. I guess I could easily extend PnPPP to do that as well, but so far I don't own a machine.

P.S: You don't have to work out github, you can even just download a ZIP file of the repository.
 

Offline SMTech

  • Frequent Contributor
  • **
  • Posts: 846
  • Country: gb
For the ID of the components in the fab, I use a custom parameter per component and simply export it as a column of the BOM with no extra tool needed. That works fine with fabs like JLCPCB which have unique IDs that never change. If you need to manage feeder IDs of your own machine (which could be loaded with different parts depending on the project), a mapping tool can make sense. I guess I could easily extend PnPPP to do that as well, but so far I don't own a machine.
Example pick and place file from CAD package:

ID,X,Y,R,Footprint
R1,2,5,180,C1608
etc

Example BOM:

InternalPN;IDs;value,SupplierNo;ManufacturerNo
11-27156-08;R1,R2,R3,R8,R11;270k;772-813; GRM270A016
etc

What the machine wants to import

RefId;InternalPN; X;Y;R
R1;11-27156-08;2;5;180
etc

Of course if its YOU who is generating the BOMs and place files you are able to include that data in the export from your CAD package. However when they are provided by a 3rd party they are often separate and the assembler needs to merge the two.

Quote

P.S: You don't have to work out github, you can even just download a ZIP file of the repository.
I meant to contribute code etc properly, never got round to finding the time to learn all the terminology.

As an assembler I would point out that for me at least I never want a panelised pick and place file, the machine does that for me.
 

Offline Mangozac

  • Frequent Contributor
  • **
  • Posts: 471
  • Country: au
This sounds quite cool but having to run it through npm is a pain and I suspect will turn off a lot of potential adopters :(
 

Offline pastaclubTopic starter

  • Contributor
  • Posts: 28
  • Country: th
@SMTech: so you simply want to use a column (ID) from the PNP file, look it up in the BOM and put another column from the identified line (InternalID) back into the PNP file? That would be very easy to implement, since PnPPP already does almost the same thing for the auto-rotation. And renaming columns (ID -> RefId) is already a feature.
 

Offline pastaclubTopic starter

  • Contributor
  • Posts: 28
  • Country: th
This sounds quite cool but having to run it through npm is a pain and I suspect will turn off a lot of potential adopters :(

You don't have to "run it through npm", you can simply run "node index.js" (that's all the npm start script does). But when you first install it, you still need npm to install the dependencies. Actually, what is the issue you see with npm?
 

Offline Mangozac

  • Frequent Contributor
  • **
  • Posts: 471
  • Country: au
But when you first install it, you still need npm to install the dependencies. Actually, what is the issue you see with npm?
It's just another thing that has to be installed and built. I prefer not to.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf