And we once had a long discussion, whether we should use one library component with different values, Like Tesla resistor manufacturing SMD resistor 0603 model 12345 and let values tell which resistor to use, but then we made each value a separate entry.
Kicad can do several flavors of BOM’s. And, user can Tweak the .PY file that’s used for it.
BOM’s can be done from PCB and from Eeschema but, they are different beasts.
Try this:
-
Decide what you want in the BOM (naturally, it’s based on the Data/Fields in the Symbol/Footprint.
-
Review the various .PY files in Kicad and discover the Keywords/etc for them (also look at the BOM exported from PCB).
-
Tweak the .PY as needed and save with new Name.
I have a few I did and my favorite is HTML followed by CSV (that I further customize in LibreOffice’s spreadsheet app).
You’ll need to discover how to implement it’s use (pretty easy but, not necessarily clearly understood).
Thus, for your amusement, my HTML version attached (I hacked it from a stock one)
Screenshot of some code and the actual file…
My_bom_html.py (3.0 KB)
The Result shown in Firefox
Not bad. Then I wish libraries would be neat, so that something like could be made. (That is: do your own libraries)
One question, How is this add on? used. Where to put it, and how to start it.
You’ll need to do some homework to clear-up any confusion but, basically, here’s the scoop on BOM’s:
BOM, from PCB editor: Fabrication_Outputs> BOM
BOM, from Eeschema: Tools>Generate_BOM
Put the file I posted in the folder called: SharedSupport>Plugins (finding it is part of your homework).
If the folder contains a file called “kicad_netlist_reader.py” then, all should work…
(when you’ve Quit and Re-started Kicad, then, arrive at the Panel (via clicking Generate_BOM), you should see the File you placed in the Folder. Select it and OK, it will make the BOM and put it in the Project’s folder.)
I agree that making a good BoM is a complex task. And this isn’t a KiCad problem.
KiBot can be used to generate HTML, XLSX, CSV, TSV and TXT BoM like this or this. Note that these examples where generated without configuring KiBot, in fact KiBot generated all these BoMs. You have a high degree of configurable stuff on KiBot and we are open to add more options.
KiBot currently works on CI/CD environments (like GitHub and GitLab) and on Linux systems. Running it on Windows is currently tricky (you must install WSL).
Generating BOM should begin with making good part libraries. I have began to think that every user should do his/hers own part libraries. And BOM generator should be able to use data in those. It should also be possible to have some useful or meaning names data fields, Field1 Field2 and so on, are silly.
It should be easy to import data data from official (KiCad ) part library, and from libraries from other sources.
I haven’t actually used the BOM scripts which come with KiCad (because editing them didn’t have enough ROI compared to just exporting BOM from Pcbnew and editing it with LibreOffice), but I think those field names in some script were just examples, and the script was meant to be customized.
Of course it’s not good usability, and a flexible GUI which is still simple enough that it can cover most use cases is needed, and the need is known to the developers, and is in plans. But as you know, there are n plans and n^2 needs and only a handful of developers. You (anyone) can try to design an easy to use yet flexible GUI and show us what it looks like.
KiCad provides the flexibility to create your own field names in EESchema. Check the preferences for “Field Name Templates”. Here you can create your own custom fields that will apply to all schematics after you define them in preferences. Here I made 3 dummy names to demonstrate:
Then you should be able to write (or customize one of the existing) Python scripts to use these field names in addition to the defaults when generating BOMs.
Yes, this requires you to do the customization yourself, but it should only need to be a one time thing.
Yes, and there are some common names used by tools like KiCost (integrated in KiBot). But this is very personal. I always suggest users to use separated fields for things like tolerance, power, voltage, current, etc. You can join those fields in the BoM and you get more flexibility in the sorting and positioning of these values. But some people doesn’t like it, is just a question of preferences.
I typically put an internal part number (IPN) in my schematic symbols, and then create a spreadsheet to cross reference IPN to MPN. Then I can do anything I want – change sources, multiple sources, etc. Also created GitPLM, which is a tool that takes a KiCad BOM, combines with spreadsheet, and then outputs a BOM with MPN. This is working very nicely for current projects (team of a couple engineers).
What to put in the schematic? I agree that not every bit of info is usefull visible in the schema. But part library is a different. To me it needs ordering info for others to use.
Very nice job with your tools – first I’ve seen your project. I added a link in the GitPLM readme so I won’t lose track of it.
Indeed, we are all reinventing the wheel! My attempt https://github.com/Gasman2014/KC2PK
linked to the MySQL backend database behind PartKeepr and used Octopart to get pricing and availability - until Altium bought out Octopart and changed the API. One day I might rewrite it for the new API.
I am working now with the bom generation from kicad project and reading the requirements for pcbway. It’s a little confusing as for example the description of required fields in here does not 100% match with their provided example BOM file.
https://www.pcbway.com/assembly-file-requirements.html
To be able to create the PCB, they need this info.
- “Item #”
- value: line number: 1, 2, etc
- “Designator”
- value: C1, C2, R1, etc…
- “Qty”
- value: 1, 2, etc
- Package: (Is imperial allowed, is metric allowed, etc.)
- value way 1: Capacitor_0603_1608metric
- value alternative metric way: 1608
- value alternative imperial way: 0603
- Type:
- value: SMT, PTH, DNS/DNP(Do Not Stuf/Do not place)
And to be able to also assembly the board they will in addition need these fields:
- “Manufacturer”
- Value: ST, ROHM, Mura, etc…
- MPN: (Manufacturer part number)
- value: FTS-101-01-L-D, etc.
- Empty field to allow fab to select generic part from multiple manufacturers?
- DPN1, DPN2 (Distributor1 part number, Distributor2, etc…)
But I think that only the values for fields number 1-3 (line number, designator and quantity) are schematic specific information.
Values for all other fields like Package, Type, Manufacturer, MPN, DPN1, DPN2 (fields 4-8) are clearly PCB manufacturing specific and are determined, specified and saved during the PCB placement and routing phase when assigning real footprints and components to schematic symbols.
So my question is that could KiCad use same BOM tool both from the schematic editor and pcb editor? If only the schematics are done, then not all of the information would yet be available unless there is a way save some of those fields to some type of shared data that is available for editing and reading for both of these tools.
I mean that values for fields like “package”, “type”, “mpn” and “dpn” could come automatically once footprints and manufacturing info have been assigned to symbols in PCB editor instead of manually specifying them to table in schematic editor.
I have made so many PCBs that I forget other ways to use a CAD. To me, every library part should have full info, that is, also your fields 6-8.
It’s not the KiCad devs job to take care of fabrication houses. JLCPCB (and other manufacturers) can take care of themselves well enough. All the instructions to generate the BOM and CPL files to their requirements are written up on their website. For a few jobs it’s easy enough to do manually. JLCPCB is one of the easier ones since they just require a single part ID starting with C which you can find on the LCSC site. For more automated workflows others have written plugins and scripts. Eventually some of those will get widely used.
PCBWay does not have as simple a scheme as JLCPCB because they don’t have a sister company like JLCPCB has LCSC. So they require more information for their buyers to find suitable parts for you. Partly this is a problem that PCBWay has to solve, to make things easier for job submitters. Partly this has to wait for a future KiCad version to acquire the capability to connect to databases so that it becomes easier for people to develop tools to accompany KiCad.
Well they do seem to be trying, they even have an official plugin in the PCM, I haven’t try it though.
I just finished a BOM. Luckily, there was only a few added components. Non stock and rare parts took most of the time. And now I think order(or names) of fields is not important, but the parts library should be consistent. I mean, every part should have full info, and in same place as other parts. Any script will work then.
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.