KiCAD project library

Hi.
I have projects in KiCAD from version 5 to version 8. When the project is completed, I need to save the libraries and link them to the project.
In the future, this project can be opened by another user on another machine and it should open without distortions in the schematic, board and 3D assembly.
I use both global KiCAD libraries and my own global libraries.
KiCAD has advantages and great flexibility in creating libraries. You can link any pattern and model to any symbol. But this is also a big disadvantage for me when I start saving all the symbols, patterns and models to the project library. All because the schematic editor separately saves only symbols,
the board editor saves only patterns, and the “Archive 3D Models” plugin saves only models. The “Archive 3D Models” plugin does not save all 3D models marked in the pattern settings, but only the last marked one.
Libraries can be created in different ways.
Previously, I took the resistor symbol R and inserted it into the circuit. Then in the schematic I could change any pattern for it, say 0805 or 0603 or 0402.
When saving libraries, KiCAD will save one symbol R and several patterns 0805, 0603, 0402.
But in this case, it is not clear which pattern is linked to the symbol in the library. It is good that this information remains in the schematic.
But in order to bind the template to the symbol in the schematic, I have to re-assign the template to each resistor symbol with a new project library path.
The same applies to linking a 3D model to a pattern.
For example, if you use the symbol of an electrolytic capacitor, then there are even more templates for it with their own 3D models.

Previously, I assigned templates in the schematic to each symbol or with the help of an intermediate utility - “assignment of footprints”, before creating the board. Then, due to the complexity for me of restoring old projects and their libraries, I began to do it differently.

I started making my own libraries for resistors and not only in this form:
Symbol R (0603) ← Patern R (0603) ← model R (0603).
i.e. the symbol in the library already knows what pattern and 3D model it belongs to.
I made libraries of frequently used components for myself.
Disadvantage - libraries become very bloated
Advantage - when I create a circuit, I immediately insert a ready-made component with a template and model and then do not spend additional time separately assigning templates to each component.
i.e. the symbol in the library already knows what pattern and 3D model it belongs to.

I am not a fan of Altium, I am writing right away. Creating libraries there is more difficult and you can not link a symbol to a template so flexibly.
And I do not like when libraries are rigid and cannot be changed. But as for me, this has an advantage in the integrity of the library and preserving the links between the symbol and the template when saving the library for the project.
i.e. when I save libraries for a project, it saves the entire link between the symbol and the template.
in KiCAD, unfortunately, the link is lost when saving libraries for a project:

  • the schematic editor creates a project library with links to templates for the global library.
  • the board editor creates a project library with links to global libraries of 3D models.
    Then I have to restore the links to 3D models for templates, relative to the project library.
    After that, I have to restore the links to templates for symbols, relative to the new project library.

Yes, both editors save libraries of symbols, templates and 3D models. But the links between them are lost. And when I open the entire project with only the project library, my board can change the drawing.
I need to restore all the links between symbols, templates and 3D models.
When it’s my personal project, it’s not so scary.
But when it’s a commercial project, the board drawing is damaged - copper layers, silkscreen.
And this then flows into a new production preparation and additional costs.
True, to avoid this, at the end of the project I also save all the layers in Gerber. This solution saves me from a new production preparation if the board drawing has slightly changed.
Now I’ve come to the topic of my question.
I think it would be right to create libraries for the project only from the schematic editor. So that when creating a library for a project, the schematic editor pulls up templates that are written in the symbol fields, and templates pull up 3D models that are referenced in the template fields.
And then when the scheme editor creates a project library, it edits all the links to templates and 3D models itself, relative to the new path of the new library.
The main thing for me is to maintain the structure of connections in the form:
Symbol R (0603) ← Patern R (0603) ← model R (0603).
Question - is there currently any plugin or method to create a project library with links to templates and 3D models?
Thanks for your help!

Assumming Footprint == Template == Pattern.

Here’s an overview of how to make your project portable:

1. Check project synchronization

Make sure your project is fully synchronized by running Update PCB from Schematic… once again:
image

2. Preparing footprints

