Electronics > PCB/EDA/CAD

KiCad6 hierarchical schematic with existing pcb layout(merging multiple designs)

(1/1)

Dajgoro:
Hello

I made a bunch of little boards to test out a design in a modular way, so that is easier for me to fix without scrapping the entire thing.
The boards have lots of discretes so doing the layout is quite time consuming.
I googled on how could I merge it all with KiCad 6 and I only found of mentions that it can be done but not how.
So once imported the little boards as hierarchical modules, how do I link the existing pcb layouts and have it all imported and annotated correctly on a single board? :o

julian1:
The process is broadly like this -
- Ensure the component designators used in the different sheets from across separate projects/modules are not in conflict. A useful way to do this is to use a naming scheme -  such as 200 for sheet 2, 300 for sheet 3 etc.
    It is also possible to reannotate designators, to avoid conflict before a merge. But push any changes to the pcb as well, so that kicad can find and reestablish the dependencies after the pcbs get merged.
- Pull the sub sheets that you want into the new top level project.
- For merging pcbs, open the pcb in standalone pcbnew (not from kicad). that will give you a menu option, 'append board'. Use this to navigate to the different pcbs that represent the sheets that you want to include, and add those pcbs.
- If everything works - all the designators will match up, as well the pcb layouts and features from the separate projects/modules.
- When the pcb is merged/updated again, it may need, 'reassociate  by reference', to keep the pcb layout intact.
- reopen in normal kicad.

SiliconWizard:
SO you'd need to reannotate all individual schematics first in order to avoid any clash - you can reannotate each using a start ref number in the 100's or 1000's, such as 100, 200, ... or 1000, 2000, etc, and then update each PCB individually from each schematic, and once done, merge schematics and merge PCBs as julian said.
That should work but I've never done it myself.

Doctorandus_P:
Starting with making sure the reference designators are unique is a good start.

After that, for the actual merge, you can:
1. Create a new / clean / empty project.
2. Copy the existing schematic sheets into that project.
3. Create the hierarchy to use those schematic files.

That should do it for the schematic. For merging the parts of the different PCB's you need a bit of a different workflow. First a bit of preparation:
1. Create the PCB by opening the PCB editor in the project.
2. Save the (nearly) empty file.
3. Exit KiCad

After this preparation you can use KiCad in the "Standalone Mode" to merge the actual PCB's together.
KiCad enters the "Standalone Mode" when one of it's sub programs is started directly from your OS, so without a project active. Because there is no project, some options are missing (there is no link between a schematic and a PCB), but other options get enabled, for example PCB Editor / File / Append Board. With this "Append Board" function, you can one by one open the PCB files from the other projects and append their contents to your new project.

Another option is to open multiple instances of KiCad, and then use copy and paste, but do not use [Ctrl + V] to paste, but right click on the canvas and select Paste Special from the popup menu, and then make sure you select the option: Keep existing reference designators, even if they are duplicated during pasting.

Up to here it's pretty much the same aw what julian1 wrote, but now there is a difference.
Because there is no link between a schematic and a pcb in the "Standalone" mode, you can not fix the links between the schematic and the Pcb in this way. So after you've added the contents of the other PCB files to your new project, Close the "Standalone" instances of KiCad again, and open the project in the normal way.

KiCad has several ways of linking schematic symbols with actual footprints on the PCB. Normally it uses UUID's, but I do not know if these get preserved with the above method. It is simple to check this though. Just use Schematic Editor / Tools / Update PCB from Schematic [F8]. If this creates new footprints on the PCB (still all attached to the mouse cursor), then abort, go back to the schematic, and do it again, but now with the Re-link footprints to schematic symbols based on their reference designators.

@julian1 You wrote "reassociate by reference", which is the same method, but it's old terminology. I think from KiCad V5. Is your KiCad version that old?

julian1:

--- Quote from: Doctorandus_P on January 28, 2023, 10:13:50 pm ---
@julian1 You wrote "reassociate by reference", which is the same method, but it's old terminology. I think from KiCad V5. Is your KiCad version that old?

--- End quote ---

Good catch. I have successfully merged in both Kicad v5, and v6. The crib notes I made to remember the steps, are from the old version with old terminology.

Navigation

[0] Message Index

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod