Struggling to work around Variants

At my day job we have some PCBAs that were designed in Solidworks PCB (Altium derivative) with variants. The simplest of which is a small PCB with just one component, that being a 1 x 2 vertical pin header.

The Variant is an assembly thing, the header is soldered from one side or the other depending on the Variant. Each Variant has a unique PCBA number so it can be detailed in mechanical GA (General Assembly) drawings.

So I’m trying to reproduce this in KiCad, what I’d like to end up with is:

  • two sets of documents, one set for each variant, containing; schematic, BOM, jpg of 3D image of the PCBA

I’ve used KiBOM to sort the BOMs . . . the rest is proving to be very messy.

I can use the settings in the schematic editor to Exclude from board or Do not populate but these are permanent changes when applied to the layout, if I later until the Do not populate and update the layout I have to re-position the component and silk etc. and make sure I have it placed in the correct position for it to work mechanically.

So I’ve given up on that approach . . . now I’m looking at having both components on the board and simply hiding the 3D model from the component that should not be fitted so I can produce my 3D jpg images.

For the schematics I’ll temporarily (without updating the layout) set the component to Do not populate and export my schematic to PDF.

This all seems a bit messy . . . I know KiCad doesn’t currently do variants so anything I try to do is going to be a workaround . . . I was just hoping there might be a better more logical way.

Any suggestions ?

Maybe you can work with colors or text strings to indicate your variants on the schematic. For the BOM you could write a script to remove parts depending on the variant. There is no scripting in the Schematic Editor yet, so that is not an option.

I have perhaps 5 ways of doing this kind of thing, going back to v4.

As versions changed and affected how I do it, I dialed it down to what’s simplest and, thus far, consistent with recent version changes.

I do like my previous approaches but, now (with v6 and v7) I seem to gravitate to this approach - perhaps useful for you…

One Schematic, one PCB - both having their desired schematic/circuit and layouts.

For your desire to have Pin/Connections on different PCB side’s, I simply Edited one Terminal-Block to be on other side of PCB… (no edit of actual footprint needed).

Maybe you can imagine doing similar. For documentation, just screen-capture as desired. Could also use different schem sheets and/or temporarily deleting (and re-annotating) or move off-screen the undesired… BOM’s can be individualized by temporarily deleting the undesired circuit or by editing the CSV. In fact, using Libre (others), it’s easy to build a Macro to do it on a repeatable basis…

I’m not sure what my PCB fabricator will make of the Gerbers containing both PCBs when I actually want them to make just one, it may well give them issues when panelizing them also.

The schematic is easy, I can just turn on and off the component(s) in question using Do not populate . . . life is made harder if I update the PCB with a component set to Do not populate as it’s position on the PCB is “forgotten”. OK, re-positioning one component is not a big deal but risk increases as the number of components increases. I guess I will just have to make getting the 3D images my last step . . . .

It’s not very complicated…
For the Gerbers, just Window-Box Select what you don’t want (say, PCB #2) (copy it just to ensure you can get it back), Delete it, export the Gerbers, then, Undo the Delete (or, paste the copied one). Now, you got Gerber for PCB#1.

Do similar process for PCB#2. If you don’t Save the file then it will remain as originally was.
At this point, it’s basically typical document editing stuff as if having deleted a paragraph of text then printing the document then, undoing the deleted text.

Cleanliness/organization of your PCB parts can aid in simplifying selections…

There are features coming in Version 8 that will make things easier for me . . . “Do not populate” will be able to cause the component not to be included in position files (Preferences setting) and this in turn will mean it can be automatically excluded from the 3D view . . .

I use git branches to do this, however it means that you have effectively two pcba even if it is easier to switch between them.

I am using KiBot for automating all my outputs. It has support for variants, maybe it can suit your needs.
My workflow is like this:

  • in the schematic I add special field ‘variant’ and through it I can control which variant I want to have populated
  • when running KiBot, I specify the variant that I want.

Sorry, I did not have KiCad on hand yesterday, here is the more detailed description.

I have project with either AVRDB (64 pins) or AVRDD (20 pins):


They both have a field named config:

image

So I have three variants: Default (AVRDB), DD20 (AVRDD), Mix (Both).
And the board looks like this (both footprints combined):

And now I have KiBot set up so that it knows the two nondefault variants. I will not show the config here as I am using a lot of config preprocessing and it would not be clear enough - the config gets constructed from various sources. However I found important to include REMOVE_SOLDERMASK_FOR_DNP: true option.

When I run the automation with DD20 variant, it will pass it to KiBot and it will render all outputs for the specific variant.
Schematic:


3D:
image
And gerbers:
image

1 Like

I looked at KiBot but unfortunately . . .

“KiBot main target is Linux,” I’m on Windows and not going to mess with emulation tools . . . not sure our IT dept would be keen either.

But thank you for your replies and explanation. :slight_smile:

Kibot also runs in docker - I am using it via docker even though it runs on a Linux box. I do my work on Windows but the automation runs on Linux.

That sounds like sad IT department. Docker helps to isolate the “weird” and unusual stuff to separate containers so it makes IT people lives easier… Of course it may be better to waste your time on manually doing stuff that could be automated…

1 Like

When I get some time I’ll take a look, after all the whole point of this thread was to try and make my life easier. :wink:

1 Like

The automation configuration may take some time but I prefer to use my time doing that than on repetitive tasks. And if there are more people in your company that could benefit from your work then even better.

1 Like

:+1:

That is one of the reasons for trying to get a process for this, so I can document it and roll it out to others within our company.

I spent a little time on Friday and installed Docker (for Windows) and even managed to “pull” a container image, Docker’s analysis suggests there are some issues with this image, not sure if that’s why it’s not running or I’m just misunderstanding . . .

. . . I can’t spare it more time right now and I’m not looking for help really, just posting an update to show I’m trying :wink: