Author Topic: KiCad6 hierarchical schematic with existing pcb layout(merging multiple designs)  (Read 996 times)

0 Members and 1 Guest are viewing this topic.

Offline DajgoroTopic starter

  • Frequent Contributor
  • **
  • Posts: 322
  • Country: hr

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

Offline julian1

  • Frequent Contributor
  • **
  • Posts: 743
  • Country: au
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.

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14871
  • Country: fr
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.

Online Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 3545
  • Country: nl
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?

Offline julian1

  • Frequent Contributor
  • **
  • Posts: 743
  • Country: au

@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?

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.

Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo