Kicad Finest Practices: Library Administration

August 4, 2022 0 By nmbj

Een typisch probleem dat we horen van veel nieuwe Kicad-individuen Associates met schematische en voetafdrukbibliotheken. De techniek is om slechts één schematisch teken en voetafdrukbibliotheek te gebruiken, elk met uw project. Op deze manier zullen eventuele wijzigingen in de standaard schematische bibliotheken van invloed zijn op uw project en het is eenvoudig om uw taak met anderen te delen zonder het te breken. Ik heb een lange tijd doorgebracht met het verfijnen van deze methode en ik loop je met het proces in dit artikel.

We hebben Kicad (evenals andere) elektronische stijlautomatisering (EDA) gereedschap een aantal keren in het verleden. [Brian Benchoff] deed een hele reeks over het bouwen van een baan van het begin tot het oppervlak met behulp van alle verschillende EDA-bundels die hij in handen zou kunnen nemen. Geen CAD- of EDA-softwaretoepassing is perfect, evenals een persoon moet ontdekken om grip te krijgen met de idiosyncrasies van het programma dat ze kiezen om te gebruiken. Dit leidt normaal tot een groot deel van Cussion en haar die tijdens de voorlopige fasen trekt wanneer iemand niet kan achterhalen “hoe doe ik dat in vredesnaam?”, Vooral van nieuwe converts die worden gebruikt om dingen anders te doen.

Lees verder om de allerbeste methoden te ontdekken om te gebruiken bij het gebruik van Kicad en het bibliotheekbeheer.

Project management

Kicad houdt schematische tekens en elementvoetafdrukken in afzonderlijke bibliotheken en u vereiste om een ​​bord te koppelen aan een voetafdruk met een van een aantal verschillende methoden. Dit komt veel mensen uit, maar het werkt nogal goed als je eraan wordt gebruikt.

In de oude dagen vóór computers zouden veel ontwerpers eerst snel snel een schematisch uittrekken, produceren vervolgens een “Bill of Materials”, waar ze de specificaties van de te gebruiken elementen uitvloeien. Dit helpt ze dan om de voetafdrukken van het element te selecteren, wat leidt tot de fase van het bordontwerp. Kicad probeert te voldoen aan deze werkstroom. Hier is een normale mapstructuur die ik gebruik om een ​​Kicad-project te organiseren, met het verfijnen van deze methode over veel jaren van werken met de software.

Doodad
↳3d_models // .Step evenals .Wrl ontwerpgegevens voor alle voetafdrukken
↳Datasheets //-gegevensbladen voor gebruikte elementen
↳GERBER // Eindproductiebestanden
↳Images // SVG-foto’s en 3D-bordverleners
↳LIB_SCH // Schematische symbolen
↳lib_fp.pretty // footprints
↳PDF // Schematics, Board-lay-outs, Dimensietekeningen
Schematische bibliotheken beheren

Wanneer u een schematische gebruik maakt van tekens uit de ingebouwde bibliotheken die zijn gebundeld met Kicad, produceert Eeschema een regionale back-upbibliotheek – DODAD-cache.lib. Wanneer u klaar bent met het tekenen van uw schema, kopieert u deze gegevens naar de map ↳LIB_SCH en hernoem het naar Doodad.LIB.

Ga vervolgens naar ↳preferences↳componentbibliotheken, kies “Huidige browse padlijst” om naar uw regionale vacature ~ / DODAD / DOODAD /, klik op de knop Toevoegen bovenaan het weergegeven venster (niet de knop Toevoegen in het midden van de pop-up), evenals ten slotte Doodad.lib. Het wordt toegevoegd onder de momenteel gekozen bibliotheek in de lijst.

Kicad leest deze bibliotheken in de sequentiële volgorde, zodat u Doodad.lib kunt kiezen en deze naar de bovenkant van de aanbieding te brengen met behulp van de knop UP. Als er een bord is met de exact dezelfde naam in verschillende bibliotheken, dan wordt het eerste geval van het gebruikt. Op dit punt kunt u alle andere verstrekte bibliotheken elimineren of ze gewoon verwaarlozen zolang u ervoor zorgt dat elk teken dat u gebruikt, wordt toegevoegd aan Doodad.LIB en wordt alleen uit dat bestand genoemd.

Jouw taak maakt nu gebruik van slechts één schematische tekenbibliotheek – ~ / DOODAD / LIB_SCH / DOODAD.LIB – evenals elk type wijzigingen aan de standaard schematische bibliotheken heeft geen invloed op uw project. Bovendien, het gebruik van de hierboven gedefinieerde mapstructuur, is het eenvoudig om uw taak op GitHub te delen. Wanneer uw taak wordt gekloneerd of gedownload, zorgt dit of er geen bibliotheekconflicten zijn.

Al het bovenstaande kan wijzigen wanneer Kicad S-Expression-stijlen in Eeschema en schematische bibliotheken implementeert (al geïmplementeerd in PCBNEW), dus we zullen dit op dat moment opnieuw bezoeken.

Toewijzen van voetafdrukken aan symbolen

