Bouni / kicad-jlcpcb-tools

Plugin to generate BOM + CPL files for JLCPCB, assigning LCSC part numbers directly from the plugin, query the JLCPCB parts database, lookup datasheets and much more.
MIT License
1.19k stars 107 forks source link

kikit panel CPL file all over the place #440

Closed whinis closed 4 months ago

whinis commented 7 months ago

I think this is a regression of https://github.com/Bouni/kicad-jlcpcb-tools/issues/155. I submitted a 3x3 board and had my CPL rejected. It seems that its randomly selecting a reference designation for each part, leading to the placement being all over the panel rather than on one unit.

Bouni commented 6 months ago

Can you provide your generated files so that I can take a look at them?

whinis commented 6 months ago

BOM-panel-3-3.csv GERBER-panel-3-3.zip CPL-panel-3-3.csv

Bouni commented 6 months ago

OK, I guess th eproblem is that the ref, SW1 for example occures on each pcb of the panel, ehich makes absolute sens (I've never done panels before, so I never thought about that). Can you provide the .kicad_pcb file or even better the complete prjetc files as well? I need to check what the API returns for all the footprints.

whinis commented 6 months ago

https://gitlab.whinis.com/Whinis/sfp-media-buddy

Bouni commented 6 months ago

Is there a reason you did not include the panized version in th egit repo?

whinis commented 6 months ago

I just generate it each time via kikit and the included kitkit json file

shuki25 commented 5 months ago

I have the same problem as above. The latest revision does not produce CPL position for every components. I have 2x2 panel generated by Kikit, it only list once for each component randomized from one of the boards (4 boards total). See example:

image

I did not have that issue before until Version 2024.04.02 when I started having problems. I haven't tested it with 2024.04.01 yet. Last production run with panelized boards were in March so I probably ran it off on 2023.09.01 version. AFAIK the 2023.09.01 version generated the panelized CPL file correctly. I'm currently on version 2024.05.01, this version is causing problems. I'm unable to rollback to the older version. I need to have the board produced this week and this is problematic.

shuki25 commented 5 months ago

Just to add comment here, I was able to generate position file using KiCad's File > Fabrication Outputs > Component Placement and renamed the columns in the generated file and it worked. It just that your plug-in is not producing correct output. This is a temporary workaround for Kikit generated panelized boards.

Bouni commented 5 months ago

@shuki25 can you share the project files including the panel?

shuki25 commented 5 months ago

@shuki25 can you share the project files including the panel?

No. It's proprietary. Sorry.

whinis commented 5 months ago

Did my panel not work ?

Bouni commented 5 months ago

Did my panel not work ?

I wasn't able to generate a panel. For whatever reason I can't get KiKit to work ...

Bouni commented 5 months ago

Ok, I finally managed to create the panel by using the Docker method.

I wonder how this could ever have worked!?

We iterate over all parts in the table and get the position of each part, so if we have 4x C1 for example, we just get the position fo one (random) of them, whatever the KiCAD API returns on self.board.FindFootprintByReference(part[0])

But I have a solution in mind. We iterate over all parts on the board and serach a match in the parts table. That way we get all C1 parts for example.

But that will take some time to implement ...

shuki25 commented 5 months ago

I don't understand why 2023.09.01 version worked just fine. Why reimplement if previous version worked? What has changed in your code base? Did it break under KiCad 8?

Bouni commented 5 months ago

After some digging I found out that PRs #398 and #407 caused this issue.

After PR #480 is reviewed and merged I'll release another version with the fix