If you’re using KiCad 9, you can embed 3D models in the footprints (although there’s no button to embed every 3D model automatically yet, and you have to close the dialog before the embedded file gets detected):
image
image

Otherwise, make sure you have relative 3D Model paths on your PCB, e.g. by running the Archive3DModels plugin.

3. Saving footprints

Use Export → Footprints to New Library… to save your footprints:

Choose Project:
image

Choose Yes:
image

4. Updating schematic

Use Tools → Update Schematic from PCB… menu item:


Click Update Schematic:

5. Saving symbols

Use Export → Symbols to New Library…
image

Choose Yes:
image

Choose Project:
image

Choose Yes:
image

6. Check


7. Save the PCB and Schematic

1 Like

Thanks for the tip. I looked at KiCAD 8, there is no such option to embed a model in a footprint. It is only available in version 9.
If I understood correctly, then I need to go the other way around - first bind 3D models to footprints, then save footprints to the project library, then update the circuit from the board, thereby binding footprints to symbols, and only then save the project library for symbols.
Okay. Then I have more questions.
The library for version 9 is inherited from the library for version 8.
For now, I don’t want to rigidly bind a 3D model to a footprint. Then I’ll have to go through all the footprints on the board and rigidly bind the models to the footprints there.
But this will probably take a long time.
It will probably be easier for me to first create a project library for footprints, and then edit it for each footprint separately, embedding the model in them.
Am I right?
Then there is another question: does kicadStepUp work with footprints with built-in models? Or will it be necessary to save the models separately and again write links to the models for footprints?

You can still the Archive3DModels plugin in 9.0 until the multi-embed button is implemented.

And the footprints are text files, so you can edit them in text editors too.

Probably not yet but it’s better to ask @maui. What do you use it for?

For now only for editing the board outline and board assembly.
I will try to create a library according to your advice.
Thank you.

Note there’s another workflow where you export the board to STEP and import the board outline from DXF.
Though this workflow might be slower compared to kicadStepUp.

This all looks like a very long and complicated story, and I don’t really understand it.
For KiCad V6 and later, all info for a project (including symbols and footprints, but not for the 3D models) is embedded inside the project. All symbol info is in the schematic, and all footprint info is in the PCB file. So there is no need to do anything special when you archive the project. The Export (symbols or footprints) to Library can always be done later from just the project itself. For KiCad V5, keeping the [Project]-cache.lib and [Project]-rescue.lib files in the project during archiving achieves a very similar result.

If I want to transfer my project to someone, I need to create a library for the project or provide all the global libraries that were used to create the project.
The project must be created and closed with all the documents needed for production.
A closed project should not depend on global libraries that may change over time.
The project must have all the necessary libraries to open it on another machine that does not have these global libraries.
That is why I described the problem of creating a library for a project in such detail.

1 Like

As I wrote, that is already the case with all KiCad V6 projects and later. (Except for the 3D models).
When you open such a project later (without the original libraries being available), you will get warning messages that those libraries are missing, but because all info is still in the project, this is just a minor inconvenience. It’s just warnings, no errors.

1 Like

As said above, all used symbols and footprints are embedded in the project. You have no need for the global libraries. This is true since V6.
For the 3D models, IDK, never used them.
What you do need to do is make a package of the simulation models used that will be saved with the KiCAD files.

Thank you. I will take this note into account. Later I will check what you write on another machine where there are no libraries.
But I still need 3D models to simulate the assembly and installation of the board in the case.
Let me give you an example.
I made a board for a device in KICAD 5. Time passed and I need to change this board a little. Now I changed it in KICAD 8.
All my libraries are inherited from KICAD versions 5 to 9.
In the V5 project, a project library with symbols, footprints and 3D models was created back then.
To make changes to the board in KICAD 8, I need to use the project library. The links are broken. So I had to restore all the links.
This work took time. And I did not do it for that long, because I have been familiar with KICAD for a very long time. But for a less experienced person, this is a problem. For a person who has worked with PCAD or Altium for a long time, it is difficult to understand. There in these cad systems these libraries are one whole with symbols, footprints and 3D models (in Altium).
Therefore, when I give my project to someone for editing or viewing, the first thing they ask me is - where are the libraries and how to link symbols, footprints and 3D models.
That is why I started this topic, that in order to save the library it would be desirable to save all the links between the three elements of the library.
If a symbol has only one footprint and 3D model in the library, then I think that this dependency should be saved in the new project library.
If one symbol has several used footprints in the scheme, then this dependency should be saved in the scheme.

