Libraries and Components- The Disconnect

If I was a German speaker, I would coin a word that means “culture shock when encountering KiCad for the first time”. Maybe there is already :slight_smile:

I am a software developer. In my spare time I develop little bits of software for home use. I was recently revisiting software I first wrote exactly 30 years ago. Looking at it, an immediate thought was why the heck did I write it like that?. There are several reasons, my own knowledge and skill has developed a lot, PC hardware has changed enormously (no longer do I need to pack all data into a 64KiB segment), programming languages and development environments have improved enormously.

Anyway, it was quite interesting to rewrite code that was originally written for DOS and character mode GUIs, but because it is for my own use, I don’t need any backward compatibility, I can completely change the interfaces and file format to suit a 2017 PC. Also, I only have a few 1000 lines of code, not millions.

KiCad started out with a DOS program, and has grown since. Ideally, we would start with a blank sheet of paper and redesign KiCad, According to https://www.openhub.net/p/kicad/estimated_cost, KiCad has accumulated 860,000 lines of code, costing $12 million or 233 person years. KiCad doesn’t have anything like such a budget to spend on creating new code.

TLDR; because legacy. We don’t have a magic wand to create new code.

There are some things you can do that will make a difference:

  1. if you can code, contribute patches to Kicad
  2. or create external tools which work with existing KiCad files
  3. otherwise, donate to developers who can work on your ideas

