Placement of parts when starting routing

Hello!

Something on my wish list for years, even with other softwares.
When generating the PCB from the schametic, we get a bunch of components placed with no special order, and after that it gets really hard to find which part goes where.
Is there a piece of soft, possibly a plugin that would enhance that?
Example: let’s suppose I have somewhere a filter (op amp, its decoupling capacitor, and its filtering caps, resistors). It would be very handy to have these parts also grouped when switching to the PCB. Would it be possible to have placement hints directly from the schematic, and have all the components that are close to each other in the schematic also close to each other in the PCB placement?

Thanks,

Pascal

Kicad right now places components placed grouped by hierarchical sheet. Of course if you do not use that then you do not benefit from it. (If this grouping is not enough to find parts then your schematic might benefit from one more hierarchical layer.)

I seem to remember that there is a long term plan to add an automatic placement optimizer. But that has a few pre requirements before it makes sense to start with its development.

Hello Rene!
I do use sheets, but I didn’t notice data was grouped. Maybe because the sheets are quite lare (I have a 208-pin STM32 on one of them, then 12 analog input channels on another. So does this meen I should make one little sheet per channel to have the data separated?

I seem to remember that there is a long term plan to add an automatic placement optimizer. But that has a few pre requirements before it makes sense to start with its development.

OK, anyway the whole thing would make sense. Taking again the example of op amps, it would make sense to place it directly with its decoupling cap, then it would also make sense to place directly the resistors and caps around it. And move everything together as a block except if ungrouped. Maybe by introducing groups in the schematic. Select a few components and say it belongs to group xx which would be reflected to the PCB.

Thanks,

Pascal

You need one sheet file but one hierarchical sheet box for each channel. Draw one channel in one hierarchical sheet. In the main level duplicate the box as many times as needed.

1 Like

Disclaimer: Below the view of object oriented design. Can be applied to an extend to electronics design (Is heavily used in SoC design already). Will however require learning a new design methodology to fully understand its power.


Yes this is how abstraction works. I would suggest to no longer see hierarchical sheets as physical sheets of paper but as an object with a defined interface. (Interface is defined by the hierarchical pins) The highest level is similar to the application level abstraction as defined in software engineering. In SoC design this is the system level.

This level instantiates the objects of the next lower level of abstraction and connects them (in SoC design by using buses. In software design by using connection classes. In KiCad this is not yet really always viable so we are typically forced to use wires. The new powerful bus system that will come with v6 will allow an abstraction here as well.)

Ideally every object should be defined in a way that you can design it without needing to know anything about any other other object (no knowledge dependencies to other objects than the ones instantiated in this object.)

Every further hierarchical sheet can then again instantiate further objects of a lower abstraction. Continue this until the single object instantiated can be understood with a single glance. (Or whatever you want your cutoff to be)

To make full use of this you should refrain from the use of global labels (This includes power symbols!) as they break several design suggestions (mainly the knowledge dependency restriction. After all you would need to know which global labels are used in all other sheets to be able to connect to them. Hierarchical pins allow for a separation of knowledge.)


One restriction of kicad to keep in mind is that there is no way to have different values or any other field in different instances of the same subsheet. If there would be a way to define sheet parameters this would be even more powerful. (Right now you might need to duplicate a sheet instead of instantiating it a second time just to be able to change the value of a single resistor.)

Because you already talk about object oriented design we could also talk about kind of “inheritance”. Take the common features, make it a subsheet. Then make a sheet which includes this subsheet but adds the variable component. Then use that middle-level sheet in main level.

This is heavy, it would be nice to have a feature you described.

1 Like

Disclaimer: My analogy is definitely not perfect but i think you will get the point.
Disclaimer 2: I am not really extremely experienced with object oriented design. (I feel more at home closer to hardware -> Mostly work in c and assembler not c++ or even higher languages.) I get the basics of object oriented design but as soon as you start to talk about factories and other design patterns i will no longer be able to follow you.

What you describe is not really inheritance. It is more like making a new class and giving it a member (or is it a parameter?) for the “parent” class and then connecting a new object to part of its interface. Therefor reducing the interface to the outside world. (reducing the interface is kind of the opposite of a typical inheritance structure.)

Inheritance would require overwriting of members. This means i would like to be able to have the resistor inside the parent object but be able to overwrite some of its parameters in a child. (So i feel my proposal is nearer to inheritance than what you described.)

1 Like

(I did not read the whole thread)

There are a lot of “side projects” around kicad. Some are plugins, others are stand alone projects.
There is a project (probably plugin script) that places all footprints on a PCB with the same relative position as the symbols are on the schematic.

Alternatively, I 've made extensive use of the " T" shortcut.
Put the schematic on your 2nd monitor, or print it on paper, then press t and type the reference value of a component you want to place on the PCB.
This attaches that footprint to the cursor without annoying you with panning or zooming.

Hello!
Very good tip. Thanks a lot!
Pascal

One thing that is on my list (but that list is I believe now legendary) is a “get the component on the other end of this ratsnest line” hotkey/button. This would only move parts that are outside the board area, and bring them to the mouse pointer, so you don’t have to zoom out and find them in order to fetch parts.

1 Like

We seem to have two topics here (which is OK with me)

Initial placement of components. When working with a design house some years I recall a capability to “explode” the parts. This would not be a huge time saver if it were a Kicad capability but was most convenient.

With Object oriented schematic “modules”. Eventually these parts would come together on a PCB. How would the component numbering be implemented? Keeping in mind in most PCB’s component ref designation space is limited.

SWE here. You are definitely right, what eelik described is more akin to composition than inheritance. The top level sheet has both a subsheet and an additional resistor. It doesn’t extend the subsheet.

The refdefs are already handled with multiple instantiating sheets (the only thing that will differ between different instances.)

When using the annotation tool you can even select to give refdefs of a sheet a common “prefix” (so have them R100, R101 for resistors on the first sheet and R200, R202, … on the second sheet and so on.)

There was a feature request for it. Wayne sadly converted it to opinion as he rightly noticed that it would be a paradigm shift. (kind of telling us: Would be nice but does not fit into kicad.)
Right now hierarchical sheets are kind of boring. (But still powerful) That single feature request would have made it very powerful.

Maybe a few of you could add your voice over there. Such that we can at least get this to be an option for some far future.

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