Discussion:
[kicad-users] KiCad Library Workflow
Chris Fiege cfi@pengutronix.de [kicad-users]
2017-06-21 08:18:21 UTC
Permalink
Hi,
I am wondering how you guys are working with KiCad and it's part library.


I am using KiCad at work and our target is to engineer electronics as internal tools and for customers.
Our goal is to have the PCBAs manufactured externally rather than soldering them by our selfs.


The last 10 years or so I've been working with Altium Designer. And we usually had part-librarys that specified parts very detailed.
Every part was linked to a Manufacturer and a specific Part Number from that Manufacturer (including Package, Temperature Range, Specific Options, ...). The
only option that was left open was the packaging (Tape and Reel, Tray, ...).


The benefit of such a strongly defined library is that you can drop a part on your schematic and directly have the symbol, datahseet, footprint and so on ready.
(If you have implemented a review-process with another engineer it's getting even better.)




The KiCad standard library is on what seems to be the opposite side of this: It's made up of generic parts, without a fixed footprint, without a Manufacturer or
Manufacturer Part-Number. I definitely see the benefits of such library: for example a low complexity level or that it's quite easy to create a new part.
But with my Altium Designer mindset in place it's hard to image to have a reproducible way of engineering a PCBA with all that manual work (selecting a
footprint, selecting a manufacturer, selecting the actual part from that manufacturer) for every single part I drop on the schematic.
(Don't get me wrong. I really appreciate the work that is done by the KiCad Library Team. I'm just not sure if that library fits my needs.)




My current workflow is to create a library that is made up of two types of parts:


*Generic Parts*
For example a "100R, 0603, 100mW, 1%, thick film" that is not linked to a specific manufacturer.
For these parts the PCBA manufacturer can choose what ever components fit to that specification from what is in it's warehouse or what is cheap on the market.


