Semantic problem with KiCad component treatment?

I’m not sure where I come down on this issue. I can see the pros of encouraging best practice by including a default (and mostly blank field) in the KiCad libraries. It sounds like this is a discussion worth bringing to the attention of the developers! I’m sure something adjacent to this is being considered related to the issue of the annoying value==symbol name in libraries and the new database system for 7.0.

On the other hand, I already have to add at least 6 fields to every library I make (or edit) so it is just part of my process to load up kifields (a wonderful 3rd party plugin) and edit my libraries to have: military spec procurement number, associated manufacturer part number, engineering model manufacturer part number, engineering model manufacturer, description for flight part, description for em part… the list goes on. All of which to say, for my serious use-case, it doesn’t matter much to me that “value” is unclear semantically because all of the truly critical info appears in fields I will always have to add anyways.

The value has to be some awkward mix between searchable in symbol list and still useful as a label on the schematic, but that isn’t the end of the world for me (and hopefully will be separated from symbol name eventually!)

This is where careful design and lots of discussion and thought needs to be applied. I will insist that semantics are important in order to make this far more powerful than anyone could imagine today.

Just in case those reading my thread don’t know what I mean by “semantics”:

If I send you an email with the string “Px234Xy-66-32-ABCD-y” and provide no other information, short of a lucky Google search, it is impossible to understand what this means. If, on the other hand, I say something like: “Here’s the internal part number for this component: Px234Xy-66-32-ABCD-y” you know what it is and you likely know where to go get all of the information relevant to this component. This could be a bolt, nut, washer, spring, electronic component, PCBA or something else.

What I did there is tag (as is known in Machine Learning) the data with something that describes or provides extractable meaning or context to the data. This something provides the data with sufficient meaning to make it useful and do interesting things with it. In this case the tag can be reduced to “internal part number”.

If, on the other hand, I send an email with ten thousand such cryptic snippets, one per line, with no discernable pattern and not tagging. Well, it is impossible to derive any knowledge from such a mess. And, if it is, it will take exponential time to get there.

The overloading of a field named “value” to contain all manner of things creates such a problem. Because of this it has lost semantic meaning. I am looking at parts like resistors, capacitors and inductors placed from the stock KiCad libraries and there is, quite literally, no place to attach a semantically meaningful part number (of any kind, internal or manufacturer) to the part without adding a custom field. You cannot hand someone your BOM and order the parts. They would not know anything about the design decisions you made that are important to the design.

The value field is fine, but it should not be used to contain, well, values or parameters (resistors) in some cases and part numbers (IC’s, transistors) in other cases. This makes things complicated. As I said before, I can understand the historical nature of this design. No problem. However, going forward, I don’t think this survives unless KiCad’s mission is to remain a hobby tool.

The simple example I gave in another comment is that, when you search a distributor for “LM324” you’ll be presented with somewhere in the order of 80 different variants. You cannot just order any LM324. One of the many considerations is that some of the part numbers have five times the slew rate of others.

In a real design you need real part numbers that link to orderable components. These can be internal or house part numbers or manufacturer part numbers. When using internal part numbers you have to eventually link to a real manufacturer part number. I would not impose either one on users, but contextually, semantically, a value is not a part number and the KiCad library model and the way components seem to be handled within the program do not seem to cover this well.

If I add a custom “part_number” field to every single component it is still treated as an add-on, rather than the most critical bit of information that it represents for every component.

I think that’s the key point. If I give you a part number (manufacturer) you can get absolutely every single bit of information about that component with a simple Google search. That is all you need for anything except for cases where there might be some redundancies (same part number made by multiple manufacturers). In that case you have to provide one additional data point. That’s about it though, I can’t think of a situation where a part number and manufacturer does not fully describe a component and grant access to all relevant data, from specifications to inventory levels and pricing.

In other words, semantically, the part number is and should be a first class citizen and one that drives every single component in a design. This is why I am arguing that, while the value field is important and useful, it has been misused in the libraries to the point that you cannot order most components in them. You have to either add at least two fields (part_number and manufacturer) or roll your own libraries from scratch to include at least this information.

I can’t use stock libraries in my work. So, yes, every single component that goes into a design has to be created and vetted from scratch. The purpose of this discussion is to highlight something that I think is a problem with the way components are represented in KiCad. A new user looking at the kind of information present in a BOM created from the existing libraries could not order the parts required to build the circuit. That, I think, is a problem.

I highly recommend those interested to browse through some of Tim Berners-Lee’s writings on the development of the Web and the Semantic Web in particular. A tremendous amount of thought has been applied to this domain. Much of it translates very well to EDA. We work with information that is threaded in to graphs that have meaning in the form of a working circuit. Maintaining semantics from the component level all the way up to the schematic and PCB will unlock things we cannot possibly imagine today.

It starts with semantics.

Here’s a quick link to start with:

https://www.w3.org/DesignIssues/

If you copied that last summary post into a feature request on Gitlab, I’d add an upvote! Just include a link to the feature request in this thread.

1 Like

KiCad is unlikely to provide a “required” schema for additional part parameters (MPN, etc) in the official libraries. There are simply too many differing opinions on the right way to do so. We will instead be providing easier tools for people to set up their own systems that work for them (e.g. database libraries, easier ways of editing symbol fields, etc)

1 Like

I think you’re writing as if adding a part_number is a controversial thing. It’s not. Overloading the value field is a hack; that’s also not in doubt; that’s historical baggage.

If you were able to create an extra field in the symbol library, with the understanding that this will have to be done in user maintained libraries, why would it be an “add-on”? It’s as good a field as any of the others. it can be used to pull in other information and generate BOMs, through post-processing (now), or through a database link (later). What is your definition of first class citizen? Be concrete, how exactly do you want KiCad to handle this field?

Not the intent. I don’t think any professional would suggest that having a part number is controversial. They could argue about such things as whether or not an internal or manufacturer part number is the way to go, however, I think in all cases the point is that a part has a 1-to-1 relationship to something you can actually order, stock, test, qualify, track, etc.

What I am suggesting here is that the standard KiCad library structure lacks this important field. Perhaps the most important of all.

Adding it manually or programmatically isn’t a problem at all. That’s not the point. The point is that it is missing by default when it should be present by default. I would add “part_number” and “manufacturer”. That would allow full specification of any component.

Those two fields can be linked to any external database or the web to find every single bit of data on any component. If “part_number” is taken to mean “internal_part_number” then “manufacturer” can be set to something like “self” or left empty. An alternative that would be better semantically might be “part_number_source” rather than “manufacturer”. In this case it could be set to something like “internal” or “Texas Instruments”. Once again, together providing a unique key used to find all necessary information on the component in question.

The current setup requires every KiCad user to roll their own solution when they realize none of the parts they put down on the schematic have an official spot to add a part number you can actually order (the value field is not that spot).

That’s the intent. I do want to hear from others before doing that. This conversation has been very useful. It is important for ideas and proposals to be challenged, and that is exactly what is happening here. This is what I wanted before wasting anyone’s time adding this as a feature request on Gitlab.

I do realize that there are varied sets of users here, from professionals to hobbyists. From trained EE’s to self-taught designers. This is great. All input is important. And, so long as everyone participates in the spirit of learning something and pushing forward ideas that will improve KiCad all discussion, disagreements and all, is good and necessary.

I’ll give it a few more days. This is also helping and forcing me to think this through some more and verbalize the request at the appropriate descriptive level. The summary post you suggested I publish to Gitlab is the result of these interactions trying to explain why this might be important.

I suppose I should point out that I maintain my own libraries. I do not rely on the libraries created by the good folks who maintain the Kicad standard libraries. At my day job, we also have a company library and do not rely on what Brand A provides.*

And here’s why. Our libraries all have a Part Number field that we add to the symbols when we create them. The part number is a “house part number,” which is basically a GUID that’s a link to a database. At work it’s the MRP system used by purchasing. At home it’s my little master parts list spreadsheet. In either case the schematic tool generates a BOM and a script takes it and runs it against the parts list and outputs a BOM with real manufacturer part numbers and an order quantity based on the number of kits to prepare and what stock is already on hand.

