KiKit icon indicating copy to clipboard operation
KiKit copied to clipboard

Add the option to relabel the component names such that they are unique

Open bem22 opened this issue 2 years ago • 10 comments

Prerequisites

  • [X] I have read the documentation and the proposed feature is not implemented.

Description

When using OpenPnP, it would be great if the .pos file generated by KiCad after panelization with KiKit had unique ids.

The new boards are "generated" with KiKit so I think this is the point where the parts could receive new names?

bem22 avatar Dec 03 '23 02:12 bem22

Could you provide (even a simple) example? What are "IDs"? References? Making the references unique across panels is not a good idea, as it will also change the silkscreen.

Generally, I am familiar with two workflows (on industrial machines):

  • you have fiducials on each PCB in the panel. Then you usually need only POS file for single board and you place it multiple times in the PnP
  • you have fiducials only on the panel frame. Then you need a single POS file for the whole panel. However, having duplicate references isn't a problem as the corresponding components are the same.

Please, describe your use case more in detail. Then we can design the feature appropriately.

yaqwsx avatar Dec 03 '23 07:12 yaqwsx

Hello,

Thank you for responding to my request.

My use case is the second workflow you described. I have PCBs on a panel with fiducials on a frame.

I understand the limitation with the references affecting the silkscreen - I thought there could be a workaround.

Unfortunately, OpenPNP complains about having the same reference for components: for example C1 in this file

panel-top.zip

In OpenPNP the references from KiCad are turned into IDs and they need to be unique. They are generated from the Ref column.

Ideally, I would run a script to make the Ref's unique in the file after exporting a panelized board .pos file so OpenPnP can work with it.

I'm attempting to create this script myself but I was wondering if there's already an integrating workflow for this.

bem22 avatar Dec 03 '23 18:12 bem22

In that case, I think what we need is to have kikit fab openpn that renames the components such that their references are unique. If OpenPNP can handle arbitrary strings, I suggest something like board-{n}-{originalRef}.

yaqwsx avatar Dec 03 '23 18:12 yaqwsx

OpenPNP can handle arbitrary strings. I tested this yesterday

bem22 avatar Dec 03 '23 19:12 bem22

image I would assume this is the part of the file that is interesting for parsing.

This gives the position, the Reference and the package.

What would be the workflow to integrate this into KiKit? And I assume this is python?

bem22 avatar Dec 03 '23 19:12 bem22

You missed my point - we shouldn't change how we build the panel. We should provide specialized fabrication output for OpenPNP.

yaqwsx avatar Dec 03 '23 19:12 yaqwsx

I got that. I meant what would the workflow to implement this be?

Also, what would be the design workflow?

After the penalization is done do you want KiKit to work by itself or is generating a .pos file by KiCad acceptable and then KiKit operates on it?

Would generating the .pos file outside KiCad (but by KiCad) be possible and is this action triggerable by KiKit?

Otherwise - there are some other formats OpenPNP would accept, but I think .pos file format is very sensible and would integrate well with the single-kicad-pcb-to-openPNP workflow.

Screenshot 2023-12-03 211320

P.S (yes that's my bottom vision, and yes that is my ceiling, thanks for asking :sweat_smile: )

bem22 avatar Dec 03 '23 19:12 bem22

One question, what does "renameRefs" function do exactly?

bem22 avatar Dec 16 '23 19:12 bem22

renamenet, renameref: A pattern by which to rename the nets and references. You can use {n} and {orig} to get the board number and original name. Default values are Board_{n}-{orig} for nets and {orig} for references. (https://yaqwsx.github.io/KiKit/v1.4/panelization/cli/#layout)

yaqwsx avatar Dec 19 '23 20:12 yaqwsx

This should... in principle solve my request?

I'll check it out today.

bem22 avatar Dec 21 '23 07:12 bem22

OpenPNP fabrication output was added in db18615

yaqwsx avatar Jan 06 '24 16:01 yaqwsx