*Specific Parts*
For example a TI SN74LVC2T45DCT dual supply bus transceiver. Manufacturer (TI) and the part number together define the functions of that part, temperature range
and package. Every specific part has a (locally stored) datasheet and the fiels "Manufactuter" and "MPN" (Manufacturer's part number). Eventually I add the
fields "Distributor" and "DPN" (Distributor's part number) for one or multiple distributors if i already know where it can be bought.


Doing so I run into problems like:
* Having more than one Part with the value field set to "100R" (like the generic parts with different package sizes) does not work on the schematic editor.
In KiCad 4.0.5 you can't define which 100R you get. I guess that depends on the loading-order of the libraries.
* You have to re-draw or copy and paste the same symbol into multiple parts that should look the same.
And thus you can't bulk-change symbols for all equal symbols if you find a bug in the symbol.
* KiCad does not support you with Manufacturer and MPN-definitions for a part. I am currently using the fields "Manufacturer" and "MPN" since those work
with tools like KiCost [0].




Does anyone else try to work with such specific libraries in KiCad?
What are your experiences?
Did you find solutions to the problems I am currently running into?


Thank you!


Regards,
Chris




[0]: https://github.com/xesscorp/KiCost
Levente leventelist@gmail.com [kicad-users]
2017-06-21 10:12:51 UTC
Permalink
I'm coming from gEDA, but using KiCad since 4.0.0. During my gEDA years I
developed a database containing all that information you requested. When I
switched from gEDA to KiCad, I ported my database system.

It is now an SQLite database, but it used to be PostgreSQL. If I recall it
correctly, both are implemented, and configurable.

The link between the schematic and the part in the database is a single ID
attribute you have to place on the schematic. I have python scripts that
digs the database and replaces attributes. Most common is the footprint, so
a specific part will have specific footprint on the layout. (BTW I don't
like KiCad's footprint assignment tool.)

In the database, you can define sources, where you can buy the specific
part, part numbers, etc. I have another script that creates BOM lists too.

I use this system for my hobby projects, but I designed to be useful for
small design companies too.


If you are interested in my scripts, drop me a private mail, and I give
further information.

Levente
Post by Chris Fiege ***@pengutronix.de [kicad-users]
Hi,
I am wondering how you guys are working with KiCad and it's part library.
I am using KiCad at work and our target is to engineer electronics as
internal tools and for customers.
Our goal is to have the PCBAs manufactured externally rather than
soldering them by our selfs.
The last 10 years or so I've been working with Altium Designer. And we
usually had part-librarys that specified parts very detailed.
Every part was linked to a Manufacturer and a specific Part Number from
that Manufacturer (including Package, Temperature Range, Specific Options,
...). The
only option that was left open was the packaging (Tape and Reel, Tray, ...).
The benefit of such a strongly defined library is that you can drop a part
on your schematic and directly have the symbol, datahseet, footprint and so
on ready.
(If you have implemented a review-process with another engineer it's getting even better.)
The KiCad standard library is on what seems to be the opposite side of
this: It's made up of generic parts, without a fixed footprint, without a
Manufacturer or
for example a low complexity level or that it's quite easy to create a new
part.
But with my Altium Designer mindset in place it's hard to image to have a
reproducible way of engineering a PCBA with all that manual work (selecting
a
footprint, selecting a manufacturer, selecting the actual part from that
manufacturer) for every single part I drop on the schematic.
(Don't get me wrong. I really appreciate the work that is done by the
KiCad Library Team. I'm just not sure if that library fits my needs.)
*Generic Parts*
For example a "100R, 0603, 100mW, 1%, thick film" that is not linked to a
specific manufacturer.
For these parts the PCBA manufacturer can choose what ever components fit
to that specification from what is in it's warehouse or what is cheap on
the market.
*Specific Parts*
For example a TI SN74LVC2T45DCT dual supply bus transceiver. Manufacturer
(TI) and the part number together define the functions of that part,
temperature range
and package. Every specific part has a (locally stored) datasheet and the
fiels "Manufactuter" and "MPN" (Manufacturer's part number). Eventually I
add the
fields "Distributor" and "DPN" (Distributor's part number) for one or
multiple distributors if i already know where it can be bought.
* Having more than one Part with the value field set to "100R" (like the
generic parts with different package sizes) does not work on the schematic
editor.
In KiCad 4.0.5 you can't define which 100R you get. I guess that depends
on the loading-order of the libraries.
* You have to re-draw or copy and paste the same symbol into multiple
parts that should look the same.
And thus you can't bulk-change symbols for all equal symbols if you find a
bug in the symbol.
* KiCad does not support you with Manufacturer and MPN-definitions for a
part. I am currently using the fields "Manufacturer" and "MPN" since those
work
with tools like KiCost [0].
Does anyone else try to work with such specific libraries in KiCad?
What are your experiences?
Did you find solutions to the problems I am currently running into?
Thank you!
Regards,
Chris
[0]: https://github.com/xesscorp/KiCost
Chris Fiege cfi@pengutronix.de [kicad-users]
2017-06-21 12:43:30 UTC
Permalink
Hi Levente,
Hi Andy,
thank you for your feedback.

With Altium Designer we also used a database (MS Access) to store the information about the parts we want to use. With AD we had direct access to this database
and could choose the parts we wanted to use. That database was also prepared to handle multiple tools that would use the same meta-information.
The difference between AD and KiCad is, that KiCad lacks an native interface to databases.
Post by Levente ***@gmail.com [kicad-users]
The link between the schematic and the part in the database is a single ID
attribute you have to place on the schematic. I have python scripts that
digs the database and replaces attributes. Most common is the footprint, so
a specific part will have specific footprint on the layout. (BTW I don't
like KiCad's footprint assignment tool.)
So you look up that token in your database and then insert it into the schematic symbol you want to alter?
At the moment I am thinking of auto-generating the KiCad Library-Files from the contents of a database.
Post by Levente ***@gmail.com [kicad-users]
In the database, you can define sources, where you can buy the specific
part, part numbers, etc. I have another script that creates BOM lists too.
Once you have all information stored in a database generating a BOM should be easy.
Post by Levente ***@gmail.com [kicad-users]
My view on such things is that Kicad is a PCB design system, it is NOT a
stock / part management system. Trying to make the kicads BOM system do
anything apart from the most simple operations always seems to me like
chewing your own arm off.. :-)
Yes, that's exactly what it feels like. It's good to know that I did not just overlooked the way inside KiCad.
Post by Levente ***@gmail.com [kicad-users]
To do this you would duplicate the eeschema symbol of the component, and
then set the footprint field to whatever module you want to use. Give it
a different name and so on. A lot of work, but much of this could be
scripted. The name would need to identify the variant such as
CP-100u-10V-radial or some such format.
That's exactly what the generic part of my library currently looks like. The value field contains some kind of key and is hidden.
The value field that I want to show on the schematic is an additional field.
Those parts/libraries are templated since nobody wants to create all values from 0R to 1M in E24-stepy by hand.
Post by Levente ***@gmail.com [kicad-users]
Define a in-house part number for each device
(..)
Post by Levente ***@gmail.com [kicad-users]
This is the way industry has traditionally worked. Your drawing would
have a reference number 1234-00-123-1234 (NATO stock number format)
(..)
Post by Levente ***@gmail.com [kicad-users]
Lots of different ways to work this sort of thing.
There are lot's of ways to create such a part number (or lets call it primary key).



It's good to know that others are working with external databases with KiCad too.
In my opinion using an external database to keep all information and just export the information needed inside one tool is a good way to handle complexity.

@all:
I am still open for new opinions and suggestions :)

Regards,
Chris
Levente leventelist@gmail.com [kicad-users]
2017-06-21 13:05:08 UTC
Permalink
This post might be inappropriate. Click to display it.
Andy Eskelson andyyahoo@g0poy.co.uk [kicad-users]
2017-06-21 17:00:06 UTC
Permalink
Post by Levente ***@gmail.com [kicad-users]
like KiCad's footprint assignment tool.)
If you mean CVPcb then lots of people don't like that. I get on with it
OK, and I find it useful for the first pass.

After that you can edit the footprint field in the symbol...
Post by Levente ***@gmail.com [kicad-users]
make them heavy on the fly. Well... sort of. For example, I don't like that
KiCad has N variant of the same mosfet symbol, like DSG, SDG, etc. My
That is really years old.

Kicad does not really care what the pins are called, the only thing
that matters is that they must match between the symbol and the
footprint.

The variants were just to cater for different pin configs of various
packages. Think of a 2n3055, comes in TO220, and TO3, so there is nothing
really wrong with having modules named 3055_TO220 and another called
3055_TO3 top cater for the different packages.

If you saw eeschema symbols named 2055_TO220 or 2055_TO3
Then I would think that someone created them and set each to use the
correct module by default. Which was linked to the auto assign function
of CVpcb


Or have I got hold of the wrong end of the stick?


Andy
aadee92@gmail.com [kicad-users]
2017-06-24 18:55:29 UTC
Permalink
I'm working on a project similar to what was mentioned above - its a library tool similar to CIP in OrCAD, except for KiCAD. More information on the KiCAD Forum Website: https://forum.kicad.info/t/are-there-any-symbol-image-scripts-or-online-viewers/ https://forum.kicad.info/t/are-there-any-symbol-image-scripts-or-online-viewers/ let me know if someone is interested in Alpha testing/developing it with me.


Thanks,


Austin
Chris Fiege cfi@pengutronix.de [kicad-users]
2017-06-26 08:13:51 UTC
Permalink
Hi Austin,
your approach looks really good. I am interested in having a closer look on the use-cases you are focusing on.
Since I am more a hardware-guy I am more a tester than a developer but I can give it a chance.

If you want you can message me in private and we can have a look on how I can help you.

Regards,
Chris

aadee92@gmail.com [kicad-users]
2017-06-24 18:51:26 UTC
Permalink
I'm working on a project very similar to the one described above for KiCad, based on python with Django and Sqlite. Basic idea is to implement something like CIP (for OrCAD) in KiCAD.
Andy Eskelson andyyahoo@g0poy.co.uk [kicad-users]
2017-06-21 11:23:35 UTC
Permalink
This post might be inappropriate. Click to display it.
Loading...