Note that I greatly prefer to not have details in the symbol like working voltage, tolerance and the like. That is all defined by the house part number. Maybe it’s nice to see it on a schematic, but in general that’s all clutter since you have the part numbers and the BOM.

Should the Kicad library maintainers add this field part number field to all symbols? Probably. It’s no pain to add it to your symbols as you add them to your own library, especially given that you have to populate the field.

As for the argument that “Value” is redundant for ICs and the like. Yeah, it is. We know “value” has a specific meaning in the context of passive components, like 10kΩ, 10μF, 10μH, which is why the field exists. So you place a RES_0805_1% from your library and edit the Value field and change RES_0805_1% to 10k0 and the BOM processing takes care of the rest. For parts like op-amps where you place AD8617ARZ from your library, there’s no need to change the value field so just leave it as-is.

I suppose you could do something like place a symbol OP_AMP_DUAL_SOIC8 from the library and then later change the Value field to AD8617ARZ, but honestly, just place AD8617ARZ (with house part number and footprint fields already included). It’s not like reasonable users have two hundred op-amps in their libraries, right?

One more thing. If you want Kicad’s schematic to show the name of the thing you placed on the sheet, you have to make sure the Value field is visible. So in this sense, Value is not redundant.


  • We don’t ignore the Kicad or the Brand A libraries. When I want to add a new part to my library, I look in the standard libraries to see if someone has already created it. If it’s already there, it’s a simple matter to clone it into my library and add the PN field.

I see the absence of a default house part number as an advantage.
It’s a clear indication that a schematic is not yet complete (for the database oriented people) and adding them in some automated way is a trivial task.

Trying the standardize the name of a “house part number” field is also never going to work in the real world. There are already lots of companies with their own names for this (or similar) field, and adding a “default name” for KiCad only adds clutter and confusion.

On top of that, there are vastly different workflows. If you already have a selection of prefered opamps, then by all means, choose one of them, but lots of people start with generic symbols, and then later refine it with more details.

This does open a window for errors to creep in. Not all opamps have the same pinouts, and more so for BJT’s etc, but being forced to choose some part instead of just typing some text where it suffices (for that moment) is a disruption of the creative process of designing a schematic. I once tried to use eagle, and I had a 0.2Ohm resistor in my hand and that *&^%$#@! program would not let me put it in a schematic, because it was not in the dropdown list.

I do see that such drop down lists can be an advantage. You first use a generic opamp during the initial draft, and when you fill in more details you select an opamp out of your companies database of preferred parts. But such a workflow should not be enforced for all users.

Then all users would either be forced to use that name for the field, or add a new field. I wouldn’t like “part_number”.

And what if a user wants to add several manufacturers/part numbers directly to the symbol? Again, they would need new fields anyway, and it’s not fair to other manufacturers to handle the first one as a special case.

At the moment KiCad has this in the Schematic Setup:

image

Something like this should be the solution, but it should be defined for KiCad setup, not just per project, and it may need more options for fields/values. Every symbol added to libraries should then inherit these fields (this Template seen above is a pseudo solution: it only shows the field in the project schematic symbols, not library symbols). It should also work when copying symbols from other libraries etc., not just for newly created symbols.

1 Like

At every company I’ve worked for, we’ve had a standard company parts library. Nothing gets put into a library for engineering use until it is vetted. This means: the symbol is correct. The footprint is correct. The manufacturer part number is correct, so purchasing knows what they are ordering. There’s a release process that we go through before a part is put into the system and before the part is put into the company library. The person handling the MRP system assigns the company part number.

None of that is arduous. Every engineer knows that orderable part numbers are an alphabet soup of options, so making sure that someone checks that part XYZPDQ really is in a particular package and has a specific value really prevents expensive screwups down the line.

When a product’s assembly drawings are being released, one of the checks is, “are all components used in the assembly released?” Since by definition a part in the library is released, then the check is easier.

