Author Topic: Hacking the KiCAD Libaray system to be actually useful  (Read 26621 times)

0 Members and 2 Guests are viewing this topic.

Offline janoc

  • Super Contributor
  • ***
  • Posts: 3781
  • Country: de
Re: Hacking the KiCAD Libaray system to be actually useful
« Reply #25 on: May 17, 2017, 08:31:40 pm »
A library *is* a database and should be treated a such.    It makes non-trivial designs manageable.         

Part library certainly isn't a database, especially not in Kicad. It is just that - library of symbols and library of footprints. The database part that permits you to join and store information about part numbers, datasheets, substitutes and similar is completely absent from Kicad so far. Trying to repurpose the existing library system for this is an attempt to drive a square peg into a round hole, I am afraid. It isn't designed for this and will be very fragile.

Industry has solved this problem by using a complete manufacturer part number as a root key for a part.   This ensures a 1:1 relationship between the part and footprint.    Cases where you can substitute multiple manufacturers is handled by abstracting the part with an internal part number.     In this case you become the manufacturer as  there has been a value added step inserted into the supply chain.     This approach is the only way that has been proven to solve long term PLM/PDM issues.

This approach of course requires some engineering discipline.

Yes, but that also assumes that you have a proper database-backed inventory system, where each entry has also associated part symbol, footprint, datasheets and what not. This doesn't exist in Kicad so far. I am not really aware of any low-end PCB tool that actually has something like that.

OTOH, it shouldn't be too difficult to build something similar, for example by tying Kicad with something like PartKeepr (https://partkeepr.org/). It would certainly beat having to maintain crazy amounts of duplicated data in the libraries or trying to stuff the extra information into schematic symbol fields.
« Last Edit: May 17, 2017, 08:44:46 pm by janoc »
 

Offline homebrewTopic starter

  • Frequent Contributor
  • **
  • Posts: 293
  • Country: ch
Re: Hacking the KiCAD Libaray system to be actually useful
« Reply #26 on: May 18, 2017, 06:48:26 pm »

Part library certainly isn't a database, especially not in Kicad. It is just that - library of symbols and library of footprints. The database part that permits you to join and store information about part numbers, datasheets, substitutes and similar is completely absent from Kicad so far. Trying to repurpose the existing library system for this is an attempt to drive a square peg into a round hole, I am afraid. It isn't designed for this and will be very fragile.

The KiCad library system is not a database? Sure it is! It's a file based one. Of course not a relational DB (hence the need for redundancy) but for no reason I would see the fragility of neither the DB system, nor the approach.


Yes, but that also assumes that you have a proper database-backed inventory system, where each entry has also associated part symbol, footprint, datasheets and what not. This doesn't exist in Kicad so far. I am not really aware of any low-end PCB tool that actually has something like that.

OTOH, it shouldn't be too difficult to build something similar, for example by tying Kicad with something like PartKeepr (https://partkeepr.org/). It would certainly beat having to maintain crazy amounts of duplicated data in the libraries or trying to stuff the extra information into schematic symbol fields.

Actually I don't see the "crazy amount" of duplication. Typically just the passives and simple semiconductors (e.g. diodes) are the ones where there is a massive choice of parts with the exact same symbol. However, these symbols also have just a trivial graphic representation, containing of only a view primitives. But yes, such information would be redundantly stored over and over again. Looking at my example from the beginning, the redundant part of the symbol is far less than the actual information provided...

Instead, the REAL argument against my proposal that came out of the discussion would be the very very inconvenient process of changing parts during the design. Changing the value of a capacitor would require the discipline to delete the part from the schematic and add a completely new one. If not done very carefully, this could easily have implications on the netlist and thus corrupt the layout (if this has been created already). The only way around that would be to address the changes by altering the schematic directly using a script. Again -  potentially an error prone process.
« Last Edit: May 18, 2017, 06:51:00 pm by homebrew »
 
The following users thanked this post: patman27

Offline Vasi

  • Regular Contributor
  • *
  • Posts: 60
  • Country: ro
    • Visual Pin Configurator for Nucleo L152RE - produces SPL code.
Re: Hacking the KiCAD Libaray system to be actually useful
« Reply #27 on: May 20, 2017, 12:15:44 pm »
I think practice is the best advisor - and a ton of projects to be finished.
 
