npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ki2jlc

v0.2.1

Published

Convert BOM and POS from kicad to JLCPCB

Downloads

5

Readme

ki2JLC

Will convert the BOM and POS files generated by KiCAD to the format accepted by JLCPCB for their assembly service.

Installing

The same as always with NPM:

yarn global add ki2jlc

# or

npm install -g ki2jlc

Generating files from KiCAD

First we need to create the BOM and POS files, here is how to generate the files accepted by this converter:

This works for the version 5 and up of the KiCAD

BOM

First you need to be sure each part that is supposed to be assembled by JLCPCB have a LCSC field defined for it. To do so you can edit the part by opening its properties panel and include a new line named LCSC and for its value copy the SKU code from JLCPCB for that part. You may create properties with other names like SKU for Mouser and/or digikey and they will be ignored, for this processes we only care for LCSC codes since they are the codes used by JLCPCB.

Tip: You can use the Edit symbol fields button on the toolbar to check/edit all fields for all symbols in your schematic.

With the schematic open use the BOM button and select the bom2csv plugin. Your command line should look like this: xsltproc -o "%O-BOM.csv" "<path-used-in-your-system-to-the-plugins>\plugins\bom2csv.xsl" "%I".

Note that is possible to edit the -o parameter to create a template for the generated csv file. Here we have added the suffix -BOM.csv to the %O, that expands to the projects name. So a project called test will create a BOM called test-BOM.csv. You may tweak this as needed.

This process will also create a XML file, it may be deleted later.

POS

Open the pcbnew editor and access the menu File > Fabrication Outputs > Footprint position (.pos) files.

Be sure to have the adjusts to CVS, Millimeters and Single file for board and then generate the file.

Using this converter

This converter will do two things:

  1. Rename/reorganize the CSV columns for both BOM and POS files.

    JLCPCB requires a set of columns different from the ones generated by KiCAD. Here we create a JLCPCB compatible CSV file. This is the easy step.

  2. Fix the positioning used by JLCPCB

    Okay, I'm not the experienced guy in here, as so, I don't know why the file generated by KiCAD contains the rotation in a way that mismatches JLCPCB's requirements. My bet is that they both use different standards. Here we try to fix this error. Not always the easy step.

For this just execute

ki2jlc bom your-bom-file.csv
ki2jlc pos the-pos-file.csv

This will create your-bom-file-JLC.csv and the-pos-file-JLC.csv files, they are ready to be uploaded to JLCPCB.

Notice that, since this files are intended to be uploaded to JLCPCB for assembly service, both BOM and POS files only include parts that have a LCSC SKU code defined for it (they are the parts they will solder at the end), any other part are suppressed from the generated files.

Wondering why the second step is not always easy? Well, because it's a work-in-progress. This application will know how to fix the rotation for footprints already added to the rules list. Any unknown footprint will simply be forwarded to the result file as is.

So, is up to you to visually check placement after upload and be sure every parts are in the correct rotation.

If incorrect you may edit the set of rules to add the new footprint to the list of known parts, regenerate the pos file, upload again, check again... well... not always easy.

Are you a nice person?

Really??!!! Then I suppose you will share with us all rules you had to create yourself so next user will have an easier experience! Thanks for that! :smile:

So, you don't know how to create a new rule?

Well, you can manually edit the generated CSV in excel, or any regular text editor, and change the angle (the last column), until placement is fine.

And you may create an issue with the wrong (original), POS files so I can include the rule for that footprint. This way you got it right next time.