Everything else is basically talk (no offense intended, I understand it comes from a desire for improvement which we all share). KiCad is not short of ideas for improvements [KiCad wishlist] (https://bugs.launchpad.net/kicad/+bugs?field.searchtext=&orderby=-importance&search=Search&field.status%3Alist=NEW&field.status%3Alist=OPINION&field.status%3Alist=CONFIRMED&field.status%3Alist=TRIAGED&field.status%3Alist=INCOMPLETE_WITH_RESPONSE&field.status%3Alist=INCOMPLETE_WITHOUT_RESPONSE&field.importance%3Alist=WISHLIST&assignee_option=any&field.assignee=&field.bug_reporter=&field.bug_commenter=&field.subscriber=&field.structural_subscriber=&field.tag=&field.tags_combinator=ANY&field.has_cve.used=&field.omit_dupes.used=&field.omit_dupes=on&field.affects_me.used=&field.has_patch.used=&field.has_branches.used=&field.has_branches=on&field.has_no_branches.used=&field.has_no_branches=on&field.has_blueprints.used=&field.has_blueprints=on&field.has_no_blueprints.used=&field.has_no_blueprints=on)

I created an unofficial repo for atomic parts. https://github.com/bobc/KiCadAtomicParts Submissions welcome :wink:

5 Likes

Most libs in the official symbol libs hold parts that i would define as atomic. (Only the Device, Switch and Connector libs are fully generic. All others should hold atomic parts.)

Every part there is identified with the manufacturer part number and the footprint field is set. (Or at least this is the goal. A lot of symbols do not yet have the footprint field set. But we are getting there.) This approach allows for footprint reuse. Take for example the soic-8 footprint. That particular footprint is used by a lot of different devices.

The footprints are generic where they can be generic. (This does reduce maintenance effort.) We allow for manufacturer specific or even part specific footprints. (Example for the former are the footprints starting with Bosch_ in the LGA lib, for the later have a look at the relay lib.)

What we can not provide is the inclusion of your personal house part number (self explanatory.)
Or the inclusion of ordering information. (Who would ensure that this is valid at all times for all users. Too much maintenance.)

1 Like

You contradict yourself in the same paragraph… Very few of the parts in the official library are atomic, because the vast majority use generic (shared) footprints. An atomic part has its own, dedicated footprint which is not shared. It is not a stated goal anywhere in the KLC to create atomic parts, it is more incidental for certain components with a proprietary footprint.

I understand your desire to promote KiCad, but saying things that are really quite misleading is not helping anyone.

What would be the benefit of this? As far as i can tell a SOIC-8 is a SOIC-8 no matter what part it is used for.

I see one major downside to having one footprint per component instead of one footprint per package. (maintainability)
Lets imagine one sets up a lib that way.
You discover later on that your SOIC footprints (with exposed pad) should get a slight modification to the paste layer because your assembly house found that they could increase yield that way. Now you need to go through your lib and change all SOIC footprints. There is a high danger of you missing one of them. (If they are atomic is it even easily possible to find all SOIC footprints?)

Of course if you have a MEMS sensor that needs special treatment then you will make a specialized (or atomic) footprint for that sensor. But this does not really make sense (to me anyways) if you do it for the logic chips. (You would need as many soic-14 footprints as there are logic symbols in the logic lib. All of them holding the same data.)


What term would you use for symbols that are fully defined and represent one component, but point to generic footprints?

1 Like

Semi-atomic? You select a component (symbol) and get also a footprint automatically (this is what people often want and are happy with), but the footprint is shared. Or unidirectionally atomic? One automatic footprint for one symbol, but many symbols for one footprint.

Looking at the KiCad FAQ and KLC, I see that some confusion has crept in. Both documents have a misunderstanding about atomic parts They both refer to “atomic parts” but get the concept wrong. Someone (maybe Wayne), coined the term “fully defined part” , and then he or someone else decided that is the same thing as “atomic part”, but that is wrong. At best it is compromise between generic and atomic parts.

It is true that an atomic part is “fully defined” but it is important that an atomic part is also self-contained, unlike “fully defined part”. An atomic part has a 1:1 relation between symbol and footprint, fully defined parts are only many:1

Why is that important? Because of version control. In production it might be necessary to change the footprint properties for a specific component, and you don’t want to propagate those change to any other.

Therefore we have 3 types of part : generic, fully defined (but probably a shared footprint), and atomic (self contained). The KLC (and official libs) might have a goal of full defined parts, but that is not the same as atomic parts.

4 Likes

[quote=“rodmcm, post:1, topic:8879”]
Please developers, in version 5, address the difficulties of the component library disconnect…
[/quote]Well, 5 is in feature freeze so it’s pretty much a done deal. As far as the 70% rule? Playing around with applications for 40 years may mean nothing if you have little to no experience with ECAD and you don’t tell us that. I tried gEDA and it was very apparent that the people developing it worked with it. I loved many elements of the work flow. As far as it went. With Kicad you at least have developers that use the software and make the decisions about its direction and not some marketing department.

To your point. The libraries have been a bone of contention for some time and that is being worked on. Many simply don’t care because they plan on vetting every single part they use because it is their axx on the line if something fails. This is independent of Kicad. As such, the existing structure becomes second nature to them. Change it too much and the existing user base might not be very happy. :wink:

1 Like

You want the schematic designer to choose generic functions such as NAND gate or OPAMP. This is the design that they simulate and verify.

The PCB layout engineer will select the actual parts and package the symbols together and assign slots. PCB will also select technology such as surface mount top or bottom, through-hole 1 sided,2 sided etc. Each one of those has a different footprint and pad-stack.

The symbol has no way to know what footprint will actually be used on the board and each board will be different.

John Eaton

3 Likes

I may disagree about who performs the specific tasks, but my personal observation and experience supports the basic point: “Design” is almost always a series of activities where the later tasks add increasing amounts of detail to what was done in earlier tasks.

I feel inefficient and frustrated when I am forced to specify all the final details too early in the process. When I start to create a schematic I may have only a fuzzy idea of what value is required for some parts. Requiring me to concentrate on details down to construction and packaging, at that stage, actually hinders my ability to concentrate on fundamental questions such as values, power and voltage ratings, etc.

Dale

2 Likes

Yes, One thing that managers need to under stand is that if you ask an engineer to go back and change a decision that they made in the past then they must now go back and revisit every decision that they made since then. Thats why changes take a longtime to get right.

John Eaton

1 Like

Thanks for the comments… However I was not really talking about atomic entities but about a standard coherent methodology in the creation of a new, modifying an old, or copying an entity, be it a schematic symbol or a a footprint.

The present methodology is non conventional, not intuitive to me, and differs between a schematic entity and a footprint hence the standard flow chart I suggested…

As to having separate footprints to schematics I like it! I can craft my schematic representation to the job at hand, especially with processors where a design could need analogs to the left and outputs to the right.
As far as cvPCB is concerned I only use this to check that all items have an assigned footprint. A simple list would suffice for me

1 Like

Thanks for that
Is there a release date for V5?

Haven’t seen one pop up on the list.

The goal is to have it before FOSDEM (february). At least according to wayne. But he admits that this might be a bit wishful thinking on his part.

https://www.mail-archive.com/kicad-developers@lists.launchpad.net/msg26779.html

1 Like

Lets back it up a little bit more. Why have how many resistors in your symbol library when only one symbol is needed for drawing the schematic.

Could the CvPcb workflow be integrated to look only at only certain libraries/folders, that contain only ERP approved part numbers?

Yes. Footprint filter.


But it think the reason why people make atomic resistor parts is because they have ordering information stored directly in the symbol (for bom)

I would however suggest to have house part numbers, that use a combination of the hpn field and the value to generate (via a script) the detailed hpn and from that the ordering information. (How should the designer know during the design process which resistor is best suited for the people in purchasing. As long as the electrical and mechanical requirements are met.)

The hpn can for example be: R_[size][value][tolerance] Then you can have the hpn field for resistors pre filled with R_0603_[%V1]_[%V2] and the script knows to split the value field in resistor value and tolerance.

The problem here might arise if the designer enters value, tolerance pairs that are not in the approved list. (Can not happen if the designer can only choose from a restricted set of fully specified parts.)

2 Likes

Well I just have to say I couldn’t agree with anything in the first post. Developers Kudo’s to you. I downloaded Kicad and produced my first PCB in 4 hours. Damn thing worked too. OK it wasn’t that complicated, it only had 100 components. I only had to make one component in the PCB foot print, which was actually in the library already, I just didn’t search well enough.

So I read all this stuff about the libraries, and discord and I say “The libraries are damn impressive”. Its is however great to see the aspirations to get things better.

I’ve been building programs for 40 years now, and where does Kicad rate… Kicad is awesome. OK some parts I find a little clunky, but then Altium was also clunky in aspects, and so is Eagle. Maybe those 2 later ones are better now, but I don’t care… Kicad is awesome.

Having produced my first Python 2.7 GUI app I’ll be joining the developers soon, I did look at some of the code…and my god where do you start.

My wish list would be to add simulation to the schematic, at least just the analog stuff, but for now truck on developers Kudo’s to you.

4 Likes

Agree that is a very workable solution. I do something similar by using a BOM script to bring in all in the footprints and values - I then extract the parameters from my component directly - so I can then do a query for parts that meet my search criteria from my stock database. This is ideal for ‘jellybean’ components. I can just place a R_0603 and set its value to say 4K7 1% and I can use the script to do a stock search with those parameters .As a one man band, I like the way that I can also tie this in with my stock management. In my case, I use PartKeepr for stock control - this runs on a mySQL database and has my ‘approved’ parts and stock levels and can pull in part parameters and order numbers/pricing directly from Octopart.

The advantage with this sort of approach is that you don’t need to hard code an PN into a particular component and are therefore not tied to one specific product. The actual component choice can be done by matching the component spec to the parameters in the database - so you might have a choice of 4K7 resistors from Panasonic or Yageo or whoever.

The BOM report also identifies non-stock items which can easily be added and so provides basic MRP functionality too. This way you don’t need a specific Resistor or Cap library - you can simply place the component and defer the choice of the exact item from stock until later.

2 Likes

I have a view that is different to some. I’d like to be able to use a database for parts. I appreciate that this is somewhat more advanced than most people require, but having used OrCAD and Altium with such features I’d like it. Plus I’d be able to use existing stuff I have here with minimal extra effort.

To me, when I place a resistor, I’d like to be able to do it all in one operation, so I’d go to my 0603 resistor database and pull out a 10k resistor, which would be pulled in with all relevant fields already assigned. I did have a go at writing a script to generate a Kicad library from the database and this worked fairly well except for the fact that Kicad uses the Value field as a primary index key, so I can’t have a pre-defined 10k 0603 1% resistor and a 10k 0402 1% resistor without messing with the Value field to make each one unique. At the moment I have such things as 100R_0603_1, which distinguishes it from 100R_0603_5 and 100R_0402_1, but that makes other parts of the system look less good.

It would be nice to have a plug-in mechanism for placing schematic components so that I could write a fancy bit of Python to return a text block on its standard output with the DEF -> ENDDEF as the equivalent of a library part. That way I could abstract the symbol graphic and the part data fields as I see fit so I could keep a separate list of symbols and reference those from the database to avoid needing several thousand identical resistor graphics.

I have been creating parts with an extra unique field that I plan to use for BOM generation with a Python script to look up in the database to retrieve manufacturer information and order codes - this means I don’t have to care too much about my resistors, assigning my part code to a manufacturer/vendor comes later than the initial schematic capture and if I have to change, I don’t need to update any of the the schematics.

1 Like

IMO this is the correct approach. Having a symbol library and footprint library and a database that connects these to “real” parts. There is plenty of free database software available, I use Oracle Express. The database can hold more than just “parts”, allowing simple SQL queries to be used to generate BOMs etc. And it doesn’t need to be that tightly integrated into Kicad, most of the functionality already exists.