Maybe hobbyists and one-person shops do that, but in a real production environment we know the requirements when we are designing, so choosing an op-amp is not just some willy-nilly process. “Oh, let me put in a TL072 here. Oh, darn, that’s too noisy, let me change it to OPA1612! oh, wait, what package do we need?” simply doesn’t happen.

Now, I’ll say that I am not at all concerned that Kicad allows the users to do a frankly ridiculous workflow like using CvPCB to match footprints to symbols. If you want to make expensive mistakes, be my guest. That Kicad supports what we call “atomic parts” where everything in the library is specified makes it usable in a professional environment.

This is the problem that the “house part number” was created to solve. Let a downstream data base that knows how to determine orderable part number options handle this.

If I see a DigiKey or a JLCPCB part number in a schematic, it’s a sure sign that it’s amateur hour.

1 Like

I agree with all your points. Your workflow isn’t very different from that of many professional EDA users. There are variants, but, as I have been saying, the part number (internal or manufacturer) is the first class citizen in all cases. As you mentioned, the end product --whether direct from schematics or after one turn of a crank through a script-- is a BOM with real world part numbers you can actually order.

I also agree that having piles of fields these days is largely unnecessary. Back 30 years ago this was deemed a good idea because local or network storage wasn’t quite unlimited and the web did not exist (it went public around 1993).

Today, so long as you have a GUID of some kind, any kind, it takes microseconds to learn anything you need to learn about that component. One could very well argue this is all you need.

If I can take a moment to drift into future-talk, I could imagine a system where the only thing that makes it into the schematic is this GUID and, perhaps a custom note or some other data that might be relevant. From there, the schematic editor would, in real time, access the component database to pull in other elements and display those you told it to surface to the visible layer. Just hovering over a component could show a bunch of information from the database on a heads-up-display of sorts or a status bar. Today we can definitely consider real time interaction with a local or network database in this manner.

Going back to reality, I think that anyone who uses KiCad for the first time should not be faced with ambiguities as to the meaning and where to place important information. Without getting into complex proprietary library or database structures, the bare minimum you need is (PK = Primary Key):

  • part_number (PK)
  • part_number_source (PK)
  • value (only for relevant components, blank otherwise)
  • footprint (a link)
  • 3d_model (a link)
  • url (typically a datasheet (URL or local storage) or the manufacturer product page URL)

Strictly speaking only the first two are required. However, I am thinking about the “open box” experience for what I am going to call the unsophisticated user. This isn’t meant as a put-down, I would define it as someone who isn’t a professional or one that has never worked in a structured environment where these matters are carefully considered and managed. I’m happy to adopt a different term for this kind of user.

Anyhow, the idea would be that if all libraries shipped with KiCad contained the above parameters anyone using the software would be able to quickly go from schematic capture to PCB layout, 3D visualization, BOM generation and manufacturing with minimal friction.

Every basic element you need is there. The “part_number” and “value” fields could be treated intelligently or manually in the software. By this I mean that, if, for example, I leave “value” empty, I must mean that I want to show only the part number (as is generally the case for an IC).

There is no case where the part number is left empty. If we are talking about generic components, the part number could be something like “generic_quad_opamp” or whatever. Part numbers have to be elevated to first class status.

Right now, today, if I were to look at KiCad as an unsophisticated user, there’s a moment of confusion when you can’t get from a schematic using stock library parts to a BOM you can order and a PCB you can layout. The BOM part fails because the semantic (and GUID) concept of a part number simply does not exist in the specification.

1 Like

If I can take a moment to drift into future-talk I could imagine a system where the only thing that makes it into the schematic is this GUID

I hope this dream doesn’t come true. This would be good for your described workflow, but for many others this would be a backstep/nightmare.

To be serious: up until now I have seen no convincing reason (in this discussion) for adding additionally mandatory fields. Let every user/company add the MF/MPN (these are my field numbers) as they wish - this is the current situation, it’s flexible and everyone can extend it for their own needs. But I would never force every other user to use my MF/MPN-field names. Maybe they want it written-out, maybe translated to their language.
For simple tasks and education it’s even completely unnecessary. With adding such features as mandatory the software may “step up” and compete with higher-end software (someone mentioned altium + mentor). But not every user wants I full featured cad-system (another discussion-theme).

