← Back to team overview

kicad-developers team mailing list archive

Re: Automatic assignment of footprint with a database

 

I have a private branch that stores symbols and footprints in a MySQL database, and I’ve been chewing on the idea of enhancing cvpcb to provide the “real-world parts” glue that KiCAD currently lacks.  My approach is in line with Jon’s, I think: to have the database also contain symbol-to-real-part-to-correct-footprint mappings (not embedded in KiCAD symbol data, but stored alongside in the DB), which cvpcb could them query and present as choices to the user (no need to add a part-number field to each symbol in the schematic; rather, the real-part selection process is integrated into cvpcb).  Then cvpcb can use this selection to pick the correct footprint, also in the database.

A tangent goal would be to enhance pcbnew to use the database information when swapping footprints.  For example, to choose among several pitch options for a through-hole resistor (to make room for routing on few layers, maybe).

Obviously this requires data to work, and in my case I have my homebrew RDBMS schema set up the way I came up with in my own personal vacuum, which I gradually build up with data each time I make a DigiKey order on some project or other.  An external database maintained by a community would certainly be an advantage over my setup.

At any rate, all that to say this is a direction that interests me greatly (HOW MANY TIMES have I had to rework a board because a TO-220 part’s pinout was wrong??), and I have ideas and time to contribute to this effort.

Cheers,
-Brian

PS: My current database schema has the following:
- a table containing KiCAD symbols
- a table containing KiCAD footprints
- a table containing uniquely-identified real-world parts (e.g. a 270-ohm 5% 2-watt through-hole resistor)
- a table that links each real-world part to a symbol
- a table that links each real-world part to any number of applicable footprints
- tables of manufacturer and vendor info 
- inventory statistics (which is why I started the DB in the first place!)



> On Aug 27, 2020, at 2:22 PM, Jon Evans <jon@xxxxxxxxxxxxx> wrote:
> 
> 
> Hey Martin,
> 
> This is a concept I've been working on in the background (managing libraries through a database, including footprint assignments but also fields/properties)
> 
> The way I was thinking about approaching it is not just a filter in CvPcb, but actually a new type of library (including a new part chooser).
> It would pull the underlying symbols and footprints from existing libraries, but would connect to a database (local or on a remote server) that has all of the information about which parts use what symbol and footprint, and what other properties to bring in (manufacturer part number, etc)
> 
> There is a draft spec:
> https://docs.google.com/document/d/1qXwFPbYOwFXRNvjRN5BttRX_4esEDdYDt1cOpOmNc8A/edit?usp=sharing
> 
> I have not put a lot of time into this yet because V6 feature freeze is right around the corner, and this would be for a later release.
> 
> Best,
> Jon
> 
>> On Thu, Aug 27, 2020 at 2:17 PM Martin Marmsoler <martin.marmsoler@xxxxxxxxx> wrote:
>> Hi,
>> 
>> I wrote already in the Forum, but did not get an answer. Hopefully I'm getting here more attention :)
>> 
>> I’m thinking about how the footprint assignment can be more “intelligent”/faster. I’m not talking about simple parts like resistors/ capacitors without extra requirements, but diodes, inductors, connectors, integrated circuits.
>> 
>> For example diode:
>> The most of the time the same symbol for a diode is used, but the footprint changes. But before selecting a footprint you search for a diode which fits your needs (at the distributor, manufacturer, …). After you selected the exact part, only a few footprints are still available (for diodes in the most time only one).
>> 
>> For inductors it is the same, but many times the footprints are generic, but the 3D model matches not always. For example they have a different heigth. (I think this is currently not doable, because there is no 3D model assigner)
>> 
>> So it would be nice if in cvpcb exist a filter which filters only these matching footprints.
>> 
>> Where to store the information which partnumber matches with which footprint?
>> Maybe this information can be stored in a database
>> found this: Part-DB Looks pretty good to do the job.
>> So CVPCB access this database and assigns automatically the footprint (and the 3d model which matches)
>> 
>> The database contains many parts which have footprints (or only the path (preffered)) as attribute
>> 
>> So at the end the workflow looks like:
>> 
>> Create schematic with generic parts
>> Add Manufacturer number to parts
>> Let CVPCB Assign automatically footprints
>> 
>> What has to be done:
>> # create database with KiCad footprints inside (script)
>> # Add parts to the database
>> # Add new filter button to CVPCB
>>     - implement db access
>>     - search in symbol if a manufacturer number field exist and use this value
>>      - access the database and search for the part
>>      - assign footprint to symbol (if in the database only the path is stored, what to do if the footprint does not exist)
>> # Add settings where the url to the database is stored.
>> What do you think about something like that?
>> 
>> 
>> This is the forum post:
>> https://forum.kicad.info/t/automatic-assignment-of-footprint-and-3d-model/24497
>> 
>> Is there a timeplan for v6/ feature freeze date?
>> 
>> Cheers,
>> 
>> Martin
>> 
>> 
>> _______________________________________________
>> Mailing list: https://launchpad.net/~kicad-developers
>> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~kicad-developers
>> More help   : https://help.launchpad.net/ListHelp
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp

Follow ups

References