Help me improve in PCB design (KiCad, Eagle etc)

Started by Keeb, March 27, 2020, 07:47:28 AM

Previous topic - Next topic

Keeb

I could never perfect the toner transfer method consistently. Sometimes it would be great, sometimes not. Plus drilling is a pain. I started looking into a small hobby CNC/PCB milling machines but realised that you still need to do the cad/cam process. So I decided that it would be better to learn CAD and be able to have PCBs (even double sided!) manufactured instead. Enough background!

I started with KiCad because it's free and because Eagle makes you register as a user. I have created two boards (and sent them for manufacturing, awaiting delivery).

In making these boards I ran into several problems that I hade to circumnavigate (we'll see how successful I was when the boards arrive). Most of these are about the actual layout of the board.

1. How do you guys handle V½/vbias/vref? Or really how do you keep tabs of everything? When looking at for example the Tonepad pcbs they have a great format. Usually it's ground goes around, 9V down the middle and components in between. Kind of like if you had folded the schematic over itself. The problem I had was that in the pcb layout mode you have a million resistors connecting through airwire/ratsnest to each other when in fact they all connect to vbias. I think it would be easier if you could make the ratsnest point to a "virtual point of vbias" instead of individual components. My solution was to make the top layer a vbias pour while the bottom layer was made a ground pour. Maybe this is me picturing things wrong. Anyone recognize this problem?

2. Does anyone know the footprint for regular PCB-mounted pots? The standard 16mm alpha kind.

3. If you have a tip that helped you in the beginning throw it at me!

I tried looking for tutorials on youtube but it's mostly digital/arduino/smd stuff and not simple stuff like this. I invite anyone else who has a question on this subject to join in and ask away!

Fancy Lime

+1 what Erik said!

I am also trying to get to grips with PCB design with KiCad. I am starting with very simple circuits and try to work my way up but even the simple ones are hard when you don't know what you're doing. I guess learning by doing and making mistakes is the popular approach in want of easier alternatives but it would sure be nice to have some pointers. Anyway, I haven't even progressed far enough to have meaningful questions other than "why won't it do what I want?". I'll be watching this thread hoping it will anticipate some of my questions and chime in when I can.

How about having a "Layout and CAD" child board to aggregate these topics, like we have for Simulation and Pictures? So we have a place where those who have mighty impressive layout skills to show off can do so and the rest of us can watch and learn and ask stupid questions.

Cheers,
Andy
My dry, sweaty foot had become the source of one of the most disturbing cases of chemical-based crime within my home country.

A cider a day keeps the lobster away, bucko!

vigilante397

I design PCBs for a living, it's my day job. I wish there was some magic piece of advice I could tell you that would magically make you amazing at it, but there isn't. There is no substitute for practice, practice, more practice, and the occasional practice. But one thing that helped me practice when I was first getting started, I would take something well-documented like a Tonepad or Madbean project and copy the schematic into my software. I then stared at the layout done by these people with way more experience than me and tried to copy their layout, just to get the feel for how they did things and to practice routing a real circuit. You shouldn't order PCBs of these files, but it's good practice for layout.

The next step I took was taking the layout I copied and seeing if I could make it different/better. Smaller, board mounted pots, ground planes, etc. Want more practice? Try combining multiple circuits into one PCB. I had a lot of designs where I added an LPB-1 to the end, partially because it was useful and partly because it was good practice.

So now to get to the questions you asked:

1. Honestly it's usually one of the last signals I route. Maybe I don't do enough that has a busy Vref line, but I tend to not worry much abotu it. Since it's a DC signal however you route it won't bother anything.

2. I have it in a Diptrace library (highly recommend Diptrace for free software) and an Altium library (highly recommend Altium for expensive [or bootleg] software) that has 16mm pots. Shouldn't be too hard to make one though, pads with about a 1.2mm hole with 5mm spacing between pads.

3. Make big pads. I've purchased PCBs from people (one in particular) that has really small pads and they suck to solder. My rule of thumb is make the annulus (the part you solder) twice the size of the hole, i.e. 1mm hole gets a 2mm annulus.

Also, make big enough traces. Usually not a huge deal unless you're doing tube stuff, but as another rule of thumb I don't make traces thinner than 0.5mm (20 mils). For high current stuff like tubes I use traces as big as 1mm (40 mils).

Also also, ground pours are great. I usually route everything besides ground then pour ground on top and bottom last, and 90% of the time the ground pours hit every single ground pad. It's a satisying thing.

Last tip: double check everything before you send it out for fabrication. For more complicated boards you may want to make your double (or triple) check the next day, so you're not as close to it and can look at it with fresh eyes.

Hopefully there was something helpful in there, and happy to answer any other questions :)
  • SUPPORTER
"Some people love music the way other people love chocolate. Some of us love music the way other people love oxygen."

www.sushiboxfx.com

R.G.

Small Bear Electronics has my book on PCB layout for the baby steps, and some advanced ones.

Quote from: Keeb on March 27, 2020, 07:47:28 AM
1. How do you guys handle V½/vbias/vref? Or really how do you keep tabs of everything? When looking at for example the Tonepad pcbs they have a great format. Usually it's ground goes around, 9V down the middle and components in between. Kind of like if you had folded the schematic over itself. The problem I had was that in the pcb layout mode you have a million resistors connecting through airwire/ratsnest to each other when in fact they all connect to vbias. I think it would be easier if you could make the ratsnest point to a "virtual point of vbias" instead of individual components. My solution was to make the top layer a vbias pour while the bottom layer was made a ground pour. Maybe this is me picturing things wrong. Anyone recognize this problem?
Yep, I recognize the problem. I took a grad level course in writing design automation software back in the mid 70s, and it informed a lot of my thinking on the topic. The book has quite a lot of explanation on this, but I'll recap quickly.
1. Figure out where the mechanically necessary parts go FIRST, before you every touch the layout for routing components. Every board has to be mounted in the box somehow. Allow for that FIRST. Wires generally come off the board. Put those pads at the edge. Pads coming out of the middle of the board is embarrassing. If the board has pots on it, or jacks, that kind of thing where the box determines where these parts have to go do that before every laying any other part down.
2. Cut the rat's nest into smaller rat's nests until you get small nests that are easy to route just as they sit.
3. Divide the nests in a way that leaves the fewest connecting wires between nests. Ideally, two nests will be connected only by power, ground, and one signal line. That's impossible for huge, conglomerated logic setups, but for audio circuits, you can get remarkably close, especially with pedal circuits having only one signal chain. It's best to do this dividing down to simple sections in the schematic before laying parts on a layout. This part tells you the signal flow on the board, that business about where the power, ground, Vbias, etc. will go, but inverted. You can't in general route ground, power and Vbias before the rat's nests, so just keep generally where these busses go in mind while chaining rat's nests.
3. In pedals, the smallest nests are likely to be one IC and one transistor amplifier stage. So split the schematic into a batch of "postage stamp" routing areas. Then assemble the postage stamps in the rough order of slgnal flow. The book has a lot about this, and the floor planning for how to combine them.
4. Within a postage stamp, arrange the individual parts to make the two-lead parts get one end closest to the three/more lead parts the connect to. Two-lead parts are also "jumpers" that get the signal away from the many-lead parts and out where you can run them around without congestion. Traces can run under two-lead parts easier. An ideal layout might have no spaces between parts with the traces running entirely under the parts. That's probably not possible, but it's a good goal.
5. With postage stamps arranged, and individually routed, connect the postage stamps. About now you're realize that you should have routed the stamp leaving a signal input on one side and a signal output on the other. It's a matter of experience to do a good job of looking forward from 4 to this consideration. Just gotta do it enough so your reptilian brain does it automatically.
6. With postage stamps arranged and connected, route the Vbias, power and finally ground. Why do these last? It gets into what the design-automation professor called "scoring nets" for priority in routing. The highest priority nets should be routed before other, less critical nets, and should, if at all possible be shortest. High priority includes special signal needs, and also connections to things that can't be moved for mechanical reasons. ICs are not very mobile, as they drag every part connected to them along with them (or should). Transistors, similar but less dramatic. Ground goes everywhere. The prof's advice was to not even bother to score it. I do my layouts today by routing ground, power and to some extent bias only locally within a postage stamp, not bothering with where they go globally. When the stamps are done, then I'll go worry with interconnecting them.
Quote