1 Like

The higher-end systems tend to be very flexible rather than having mandatory stuff, because every company wants something different and if your software can’t adapt to the company’s desires, you lose a sale.

Yup, that’s been my experience, whether it was working for a large aerospace company with 3,000 engineers or my own business. In many ways this is the most important task in any design; uniquely identifying and qualifying your parts. Once that’s out of the way you can focus on the design.

One of the neat things about the movement KiCad is becoming is that a lot of people are learning through it. Encouraging good, solid and safe workflows, is, in my opinion, very important. A lot of EE students are now going to come out of school having worked with KiCad exclusively. KiCad could encourage adoptions of good habits and workflows before they enter the workforce.

Looking even beyond that, I can see it becoming the dominant world-wide EDA tool over time. This, again, makes almost enforcing some base-level uniform workflow important. That does not necessarily mean making it so rigid that professionals could not integrate it into more advanced workflows. I think it does mean that the out-of-the-box experience has to be based on a solid approach that’s easy to learn and use by everyone, professional or not. Right now, I think it is kind of messy.

Here’s what I think our path will be:

We just started migrating to KiCad after, I don’t remember, 20 years of Altium Designer and another two decades of other stuff (including doing PCB’s with AutoCAD in the early 80’s). What we are talking about doing is sticking with a version of our database-driven parts library and writing a Python application that will extract these into KiCad symbol and footprint libraries based on the current format.

What this means is that we never want to manually edit the KiCad libraries. They should all be generated automagically from our database. We will likely use SQLite or PostgreSQL for this purpose and create a browser-based management front end with Django.

At a more advanced level we might be able to use the Django application to search for components and drive KiCad to place them from the auto-generated native libraries.

This approach would allow us to make part numbers the first class GUID they need to be and let KiCad be KiCad.

I did this kind of thing way back before Altium Designer, when we were using P-CAD. This, along with custom automated component generation tools had a huge positive effect on our productivity. I believe I can repurpose a bunch of that old code to make it play nice with KiCad today, which would be fantastic.

1 Like

This is about semantic value rather than picking a specific name for the field. Everyone understands what I mean when I say “part_number”. This could be an internally made-up designator, a manufacturer part number or whatever. The point is, nobody would mistake “part_number” to mean “value”.

As for your very valid point that there might be preferences in naming fields, this isn’t intractable. I speak several languages. I can’t think of any one of them where the translation for “value” and “part_number” means something different. KiCad could easily provide an alias definition such that, if you’d rather see “my_special_code” or “identificacion_de_componente” rather than “part_number” that’s what you’ll see.

What matters here --and the entire point of my thread-- is to understand that semantics matter. What you call the tag is unimportant so long as the meaning it conveys is uniform within the category it covers.

Of course, there is such a thing as adding too much convolution and complexity. In my opinion this is where Altium Designer has gone. From some perspectives it is a real mess, to the point that every time they release hot fixes they break five new things. This is what finally got me to decide we were going to stop sending Altium money and move to KiCad (6.0 made this decision easier).

So, yes, careful about not introducing unnecessary complexity. That said, over-simplifying is a terrible idea just the same. Semantic overloading is never good.

I’m convinced you’re a serious KiCad user and I fully support your professional workflow, but assuming that any other workflow would be half arsed amateurish is short sighted.

There are plenty of companies who do not need or want an integrated database approach. There are people to select and test the parts before they are vetted. There are students who have to learn part selection. Projects get send to other companies for review and modifications. Companies go broke and projects get inherited and there are lots of other reasons why database connections can get lost or broken.

And all those “hobbyists” are a significant contributor to KiCad in lots of different ways. From small direct donations, ordering though companies such as Aisler, or even just by contributing to the forum or just using KiCad and spreading the word.

What you call a ridiculous workflow that invites expensive mistakes, I call flexibility to cater to different needs of different user cases.

I support the database approach, as apparently it’s important to the “higher end” of the market, but KiCad needs the flexibility to be approachable with a very low threshold of entry.

To take this to an exaggerated absurd level: If you had to start by creating a database of parts before you could even use KiCad, not many people would be using it.

1 Like

Yeah sure, I understand.
But somebody has to draw the schematic symbols and maintain the database you are using.
So how do the parts get into your database?
Do you have people for that job or some other method?

I don’t think you are addressing me, but I fit the first portion of that description, so I’ll give you my opinion.

In another post I described how we think we are going to handle the current situation. We are going to write an application that will translate our database-driven parts into custom KiCad libraries and go from there. We will strive for never manually editing KiCad libraries at all. They will simply be a communications bridge between a database system and the EDA tool.

On the point about amateur workflows being shortsighted. Well, it’s true, pretty much by definition. I am an amateur when it comes to lots of things. I don’t know, dancing. If I was tasked with putting together a dance routine any professional would like --and rightfully-- think my workflow was shortsighted and maybe even silly. That’s with comes with being an amateur or a newbie. And that’s OK. Nothing wrong with that.

That does not mean that professionals should not make an attempt to guide newbies or engineering students towards good solid practices. It’s called learning. Everyone has to do it at some point.

I spent many years as a mentor for a local high school robotics team. Some of the kids came to the team having never drilled a hole in anything in their lives. You can either let them loose with the drill press to fend for themselves or provide some structure and guidance. The latter is the only way to help them advance to bigger and better things with minimal pain.

One of my favorite quotes by Mark Twain:

A man holding a cat by the tail learns something he can learn in no other way

Boy, have I lived that one!

What I think you are seeing here is a bunch of professional users (who do not necessarily have to agree on all points) noting that there are important issues that might benefit everyone if addressed in a sensible manner. Perfect? Never. That’s impossible. Better? Yes, that’s almost always possible.

My preference would be to provide a far more rigid scheme that would safely guide everyone through a more uniform workflow. The semantic issue with regards to the lack of part number information in the default data structures is, in my opinion, an invitation to create an absolute mess.

Of course, one should be able to turn off the out-of-the-box “Safe Mode” setting to roll your own. Lots of professionals will do just that. Lots of amateurs will do the same. There could be an “Expert Mode” that introduces interfaces to DB-based component management. And there could be an “Experimental” setting that let’s you explore within the bounds of what might be possible and wrap yourself around a post if things go wrong.

All of that would work fine.

My test would go something like this: Can I give KiCad to an engineering student who has never used it, tell them to create a minimal Arduino or RP2040 design from documentation (in other words, I actually give them a PDF of the schematic, nothing to invent) and have them walk away with a board they an manufacture and a BOM they can order immediately.

I don’t think that’s possible today. The library data structure, out of the box, only has “value” as a field that will get overloaded and muddled with stuff with different meanings. The bare minimum requirement is a part number you can actually order, the manufacturer and value when relevant. If you have these you can find everything else on the web. KiCad does not have this in the stock component definition. Just “value”.

These days this isn’t really high end at all. I mean, think about it. When you are reading and interacting with this forum you are working with a database. The user interface is what makes this simple or complex. Few of us could work with this forum if we had to type SQL statements into a console. When it comes to EDA component management “database” does not mean “complex”. In fact, it could be a lot easier.

I’ll given you and example of this that goes back to P-CAD days (before Altium Designer). We created a tool back then (early 2000’s if I remember correctly) that read an Excel file containing a list of all available resistors from a manufacturer, along with parameters, links to datasheets, vendors, etc. With one click and in a couple of seconds, this tool processed that data and created P-CAD/Altium component database entries for thousands of components, ready to use with qualified footprints, etc. After that nobody had to touch the database for anything. If you needed to add new parts all you had to do is append them to the Excel spreadsheet and re-run the tool for an update. Easy.

Imagine if amateur users could create parts in a database just by filling out a spreadsheet and then just use them after clicking a “Process” button. How is that complex?

1 Like