PCB Routing: Tips & Tricks & Building Blocks

Started by KarenColumbo, August 21, 2017, 03:40:48 AM

Previous topic - Next topic

KarenColumbo

During my never ending quest for siphoning as much knowledge in as short a time as possible I'd like to start a thread about designing boards.

Beside many other obstacles between idea and stompbox it's also always about available space: How can I "compress" as much circuitry in as little PCB estate as possible without having to bridge?

Me, I almost always start with the input and try to move along with the schematic. Except when it's a circuit with opamps in it: here I start with those multi-pin-gadgets and work my outwards from there. This works out in 35-40% of my attempts. My intuition is not too bad, but there's still (and always will be) lots of situations I find myself in right in the middle of routing, where I simply have to scrap it and start over from a different angle. This can become very frustrating.

After reading through a LOT of PCB designs I began to see some distinctive "patterns" in designing. Sooo ....

... what I'd be interested in is:

- Building Blocks: "classics" like transistor gain stages, filter stages (including power supple filtering). Do you always do them in the same way? What are your tried and tested methods of clustering parts together for those recurring electronic elements?
- Philosophy: Here's the schematic (i. e. an overdrive, a CMOS thing, some BBD build - watch those clock noises! - and so forth); you built those already in the past, so what's will be your almost instinctive first moves in EagleCAD, ExpressPCB and other software helpers when you attempt the current one?
- Reading material: Are there books specifically PCB design centered?
- PCB snippets - I know, that's a lot to ask for, but seeing is learning.

Think we could do that? If it works out I promise to collect them all in a nice, neatly arranged PDF for everyone to download :)
  • SUPPORTER
I see something of myself in everyone / Just at this moment of the world / As snow gathers like bolts of lace / Waltzing on a ballroom girl" - Joni Mitchell - "Hejira"

EBK

#1
Quote from: KarenColumbo on August 21, 2017, 03:40:48 AM
- Reading material: Are there books specifically PCB design centered?
R.G. wrote a book on the topic.  It's available through smallbear.  I haven't personally seen any of the content.
  • SUPPORTER
Technical difficulties.  Please stand by.

Fancy Lime

Excellent question. Been meaning to start PCBing but vero or perf is just too easy to force me out of my comfort zone.

Are there no computer programs that do that (semi) automatically by now? Designing "the optimal" PCB from a schematic should be fairly easy for a computer program. You just need to iteratively arrange everything according to strict rules. But one might need lots of iterations and compare lots of different variants, so it's rather tedious to do by hand unless you have the experience to save you time. No point developing this for a fuzz face, of course, but I would imagine that people who try to make the smallest possible cell phone or laptop motherboard must have developed something like this at some point. Question there: is there an available, non-corporate-secret version?

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!

marcelomd

Hi,

In another life I was a PCB layoutist/designer. I used to work with 1000+ pin FPGAs, 10+ layer boards, etc. Mostly for testing equipment. Then I got bored with it and moved to software. This was +-10 years ago and just now I'm coming back to audio stuff, so I may be a bit outdated.

