Footprint with optional sections?

I hereby certify that I am not simply asking someone else to design a footprint for me.

Is there a feature in Kicad footprints that allows sections of the footprint to be enabled or disabled? Preferably depending on whether those pins are or are not used on the schematic (appear in the netlist), or otherwise manually?

Here’s a use case (though not the actual case). You’re designing a footprint for an Arduino Nano to sit as a module on a larger host PCB. It has a basic DIP-30 footprint, so those TH pads should appear regardless.

The Nano also has a 6-pin ISP header, which might or might not be populated, and if it is populated on the bottom, it could plug into a corresponding socket in the host board.

Different applications might or might not want to include the ISP socket on the host board. Hence the motivation to be able to turn that part of the footprint on or off.

OK, in that simple case, it’s not too terrible to just create two separate footprints. However, there are boards which have several such “secondary” headers or sets of pins, and footprints for every combination would be tedious to produce and maintain.

So is there some feature that can be used to switch on and off parts of the footprint?

Thanks. Graham

No, not really, I would still create multiple variants of the footprint.

Remember that footprints are text files, so it could be easier to comment out stuff in a text editor or do a search-replace or do something with scripting than manually editing the footprint in the UI.

Thanks Jonathan for your reply. I suspect my fallback is to specify this kind of footprint (and maybe also the symbol, to keep them coordinated) with some Python code, with conspicuous flags to include or exclude sections. But it would have been nicer to deliver actual fully baked footprints to other users, rather than have them fiddle with Python.

Assuming you don’t have hundreds of variants, you could “bake” them with python yourself and put them into a library that you give to your users. The user could then choose the right one. You can assign a footprint to a symbol, so it should work reasonably well.

I think it’s mostly pointless to design lots of variants of a PCB you will probably never use. Make the first version that you want to use, and if you want a different variant for the next project, then modify it as needed.

It is very easy in KiCad to modify a project. That is what KiCad is designed for. An intermediate way is to make a single footprint that has all the options. If that is made public, then simpler variants can easily be made by deleting the unwanted stuff from the schematic and PCB.

Also, (to keep your example of the “arduino” nano:
The Nano itself always has the ISP connector. That project can be distributed in the form of a KiCad template. When the pads for ISP programming are not needed on the PCB, it still does not hurt to just re-use the same footprint, and then not populate the connector. You only loose the area of the pads on the PCB, and that is insignificant. (For projects such a small PCB area would be important, an “arduino nano” would not be used anyway, but instead everything will be space optimized.) For hobby projects it can also be useful to add that connector later, as ideas and goals change.

Maybe some day real support for different variant gets supported by KiCad itself. A first small step is support for named variables, which is already implemented in KiCad-nightly V5.99.

Thanks @paulvdh for your comments.

I think it’s mostly pointless to design lots of variants of a PCB

We’re not discussing variants of a PCB. If you meant variants of a footprint, then we’re not discussing laboriously designing each one; indeed we’re discussing methods to avoid doing that.

It is very easy in KiCad to modify a project.

We’re not discussing modifying a project.

simpler variants can easily be made by deleting the unwanted stuff from the schematic and PCB

You have a method to delete parts of a footprint from the PCB? That would be interesting to hear about.

Nano […] just re-use the same footprint, and then not populate the [ISP] connector.
You only loose the area of the pads

Except that ISP footprint sits right across the end of the DIP footprint, significantly obstructing the path through which you can route out tracks down the middle of the DIP, on both sides of a 2-layer board. And that path is at a premium, because the other end of the Nano holds the USB connector, which would motivate placing that end of the DIP right on the edge of the board. So actually retaining the ISP footprint presents a far greater loss than just the area of the ISP connector.

I only used the Nano as an example that might be familiar. There are all sorts of applications for premanufactured daughter modules in commercial products, so your assertion that it’s not useful to delete unneeded parts of the footprint is rather an over generalization, even if it was true.

I do however appreciate your drawing my attention to named variables. Those are interesting!

Because each fp in a board is a full local copy of the original, you can open each one in the fp editor, change it and save back to the board. Usefulness of this approach is limited if you want to to edit the library fp and update all instances: all local changes are lost.

I have also thought about having optional features. Think about basic and handsolder footprints in the official KiCad SMD Resistor library. Each component is duplicated. Or an MCU footprint with and without thermal pad.

image

This wastes space and makes finding a correct footprint more difficult. Why not have the thermal pad and thermal vias as on/off options?

This would require having named features which can be toggled on/off. Then in the footprint properties UI these could be chosen after the footprint has been added to the board. If the footprint was updated from the library the choices would be kept.

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