Kicad advice

GroupDIY Audio Forum

Help Support GroupDIY Audio Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

Brian Roth

Well-known member
Joined
Aug 20, 2005
Messages
3,268
Location
Salina Kansas
First of all, I'm not a newbie when it comes to laying out PCBs...but it's been eons since I've done any.

Back in the 1970's, I taught myself the "art" using clear Mylar film sitting on a light table with a translucent grid beneath the Mylar, and using Bishop Graphics "stick on" footprints for DIPs, "doughnuts" for pads, and various widths of tape to "connect the dots"...all in 2X sizing.  A local shop catering to the printing industry would take my 2X tape-ups and reduce them down to actual size, so a PCB maker could then crank out the boards.  In a few cases, I did one-off "short runs" from the 1X negs/positives in my kitchen <g>.

A couple examples of PC boards used in a desk I built back in 1977, using the tape-up technique:

http://brianroth.com/projects/m77/proto/pre&eq-rear.jpg

http://brianroth.com/projects/m77/proto/pre&eq-front.jpg

ANYWAY, I dabbled a bit 11 years ago doing a relatively simple PSU card, using my fave CAD app, DesignCAD, and I attached a PDF to this missive showing what I did (and I have NO idea what the scaling factor is on that PDF).  It was intended to be "made in the kitchen", or via a vendor like this guy who makes PC boards from tape-up negs/positives:

http://www.farcircuits.net/

Now into the year 2014.  I've done a bunch of reading and research, then decided that Kicad looks like a good choice for me.

I am working on something a bit more complex, involving multiple discrete transistors, etc.  No 2000000000 pin microprocessors <g>.

I have read/watched multiple tutorials, and actually drew up a schemo for a very simple circuit with a single NPN transistor and a few resistors, annotated it, etc etc, then "plopped" it into PCBnew, then dragged around the various elements.  My result looks "plausible" <g>.

Here is my first of many questions.

The entire "library" structure of Kicad seems to be confounding me.  I spend too much time messing with it, and then sometimes accidentally overwrite a "stock" library item.  Yes.,..yes  Me Stoopid!  <g>

So, my Simplistic idea is to "grab the components that I need" from various libraries, then copy them into my own library stash required for the project.  What SEEMS to happen if I'm not VERY cautious is that I overwrite the originals.  Fortunately, I'll just uninstall Kicad and begin anew....

I need some suggestions re. managing the libraries...including the schemo, device footprints, etc.

Via Google, I did find some "3rd Party" Library Managers for this, but haven't explored them.

I also am a bit clueless how the schemo elements link into the footprint elements which then link into the PCBnew, with ALL having to link pinouts so that (as an example) the Emitter pin of a transistor drawn in the Schemo app  hooks into the correct pad  in the layout of PCBnew.  It appears that "magic numbers" for the pin numbers in the schemo app somehow translate into PCBnew.

Learning Curve!  Thanks for any assistance!!!

Bri


 

Attachments

  • Tooob PCB.pdf
    300.9 KB · Views: 22
I have a pretty good idea where you are coming from. I guess we are even about the same age. I too was brought up and blue and reds and hand taping.

I want to design PCBs but I don't want to be a PCB designer. I want to draw mechanical things but I don't want to be a mechanical designer. I want to use CAD but I don't want to be a CAD designer. This can be extremely frustrating. To use CAD effectively, you not only have to go up a pretty steep learning curve, you have to keep using it so as not to forget how to use it. To use PCB CAD effectively you not only have to go up the learning curve but also build up your own library of parts because the standard parts library never have all the things you need.

When I was at work this was no problem. We had CAD designers who did this all day for a living. Now I am on my own I cannot afford that luxury. So, like you I surveyed what was available and picked Kicad. I even set up the Kicad User Group at yahoo groups and if you want help from seasoned Kicad users then that is the place I would advise you to go.

But here's the rub. My designs are not that complex - you will have seen my Eurocard tube mice pre I am sure. They are small enough you can keep the design pretty much in your head. So I do not use Kicad. It is a great PCB CAD program but I am not inclined to make the investment necessary to use it with my relatively simple circuits. So instead I use FreePCB. It has nowhere near the bells and whistles of Kicad; it does not even have schematic capture. It does have a really easy to use footprint editor and automatically puts all your own footprint designs in a separate library!! I draw my schematics by hand or maybe using TinyCAD but the board layout is done by dropping footprints onto the board and connecting them by hand. I essence it is hand taping on the computer.

Cheers

Ian
 
Brian Roth said:
Now into the year 2014.  I've done a bunch of reading and research, then decided that Kicad looks like a good choice for me.

FWIW, we're an Altium Designer shop at the day job, and a few months ago started to use Kicad for home projects. I've completed a design for a studio monitor controller but I keep futzing with what I want it to do, so I haven't had any boards built.

NB that my comments here reflect the version of Kicad that is stable before they introduced a "new" PCB library format (called "pretty"). They added all of this other library support stuff, including the ability to pull libraries from a Git repository. I don't care about any of that.

Here is my first of many questions.

The entire "library" structure of Kicad seems to be confounding me.  I spend too much time messing with it, and then sometimes accidentally overwrite a "stock" library item.  Yes.,..yes  Me Stoopid!  <g>

So, my Simplistic idea is to "grab the components that I need" from various libraries, then copy them into my own library stash required for the project.  What SEEMS to happen if I'm not VERY cautious is that I overwrite the originals.  Fortunately, I'll just uninstall Kicad and begin anew....

I need some suggestions re. managing the libraries...including the schemo, device footprints, etc.

Rule #0: DO NOT use the stock supplied Kicad libraries. Create your own. Give them reasonable names, etc etc.

Why? Two real good reasons stand out.

a) You need to vet your libraries. The best way to do that is to create them. This way you know they're correct because you added them. You can start with the provided libraries and copy symbols and footprints into your libraries if you can find things you like.

b) It is likely that updates to Kicad will overwrite the libraries provided with the software. That whomps your changes.

I also am a bit clueless how the schemo elements link into the footprint elements which then link into the PCBnew, with ALL having to link pinouts so that (as an example) the Emitter pin of a transistor drawn in the Schemo app  hooks into the correct pad  in the layout of PCBnew.  It appears that "magic numbers" for the pin numbers in the schemo app somehow translate into PCBnew.

OK, for starters, Kicad keeps symbol libraries (extension .lib) separate from footprint libraries (footprint are called modules, and the library files have the extension .mod). There is no mechanism which associates a symbol library with a footprint library. They're completely separate.

Each symbol has a field called "Footprint." You can leave it blank and then later use a program called cvpcb to take the schematic netlist and associate each component with a footprint. This is so ungodly fucking moronic that you should NEVER use it. Instead, your symbols should always include the name of a footprint in this field.

So for your transistor example. You need to check the transistor symbol to see what the symbol designer called the pins. They could be called E, B, C or 1, 2, 3 or whatever. If you create the symbol yourself, choose whichever you prefer.

Now you need to look at the desired footprint. The generic TO-92 package can be used for many types of parts, so perhaps the pins are numbered 1, 2, 3.  Obviously, the pin mapping must be correct, so your choices are to have multiple TO-92 modules in your library, or just settle on one with the pinout numbered per a datasheet (I think the TO-92 pin numbering is standard).

In the symbol editor, you'll see that each pin has a "Pin Name" property and a "Pin Number" property. The number is the important property. (It doesn't have to be a number.) So just make sure your 2N2222A symbol has pin numbers that match the TO-92 footprint's pin numbers and you're good.