Some things I remember in no particular order:

  • My workflow is:

       
    • Draw board layout
    • Position connectors
    • Divide PCB in sections (PSU, input, tone, switching, etc.);
    • Bigger component positioning
    • Small components + traces
    I do several iterations of this list. I find that setting constraints first (like connector positions) frees my mind to focus on the smaller stuff instead of having to mentally recalculate everything at every step. Plus, by the time the PCB got to me, the external enclosure was already defined anyway;

  • Clean sections with matching component orientations are beautiful. Do it =)

  • I tend to use standard subsections/snippets. Example work in progress (it's a veroboard). Note the transistors:

  • Power first. Most noise issues begin at power supply and routing;

  • Give preference to V+, V- and GND when routing. If possible, route all power traces first. If you have to use a jumper/bridge, use it on the signal trace, not the power ones;

  • In the image above. I'm experimenting with having a single ground trace around the circuit. Works well enough;

  • Best book about PCB best practices: High Speed Digital Design: A Handbook of Black Magic

  • Everything is analog. Even if it says 'digital' on the cover;

  • I always use one 100nF capacitor per integrated circuit. Even if I don't need it;

  • I like to minimize off board wiring, so if I have to connect pins from two potentiometers, I route the connection in the board. For hobby stuff this is kinda inconvenient. I may change it;

  • The above goes for ground connections. For single board projects, I connect every external pin/lug/tab to the board. My star ground is a big ass trace;

  • Small quantity PCBs are cheap today (well, cheaper). After verifying a new design, doing a proper layout and ordering a few boards is often less work than debugging a veroboard. Less noisy too;

  • NASA's workmanship standards. Must read;

  • Last one: Relax. Audio frequencies at the power levels we use are very forgiving. You don't NEED to follow NASA's standards every time;

As always, I might be wrong and welcome suggestions =)

@Fancy: In my time as a professional layoutist, there were no really good autoplacers or autorouters. I Suspect this is still the case. One place I worked had a team of PCB designers that routed the important traces by hand (PSU, DDR memory, high speed networking) and automated the rest (glue logic, display LEDs, etc.). They said that setting the autorouter properly took almost the same time as doing it by hand. Also When you are manufacturing large quantities of something, you have to design for the manufacturing process itself. Sometimes the computer can come with a place/route solution that works as expected, but can't be reliably assembled in the line.

R.G.

There is one really immutable rule: place the stuff that can't be moved around FIRST.

Get the board outline, connector and controls positions, and >>> PCB mounting holes or other mounting provisions <<< down and cast in stone before ever placing another component or drawing a trace. It is a true beginner's mistake to complete your place-and-route and then go to work trying to reflow the whole mess to put in mounting holes for the board, or place a volume pot.

A word about controls placement. This doesn't matter much in pedals, where the controls are often dangling on hanging wires. However, the higher the gain, and the more complex the circuit, the more control placement matters, and when you have to mount controls and jacks directly on the PCB (which is when PCBs really start helping with assembly) you have the user appearance dictating the intimate details of the routing to get the controls in those places. A good layout with PCB mounted controls that is quiet and well behaved is the mark of an experienced low-frequency PCB designer. RF and high speed logic PCB design is a whole 'nother world on top of this.

And you haven't properly appreciated how much you'd like to do something other than PCB design until your boss says he wants to move the pots and switches around after you've put in a few weeks getting a two- or three-board stack to have everything in place.

Getting beyond a minimal board with a few devices on it and all flying-wire controls requires some background in mechanical design. I find that I often "sketch" a new design in a 3d modelling program. I use FreeCAD at the moment. Good program, and free. But you pay for free with your work to apply it.

After the mechanicals, place stuff that can be moved, but shouldn't - i/o wires. I can tell at a glance if a person has no experience with layout if the wire pads come from all over the board. This is a sign that the person has never had to take every cotton-picking wire loose to get the PCB up where it can be worked on. Start by assuming you want all the wires coming off ONE edge, not having the board held down by wires on every edge like Gulliver in Lilliput. Again, mechanicals matter.

Every board designer develops their own internal way of looking at things, but the more successful you are at other disciplines like mechanicals and circuit design, the better you'll do layout. Once the mechanicals are taken care of, you start subdividing by section and plotting signal flow through the board. It's really only after you get sectioning and signal flow down that you can do a good job on power and ground.

I had to sit through a couple of courses in design automation long ago. At that time, the prevailing wisdom was that power and ground should be the last things placed, not because they were unimportant, but because they went everywhere. That's true in general in logic boards, but much less true in the micro-mini boards done for pedals. What's more accurate about ground in pedals is that (1) the higher the pedal gain, the more ground routing matters and (2) you need to know what's happening in the circuit so you know what currents and voltages flow through the circuit traces to do a good job of running power and ground.
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.

yanng45

As a disclaimer, I'd like to mention that I'm a hobbyist, not an electronic engineer and have no academic background in the field so bear with me. I recently started designing PCBs using EAGLE and can offer some contribution to the topic since i have successfully built a few pedals from my own PCBs. My goal was to board mount everything (pots, dc jack, audio jack).

First, that goes with what R.G said : i clearly overlooked the mechanical aspect of it all and had to start over a couple time until i actually sat down with a 125B enclosure and a caliper. I properly measured everything, designed my board and its outlines and placed the jacks, the dc connector and the pots. I now have a template that's a 100% reliable and a matching drill template. Beginner's mistake clearly, but hey I am a beginner !

As for the actual layout, i actually do what KarenColumbo said for now. I work my way from the input of the circuit to the output and lay out components and traces in "subsections" that are coherent with the schematic. This worked really well for circuit with only discrete devices, i had to adapt when i moved to schematic with integrated circuits but still try to follow that logic. It's important since i always try and compromise to keep the position of the pots as consistent as possible between pedals.

You can take a look at my github if you want some examples : https://github.com/effectspcbs/pedals, that's where i backup my stuff so it's pretty up-to-date, any project with a gerber file inside has been built and is verified. The libraries needed are located here : https://github.com/effectspcbs/eagle-libraries

Again, I'm just not sure they're the best example. Any constructive criticism is welcome actually.  ;)

arkatom

Hey guys I'm an electronics engineer that spends most days routing boards. That being said I'd just echo what's already been said here. Define the size of the board and shape first. The mechanicals are critical. Place down parts that cannot move or are location restricted. Get the wires/connectors coming out of 1 side. Then seperate into blocks power, eq etc.

Always start with Power and route those first. Then just move through systematically after all the parts have a loose location.

A little trick that's always helped is keep the top layer tracks moving in 1 direction only (say vertical) and the bottom layer moving in the other direction (horizontal) and jump between the two with via's. Boards these days are so cheap and easy to get made that there is no need to only have a 1 layer board.

Auto routers are terrible. I wouldn't use them. Pcbs for guitar pedals are perfect to learn on as the frequencies are extremely forgiving. The standards like the NASA one mentioned before are overkill. I wouldn't worry too much about it it'll be a great experience anyway.

If you need any pointers feel free to shoot me a message. I'll look over the board and give you some tips if you want. :)


Sent from my iPhone using Tapatalk

KarenColumbo

Thank you all for the invaluable input, the offer to help and the great files. I'm just waiting for a few free days to sit and learn and sift through it all and practice this with some builds that wait for it on my breadboards. Can't wait!
  • SUPPORTER
I see something of myself in everyone / Just at this moment of the world / As snow gathers like bolts of lace / Waltzing on a ballroom girl" - Joni Mitchell - "Hejira"

deadastronaut

Add more ground pads than you think you need.

think in reverse upside down order.

lots of whiskey...essential.


https://www.youtube.com/user/100roberthenry
https://deadastronaut.wixsite.com/effects

chasm reverb/tremshifter/faze filter/abductor II delay/timestream reverb/dreamtime delay/skinwalker hi gain dist/black triangle OD/ nano drums/space patrol fuzz//

antonis

#9
I'll make 2 definitions on Rob's last proposal:

Substitute "essential" with "strongly recommended"..

Do not substitute "whiskey" with any other "spirit"..


Conclusion: Do not route PCBs under heavy medication..  :icon_wink:
"I'm getting older while being taught all the time" Solon the Athenian..
"I don't mind  being taught all the time but I do mind a lot getting old" Antonis the Thessalonian..

R.G.

I don't mean this to be just self promotion, so let me apologize first if it seems that way.

This thread hasn't yet hit any topic I didn't touch on in "PCB Layout for Musical Effects". I wrote that specifically to answer these questions, all in one place, as a learning tool for people with little or no background in layout, with illustrations on how to do the placement, routing, and optimization. It's by no means a complete education on PCB layout - I'm still finding out tricks a few decades into this - but it does hit the majority of what people need in starting from a schematic and going to a finished PCB for pedals on boards of two layers or less.

- Place the stuff you can't change first: mechanicals and control/connector locations
- Break the circuit into manageable pieces for sub-routing in what I call "postage stamps", as that's about the size of the chunks.
- Use what amounts to the minimal cut-set to do that; it's a fancy term for splitting the sections where there are the fewest wires between sections.
- Arrange the chunks in signal flow order, with the most-sensitive in the most-protected positions. You simply must put in the time to be able to understand what "most-protected" means, and how the mechanical and electrical worlds interact to do this well.
- Allocate space on the available PCB for the chunks, roughly equal to the number of parts for a first, crude allowance for space. On pedal effects, you're not going to be able to place and route any better than simply the area the parts take up. In fact, you won't be able to get close to that, so take the part area, and multiply it by your experience level. If that's bigger than the PCB mechanicals, you can't do it on one PCB.
- Think in terms of costs. A cost is something that is paid in some combination of space, materials, or time. As you approach the PCB being completely full, the cost in materials and time rises exponentially. So does the effect any one last change.
- Arrange the parts within chunks so they connect electrically, then use several of a zillion mental movement operations to compact them down to fit in the allowable space not eaten up by the mechanicals.
- PCB part placement is like a compressible gas. You can push in here, only to have it pop back out somewhere else. You only compress it all down by working on pressing the whole mess at once. The higher the density, the harder the compression gets.
- Auto routers are, as mentioned, useless for your purposes on pedals. It sure seems like all it takes is iterative placement and routing to get to the finished product. The fundamental problem with that idea is that a good PCB is not simply all parts placed and routed. Once it's populated the circuits have to work in ways that reflect the interactions of the parts >> and traces, considered as resistors << with both microscopic induced voltages and fields in 3-space. You can only do that if you know what voltages and currents flow in which traces and how sensitive to disturbances that electrical condition is. So you need to understand the circuit to know how to place the traces, including especially "ground". I've posted many discussions on what ground really is in this forum. It's not simple.

Sorry - I got all started up again. We now return you to your regularly scheduled forum.    :icon_lol: 

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.

Fender3D

Quote from: R.G. on September 01, 2017, 10:48:50 AM
...So you need to understand the circuit to know how to place the traces, including especially "ground".

This!!

understanding the circuit means you know where you'll collect measurements to check functioning or for setting purpose.
Just a small advice: add those *%&£ing test points. It will be easier checking or setting the board, and that's just a few 3mm pads more...
"NOT FLAMMABLE" is not a challenge

KarenColumbo

Yeah, Ive been trying to buy your book for weeks. PayPal can't seem to transfer the dough from here to US, it seems. Support says everything is fine, but the transaction to small bear always fails.
  • SUPPORTER
I see something of myself in everyone / Just at this moment of the world / As snow gathers like bolts of lace / Waltzing on a ballroom girl" - Joni Mitchell - "Hejira"

marcelomd

R.G. is really a master.

In the end, pedals and low powered audio are easy. Perfect for learning analog stuff. My first PCB ever was a two stage BJT amplifier for a class in engineering school.

On the other hand, high speed digital and RF are witchcraft. I quit the layout business after I had to calculate trace impedances and capacitances for DDR memories and switching power supplies. also FPGAs BGAs with 1000+ balls.

I remember the components for which layout was reeealy critical, beyond best practices, had specific guidelines in the datasheets.


You also asked for blocks and snippets. I don't think there are a lot of those. There are common design blocks (a bjt buffer, an opamp gain stage, BMP tonestack, etc.) but each realization of one of them is slightly different from the other by design (different cap sizes, this opamp stage has a highpass cap in the feedback loop? etc.) and by 'chance' (different transistor pinouts, the input comes from right or left? Where the next stage is? My snippet is square but I only have a triangular space left).

Anyway I would love to see examples of great layouts for audio, reusable or not.

yanng45

#14
Quote from: R.G. on September 01, 2017, 10:48:50 AM
So you need to understand the circuit to know how to place the traces, including especially "ground". I've posted many discussions on what ground really is in this forum. It's not simple.

You know R.G., i haven't read your book but i have a "grounding" doc on my Google Drive that is a compilation of stuff you said on that specific subject in this particular board... really anything that i could find, it's like 10 pages long. I actually just made it public in case it could help anyone else : https://docs.google.com/document/d/1jTHy2aDxYIVhqZRoZA_crJ7zEbCwso0MES4NRIRuRY8

I've read it so many times and it did really help me a lot so thank you for that ! My favorite quote being this one, it just spoke to me after spending many hours figuring what the "perfect" grounding scheme should be :

Quote from: R.G. on April 20, 2011, 07:06:25 PM
This gets near to meditation and religious revery sometimes. There is ideal perfection, which is guaranteed not to cause grounding problems. Then there is pretty good, and causes no problems, even if it's not perfect.

arkatom

Well said R.G!


Sent from my iPhone using Tapatalk

POTL

Hi, I will not produce a new topic.
I have a quick and simple question, I created several two-way boards, on both layers there are ground planes.
However, I often saw that many manufacturers make an ground plane only on one layer.
The question is, does it make sense to remove one ground plane, does it give any hidden problems (which I could not notice) or is there much difference?

marcelomd

When I was a layoutist I had to use a certain layer stack dictated by some standards for multilayer boards. I knew what I was doing at an intermediate level but I changed jobs before I could really understand WHY the standards were so. Most of it had to do with EMI compliance and protection.

I heard so many different explanations for the double ground plane general PCB design "rules" that I came to the conclusion that most people don't know what they are doing and just repeat what they saw before (as most complex things in everyday life). Myself included, when I started. And now that I forgot most of it =)

That said, I don't remember it being necessary, or even beneficial, but I may be wrong.

One thing I remember doing is filling most unused spaces with copper patterns (dots or squares), unconnected to anything. This helps with the manufacturing process (evening the etching and plating of copper). Some say it helps to prevent warping of the board during reflow. It had an effect on high frequency signals, so it wasn't used everywhere.

Meh... I talk too much and need some sleep.

KarenColumbo

Finally bought the book :)

And: The double sided PCBs I've seen so far only have one ground plane - on the bottom side. Mind though, those PCBs were audio/stompbox circuits, so not OVERLY complicated. But why two ground layers? Seems a bit overkill to me ...
I've been Eagle-ing my boards with two layers since a few weeks ago when I decided I wanted to have more circuitry in as little space as possible - I had to many 2 knob circuits that needed a 1590BB enclosure - i.m.h.o. doesn't look right. So -> PCB manufacturer.
In the process I connect all the ground pins per "NET", name the net "GND", draw a polygon, name it "GND" and Bam!, there's a perfect ground plane. I use the second layer (top side) solely for routing those mofos that I couldn't snake through otherwise.
Works every time.

But i dunno how complex your circuitry is, dear POTL - but i can't imagine why it should be a problem having two ground planes, other that two planes, separated by some medium (PCB), can be a capacitor IF they're not connected. But they are, so ... everything cool, I guess.
  • SUPPORTER
I see something of myself in everyone / Just at this moment of the world / As snow gathers like bolts of lace / Waltzing on a ballroom girl" - Joni Mitchell - "Hejira"

POTL


thanks for answers
I'm basically building distortion pedals
I connect the earth on both layers
I correctly understand that when connecting the ground on both layers, I should not have parasitic capacitances (after all, you mean them).