2. Does anyone know the footprint for regular PCB-mounted pots? The standard 16mm alpha kind.
Yes. It's on the pot data sheet. Go look at the data sheet and make your own footprint. That sounds harsh, I know but if you do this more than a few times, you're simply going to run into a part you have to make up a footprint for. Along the lines of ripping off the bandaid, just go learn to do it. You'll be happier with layouts quicker if you do. There's another thing lurking here. There probably aren't any standard 16mm pots. Or any other pots for that matter. Each manufacturer of things attempts to match some others to grab part of the market. But sometimes the parts vary a little. Being able to tinker the actual parts you order is a big deal. So either find the actual manufacturer's datasheet and match their mechanical spacings, or get an actual part in hand so you can use your digital calipers ( $10-$20, Harbor Freight; just get a set) to measure the actual parts you're going to put down. And use your new ability to make up foot prints to match.
Quote
I tried looking for tutorials on youtube but it's mostly digital/arduino/smd stuff and not simple stuff like this. I invite anyone else who has a question on this subject to join in and ask away!
If you possibly can, get the book. I'm not just self advertising. I really wrote that thing specifically for people with your questions. It's a lot faster and more disciplined way to learn it than asking and getting even high quality answers to a thousand forum questions.

Ask about what I've not been clear about.

Edit: I wrote this over about three hours of being interrupted, so I didn't see vigilante's post. His comments are a good addition. And if you want pointers, ask; but learning in little bits - as I did, over a few decades - is tough.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

Keeb

Quote from: vigilante397 on March 27, 2020, 01:13:08 PM
practice, practice, more practice, and the occasional practice.

10 000 hours right?  ;D
I think part of the problem is learning the program at the same time as the craft. Sometimes it's "why won't the program do what I want?" and sometimes it's "why is it getting messier!?"

Quote from: vigilante397 on March 27, 2020, 01:13:08 PM
1. Honestly it's usually one of the last signals I route. Maybe I don't do enough that has a busy Vref line, but I tend to not worry much abotu it. Since it's a DC signal however you route it won't bother anything.

I don't know if it was particularly busy but it threw me at least (it was frequency centrals causality 4 mk 2 phaser). I guess my difficult more lies in the difference between the systematic drawing of a schematic as opposed the the Mad Max component orgy that happens as soon as you go into the PCB making part.

Quote from: vigilante397 on March 27, 2020, 01:13:08 PMI usually route everything besides ground then pour ground on top and bottom last

So then you just ignore all the ground airwires? That's part of my problem, on a schematic it's easy to see the filter cap or voltage divider resistor but when it's all R6,R19,R11 in a bowl of spaghetti it's a different story. Maybe I just need to cross reference the schematic more.


Thank you for your answer. I found the pot footprint (I think) and I'm quite convinced I've been using quite large footprints for resistors...oops.

Keeb

Quote from: R.G. on March 27, 2020, 01:54:44 PM
Small Bear Electronics has my book on PCB layout for the baby steps, and some advanced ones.

Thank you RG for your extensive reply. I was looking for your book but looks like smallbear had to close down temporarily due to the pandemic. I'll definitely get it when he opens up again.

vigilante397

Quote from: Keeb on March 27, 2020, 01:57:41 PM
So then you just ignore all the ground airwires?

Exactly. As you said getting to know your software intimately will make everything easier. Altium (my tool of choice) has a neat feature that I use a lot, where if I Ctrl+click on a net it will highlight all the pins connected to that net so I can focus on those and easily ignore the other messiness.

Also cross-referencing the schematic is always a good idea. I like using two monitors when I'm doing layouts so I can keep the schematic open the whole time on the other screen. This is especially important in component placement, as good placement makes routing easy, whereas careless placement can make routing difficult or impossible. You should spend at least as much time placing your components as you do routing, because it's crucial. Should have mentioned that in the first round of pointers :P

I also agree with R.G. (as always), breaking rat nests up into smaller rat nest's is also a good idea, especially in bigger designs. I will typically group components based on what they do, i.e. power supply stuff, gain stage 1, tone stack, etc. It makes routing easier as related components are close together, and also makes debugging easier as you can pinpoint which section is having a problem and deal with it accordingly.

I would also like to add an endorsement for R.G.'s book PCB Layout for Musical Effects, definitely worth picking up a copy.
  • SUPPORTER
"Some people love music the way other people love chocolate. Some of us love music the way other people love oxygen."

www.sushiboxfx.com