Approaching PCB track routing for a newbie

Cheers
Back on Kicad now and I have created the Gnd plane.
But it is not obvious to me how to connect connections from the top copper tracks through to the ground plane using a via. Creating a via does not connect it to the ground plane but keeps the via and subsequent bottom layer track isolated
Edit - this was a misunderstanding of how the router tool works. After selecting and creating the via I had expected the via to automatically connect to the ground plane. Instead I now realise it requires another click onto one of the other device Gnd pins at which point the bottom layer track ‘dissapears’ and becomes part of the bottom plane copper.

There are some easy ways to place vias to ground. One option is to start a track at the pad and press the “v” key. The other is to simply place a free via where you want it but make sure that the ground fill already exist. You might have to calculate fills first (press “b” key I think).

I’d route ground last, if necessary. I generally use ground fills on both the top and bottom layer, so that’s something to not worry about. As the last step just spam a bunch of vias to connect any islands and top and bottom planes together (this is called via stitching and there are also plug-ins to automate that, but I recommend doing it manually).

I’d go in roughly this order:

  • place connectors and other fixed components at the correct position
  • rough placement for other components
  • create thick direct tracks for high current VCC lines (and maybe GND to reserve a return path, although it’s less critical if you use both layers as GND fill).
  • route components where layout is important, for example high-speed ICs, power regulators and their caps. Adjust placement as necessary.
  • route data lines
  • route other random connections
  • adjust placements as necessary. Use existing components/resistors, vias to other layers and maybe new zero ohm resistors as last resort to jump tracks if necessary. Try to keep the bottom GND layer mostly intact but a few (as short as possible traces) are okay. If you run into problems, you might want to use a 4 layer board instead. (but for your original circuit a two-layer board is definitely sufficient)
  • place ground vias/connection, make sure fills have a nice shape and are connected sufficiently
  • optimize, optimize, optimize
2 Likes


This is my 2nd attempt. Still much more challenging than I’d expected.

1 Like

Some queries:

  1. How can I assign different NetClasses to different segment of the same net? For example here the track that carries the motor current is wide so that it comfortably carries a few amps but the track that offshoots and provides the voltage drop across R2 to the op amp carries very little current so I have kept it thin. To do this I changed the Netclass before I routed the thinner segments of the track.

  2. When I run the DRC I subsequently check all the warnings or errors, fix them or dismiss them. Often I want the dismissed errors to be displayed again, but I can’t figure out how to reset the checker so that the dismissed items come back.

This is already much better. Some suggestions:

  • Flip R1 by 180° and move it a little bit to the right, so it can directly sit between the existing tracks
  • Eliminate the longer sections of tracks on the backside in the top right. Only route them in short section where they need to jump over the top track.
  • The via in the top right is unnecessary as you can route to J5 on the front side. (and you can take a shorter route going below J5)
  • The component right of U3 looks like if would sit more efficiently on the left side of it.

How can I assign different NetClasses to different segment of the same net?

You can’t really. One option is net ties, but they’re implemented relatively crappy in current KiCad versions. Just manually changing track width is usually easier.

but I can’t figure out how to reset the checker so that the dismissed items come back.

There should a an ignored items tab I think (from memory)


Thanks Jonathan

What about:
Popr

And if you go with U4 pin 13 to the left and not to the right one of my green lines will be simpler.

Thanks Piotr - you can spot a route much easier than me!

Some quick suggestions. it also looks like you can optimize routing by rotating both U4 and the component below U2 counterclockwise 90 deg. Is the position of J4 fixed? You might be able to move it slightly away to make the connections between U4 and J5 less awkward. Otherwise it might be better to simply route there on the backside of the board instead of going huge circles on the top right.

Also i suggest also adding a GND fill on the front side if not already there and some more stitching vias.

Maybe R7 and two components near it, and the three-legged under U2, could be moved above U2 (and U2 downwards). And then some rotations applied, perhaps.

Example way of thinking: U3 is being pulled to J4 and J5 by 3 wires and to J1 and J2 by only 2 wires. That suggest that if it will be placed more north then you will have shorter tracks in total.

Simple answer: You can’t. A net can only be in a single net class at a time.
You also should not take the feedback from halfway of the track like that, because PCB tracks do have resistance too. The proper way to do it in KiCad is to split the nets in the schematic. For this you place “net tie” symbols in the feedback tracks, and then you place the net tie footprints directly on the pads of the shunt resistors. But just assigning a thinner track width to the feedback wires is a bit simpler and also works, but you should still take the feedback directly (or very close) from the pads of the shunt resistors. I would also use “differential pair” routing for the sense wires. This keeps those wires close together and reduces noise pick up.

I had to have a look at the datasheet of the LT1637 to see it’s an opamp (although a bit special one). Using an opamp symbols (as they also do in the datasheet) makes it easier to understand what the circuit does.

I am also missing some decoupling capacitors. I would add a 100nF capacitor to both the MCP3008 and each of the opamps, and a buffer capacitor. There is no voltage regulator on this PCB, and that means that power comes from (long?) wires and you do not want high frequency content through those wires and adding a capacitor (10uF to 100uF or so) between VCC and GND.

I would place U1 more to the north east of the PCB to keep it away from high currents through the GND plane between the motor connectors. The dog-bone on U1 pin 2 is also in a bit unfortunate place because currents in the GND plane have to go around it.

How high is your motor current? The circuit seems to be dimensioned for 3A to 5A, and the track widht for the motor current seems usable, but still a bit thin and you have plenty of room to make these tracks wider.

1 Like


Perhaps this should have a new thread.
Should there be separate ground planes for the Analog and Digital sections for this board? It is a simple circuit and has one ground plane. I really don’t want to overcomplicate it if unnecessary.

Maximum current around 3A per servo motor and there are 2 of them.

J4 and J5 are GPIO busses (J5 for a RPi, J4 for a similar SBC).

There is no need for using separate grounds. That’s a mostly deprecated technique from 30 years ago. But you do have to manage how currents flow though your GND plane and how that affects your circuit. DC currents take the path of least resistance, but already at about a kHz the inductance of the whole loop between an “outgoing” current and it’s return path become the dominant factor.

Ideally you limit high currents and noisy circuits (such as an SMPS) to a corner of the PCB, and put sensitive parts on the opposite corner. Right now one of your current sense opamps is right above the return current (straight) path of the motor current on one of your motors, and that is a bad place for it to be.

2 Likes

Thanks Paul! Glad I don’t need to deal with separate grounds. Will have a look into your other suggestions.

Piotr

I meant to ask - how can you hide the air bridges to the GND nets? You said it was possible in V6.

And the power tracks and the colour - nice idea - I expect I can find that setting.

Paul
Your suggestion of moving U1 is a little daunting - is there an alternative? What if I were to position it as far north as I can rather than across the other Eastern side of the board? That would take considerable less re-routing which for me is significant.

Doing such things is not too bad, especially on a PCB where everything is as widely spaced apart as on your PCB. Just moving it 20mm to the north as you suggest is probably also enough.

But “splitting the GND plane” is also a possibility.
The easiest way to do this is to click on the edge of the zone to select it, then right click and add a few corners and then make a cutout as shown in:

this separates the GND return current to the power connector enough.

But other things such as the place where you connect the feedback wires to the shunt resistors are much more important.

I’m not sure what do you mean saying ‘air bridges’. I was saying about rats nest lines showing connections to be done. I have installed V6 yesterday so can check it. At panel at right side you have ‘Nets’ tab and there you can hide each net and set its color.
Edit:
I noticed there also Net Classes (I just opened my project where I needed to have one net class except default). So it looks you can change color for all nets in net class. That suggests to define power supply net class.
I didn’t checked anything of that as I just opened finished project.

If you plan to have GND planes at both sides the easiest way is to add keepout area (in V5) and rule area (in V6).

Thanks guys
Simple one - is there a way to elect a track and change its width including all the segments (select all with u)? Google hasn’t helped me.