(There is an argument that having a symbol for 2N2222A vs MMBT3904 vs TIP29 just means you have a lot of symbols in your library, and you should instead just have one symbol for NPN and then use cvpcb to match the symbol to the footprint. That argument is stupid. Those three transistors have different footprints, and different orderable part numbers, and there's no way you'll be able to keep it all straight. So create a symbol for each, include the correct footprint for each, and don't worry about ever having to match them again.)
 
Yes, there is a LOT of upfront work to create and manage libraries. But that work upfront is rewarded when you simply pull symbols from the library, place them on the schematic, wire it all up, export the netlist for PCB, then you import that netlist into PCB and all of the footprints are there.

So for library management, I have a handful of libraries.

For symbols, I have asp_analog, asp_connector, asp_converter, asp_digital, asp_discrete, asp_display, asp_oscillator, asp_passive, and asp_regulator. eeschema is told only about these libraries. For modules, I have asp_connector, asp_discrete, asp_display, asp_ic, asp_oscillator and asp_passive. pcbnew is told only about these libraries. The libraries themselves are text, and as such easily imported into a source-code control system. On my Macs, the libraries live at ~/andy/Library/Application Support/kicad, and that directory is actually a subversion working copy. If I do some work on the laptop and add a new symbol or footprint, I commit the change. And then on the desktop machine, I update the working copy in the usual way, and voila, my libraries are now up to date.

(Since the Kicad schematic and PCB formats are also text, the projects themselves are in the repo, too, and in the same was as with the libraries, I can work on one machine, and then update the other and nothing is out of sync.)

IT IS IMPORTANT TO NOTE that the footprint field in the schematic symbol DOES NOT indicate the library name, only the symbol name. This, then, is why you should limit the libraries that PCBnew knows about to only those you've created and vetted. Too many random libraries have footprints called R0805 so if you want to make sure that YOUR R0805 is pulled by the netlist import, you have to ensure that only one such footprint name exists.
 
Thanks for the comments, Ian!  CAD apps themselves don't bug me, since I've been using DesignCAD for maybe 25 (!) years beginning with a DOS version.  But, my use for that app has been for things like mechanical drawings for custom electronic enclosures, system block diagrams for recording or video production facilities, etc.  However, DesignCAD didn't "feel" like the correct app to make up PC boards.

ruffrecords said:
I even set up the Kicad User Group at yahoo groups and if you want help from seasoned Kicad users then that is the place I would advise you to go.

Can you point me in the right direction to that Group?  I will at least lurk a bit, and most likely sign up.  Thanks!

Bri

 
Thanks for all the great suggestions, Andy!  I will go through them all and do some experimentation before I dive into an actual board design.

Bri

 
I've been gingerly <g> experimenting with Kicad, looking for various "causes and effects".  First of all, from a "fresh" install of the current "stable" version (2013-07-07), I renamed the "share" directory to keep it as downloaded, since Kicad seems to insist on always "looking around in there".  I never have found any config file(s) that set that up, so that's my workaround.

From there, I made a new share directory, and have been learning the various "musts", like having kicad.pro in a template subdirectory to prevent it from crashing when making a new project.  Fortunately, all those various files are text files, so I can edit them.  Easy question....what character(s) are used to "comment out" a line in any given file?  Kinda like comments in Ye Olde DOS batch files!

Very stupid question re. footprints in PCBnew,  I ASSume the "viewpoint" is from the bottom foil/non-component side.  I can prove that to myself by trial and error, but thought I'd ask. 

From some observations, it looks like cut-and-paste from the text files could be a time saver.

I also need to spend a LOT more time threading around at Ian's yahoo group.  Just so many hours in the day  lol.

thanks.

Bri



 
Everything is viewed from the top side/component side. Unless you hit F and flip it to the other layer (red is bottom layer, green is top), then it will flip the part over and you'll be looking at the pins from the bottom.
 
Brian Roth said:
Easy question....what character(s) are used to "comment out" a line in any given file?  Kinda like comments in Ye Olde DOS batch files!
You put a '# ' in start of each line you want to comment

[edit]
At least in pcbnew files, I am not sure for other file formats

http://en.wikibooks.org/wiki/Kicad/file_formats
 
Brian Roth said:
Very stupid question re. footprints in PCBnew,  I ASSume the "viewpoint" is from the bottom foil/non-component side.  I can prove that to myself by trial and error, but thought I'd ask. 

Like most PCB layout packages, in Kicad you always look down at the top of the board. If you place a component on the bottom layer, you view it mirror image through the top. This can be odd when you generate Gerbers, because they too are as if you are looking at the stackup from above.

Oh, yeah, this notion of "non-component side." Exactly which side of the board is that?  8)

-a
 
Brian Roth said:
I also am a bit clueless how the schemo elements link into the footprint elements which then link into the PCBnew, with ALL having to link pinouts so that (as an example) the Emitter pin of a transistor drawn in the Schemo app  hooks into the correct pad  in the layout of PCBnew.  It appears that "magic numbers" for the pin numbers in the schemo app somehow translate into PCBnew.

Learning Curve!  Thanks for any assistance!!!

Bri

