ki2jlc
v0.2.1
Published
Convert BOM and POS from kicad to JLCPCB
Downloads
4
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:
- 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.
- 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.