Ok, I have this schematic. The mosfet things on the right al share the same schematic. I made 8 ‘objects’ with this schematic. (side note, is object the right word for this? Or should I be saying instances or … ?)
I obviously would prefer to see GPIO1 <> GPIO16 instead of 8x Coil_A and 8x Coil_B.
I dunno how Kicad works under the hood. I get that Kicad has to pick atleast one of the two names.
What I would do, is to check if there is more than object/instance sharing a schematic and not use those netnames.
An other option I can think of is to count the amount of hierarchiel labels and use the names of the sheet which has the most labels. Exceptions aside, the sheet carrying the uController circuit would propably ‘win’ in most cases. But if that is a good idea I don’t know. I can imagine if you have 4 servo’s, 3 switches, and 2 sensors, that you would prefer those names instead of meaningless GPIO numbers.
I can also think of a adding a priority number to sheets to decide who’s label names should be used? Though I can think of drawbacks of this as well.
Or perhaps a manual override per net, something like this?
Perhaps an automatic generated pre- or postfix? Coil_A_1, Coil_A_2 etc.
Can we get any of the above in Kicad 8 perhaps?
EDIT:
Forgot to mention, my current solution exists out of using regular labels next to the hierarchial ones
I don’t quite understand. You suggested other solutions which would need changes in KiCad and wouldn’t necessarily be easy to use and obvious to those who read the schematic – and which could have “drawbacks” as you admit – but an existing solution which is how KiCad logically works (explicitly added label overrides implicitly chosen name) is a “workaround”?
Regarding the “choice” of name, I believe a given net with multiple labels of the same type (all hierarchical in your case) will receive the lowest alphabetical ordered net name. In your case all of the Coil labels are earlier in the alphabet than the GPIO names, so they get selected. The way around that is to use unique regular labels on the root sheet between sheet instances, as you discovered, or unique global labels (not great practice imo).
Why do we add labels? The main reason is to connect 2 items without drawing a long obfuscating wire. A 2nd reason is to add readability and a 3rd reason is to make routing slightly easier. (sure we have airwires for that, but a good net name does not hurt either)
In my particular example. I have very short lines drawn between the schematic sheets. Therefor a 3rd label would not really increase readability. Nor do I need a label to connect the sheets. That is why I did not a regular label in the first place.
and which could have “drawbacks” as you admit
The drawbacks of my ideas that I thought of were applicale for two out of five suggested ideas. That is why list not 1 but 5 ideas and discuss them here with the meager hope that atleast one of them could perhaps be a contribution on a good day .
For the idea to manually assign a net name I could not think of any drawbacks. As it would be completely optional to use.
I personally find it a (minor) drawback that Kicad generates identical net names. I mean, what goods will that ever bring? Therfor a unique generated postfix like Coil_A_1 and a Coil_A_2 or something like that does not sound like a terribly bad idea, does it?