The following users thanked this post: jancumps

Offline ar__systems

  • Frequent Contributor
  • **
  • Posts: 516
  • Country: ca
Re: Hacking the KiCAD Libaray system to be actually useful
« Reply #28 on: May 25, 2017, 11:36:16 am »
Instead, the REAL argument against my proposal that came out of the discussion would be the very very inconvenient process of changing parts during the design. Changing the value of a capacitor would require the discipline to delete the part from the schematic and add a completely new one. If not done very carefully, this could easily have implications on the netlist and thus corrupt the layout (if this has been created already). The only way around that would be to address the changes by altering the schematic directly using a script. Again -  potentially an error prone process.
Nobody will want that. And I'm sure no one will want a database of passives in their CAD. There are 100s of manufacturers and millions of parts. Who would want to maintain that, and why? 
 
The following users thanked this post: splin

Offline Gibson486

  • Frequent Contributor
  • **
  • Posts: 324
  • Country: us
Re: Hacking the KiCAD Libaray system to be actually useful
« Reply #29 on: May 26, 2017, 03:57:30 pm »
Jst curious...

What system do people use to make their libraries? If you do not make something based on the the part number, how do you differentiate?
 

Offline Kelbit

  • Regular Contributor
  • *
  • Posts: 58
  • Country: ca
Re: Hacking the KiCAD Libaray system to be actually useful
« Reply #30 on: May 27, 2017, 08:02:51 am »
This thread is pretty timely. I'm predominantly an Altium user (originally learned it in university & now use it daily at work), but I've been forcing myself to learn KiCad for a side project.

I agree the KiCad library system is pretty bush league - I've ended up junking all the default KiCad libraries and rolling my own. I assign custom fields to each part for manufacturer, manufacturer part number, preferred distributor, and distributor part number. This way I can closely mirror the way I do it at work with Altium: each schematic symbol is associated with a physical part that can be purchased, and I can automatically generate a BOM from the schematic.

For passives, I have template components for the schematic symbol that I can duplicate and modify if I need to add parts to the library. I also hacked together a python script which can take in a CSV file from DigiKey and automatically fill a library with passives. For example, I pulled a list of all the 1% ERJ series 0603 resistors from Panasonic from DigiKey and then had the script automatically fill the library with the parts complete with description, manufacturer & P/N information, and DigiKey P/N info. It works well - I have all the standard values in my library now, and I know that if I put a part from my libraries on the schematic that I can buy it from DigiKey.
 

Offline homebrewTopic starter

  • Frequent Contributor
  • **
  • Posts: 293
  • Country: ch
Re: Hacking the KiCAD Libaray system to be actually useful
« Reply #31 on: May 28, 2017, 10:31:57 am »
Instead, the REAL argument against my proposal that came out of the discussion would be the very very inconvenient process of changing parts during the design. Changing the value of a capacitor would require the discipline to delete the part from the schematic and add a completely new one. If not done very carefully, this could easily have implications on the netlist and thus corrupt the layout (if this has been created already). The only way around that would be to address the changes by altering the schematic directly using a script. Again -  potentially an error prone process.
Nobody will want that. And I'm sure no one will want a database of passives in their CAD. There are 100s of manufacturers and millions of parts. Who would want to maintain that, and why?

Well than, what do you want? A PCB full of errors?
What is the pin-spacing on your 100uF jelly bean capacitor? 2.5mm? 3.5mm? Is the 22uF capacitor really available in 0603 package? And so on and so on ...

Yes sure, the best option would be if CvPcb would provide a database with orderable components. So instead matching designators to footprints one would match designators to orderable components. Each component would then have A SINGLE footprint associated. Problem solved ...

However, we don't have that ...
 

Offline ar__systems

  • Frequent Contributor
  • **
  • Posts: 516
  • Country: ca
Re: Hacking the KiCAD Libaray system to be actually useful
« Reply #32 on: May 28, 2017, 02:32:39 pm »
Well than, what do you want? A PCB full of errors?
What is the pin-spacing on your 100uF jelly bean capacitor? 2.5mm? 3.5mm? Is the 22uF capacitor really available in 0603 package? And so on and so on ...

Yes sure, the best option would be if CvPcb would provide a database with orderable components. So instead matching designators to footprints one would match designators to orderable components. Each component would then have A SINGLE footprint associated. Problem solved ...