Er is een aantal methoden om dit te doen, maar in wezen kiest u een schematisch symbool, evenals het aanwijzen van het een voetafdruk van een van de standaardbibliotheken. Ooit gezien dat Kicad Footprint-bibliotheken naar Github verhuisde, is dit voor velen een oorzaak van maagzuur. Voor één worden alle bibliotheken online gehouden, evenals Kicad moet ze opzoeken wanneer u het opdraagt. Voor degenen die dit gedrag niet wijzigen, vertraagt ​​het het programma tijdens het opstarten, als u niet aan het web bent gekoppeld. Op de internetbibliotheken zijn een geweldig concept, omdat voetafdrukken bijgewerkt blijven, maar het is een zeker eindmethode om je stijlen te breken, moet een van de voetafdrukken die worden gebruikt in je stijlwijziging. Dit zal niet onmiddellijk voor u worden weergegeven, omdat u de net-lijst expliciet opnieuw moet lezen en Kicad T krijgto replace altered footprints. however for somebody else who clones your design, as well as their KiCAD version tons up the updated footprint, it will break things.

The option is to clone all the KiCAD libraries to a regional place on your computer, as well as then point KiCAD to this location. however when you do this, it negates the advantage of having gain access to to updated libraries. I don’t believe there’s an suitable method to make it work, however here’s what works for me.

I clone the GitHub libraries to my regional computer, as well as keep them updated by routine pulls. This assists me utilize existing footprints or customize them to fit my requirements. however my job does not utilize any type of of those cloned libraries directly. Instead, I produce a job certain footprint library that contains all of the footprints (~/doodad/lib_fp.pretty) utilized in the project. when again, this makes sure that when the job gets cloned, all of the ideal footprints are already offered without depending upon outside source libraries.

How to Make KiCAD Footprints regional as well as Project-Unique

Start by cloning (from GitHub) the KiCAD footprint repository to your computer. This is finest done utilizing the ‘Footprint Libraries Wizard‘ from within PCBnew. In my case, I have cloned it to ~/kicad_sources/library-repos. In KiCAD’s PCBnew, choose ↳PREFERENCES ↳CONFIGURE paths as well as edit KISYSMOD to point to the regional footprint library path (~/kicad_sources/library-repos).

path to fp-lib-table
In some cases, extra steps may be needed to make things work. Select  ↳PREFERENCES ↳FOOTPRINT LIBRARIES MANAGER and figure out the place of the “fp-lib-table” data utilized by PCBnew. This is a text data that tells PCBnew where to look for footprint libraries – on Github, regional path etc. open this data in a text editor, as well as inspect if it utilizes KISYSMOD as the path. If not, do a browse as well as replace for all instances of present path as well as replace it with KISYSMOD.

Now, you can edit each schematic symbol, as well as add a footprint to it — either from within EESCHEMA, or utilizing the stand alone Cvpcb module. when all footprints have been assigned, make sure you re-generate the netlist before moving on to PCBnew.

MODE : footprint
You can now begin PCBnew as well as checked out the netlist, which dumps all the footprints in a stack on the canvas. choose the mode : footprint icon, then context-click on any type of ONE footprint, choose ↳Global spread as well as location ↳Spread out all footprints.

This spreads out all the footprints making it much easier to choose as well as step them around. when you’re made with your board layout, as well as all of your footprints are locked in, choose data ↳Archive Footprints↳Create library as well as Archive Footprints as well as supply the path/name to the .pretty folder in your job (~/doodad/lib_fp.pretty). This copies all the footprints utilized in your design to the target folder.

Then, Preferences↳Footprint Libraries Wizard↳Files on my computer↳(navigate to ~/doodad/lib_fp.pretty) as well as make sure you choose “To the present job Only” before hitting Finish. At this point, you have utilized footprints from KiCAD’s worldwide libraries as well as used them to schematic symbols, made a netlist, imported netlist in PCBnew, put the footprints as well as directed the board, made an archive of all the footprints used, as well as configured PCBnew to utilize that archive library.

Replace library paths
Next, return back to EESCHEMA, as well as edit the footprint association of each sign to point to the new lib_fp.pretty folder instead of the regional GitHub repository on your computer. The simplest method to do this is to open the .SCH data in a text editor as well as do a search/replace. In our present example, we will replace instances such as “Capacitors_ThroughHole” or “Resistors_ThroughHole” or “LEDs” with our regional job library folder “lib_fp”

Open the schematic one last time, save a fresh netlist, open PCBnew, checked out this netlist, however this time around choose the modification choice under exchange Footprint. Your board design will now be utilizing footprints saved in your lib_fp.pretty folder, as well as modifications to the KiCAD worldwide libraries will not impact the layout.

Afronden

This may noise a bit convoluted in the beginning, however over time it becomes rather easy, as well as you can get rid of some steps as you get better. For example, I already have my own library for a lot of of the typical parts that I use, as well as copy these footprints before starting off on a new project. Over time, as you get much better at it, you will begin building your own schematic signs as well as footprints from element data sheets instead of utilizing outside versions. like I stated at the beginning, it’s not perfect, as well as for me this process works extremely well. If you have comments or tips on making this better, chime in as wellLaten we weten.