This bit is fairly simple as schemo library parts are not actually linked to PCB modules in any way. (unless you explicity specify the footprint in the file, but I dont do that as there are generally more than 1 possible footprint for each component. Like a DPDT switch for example)
You specify the 'linking' yourself using CvPCB after you have generated a netlist from EESchema.

CvPCB can do things like filtering all modules which have the same number of pins as your schematic part, and then you assign them.

The pin numbers are simply transferred directly..i.e PCBnew assumes that pin 1 of the schematic part (well, netlist) equates to pin 1 on the module you have assigned and so on...

You shouldnt really have to end up writing over stock library parts. If one of them isnt right, edit it by all means but you should always give it a different module reference so it doesnt overwrite the module in the file. I usually make a whole new file for them anyway.

 
Andy Peters said:
Each symbol has a field called "Footprint." You can leave it blank and then later use a program called cvpcb to take the schematic netlist and associate each component with a footprint. This is so ungodly f**king moronic that you should NEVER use it. Instead, your symbols should always include the name of a footprint in this field.

Disagree with this. I dont necessarily always use the exact same parts.

Take a DPDT switch for instance. I might use different DPDT switches for different design, depending on price, availability, size, electrical characteristics etc.

But I dont want to create a different schematic part for each different one, because the schematic symbol doesnt change! So I have 1 DPDT switch schematic it part and use CvPCB to link it to my desired footprint (after I have decided what it will be).

Same with pots. Different situations may call for a pot that can be PCB mounted or with solder lugs. This affects the PCB module, but not the schematic part.

CvPCB is there to save time....you generally need a fairly small collection of schematic parts and a lot of different PCB modules...

In fact I think that you should never 'hardcode' the PCB - schematic part association so that you are always forced to check you are using the right footprint. If you dont have a footprint linked to a part in the schematic PCBnew will warn you when you read the netlist, which is better than it blindly importing the 'hardcoded' module and you dont realise it is the wrong footprint til too late...
 
ramshackles said:
In fact I think that you should never 'hardcode' the PCB - schematic part association so that you are always forced to check you are using the right footprint. If you dont have a footprint linked to a part in the schematic PCBnew will warn you when you read the netlist, which is better than it blindly importing the 'hardcoded' module and you dont realise it is the wrong footprint til too late...

I respectfully disagree. Completely. First of all, I use my own libraries, not the "community" libraries. I vet all footprints and all symbols, and I know that the footprint name I've put into the symbol is what I want.

Since my symbol names always give a hint as to the footprint, there is never any confusion. That's why my library has both LM317T and LM317EMP. While the symbols for each look the same, the footprints are different, so necessarily there are two different entries in the symbol library.

And that's why my library has RES_0805 and RES1206 and RES2012 and the like, again because on a board with over a hundred resistors, the last thing I want to do is put just RES on the schematic and then go through CvPCB and try to match which resistors can be 0805 and which need to be 2012 and which need to be that big through-hole power resistor. It's way too easy to make mistakes.

I think you have this notion that one schematic can be used as the source for several disparate PCB implementations. Maybe for trivial designs, you can do that, but for anything more complicated than a simple mic preamp, forget it.

There's this concern that libraries may have "too many" parts. I don't see that as a problem, I see that as a benefit.  When I look in my asp_regulators library, for example, I see immediately which parts I've researched and for which I've built symbols and footprints and found orderable part numbers. Same with my asp_connectors library, I know which exact XLR connectors I've got worked out. I know that if I place a Neutrik symbol on the schematic, it'll put the right Neutrik footprint on the board, and it should be obvious that I can't just swap in a Switchcraft part because it won't fit.

If your library starts to get "big," split it into several.

OK, maybe I have this attitude because at every place I've worked, a CAD system has been in place where there's an official library.  We use Altium Designer here, and we have one integrated library everyone uses. This library presents components, which marry symbols, footprints and 3D models.

Boards aren't designed using components not in the library. Everything added to the library is vetted. There is simply too much money at stake to not do this; you can probably guess how much it costs to fab and stuff an eight-layer PCB loaded with SMD parts. The purchasing person needs to order the part the engineer put on the schematic, the footprint has to match what was bought, and the mechanical design has to match the board. I'd rather spend my time on my design f**kups than figuring out that the PCB design was borked because of a footprint mistake.

