matthewlai / jlckicadtools Goto Github PK
View Code? Open in Web Editor NEWTool for using JLCPCB assembly service with KiCad
License: GNU General Public License v3.0
Tool for using JLCPCB assembly service with KiCad
License: GNU General Public License v3.0
FYI, I just had a few boards printed and assembled with JLC PCB. Parts that were. " C123456" were not placed, but ones that were "C123456" were fine.
Can you trim out the whitespace out of the front of the field.
The Python script is excellent!
I installed the package with pip
, as is recommended in the README.
This does not install the cpl_rotations_db.csv
, beacuse it is not Python code.
See https://python-packaging.readthedocs.io/en/latest/non-code-files.html
Hello! Thanks for your help. I found this issue that may affect a class of ICs, but I only verified it with the one IC that I noticed it with initially.
I have a PCB that involves a ESP32-WROOM-32 SoC.
I noticed that in the jlcpcb rendering that the ESP32-WROOM-32 seems to be placed lower then it ought to. (see image) jlcpcb seems to correct this manually, but ideally this should not be needed.
I have not not rigorously tested this issue but I get it by:
Use JLCKicadTools version with commit hash 62cd76c
RF_Module:ESP32-WROOM-32
symbol and the RF_Module:ESP32-WROOM-32
footprint.jlc-kicad-tools -n my_project -v --warn-no-lcsc-partnumber . -o g
Hi Matt,
I received the cbs last week and i have been working on the code. Yesterday I started testing the relay and i could not get it to switch. I checked that the NC was working but the NO did not work. I reviewd every component of that part of the circuit and i think the culprit is the relay. It is placed reverse. the coil side is 180 degrees opposite of it should be.
I had add it this line to the ritation file:
"^Relay_DPDT_Omron_G6K-2F",-90
because originally was placed perpendicular, I guess i should have one:
"^Relay_DPDT_Omron_G6K-2F",90
Just wanted to give you a head's up. I am working through the pcb and i expect to make the next version in a couple of weeks.
Will send you an update once i have verified that this correction fixes the problem
thanks
When having the following input from the POS file:
Ref,Val,Package,PosX,PosY,Rot,Side
"H1","Pogopin_PNP","Mill-Max_Pogopin_0906-8-15-20-76-14-11-0_PNP_DUMMY",16.335000,1.485000,180.000000,bottom
"H2","Pogopin_PNP","Mill-Max_Pogopin_0906-8-15-20-76-14-11-0_PNP_DUMMY",-13.365000,1.485000,180.000000,bottom
"H3","Pogopin_PNP","Mill-Max_Pogopin_0906-8-15-20-76-14-11-0_PNP_DUMMY",-16.335000,-1.485000,180.000000,bottom
"H4","Pogopin_PNP","Mill-Max_Pogopin_0906-8-15-20-76-14-11-0_PNP_DUMMY",-16.335000,1.485000,180.000000,bottom
"H5","Pogopin_PNP","Mill-Max_Pogopin_0906-8-15-20-76-14-11-0_PNP_DUMMY",4.455000,1.485000,180.000000,bottom
"H6","Pogopin_PNP","Mill-Max_Pogopin_0906-8-15-20-76-14-11-0_PNP_DUMMY",7.425000,1.485000,180.000000,bottom
"H7","Pogopin_PNP","Mill-Max_Pogopin_0906-8-15-20-76-14-11-0_PNP_DUMMY",13.365000,-1.485000,180.000000,bottom
I get the following output in the CPL file:
Designator,Val,Package,Mid X,Mid Y,Rotation,Layer
H1,Pogopin_PNP,Mill-Max_Pogopin_0906-8-15-20-76-14-11-0_PNP_DUMMY,16.335000,1.485000,0.000000,bottom
H2,Pogopin_PNP,Mill-Max_Pogopin_0906-8-15-20-76-14-11-0_PNP_DUMMY,13.365000,1.485000,0.000000,bottom
H3,Pogopin_PNP,Mill-Max_Pogopin_0906-8-15-20-76-14-11-0_PNP_DUMMY,16.335000,-1.485000,0.000000,bottom
H4,Pogopin_PNP,Mill-Max_Pogopin_0906-8-15-20-76-14-11-0_PNP_DUMMY,16.335000,1.485000,0.000000,bottom
H5,Pogopin_PNP,Mill-Max_Pogopin_0906-8-15-20-76-14-11-0_PNP_DUMMY,4.455000,1.485000,0.000000,bottom
H6,Pogopin_PNP,Mill-Max_Pogopin_0906-8-15-20-76-14-11-0_PNP_DUMMY,7.425000,1.485000,0.000000,bottom
H7,Pogopin_PNP,Mill-Max_Pogopin_0906-8-15-20-76-14-11-0_PNP_DUMMY,13.365000,-1.485000,0.000000,bottom
Please note H1 and H4 is suddently placed in the same position!
Hi Matthew & Co
Is there a way to run the tool in the current folder?
Perhaps this could be done when no other argument is provided.
Currently I need to use "cd .." and then add the right folder to the tool.
(going one back often brings my PCB repo, hence finding the right folder again can take a while)
When placing a QFN-48 chip (ESP32-PICO-D4 as example) with pin 1 as right side bottom most pin the CPL puts it as bottom edge left most pin.
The KiCad all-pos csv shows it as:
"U6","ESP32-PICO-D4","QFN-48-1EP_7x7mm_P0.5mm_EP5.3x5.3mm_ThermalVias",163.576000,-91.440000,180.000000,top
generated CPL file shows it as:
U6,ESP32-PICO-D4,QFN-48-1EP_7x7mm_P0.5mm_EP5.3x5.3mm_ThermalVias,163.576000,-91.440000,90.0,top
Hello, great project!
If a component has a value with a unicode character like 10KΩ an error occurs
Traceback (most recent call last):
File "generate_jlc_files.py", line 78, in <module>
main()
File "generate_jlc_files.py", line 71, in main
if GenerateBOM(netlist_path, bom_output_path) and FixRotations(cpl_path, cpl_output_path, db):
File "E:\source\JLCKicadTools\jlc_lib\generate_bom.py", line 65, in GenerateBOM
out.writerow([c.getValue(), ",".join(refs), footprint, lcsc_part_number])
File "c:\Python34\lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u03a9' in position 4: character maps to <undefined>
Anyone having luck with exporting placement file for the backside? Mine seem to be completely off in the preview.
Not sure if this is script or JLC related
I had a component (C83451) where I had copy-pasted a description including the symbol for ohm (137MΩ) into the value field. It appears the JLC tools don't like this as the component appeared in the review tables when ordering but it was not shown on the graphical review. Changing the value in the schematic editor to remove the Ohm "Ω" character (and re-generating the BOM and CPL using your script) fixed the problem and the component was shown in the review window properly.
Maybe consider looking for non-standard (non-UTF-8?) characters in the script and fixing or warning the user?
Thanks for the script - I have just placed my first order using it!
A part with SOIC-14_3.9x8.7mm_P1.27mm
footprint has incorrect rotation, it needs to be corrected by 270 degrees (like the SOIC-8 and SOIC-18 already in the corrections file). It wouldn't surprise me if all SOIC-* packages need 270 degrees rotation (but I haven't checked that).
Hi,
when a TH footprint is present in a pcb with a different orientation, the script should adjust the translation considering the footprint orientation in the pcb (getting it from -all-pos.csv file).
For SMD fp the issue is not present because they are placed on fp center, in case of TH fp, the anchor is instead on first pin.
This is generating a misplacement in JLC assembly service
i.e. in case of a PinHeader placed in the pcb with 0deg, 90deg, 180deg and 270deg, the transformation will generate 4 different alignment to the original footprint
"^PinHeader_1x02_P2\.54mm_Vertical",90,1.27,0.0
when using the generated placement file, i get no components whatsoever.
strangely when i remove some components from the placement file it starts working, but they're literally the same components as some others that work fine.
there's one interesting lead (edit, never mind, thats just because the BOM didnt match. not useful info. continuing to dig)
I have used this tool a few times already, and I am loving it.
I still frequently come across components, that are incorrectly rotated. For instance, just now I see a tantalum cap that is reversed (C7171). There is a particular rule about this one package in the database already:
"^CP_Tantalum_Case-A_EIA-3216-18",180
So either
Neither strikes confidence in JLC or JLCKicadTools. The last one would be particularly disastrous for when I'd like to reorder an old design.
I suggest that in the future all changes to cpl_rotations_db.csv
are required to be documented with an example component. This could just be a additional column (AFAICT, that is acceptable even without any changes to the current script).
This way, I can at least verify that particular rule.
What's more, there should be a reference board maintained somewhere (perhaps even in this same repo), that includes all of those components. This is important for regression testing: The database features both generic rules (^QFN-
) and more specific ones (^(.*?_|V)?QFN-(16|20|24|28|40)(-|_|$)
). I can easily see how changes could cascade and break components the author did not intend to touch.
Ideally testing would be automated, but I don't see how that could happen :)
Have you ever considered using some for of semantic versioning and publishing this tool via pypi. It would lower the barrier on entry and would make it easier for users to update things. I would be willing to help here if you are up for it.
My thought process:
update
command where the latest database could be pulled from githubWhat do you think?
Hello,
First off thanks for the blog post and the script. I got it working to the point where i can produce the needed files.
The problem that i have is that one of my components needs to be rotated by 90 degrees.
I tried following your instructions but i cant find the ‘cpl_totations_db.csv’ file. You mentioned that is in the same
directory as the conversion script, but I cant find that either.
I am running on OSX, and while i can execute the command
jlc-kicad-tools /Users/arifainchtein/Data/DigitalStables/mcu/kicad_designs/GloriaField/GloriaField
i dont know where the files are installed and therefore the cpl files generated dont have the corrections
. Could you give me some suggestions?
thanks
Hi, thanks for the great tool. I am having an issue generating the files - a particular part (C620322) shows up in the BOM file but not in the CPL file. There are no errors or complaints when running the script.
Relevant row in BOM:
"1825910-6","S1,S2,S3","SW_SMD-4P_Switch","C620322"
Nothing in the CPL file.
Your help in figuring out what the problem is would be much appreciated.
https://github.com/matthewlai/JLCKicadTools/blob/master/README.md states "KiCad 5" making me wonder status of kicad 6 and 7 support
I would like to describe an interesting situation. Maybe someone had experience.
When placing an order, the position of the component SOT-363 appears to be correct.
But in DFM analysis the position is wrong, which is corrected by the JLCPCB engineer.
Before:
After:
It seems to me that DFM analysis should be trusted. So I added the component to the database in #66 .
Actually the question: did I do the right thing and did anyone deal with such oddities?
Hi All
I have spent a good half hour debugging why one component was missing in the JLC bom.
Turns out I had a seperate export folder, which also had a valid .pos file.
Could we perhaps throw an error if there are multiple XML, pos files etc?
alternatively use the latest one.
These file inconsistencies can be quite dangerous IMO
Thanks for a great tool!
Hello,
just to let know that command
sudo apt-get install python-pip
has to be changed for
sudo apt-get install python3-pip
and read
... since the script needs Python 3.7 up.
Hi,
I wanted to try this plugin but had trouble because I'm using OSX and the way it attempts to install pip doesn't work because OSX won't load the unsigned numpy extensions into KiCAD (which is signed). It also appears to break the KiCAD install, although maybe that was something else.
I pondered making a pure python parser but figured it would be too slow, then I realised I can use sqlite3 for most of the heavy lifting.
My code is at https://github.com/DanielO/JLCKicadTools/tree/sqlite if you want to take a look.
The most horrible part is loading into the DB - I had it call the iconv binary to convert from gbk to UTF-8 (sqlite does not support many encodings).
Hi @matthewlai
First, thanks for the great work :)
I noticed V6 imports all the extra fields from schematic (LCSC etc).
I guess this would make it possible to run the script from PCBnew, and avoid a bunch of the export steps.
Perhaps it could even be made as an actionplugin.
Would this make sense?
I do understand if the amount of work would not be worth the gain.
Kindest regards
From how I see it, the tool should only try to group components if they are the same designator type (R1, R5, R10 etc) besides FP, value etc.
An NTC resistor with same value and FP as a normal resistor, gave me this warning:
"Components R5, TH1 from same group have different LCSC part numbers: C25744, C92371"
Is this a bug or by design?
Having an option for an extra database file would be great for personal libraries.
This way I wouldn't need to flood the current database with own namescheme FP's :)
As described before. This Project creates an empty BOM but a working CPL
Circuit.zip
Hello,
I did all the steps outlined in your blog and i discovered that all the components that use footprints which i created do not show up in the cpl file generated. They do show up in the bom file generated. I am assuming i am missing something in my footprints, but cant figure out what.
Do you have any suggestions? I am running on OS X
thanks
Hi Matthew,
Here is the case.
I made a project, did everything according to the instructions and generated the files. I uploaded the gerners, the bom and the cpl to jlcpcb and discovered that two components where out of stock.
I went back chose replacements for those two components and made sure that all the places of those compnents had the new JLCPCB codes in the components in the sch.
I then generated the bom and check the xml file to make sure that the new JLCPCB codes where in the xml.
Then when i ran the jlckicadtools script it kept using the old components code.
I cant seem to find where is the jlckicadtools is getting the previous code since there is nowhere in the kicad files
I just needed to replace a diode (C95872 by C412437) because JLC went out of stock on the former.
I now see that the new diode is incorrectly rotated, although I am confident that the rotation was correct with the other part number. I cannot verify now, because, well, JLC won't allow me to visualize any components that are out of stock...
Anyhow, this strongly suggests that not all the components of the same package are oriented the same way. It might just be an oversight on JLC's side.
This script should support a by-part-number rotation.
Hello,
I was thinking of using multiple schematics in a project. Does JLCKicadTools support that?
thanks
Thank you for making this tool. It is very useful for generating JLC production files.
Is there a reason you have the two-step install, using pip to install requirements instead of just putting the requirement for logzero
in the setup.py file? If not, then I would be happy to submit a PR to move this requirement into the setup.py.
Hi Matthew,
I am having an issue that would love to hear your feed back on. I generated the JLCPCB files and when i got the pcbs a few components were not placed on the pcb. I contacted jlcpcb and they told me that those components were not in the files and that it why they had not been placed.
Sure enough when i checked the files i discovered that they are in the generated bom file but not in the cpl file. I am including the files.
For example, the following components are present in the bom but not in the cpl:
C10 C14 C18 C22 C27
J13 J29
J10
C27
C11 C15 C19 C23 C25
Do you have any suggestions as to what i could be doing wrong in my kicad files for the components not to appear in the cpl file?
Thanks
valentino_2104.pro_bom_jlc.csv
valentino_2104.pro_cpl_jlc.csv
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.