First you can divide footprints into logical groups by schematic. It was already said but when you have PCB and schematic opened together and select some elements at schematic you can use M hotkey at PCB to move these elements and there is also other hotkey (I think P, but I have not used it a lot and have a half year break in using KiCad so not 100% sure, and can’t check it now) that at once pushes selected footprints together.
Then the strategy depends on how many layers you use.
For 2 layer PCBs I design them having full continuous GND at bottom (because of EMC). So I switch GND connection lines visibility off as I need not to design these connections - I have everywhere GND one via from me. Then I go with VCC under the main microcontroller and I spread it radially through this IC corners and VCC pins.
You can see effect of this strategy here:
Yes, P is for Pack and move footprints. Also available from the context menu under the right mouse button:
For PCB layout, footprint placement is a very important step. Sometimes it’s beneficial to start with a very big “fake” PCB by drawing Edge.Cuts as a big rectangle, then layout sections of parts that are connected to each other (Teletypeguy has a very good example of this. The section he selected only has two connections (and power) to the rest of the circuit). It is also an excellent example of a compact layout. Footprints are placed to function with short PCB tracks in between them (In most cases this does not matter much for signal integrity,(sometimes it does!) but tracks always occupy PCB area. In cases where track length does matter, it’s mostly in high impedance area’s and feedback circuits.
Footprint placement in such a way that tracks do not overlap is a big concern. You can use via’s, but those also take up PCB area. With THT parts, PCB tracks can easily be routed under footprints. With big SMT resistors and capacitors this is also still possible, but with the small SMT footprints this is no longer possible, and this is another complication.
After the initial sorting and mock layout you get a decent idea of the size of the PCB needed, and the real PCB outline can be drawn. Also consider mounting holes, texts for revision numbers, project name / date KiCad logo
But overall, how to do a good PCB layout is a very big topic. Too big for a forum such as this. There are also very different types of PCB’s (analog and digital circuits) and lots of PCB’s need special considerations for their layout. (SMPS circuits, GND return currents just to name a few).
<random_thoughts>
Another thing I find handy sometimes is just pencil and paper. Many, many years ago, I started pcb layout on a light table with sticky tape and donut pads, so it was not as easy to rip up and re-route – a bit of planning was vital. Sketching is still a good technique today: scribble and think and visualize connections in your head. Various little chunks of the circuit can just be sketched circles with some lines going in and out – figure out a general floor plan before you drag/rotate/position those chunks into the board area. Sometimes a lower-level sketch of a chip and associated parts is insightful before you start positioning parts in the pcb window. And if you start to get stuck solving some routing problem, take a break and come back to it tomorrow. Your brain does more background processing than you realize.
</random_thoughts>
My PCBs are small, and used for audio. For example, I have one board that contains 8 DIP relays… so they get lined up on one side of the board in a way that lets me have nice short tracks out to connectors, placed at the edge of the PCB. Then I have things like USB sockets or USB daughter-boards, then need to be by a different edge of the board. After that, I know in my mind what’s going to need to be around the small number of ICs, so I get these roughly in place, and work out how I can place the (NON-SMT) resistors & capacitors.
If I have a dual or quad component (eg an op-amp) then I may spot during the layout that swapping them around make the board layout simpler, so I go back to the schematic, and make those changes, then back to the PCB.
For some specific circuits, layout can be crucial, so you need to understand the requirements.
Having placed the components (if you are not going beyond 2 layers) then you need to think about how you intend the distribute the power… that may affect the component placement (for example, op-amps typically need +ve and -ve to the chip, so that’s two reasonably-sized tracks, and capacitors adjacent)
The image shows a 4" x 4" PCB, RCA phonos at the bottom. Power in top left, 5v to +/-12v DC converter top middle, the dual op-amps in the middle. This is a really trivial audio circuit, but you can see that I don’t believe in thin PCB tracks! Oh, you’ll see that I have TWO grounds: the small one at the top is the one related to the incoming 5v, the lower one is isolated (via that DC:DC converter) and is an “analogue ground”.
I love putting Power LEDs on my boards. You don’t have to fit them, but (especially when doing initial testing) gives you a feel-good that yes, you DO have incoming power!
Thanks everyone. That’s all really useful input.
Critique of my first board would be appreciated.
For reference, it’s single sided, THT, and an audio amp (not my design) that I plan to fabricated with CNC.
With hindsight, I could have placed the components closer, but I hadn’t figured out the significance of the fabrication layer and was making room for that text. (The fab layer is hidden on this screenshot.)
Schematic?
You probably should go with track through C9 like you go through C10.
From Pot1 center point I would go directly down jumping with C3 over the track.
If U1 is an LM386 it will benefit from a decoupling capacitor (C11?) right next to pin 6. The LM386 is prone to motor-boating without it.
It appears Pot3 is intended to vary the gain of the LM386? There is usually a 10uF or so capacitor in series with the resistive elements (R16, Pot3) so that only the AC signal is adjusted.
If U1 is something else then ignore.
Speculative guesses these are.
Have you made any test runs with your CNC machine?
Sometimes milling will tear the copper. Are your pads big enough to survive possible edge damage?
Maybe try a test run on a scrap board with a couple of U1, Qs, small electro. type footprints and pads with thermal reliefs, to make sure the results for your Amp. board will be reasonable?
Not a bad looking layout. Maybe bigger pads as @jmk mentioned. The TO-92 pads can be spread and made larger (spread the leads). Schematic would be useful. Is this an effects pedal? Are those neutrik jacks on upper left?
I am guessing that bottom right is a 9V battery holder and bottom left is a coaxial dc jack that appears to point toward the inside of the board, not the outside. The ground plane is connecting to what? Are you splitting the supply?
@idris Not knowing your experience with CNC-Milling a PCB, I post two links YouTube and Kicad-Post only to show that I Mill large Pads and wider Tracks to accommodate Milling ‘Hysteresis’ that can result in narrower/wider Tracks and Pads.
The 1st Video was done on a low-cost CNC as a Demo. Pads get milled at around 2-minutes into the First Video (Video also contains a view of Milling Parameters/Info at about 1-Minute)
The second link contains some Tip’s, Video and Results, milled on a different machine…
Thanks all. Really useful feedback.
@Piotr
C9 / C10 - what difference does that make?
@tryitagain
Yes, it’s a LM386. I wondered about a decoupling capacitor, but figured the (open source) circuit’s designer knew better. What do you mean by “motor boating”?
@jmk
No, I’ve not done tests yet, but I was planning to do some once I had a PCB I actually wanted to machine.
What size pads would you recommend as a starting point?
@teletypeguy
Thanks - I was quite pleased with it for a first attempt.
I did think the pads looked perilously close for machining. Is there a way to move pads in the PCB editor (I can’t see a way to drag’n’drop pads like you can labels), or do you have to do it through the footprint eiditor?
It’s just a guitar amp from Electro Smash, not a pedal, and yes, the jacks are Neutriks.
Re the coax power - ha ha - you spotted my deliberate mistake then.
Re the ground plane - ah yes … The battery -ve should be connected to that. The idea is that when there’s nothing plugged into J1, the normaling powers down the circuit. Whilst I like the idea in principal, I can see issues with that and may just swap in a switch. (And I was probably getting a little gung ho when I go to the lower part of the board.)
I’ll need to read up on splitting the power supply - is this about reducing noise?
@BlackCoffee
Usefule videos. Thanks.
I’m familiar with the concept of hysteresis, but I’ve not heard of “milling hysteresis” before. Is this about the direction of rotation wrt linear movement or play in the lead screws etc?
I’ve never milled PCBs. My comments were the result of seeing milled boards. Depending on the cutter, you may need more space between electrolytic and transistor pads, and your thermal reliefs may need altering.
@BlackCoffee is your best guide to milling. He knows stuff, including milling PCBs.
Me neither. I wouldn’t have the space for it here, and I avoided mechanical engineering at uni because they had scary stuff like lathes and mills. Volts I can handle, newtons no thanks.
Besides I can get PCBs made in satanic mills, er, PCB fabs, for very cheap. Shipping for 5 boards these days is as low as $1.50, the boards themselves as cheap as ever. How can the couriers make any money that way? And they arrive within 2 weeks which is good enough for me and the delay makes me check very thoroughly before submission.
Growling sound due to oscillation of the LM386. I note that the PCB layout shown in the provided Electro Smash link shows an electrolytic decoupling/bypass capacitor somewhat close to the LM386 power input pin.
I don’t play guitar but my understanding with these guitar amplifiers is that distortion and other noise is often desirable so perhaps the way you have it is the way it should be.
Typically electrolytic capacitors are used to filter out disturbances/noise from DC supply.
Each track has small inductance. Just simulate how effective is C if you have L from source to it and then L from it to load. Then compare it with the same connection but when you add L in serie with capacitor.
It is the difference between going with tracks through C pin and going near with the track to the side.
Mechanical ‘hysteresis’ is from the ‘Backlash’ - in Milling, it’s when the direction reverses and the travel in a ‘Repeating’ manner does Not fully travel to the exact same ‘value’ (if you want to call it that). It’s commonly due to mechanical ‘Slop’ , ‘Wear’…etc.
My Mill (as does most Mill’s) has inherent ‘Backlash’ of some amount, mine has 0.001 to 0.002 Inch of Backlash.
The ‘setup’ has Controller Adjustment/Compensation for it and determining the Setting-Value is based on measuring travel-direction changes in testing (typically at Maintenance time) .
If one were to Plot this, it would look just like most any other Hysteresis
NOTE:
I stopped adjusting Backlash about 10yrs ago after determining that moderate usage always proved out the Backlash grew to about 0.001inch and that is what I set the Compensation to. Yes, I can tighten it up but it’s not important for my projects.
Screenshot is ‘How to test Backlash’
ADDED:
I use LM386 in some Audio projects (I’m also a Musician and fiddle with Stomp-Boxes…)
There’s nothing wrong with using someone’s design but, for me, when it comes to using Chips/parts/etc, I prefer referring to manufacturing Spec’s and starting with their recommended Circuits and building them (on BreadBoards before doing a PCB).
Here’s link to Spec and you can start at page 12 and review the recommended circuit(s) for various Gains/Distortion/Oscillation…
An old photo of my first LM386 test on BreadBoard… and on PCB. I still use them!
First off, never presume some open-source author knows what they are doing. There is a lot of shitty advice out there from self-proclaimed experts who are a product of the look-at-me, I-know-everything, selfie generation. I would put a 10uF and 0.1uF bypass at the chip to ensure clean supply.
Yes, connect your ground plane to batt negative. I don’t see a power switch – it looks like plugging an adapter into the coax jack disconnects the battery, like most of the 9V-center-negative stomp box designs, but no other switch to disconnect battery? I think I have seen neutriks with extra switches that may disconnect power when guitar is unplugged.
Split supply does not apply here as your circuit is designed for single supply (I presume your schematic is like the one in the link you provided). An interesting looking circuit – I have always liked JFETs.
Splitting supply is when you want to run opamps that need pos/neg rails instead of single-supply opamps. With a single supply (eg: 0 to 9V) you need to create a half-supply reference voltage (not critical voltage but typically half supply eg: 4.5V) to bias the opamp inputs which is as simple as a voltage divider and filter cap. This provides a clean ref voltage but high source impedance (eg: if you use two 10k resistors in the divider the result is the thevenin equiv of a 4.5V source with 5k series impedance). This is perfectly fine for low-power opamp circuitry.
When you need a split supply with a low impedance (need to sink/souce current during operation) you often see the TLE2426 used in designs like the popular cmoy headphone amp:
https://electronics-diy.com/electronic_schematic.php?id=797
https://www.ti.com/document-viewer/lit/html/SSZTAI6
Attached is a little stomp box I did years ago with a base pcb and an effects pcb that plugs into it. A couple of things to note: I used a resistance-multiplier opamp input which provides a 10meg input impedance to not load down the guitar pickups (which can be 100k). This way you don’t have resistor noise of a 10meg resistor as this uses 100k/10k/100-ohm resistors. I didn’t believe this could have 10meg in until I simulated and then built and tested it. Resistance multiplier is an interesting circuit. Probably overkill here but I wanted to try it out.
190-8002-A-pedal-SCHEMATIC.pdf (188.3 KB)
Also note that I want my jack symbols to show all the detail of switches, which contacts are posistioned for tip/ring/sleeve… I hate cryptic schematics that tell you nothing and require you to look parts up to figure out what is going on.
I am using the 9V as the positive rail and using a buck reg configured as an inverter to generate a negative (~-9V) rail. I used the commonly-available 3PDT stomp switch which provides power switching and true bypass. Added an optional 3.5mm line out.
The 100-ohm R112 is important to drive the capacitance of the cable to the guitar amp and not piss off the opamp.
Anyway, fyi.
My general philosophy is that, if someone knows enough to design a circuit, they probably know more about circuit design than I do.
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.