Sorry for the length. YMMV.

-a

PS: because of the parts-ordering problem, I've taken the above a step further. I've created a rather simple "part number" system. Each symbol also gets an embedded "company" part number that I've made up (user-defined field in KiCad). The master is a simple spreadsheet, with the first column being that part number, and other columns including orderable vendor part number (the most important thing), description, footprint, price (last time I looked it up) and other comments. Kicad exports a BOM, and I wrote a Python script to parse the BOM and the Master Parts list and spit out a BOM from which I can order parts. This was a bit of work, but it saves a lot of time when ordering parts.

If anyone is interested in seeing my script and my spreadsheet, PM me.
 
Oh, if anyone is interested, I was able to get Kicad (BZR 4741, as of today) to build on OS X 10.9.2. Binaries are here. Libraries are not included; when you find them, they belong in ~/Library/Application Support/kicad

No warranty implied, YMMV. Good luck.

EDIT: whoops, built dynamic, not static, so much is missing from the binaries.
 
Andy, I've now gone "past the HUMP" of  the Kicad Vertical Learning Curve...as an Ancient Person who began "taping up" "do-nuts" and tape lines on clear Mylar stacked atop a translucent grid Mylar, all atop a light table...done in 2X sizes...from DECADES  ago!  LOL.

Still many things to learn/tweak, but it is all coming together.  One day, my PERSONAL libraries (as you suggested!) will let me preview new designs in 3D  <g>.

Odd...I always had a knack to translate a well-drawn Schemo into tape-and-donuts for single-sided cards.  Back then, it was:

"MAKE IT SINGLE SIDED...WE CAN'T AFFORD THE PRICE OF DOUBLE-SIDED/PLATED THROUGH!!!"

British companies like Soundcraft and A-H made PCBs that were double-sided, but with no plate-throughs/vias.  But, they required "odd bits" of jumpers from top/bottom, which were manually soldered.

Moving around all of the through-hole schematics/layouts/components are still here in my aging mind.  Kicad makes it easier than ripping up a bunch of donuts and tape.

I LOVE the fact that all Kicad files are ASCII-ish text which I can easily edit/tweak/cut/paste/etc.

But I found a shortcut app, which seems to work well:

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

Easier than keeping open several instances of WordPad...and cut/pasting.

My days of commercial App coding are well-past....like my "run" from 1986-2001 ("2001" because I made sure my clients were A-OK with the apps they paid me for, after the cross into 2xxx years) when I wrote/sold apps to Pawnshops, written in DOS.  I Bailed Out when Windoze made it more complex than what I chose to create/support. 

Not bragging, but my Olde pawnshop apps were pretty bullet-proof, since the shops always had to answer to the police/sheriff/etc.  Another level had to track sales of firearms to make the USA ATF (Alcohol Tobacco Firearms) people happy.

All written in Clipper, a compiled "superset" of dBase.  I "made some hay while the sun shined" in that niche.

Whatever.  No way an Ordinary Mortal can write any code for any apps any more, without at least 10000000000000000 programmer people behind them.  It's just too complex.

Days of writing this level:

10  Print "POOP"
20  GOTO 10

... LOL  are gone.  Ahem  my Pawnshop DOS app was a bit more complex.  Made a bit of money, though, to put "Beans on the Family Table" once I mastered things like interlocked databases and Keys and yada yada.

Back to my roots...Back to my roots...Back to my roots...

Analog designs!  I began young and dumb, but did it anyway:

http://brianroth.com/projects/m77/m77.html

Kicad is making me happy.


Bri

 
Digging up an Olde Thread with some newer FYI info.  I had to move all my Stuff onto a "new" computer last year....moved from XP to Win 7 Home.

Well, tried to do some new KiCAD stuff last week and it was a mess. 

Turns out there IS a Secret...do NOT let KiCAD install onto the default Windoze "applications" folder, but instead install it into it's own directory on the C: (or whatever) drive.

What happens is that Windoze 7 won't save the files where you expect, but instead stashes files into:

C:/users/**username**/appdata/Local/VirtualStore/kicad

Parts of KiCAD are happy with that, but others cannot find the files.


Thank You MicroSloth for constantly breaking good ol' apps....


Bri



 

Latest posts

Back
Top