However, we don't have that ...
Well you need some common sense when designing the circuit board, CAD is not a substitution for it. Personally I don't want to assign mfg part numbers to common (0603 0805 etc) passives ever. Not even when I provide BOM to my client. Unless I need something special in a particular place. I don't want to restrict purchasing more than absolutely necessary.
 
 

Offline Rerouter

  • Super Contributor
  • ***
  • Posts: 4694
  • Country: au
  • Question Everything... Except This Statement
Re: Hacking the KiCAD Libaray system to be actually useful
« Reply #33 on: May 29, 2017, 12:03:10 pm »
Jst curious...

What system do people use to make their libraries? If you do not make something based on the the part number, how do you differentiate?

Personally, I begin with the schematic symbol, generally i am forced to create this for each IC i use short of the generic pinout ones like op amps,
Next up i pull up my footprints and see if i have a good match, if not i create that footprint following kicads smd footprint naming convention (style, e.g. qfn, number of pins, size key value, e.g. width, pitch, and thermal pad or not), this way unless something is weird, there is nothing about the footprint that has to be unique. i can look at the name and tell what it is, and if it matches up.
add that to the footprint feild in the schematic symbol and be done with it,

For multiple footprint options i use alias's, but rarely do i forsee using multiple footprints in 1 go so i just add them as i use them, e.g. one project i may use a soic, then later a tssop, same pinout, just different footprint.  so open the old symbol and add in a new alias for an already created part

What would make kicads libraries 80x better in my book would be a duplicate scanner and a drag drop interface to move stuff between library files and delete / rename them.
« Last Edit: May 29, 2017, 12:40:32 pm by Rerouter »
 

Offline Gibson486

  • Frequent Contributor
  • **
  • Posts: 324
  • Country: us
Re: Hacking the KiCAD Libaray system to be actually useful
« Reply #34 on: May 30, 2017, 04:39:09 pm »
Jst curious...

What system do people use to make their libraries? If you do not make something based on the the part number, how do you differentiate?

Personally, I begin with the schematic symbol, generally i am forced to create this for each IC i use short of the generic pinout ones like op amps,
Next up i pull up my footprints and see if i have a good match, if not i create that footprint following kicads smd footprint naming convention (style, e.g. qfn, number of pins, size key value, e.g. width, pitch, and thermal pad or not), this way unless something is weird, there is nothing about the footprint that has to be unique. i can look at the name and tell what it is, and if it matches up.
add that to the footprint feild in the schematic symbol and be done with it,

For multiple footprint options i use alias's, but rarely do i forsee using multiple footprints in 1 go so i just add them as i use them, e.g. one project i may use a soic, then later a tssop, same pinout, just different footprint.  so open the old symbol and add in a new alias for an already created part

What would make kicads libraries 80x better in my book would be a duplicate scanner and a drag drop interface to move stuff between library files and delete / rename them.

I used this to move library stuff around...

https://www.compuphase.com/electronics/kicadlibrarian_en.htm
 

Offline Kelbit

  • Regular Contributor
  • *
  • Posts: 58
  • Country: ca
Re: Hacking the KiCAD Libaray system to be actually useful
« Reply #35 on: June 01, 2017, 01:03:24 am »
Well than, what do you want? A PCB full of errors?
What is the pin-spacing on your 100uF jelly bean capacitor? 2.5mm? 3.5mm? Is the 22uF capacitor really available in 0603 package? And so on and so on ...

Yes sure, the best option would be if CvPcb would provide a database with orderable components. So instead matching designators to footprints one would match designators to orderable components. Each component would then have A SINGLE footprint associated. Problem solved ...

However, we don't have that ...
Well you need some common sense when designing the circuit board, CAD is not a substitution for it. Personally I don't want to assign mfg part numbers to common (0603 0805 etc) passives ever. Not even when I provide BOM to my client. Unless I need something special in a particular place. I don't want to restrict purchasing more than absolutely necessary.
 

I'm of the opposite view... I prefer that I get as much control over what parts go on the board as possible. A 100nF 35V 0603 ceramic cap from two different manufacturers may have radically different DC bias characteristics, for example. Or maybe the ESR is different, and that affects the ability of a cap to act as an EMC filter which means the device isn't performing the same way it did in the EMC lab. Or maybe the temperature coefficient of a replacement resistor in an analog circuit is radically different than what I tested on which affects high-temperature performance. I would prefer to keep everything as similar as possible to what I did verification & IEC testing on.