Let me describe what I do when packaging a project for someone else.
First, each project has its own directory.
This is where *.kicad_pro, *.kicad_sch and *.kicad_pcb are stored.
I then create subdirectories ./models and ./datasheets for simulation and documentation.
In the end, everything is stuffed into a .zip file for transfer.
You could probably also add a 3D subdirectory as well.

Important is to use relative paths for the subdirectories.

I started to figure out version 9 and found that it is also possible to embed files in schematics and library symbols.
If I follow your path, then it is possible to embed a 3D file in the footprint of the global library. Then in the same way it is possible to embed the footprint in the symbol of the global library.
After completing the project, I create only a symbol library for the project with all the files already embedded (footprint + 3D model) and will this be enough for the library to be portable? Or is it impossible to do this and separate footprints are still needed for the board editor?

Yes, it’s not supported.

Here is such a footprint with two models.
KiCAD v8.

When viewing a 3D construction in KiCAD, two models are visible.
When building a step file assembly both with Kikad and with kicadStepUp, two models are visible.
But the “Archive 3D Models” plugin saves only the last model in the list.

Seems to work for me (KiCad 9), did you install the plugin from the Plugin and Content Manager? Is it up to date?
image
image

1 Like

Updated in v8. now saves two models. Thanks.

Editing and viewing are two different things. All projects are automatically self-contained for viewing, except for the 3D models unless they are embedded. You can even edit the layout and generate the gerber files etc. without libraries.

Editing the design with the normal workflow, adding new components, is a more complicated case. You can’t add components to the design in the normal way if you don’t have the libraries for that component available. It’s possible to use workarounds even for that, but this breaks the normal workflow.

I say this because you have to know for what purpose the project is shared. Sometimes just viewing is enough, and KiCad is explicitly designed to allow viewing without any special actions even when the libraries aren’t available (again, except for the 3D models).

2 Likes

A Project should on completion be exported with its details, schematic, symbols, footprints, and Gerbers, BOM, data sheets, calculations, block diagrams, vendor quotes, etc, to “Document Control” directory/repository, for archival purposes.
3D models are not used by PCB manufacturers, so only useful for mechanical integration, but can be included if needed.
New and updated Global public libraries should not be used for old and tested projects. It should be possible to open an old project without referencing any new or global library, only the one being used at the time.
If project needs to be updated, it should be imported into a new project. Any new library referenced must be checked for usability against IPC standards, and PCB fabricator specs and requirements.

There are (PCB layout programs) industry conventions used and are considered “standard” methods, that should be used, Switching from one of those it should follow the same thought pattern. The wheel has already been invented.

Hi.
I do as you wrote.
For the production and assembly of the printed circuit board:

  • I create a gerber;
  • a file for the arrangement of elements POS;
  • a list of elements in HTML form;
  • additionally a BOM file;
  • plus additional technical requirements for creating a printed circuit board;
  • if it is a multilayer board, then also a stack.

Yes, you are right, 3D models of components are not needed to assemble the board. But I use a 3D assembly of the board to arrange it in a finished case. I create a board relative to some device, case or 3D space.
I have already been told that in order to view the circuit and the board, libraries are not needed, starting with KiCAD V6. I have not checked this yet.
But for modeling the device and editing the board, libraries are needed. The project should not depend on the creator.
I have already been told how to do this, I have already tried to do this, but have not yet come to a final decision. This process of creating libraries does not happen as I imagined, but it is still a solvable problem.
In the near future, when I find a convenient solution for myself, I will write how I did it. For now, I am still working in KiCAD v8.0.9

1 Like