Local power on a Hierarchical sheet

At the moment I’m working on a hierarchical KiCad project.
Main sheet has a microcontroller, sub sheets have a small isolated SMPS, some opto couplers and circuitry behind it.

As this circuitry gets more elaborate, it would be nice to use local power symbols on such a sub sheet, but in KiCad all power symbols are global. The only option I know is to use local labels, and then draw it in such a way that it mimics a power symbol:

image

It sort of works for the +5V, but it does not work well for the local “GND” connection

There have been similar questions before (see below), but none have a “neat” solution.
Does anyone have a better Idea?

I use several GND symbols.
For example, GND_IN, GND_OUT, GND_Power. They all are global, of course. Not useful if you need some instances of the same hierarchical sheet.

Multiple GND or power symbols does not work for me, because the hierarchical sheet is included 4 times, and each instance has it’s own isolated channel.

i do more ore less like you:
image

Unfortunately I can’t find a solution for v7.0. However, in 7.99 there’s an ingenious way using trickery with sheet variables.

The short version: edit the GND symbol, change the Value to for example GND_${SHEETNAME}. The result in 7.99:

image

The longer version:

Apparently the power symbol handling have been changed for the future v8. In 7.99 it’s possible to use sheet variables in the power symbol and it’s resolved correctly, and just changing the Value field of the symbol in the schematic seems to do the trick. In v7.0 it’s not possible to change the Value field in the schematic, it must be done in the library, and a sheet variable doesn’t seem to work.

Using the automatic variable ${SHEETNAME} is handy, but you can add any variable name to sheet properties, the same field just has to be added to all instances.

3 Likes

Indeed:

And using the sheet name in the power symbol looks like a pretty good option for me (though I probably would like a shorter name). On the other hand, it prevents interpretation mistakes of such power symbols.

On a sidenote. Posting smaller images so they are scaled less is a (small) forum usability optimization. Below I cropped your screenshot a bit.

My problems with taking and attaching screenshots started when I changed to UltraHD from FullHD resolution, sorry for that, I haven’t found a nice way to scale them.

There is no need to scale them yourself. The forum software scales them (and shows original when you click on it).

But the forum software always scales them back to less then 900 pixels, and when it scales less, small texts remain much more visible. For comparison. In my cropped image I can read the net names, while in your screenshot, I have to zoom in on the picture to see them.

Related:
Sometimes users post 3600 pixels wide pictures. when I still had a small 24" monitor those pictures were difficult to view when they had small details. Now I have a 107cm monitor :slight_smile:

(If this image thing continues, I’ll split it off).

The goal of the exercise is unclear. Just convenient naming? Some later reuse? Clarity on schematic?

If all of the power labels will be tied together, then what is the point of unique names. Global is the correct answer.

If you need isolated power or gnd, there will be a schematic of their interconnect where you can define unique labels. The labels could be global but only used locally.

I’ve done a lot of work on multichannel digital and redundant analog avionics.

In my case that.

(plus some useless text to get to the count)

it works also for sheetnumber so shorter name it is.
I think is a bit more ‘dangerous’ since you have less control on page number than sheet names but i think i can live with it

1 Like

Be careful with pagenumber ${#}, because kicad doesn’t prevent you from using the same pagenumber for different sheets.

1 Like

I’m a bit apprehensive of adding just a number. I think I’d rather live with the longer, but unambiguous names.
But on the other side, my intention is to use it only for power nets, and those (should) have a power output pin, and KiCad will complain if those get connected accidentally.

When I create power symbols I found myself copy-pasting the already placed ones. You could solve that ‘too-long-name’ thingy by simply doing this:

Now you can have Identical power symbols in all sheets, even if they belong to a different net. :stuck_out_tongue:

I decided to go full hierarchial label mode. It is not pritty, but it is functional

When using hierarchial labels I don’t want to use global labels at all. I use those global labels in my main sheet to indicate who has which power lines. And I sometimes draw the actual lines for some clarity.

This is my cup of tea untill I find one I like better.

Having said that I would love me a local power label. Instead of having 10 hierarchial ground labels I would love to have use ‘normal’ ones and a single link to a hierarchial label. (which currently trips red flags for the ERC)

Regards :tumbler_glass:

Bas

I do not really understand what you did with that power symbol.

I think you mean a local power Symbol. And yes, I think I agree that having local power symbols is the only real solution.

For me, the answer is also partly academic. The schematic looks pretty clean and simple at the moment. The main sheet has a regular GND and +5V power supply, and on it are a few instances of a hierarchical sheet which just has 3 hierarchical pins:
image

.

And then, on the hierarchical sheet, an on/off switch powered by the global +5V & GND, then an B0505 1Watt SMPS module, some filtering with a capacitance multiplier and a cheap HX711 module. (Schematic is not finished yet, so don’t bother with details).
Below that 2 opto couplers to get the data out of the module.

Working with only local labels for the isolated power works for now, but I have plans for more elaborate isolated modules later, and it would be nice to have a better solution then.

I unchecked the box ‘visable’ to removed the GND lettres.

(Schematic is not finished yet, so don’t bother with details)

I don’t even pay attention to the label’s shape, whether it is input or output :see_no_evil:

I see, thanks for the clarification.
But It’s not a direction I will go in.
Power symbols in KiCad are quite a mess, and I was very pleased that KiCad V8 is (Finally!) going to have editable net names for power symbols. It’s one of the (ever fewer and smaller) remaining eye sores.

From what I remember, the net name of a power symbol is derived from the pin name and not from the symbol name, but there are also special conditions such as visibility of things that determines if KiCad accepts a power symbol as a valid power symbol. And this may or may not have changed over all the KiCad versions I have used. For me personally, there is only one solution, and that is to not edit the existing power symbols in any way.

I’ve concluded there is no real solution at the moment (That would be local power symbols). It’s all variants of compromises.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.