My GND net name gets eaten by another net name on the PCB

As far as I know there is no “mechanism of precedence” of naming a net when multiple labels are assigned to a single net. KiCad just picks one of the names. It is possible there is some correlation with drawing order, or the order in which the labels appear in the schematic file, but it’s not something you can rely on.

I have read that here on the forum (and partially stackexchange) where people asked a similar question.

About your second question: I mean, I have to give it some name, right? Otherwise how can I draw a schematic? If I want to add a resistor or other component to that opamp pin, how would I ever locate it when it’s connected straight to ground on the connections sheet?

I name all ground connections simply GND. Some Cad packages have different symbols/names for different groundings. Like chassis ground and so on. I don’t know about Kicad. One GND is enough.

If you have one board, all ground connections can be common. It is your job to route or design tracks well.
If you have more than one board, there is even less problems.

Is this something to do with hierachical SCH sheets. I had problems with them, but that is a KiCad problem or bug.

Thank you for your thoughts but this doesn’t help at all. I am looking for a way to read ‘GND’ for my ground connection and am either facing a bug or undocumented naming algorithm.

I am explicitly not looking for layouting or project management advice, thank you.

and am either facing a bug or undocumented naming algorithm

no bug, like paul said it’s the internal automated naming algorithm which chooses the lastly used global netname (and the power-symbols like GND behave like global labels)

Thanks for that, that’s very helpful. Did you manage to find the “better and more user-friendly way in the user manual”? I couldn’t, and I’m not 100% sure I understand the post correctly.

So, essentially, there is no way to have my ground net called ‘GND’ as soon as I directly connect a global label to it?

//edit:
Well, actually found this:

But that doesn’t seem to check out for me. Running KiCad 6.0.9 by the way.

Can you explain what “lastly” means in this context?

The other answer from paulvdh just states that “KiCad just picks one of the names” and “It is possible there is some correlation with drawing order […] but it’s not something you can rely on”. I wouldn’t describe myself as a programmer per se but I’m quite sure there is a deterministic function inside KiCad that chooses a net name in the same manner every time. KiCad won’t roll the dice everytime it picks a net name, right?

Can you explain what “lastly” means in this context?

I will try. I think the net-naming algorithm goes trough all connected nets/netlabels, collect all netlabel-strings and chooses in the end one of the available labels that is finally used for the netlist. (keep in mind I’m no developer - it’s only my imagination).

Looking to your screenshot (I remember - it’s from the kicad schematic help/documentation) you are possible right with “bug” - according to the description the power-port-priority should be higher than a normal label.

I didn’t try hard to understand the problem, but to me this looks quite clear. There’s a certain order between different kinds of labels. Between labels in the same level (e.g. two local labels, or two power pins, or…) the alphabetical order is decisive. “If there are multiple conflicting (meaning, same priority) drivers on a net, the “lowest” one alphabetically will win” as @craftyjon says in the post linked to above.

In the list by Jon global label is the most “powerful” so it overrides all other names. In the original post OP_AMP_+_2 is a global label.

In this case there are two solutions if you want to use name GND: 1. Take off the global labels and use the GND symbol. 2. Change the global label name to something else, probably adding _ would be enough, and add a new global label named GND to that net somewhere. Number 2 should work because the “lower” one in alphabetical order wins.

I didn’t try hard to understand the problem

My current understanding of the “problem”: a discrepancy between:

  • the kicad documentation (see screenshot from @osterchrisi) which says power port==highest priority
  • and the description from Jon which says global label == highest priority
1 Like

Yes, I see. This really looks like a bug in the documentation. Or maybe in the software after all… :smile:

1 Like

Correct. I find it very confusing.

Just to get another data point, I swapped GND for +12V


In this case the ‘+12V’ net name does also get changed to 'OP_AMP_+_2 ’ in PCBnew. So, maybe it isn’t a bug after all, as this is at least consistent behaviour across two tested power ports now.

Just on a side not, I did find a workaround now by simply adding a 0R resistor between the two nets. But yet the question remains if this is a bug, a discrepancy between documentation and reality or just a strange choice of what has highest priority in deciding a net name.

Just tried that but that doesn’t help. Adding the net-tie component between the two nets does separate the two nets for me. I think that might be the purpose of that symbol, although I’m not 100% sure.

Yes one use of a net-tie is to permit different “net labels” for what is essentially the same physical net

They can be used where part of a net requires different constraints and is critical for Kelvin connection points

2 Likes

I don’t understand your problem (I know it is probably my problem that I don’t understand).
If you have something connected directly to GND and want to put resistor there you move GND symbol a little and put resistor between that something and that GND symbol.
Probably you have some different basic assumptions how your schematic have to look than I.

Yes, I think you don’t understand because you are referring to an answer of mine to a suggestion of yours that doesn’t solve my problem.

My initial and still relevant problem/question is: How do I get KiCad to call my GND net actually ‘GND’ and not whatever is currently connected to it?

Imagine you are layouting a board and you look for your GND plane or ground net because some other engineer asks you a question. Maybe even better, imagine this happens in say 6 years from now. You don’t find GND because it’s not called that name. So then you go into your schematic editor and either are lucky enough to simply remember what was going on (unlikely) or go through every single schematic page and hope to find that one connection with a global label that re-named your GND net.

I can’t make friends with the idea that this is the supposed workflow.

I think that if you connect a global label ‘GND’ you should obtain what you want according to the net priority explained in the attached post.

I tried it and it doesn’t work. Net is still called ‘OP_AMP_+_2’ after adding another global label with the name ‘GND’. Also tried to connect a separate global label called ‘GND’ to GND first, then connect that global label to the other global label and it’s still never called ‘GND’.

Again, I think it makes no sense that any net can override power net names. Who wants that? If you look for ‘VCC’, ‘VDD’, ‘GND’ or whatever have you, you want to find that net on the PCB. And not figure out first which other nets are connected to GND. It’s just strange. And the KICad 6 documentation suggests it shouldn’t be that way.

I’ll open a bug for this now as it seems there is no solution and it’s not clear if it IS a bug or wrong documentation.