If the contract manufacturer can't find a part because it's out of stock, fine - but they should contact me first before slapping in a generic replacement they found on the third floor of the Shenzhen market. That way I can check that the part they want to substitute as actually equivalent for intended use. In the case where a part is extremely jellybean (like a pullup resistor) where a bit of carbon-soaked string might do the job, then fine, I can insert a field in my BOM called "equivalent substitutions permitted" and the CM can go to town. But most of the time, I want to sign off & document any substitutions.
 
The following users thanked this post: voltsandjolts

Offline ar__systems

  • Frequent Contributor
  • **
  • Posts: 516
  • Country: ca
Re: Hacking the KiCAD Libaray system to be actually useful
« Reply #36 on: June 02, 2017, 02:40:15 pm »
In my experience only two times I had to spec specific passives. One time product was failing due to caps cracking because of the board was deformed due to over tighten screws (I spec'd some flex-termination caps) and second time I had to spec pulse-withstanding resistors in some AC circuit. All other times 1% spec for resistors is sufficient. My customers are only buying good parts from digikey or mouser anyway.

How do you do it? Say you attach an mfg p/n to your component in CAD. What happens next time you want to change the value of that component? I had problems with this scenario in the past, where pieces of sch was copied to another board, values of components changed but attached p/n were not updated. Now I have discrepancy between my board and BOM. That was kind of embarrassing. This whole approach just creates way more opportunities for errors.
 

Offline Gibson486

  • Frequent Contributor
  • **
  • Posts: 324
  • Country: us
Re: Hacking the KiCAD Libaray system to be actually useful
« Reply #37 on: June 02, 2017, 03:03:01 pm »
In my experience only two times I had to spec specific passives. One time product was failing due to caps cracking because of the board was deformed due to over tighten screws (I spec'd some flex-termination caps) and second time I had to spec pulse-withstanding resistors in some AC circuit. All other times 1% spec for resistors is sufficient. My customers are only buying good parts from digikey or mouser anyway.

How do you do it? Say you attach an mfg p/n to your component in CAD. What happens next time you want to change the value of that component? I had problems with this scenario in the past, where pieces of sch was copied to another board, values of components changed but attached p/n were not updated. Now I have discrepancy between my board and BOM. That was kind of embarrassing. This whole approach just creates way more opportunities for errors.

Well, if you change the value, you need to change the part number. At least with KiCad, some make it so you cannot just change the resistor value in the field alone.  I can understand why people put that field in there, but instances where you are worried about what you are saying, people just make the value part of the symbol itself. At the end of the day, no matter what you do, it requires you to be very careful.
 

Offline Kelbit

  • Regular Contributor
  • *
  • Posts: 58
  • Country: ca
Re: Hacking the KiCAD Libaray system to be actually useful
« Reply #38 on: June 06, 2017, 06:09:48 am »
In my experience only two times I had to spec specific passives. One time product was failing due to caps cracking because of the board was deformed due to over tighten screws (I spec'd some flex-termination caps) and second time I had to spec pulse-withstanding resistors in some AC circuit. All other times 1% spec for resistors is sufficient. My customers are only buying good parts from digikey or mouser anyway.

How do you do it? Say you attach an mfg p/n to your component in CAD. What happens next time you want to change the value of that component? I had problems with this scenario in the past, where pieces of sch was copied to another board, values of components changed but attached p/n were not updated. Now I have discrepancy between my board and BOM. That was kind of embarrassing. This whole approach just creates way more opportunities for errors.

Simple, I never change values on the schematic, only in the library. If I need to change the value of the part, I'll just delete the part from the schematic and add the replace part with the same reference designator set. My philosophy is that if it's on the schematic, it's got a manufacturer's part number attached. I don't edit parameters on the schematic - only in the library. That way, at the end, I have a BoM as an output with exact, orderable part numbers.
 
The following users thanked this post: voltsandjolts

Offline Gibson486

  • Frequent Contributor
  • **
  • Posts: 324
  • Country: us
Re: Hacking the KiCAD Libaray system to be actually useful
« Reply #39 on: June 07, 2017, 01:46:13 am »
In my experience only two times I had to spec specific passives. One time product was failing due to caps cracking because of the board was deformed due to over tighten screws (I spec'd some flex-termination caps) and second time I had to spec pulse-withstanding resistors in some AC circuit. All other times 1% spec for resistors is sufficient. My customers are only buying good parts from digikey or mouser anyway.

How do you do it? Say you attach an mfg p/n to your component in CAD. What happens next time you want to change the value of that component? I had problems with this scenario in the past, where pieces of sch was copied to another board, values of components changed but attached p/n were not updated. Now I have discrepancy between my board and BOM. That was kind of embarrassing. This whole approach just creates way more opportunities for errors.

Simple, I never change values on the schematic, only in the library. If I need to change the value of the part, I'll just delete the part from the schematic and add the replace part with the same reference designator set. My philosophy is that if it's on the schematic, it's got a manufacturer's part number attached. I don't edit parameters on the schematic - only in the library. That way, at the end, I have a BoM as an output with exact, orderable part numbers.

I have done it both ways. There are pros and cons to both. The nice thing about changing it in the library is that everything is already filled out ahead of time (your description, you values, etc). It, however, becomes a huge burden to have the library full of different resistors. Every time you get a new value, you have to search to see if you have that value already.
 

Offline Kelbit

  • Regular Contributor
  • *
  • Posts: 58
  • Country: ca
Re: Hacking the KiCAD Libaray system to be actually useful
« Reply #40 on: June 07, 2017, 06:08:30 am »
I actually automated that process in the current set of KiCad libraries I'm building up - I dumped all the 1% 0603 Panasonic ERJ series resistors from DigiKey to a CSV file, then wrote a python script to populate my library with them:



This way I already have all the standard 1% series values ready to go, complete with supplier links.
 

Offline Gibson486

  • Frequent Contributor
  • **
  • Posts: 324
  • Country: us
Re: Hacking the KiCAD Libaray system to be actually useful
« Reply #41 on: June 07, 2017, 12:15:37 pm »
I actually automated that process in the current set of KiCad libraries I'm building up - I dumped all the 1% 0603 Panasonic ERJ series resistors from DigiKey to a CSV file, then wrote a python script to populate my library with them:



This way I already have all the standard 1% series values ready to go, complete with supplier links.

That is awesome. Unluckily for me, we just used the part number as the name. It was a bad idea in retrospect. We are using Altium now. I am trying out both ways to see which way is better for our needs.
 

Offline Pr0toc01

  • Newbie
  • Posts: 1
  • Country: us
Re: Hacking the KiCAD Libaray system to be actually useful
« Reply #42 on: March 10, 2019, 10:46:50 am »
Hi Im new here and off to a REALY bad start by raising a dead thread.  (Pr0toc01 plays his Thread Necromancer card, everyone sighs and shakes their head in disgust  :palm: |O ::) ??? :o >:( )


Im of two minds on this.
I like the fact that I can just drop a capacitor on a schematic and enter the value for it without having to go looking through the library for the one with exactly the specs I need.
On the other hand there have been times where i have ended up using values for components that just dont exist / nobody makes (hey im self taught, leave me alone)

I like flexibility, but I also like knowing im not going to design something that cant actually be made unless I rework everything due to bad part values.

Would it be possible for someone far mopr familiar with KiCad then myself to basically add a "KNOWN VALUES" option.
So you have your schematic symbol, you have your foot print, you have your model, you have your Documentation file and then you have a file containing information about known manufactured components.

Lets take resistors.
So you have your --|/\/\/\|-- symbol that you put down
you hit V click it and in the EDIT VALUE window you get a list (like in the add part window) with known REAL WORLD value combinations for that resistor (10k 1% 1/4w) that also contains manufacturer name, part number etc?
OR just manually enter the information (and have it ask if you want to save it to the list)

This would give you the flexibility to use known real world values, or type them in on the fly as you go without the need for creating a new part in the library for every value combination...

Its just a thought, and im not familiar enough with the code of KiCAD to try to make this work myself.

Again, sorry about raising a dead thread
 

Offline janoc

  • Super Contributor
  • ***
  • Posts: 3781
  • Country: de
Re: Hacking the KiCAD Libaray system to be actually useful
« Reply #43 on: March 10, 2019, 11:01:10 am »
Hi Im new here and off to a REALY bad start by raising a dead thread.  (Pr0toc01 plays his Thread Necromancer card, everyone sighs and shakes their head in disgust  :palm: |O ::) ??? :o >:( )


Im of two minds on this.
I like the fact that I can just drop a capacitor on a schematic and enter the value for it without having to go looking through the library for the one with exactly the specs I need.
On the other hand there have been times where i have ended up using values for components that just dont exist / nobody makes (hey im self taught, leave me alone)

I like flexibility, but I also like knowing im not going to design something that cant actually be made unless I rework everything due to bad part values.

Would it be possible for someone far mopr familiar with KiCad then myself to basically add a "KNOWN VALUES" option.
So you have your schematic symbol, you have your foot print, you have your model, you have your Documentation file and then you have a file containing information about known manufactured components.

Lets take resistors.
So you have your --|/\/\/\|-- symbol that you put down
you hit V click it and in the EDIT VALUE window you get a list (like in the add part window) with known REAL WORLD value combinations for that resistor (10k 1% 1/4w) that also contains manufacturer name, part number etc?
OR just manually enter the information (and have it ask if you want to save it to the list)

This would give you the flexibility to use known real world values, or type them in on the fly as you go without the need for creating a new part in the library for every value combination...

Its just a thought, and im not familiar enough with the code of KiCAD to try to make this work myself.

Again, sorry about raising a dead thread

a) It is better to start a fresh thread than to hijack a random old one.
b) What you want would require ENORMOUS amount of work from "someone" - you do realize that KiCAD devs are all unpaid volunteers, right?

There are tons of possible "real world" combinations, literally tens of thousand when speaking about passives, from many manufacturers. Think not only values and tolerances but also temperature coefficients, materials, dimensions, max. voltage, etc.

Some manufacturers provide their own libraries you can load and use but most don't. It is a pretty unworkable idea, IMO. When you are designing something, you calculate the values you need and then look up online what you can get (and how much it will cost - one can get even oddball values easily but they may be expensive specialty items!) and then adapt your design. Only then you put it into a PCB CAD program.
« Last Edit: March 10, 2019, 11:04:46 am by janoc »
 

Offline rs20

  • Super Contributor
  • ***
  • Posts: 2317
  • Country: au
Re: Hacking the KiCAD Libaray system to be actually useful
« Reply #44 on: March 10, 2019, 10:53:37 pm »
Pr0toc01, go to http://www.logwell.com/tech/components/resistor_values.html , print it out, and stick it to the wall next to your computer screen. Job done.
 

Offline bson

  • Supporter
  • ****
  • Posts: 2265
  • Country: us
Re: Hacking the KiCAD Libaray system to be actually useful
« Reply #45 on: March 11, 2019, 12:47:07 am »
If I need a special tolerance for a component, I will add it in the value field. Like "10k 0.1%". I also have fields for manufacturer part number, manufacturer name and distributor id.
This is exactly what I do, too.  I wish KiCad would standardize these fields so BOM tools would know what to look for.

I may have a dozen 0.1µF caps, all 0402, but the one in the buck converter is different from all the others and needs to be a specific part.  So I make those custom values visible on the schematic and the PCB fab layer, but many BOM tools can't be configured to look for them.

I also wish it could use a simple REST API to do part lookups; then I could implement a simple server in golang that fronts a part inventory database and bridges queries to those distributors who will let me do API based parts lookups.
« Last Edit: March 11, 2019, 12:49:56 am by bson »
 

Offline HendriXML

  • Super Contributor
  • ***
  • Posts: 1085
  • Country: nl
    • KiCad-BOM-reporter
Re: Hacking the KiCAD Libaray system to be actually useful
« Reply #46 on: March 13, 2019, 11:07:28 pm »
If I need a special tolerance for a component, I will add it in the value field. Like "10k 0.1%". I also have fields for manufacturer part number, manufacturer name and distributor id.
This is exactly what I do, too.  I wish KiCad would standardize these fields so BOM tools would know what to look for.

I may have a dozen 0.1µF caps, all 0402, but the one in the buck converter is different from all the others and needs to be a specific part.  So I make those custom values visible on the schematic and the PCB fab layer, but many BOM tools can't be configured to look for them.

I also wish it could use a simple REST API to do part lookups; then I could implement a simple server in golang that fronts a part inventory database and bridges queries to those distributors who will let me do API based parts lookups.
This repo https://github.com/HendriXML/KiCad-BOM-reporter is about precise matching on different criteria. It’s work in progress, but it has a lot of potential.
« Last Edit: March 14, 2019, 06:17:51 pm by HendriXML »
“I ‘d like to reincarnate as a dung beetle, ‘cause there’s nothing wrong with a shitty life, real misery comes from high expectations”
 

Offline mkschreder

  • Contributor
  • Posts: 17
Re: Hacking the KiCAD Libaray system to be actually useful
« Reply #47 on: March 31, 2019, 08:15:57 pm »
I constantly abuse the value field for part id. This is just the only way to make it work for larger projects.

Sent from my SM-G960F using Tapatalk

 

Offline mkschreder

  • Contributor
  • Posts: 17
Re: Hacking the KiCAD Libaray system to be actually useful
« Reply #48 on: March 31, 2019, 08:18:17 pm »
Well, so basically you have turned the Kicad library system into a copy of Eagle's, where every value/footprint variant/voltage rating has its own symbol/footprint in the library, duplicating the stuff all over the place.

Now imagine that there is a mistake in that symbol or footprint. With the original Kicad way of doing things you fix a single symbol/footprint and all parts using it will be correct. With yours? Good luck fixing few thousands parts each time - even if you automate the job.

The entire point of the Kicad's design is that you are not supposed to do this. Add the fields to the components, but do that per project, as you need them, not creating entire libraries of 0603 and 0805 capacitors that differ only in a value of a field or two.
I disagree. It is extremely clean approach to create a bunch of 402 capacitors of different values. I even go as far as adding static text to them specifying value, voltage etc. Then I can just place these parts on the schematic and no more hassle. Great approach.

Sent from my SM-G960F using Tapatalk

 

Offline Bassman59

  • Super Contributor
  • ***
  • Posts: 2501
  • Country: us
  • Yes, I do this for a living
Re: Hacking the KiCAD Libaray system to be actually useful
« Reply #49 on: April 01, 2019, 02:17:16 am »
Well, so basically you have turned the Kicad library system into a copy of Eagle's, where every value/footprint variant/voltage rating has its own symbol/footprint in the library, duplicating the stuff all over the place.

Now imagine that there is a mistake in that symbol or footprint. With the original Kicad way of doing things you fix a single symbol/footprint and all parts using it will be correct. With yours? Good luck fixing few thousands parts each time - even if you automate the job.

The entire point of the Kicad's design is that you are not supposed to do this. Add the fields to the components, but do that per project, as you need them, not creating entire libraries of 0603 and 0805 capacitors that differ only in a value of a field or two.
I disagree. It is extremely clean approach to create a bunch of 402 capacitors of different values. I even go as far as adding static text to them specifying value, voltage etc. Then I can just place these parts on the schematic and no more hassle. Great approach.

Sent from my SM-G960F using Tapatalk

I split the difference by using a custom field for a house/company part number. That part number is for a "family" of parts, which is to say, parts that vary in only one parameter. So I have a family for 0805 1% resistors, and another family for 0805 0.1% resistors, and a third family for 0603 1% resistors. Therefore there are just three resistors in my passives schematic library. When I start to need 0402 1% resistors I'll make another resistor symbol for my library.

A Python script takes the BOM generated by Kicad and uses the Part Number field and the standard Value field to key into a database that spits out a full vendor part number.

There are many many ways to do this. At two previous jobs, the resistors library contained one entry for every part value/tolerance/package we'd want to use. At first glance that might seem unwieldy ("there are SO MANY resistor values!") but in reality, even for a company that did a lot of analog, the number of resistors we actually used was maybe 200, and the naming scheme was obvious so finding the part in the library and placing it on the schematic wasn't difficult.

"But what if you have to change the part value?" Well, that was easy, you just delete the old part in the schematic and replace it with one with the new value and same reference designator. The PCB layout didn't care. The schematics and BOMs were tracked as separate entities in the system anyway, and the system was set up for the convenience of the purchasing department. It ensured that parts put on the schematic got ordered and that they'd fit the footprint on the board, always.

Also many people have suggested (and some have even demanded!) that Kicad implement a database for its parts library. Most people will agree that it's a good idea, but zero people have stepped up to propose a library database scheme, much less even implement one as a proof of concept.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf