Need advice for footprints

Hi,
I’m a bit confused about how to use layers when designing footprints for modules such as Arduino ProMini, BluePill, and other things like DC2DC converters, OLEDs, LCDs, etc.

These modules are made to be soldered using pin headers, or pin headers + pin sockets. Therefore, I use pin header footprints as a starting point. They come with : Silkscreen, Courtyard, and Fabrication layers. The pin headers outline is on the Fab layer.

I read the KLC, and had a look to the “Modules” library. These footprints consider that nothing can live underneath (Courtyard). This is untrue, in particular if pin sockets are used for mounting, and additionnal components are small sized. Therefore I use the headers courtyards.

KLC : “The fabrication layers are used to display the simplified mechanical outline of components on the PCB”. What layer should I use for the module outline ? It seems to me that the Dwgs.User is the one to use, as the module is not really on the PCB (only the pin headers/sockets are).

So, I did this :

  • Silk, Courtyard, Fab : same as pin headers
  • Dwgs.User for module outline

Is this correct ?

KLC : “footprint anchor should be placed at the location of Pin-1” (through hole components). Is this 100% mandatory ? I made all my modules centered at 0,0 not pin 1, and modifying all origins would be a pain (I already created a lot, and resetting the origin of all 3 D models, re-exporting, reconverting in KiCadStepup would be really tedious and time consuming : hundreds considering mounting variants and pin breakouts ! Some need 10-15mn of calculations in FreeCad !). Is all that work really needed for such components in order to get the “KiCad approved label” ? (I’d like to share, the reason why I ask these questions)

FYI, nothing in KLC is mandatory unless you are submitting assets to be included in the provided libraries. For everyone else, I find them a good guideline and if I’m at least close to KLC then my assets won’t stand out as being “odd” when I use them with the provided libraries.

For the module outline, remember the fabrication layer is reference only. Personally I’d probably have the full (and dimensionally accurate) module outline on the fabrication layer, and have outline hints (corner marks, separated line segments around the perimeter, orientation marker, etc.) on the silkscreen layer. Maybe even expecting to iterate the footprint so I don’t overlap any components that are only half under the module with the module’s silkscreen outline hints.

As far as the anchor point, not all modules have a manufacturer defined “pin 1”. Your existing anchor in the center is probably good enough. When you select to move the footprint, if you have the full footprint selected then moving it will be by the anchor point. If you start moving at one of the pads it should move by the pads. This gives you the choice of having your module’s center on grid or the pads on grid.

1 Like

Keep in mind that you can have at PCB more elements defined that way and some of them at top and some at bottom. If you wont to use this outline in any plot/print/export file you will be not able to separately get top and bottom pictures.
I wonted to have (for small elements 0603, 0402) as big rectangle as possible to fit in it the element reference or value. So my first decision was to use CrtYd for it. But I wonted to have in those pictures also the polarity information so I added it to CrtYd. When DRC started to check CrtYd I decided to allow it to do that so I have changed all my CrtYd to be simple rectangles. Because there are really only 3 graphical layers flipping with element (top/bottom) I decided recently to stop using Fab for mechanical dimensions and used it for my as big as possible rectangles with polarity marking.
It is my current state.
If there will be one more flipping layer I will probably get back with actual mechanical drawing to Fab and use that layer for my rectangles.

@SembazuruCDE : problem is for footprint/3Dmodel alignment ; hope I could script such changes in FreeCad (35 wrl and 35 step model variants to be offseted). I first had all my models anchored at pin 1, and suddenly, because it was easier, I re-centered 3 of them (and only 3 but with a total of 35 variants…), at the CAD lowest level, considering that modules are not real through hole components ; that was before I had a second look to the Module library (yesterday !)… I was wrong… The step exported original models take 10-15mn each in KiCadStepup to generale KiCad step and wrl. Even with 4 instances of FreeCad, it takes a while (seems the OS refuses to give more than 3 cores / 6 threads to FreeCad on my 6 cores 12 threads machine, whatever the FreeCad instances count is)

@Piotr : oh yes, I see ! There’s no F/B Dwgs.User ; therefore, Fab/Silk have to be used. Period.

Will stick to Fab layer.

I don’t intend to submit my 3D libs to KiCad for providing them (too soon !). But I want them to be as compliant with the rules as possible (already shared some on GradCad and GitHub, and was about to share some more). There have been hundreds of downloads for 3Dmodels with the wrong origin. If a user wants the origin at pin 1 and moves the footprint, realigning 3D models will be a pain. I must do something… Learn FreeCad scripting features, for example. And guess what… I hate Python ! Maybe OpenSCAD could do it ?

Oh, yeah. @Piotr brings up a good point that I missed. You probably don’t want to use Dwgs.User for footprints because there is only one of those layers. This layer is best for things like overall board dimensions and text notes. The fabrication layers that I referred to are F.Fab and B.Fab. If you design your footprint using F.Silk and F.Fab and then after placing it on the board you move it to the other side of the board (Flip, keyboard shortcut “f”) the F.* layers will be automatically moved to B.* and any texts should be automatically mirrored.

The same guy that wrote the StepUp workbench for FreeCAD (@maui) also wrote the Manipulator workbench. Once you’ve loaded a footprint into FreeCAD using the StepUp WB and then also loaded a step model, you can use the Manipulator WB to align any feature of the step model to any feature of the footprint. For example, aligning rotation of the step model to the footprint, then aligning a pin to centered in a pad’s hole, then aligning the bottom of the step model to the top of the board surface. Then when you export the footprint the step model (and the generated wrl model) will be scaled properly and aligned properly to the footprint no matter the location of the footprint’s anchor point. Unfortunately, I don’t know of a way to automate this for your 35 variants…

I remember seeing a video showing this, but can’t find it quickly. Maybe by me invoking maui, above, he will notice this thread and be kind enough to point you to a video explaining this workflow.

I do not understand the confusion.

You ask:

Right after the sentence:

This looks very clear to me. Put the outline on F.Fab.

Dwgs.User is a layer for users to make notes on, not for library parts. I’d be surprised if any of KiCad’s default libraries puts anything on user layers.

The intention of the courtyard layers is to have the outline of the component plus some margin for automated pick and place machines to have room to place the parts. I think it does not have much meaning for your modules, as it looks like these are hobby oriented and not for P&P machines.

I’d be a bit weary of Piotr’s advice concerning layer use. I’m sure he means well and wants to help, but on the other hand he goes his own way and uses layers in different ways as intended in KiCad’s workflow, and this has put him into trouble before.

I try to imagine why you have “35 variants” look like…
I’m also interested in learning more about FreeCAD. Will you share a representive model, or a link to your github repositories? Maybe I can help a bit with some of the conversions.

Is this you?


(Even if not, i’ll have a look at it anyway)

Edit: Addition.
I can see your intention with all those exports for different connector variants, but you take up a lot of work, with limited use to others.

It would be far more useful to share the KiCad project of the “Blue Pill” itself.
I’ve bought a bunch of those, but with all the clones of the STM32F103C8T6, I have become very weary of buying more of them, and considered drawing my own (euhm, sort of already did that). Then there are also other variants on github such as “STM32surface”, and there are probably some more also on github / gitlab and other sites. Just bumped into: https://stm32-base.org/boards/ for example.

The “Blue Pills” Ive bought were without solderered connectors, which I prefer. Instead of the thick square pins, I’ve soldered in thinner round connectors, so the pill fits in a standard socket. Personally I also prefer to move the programming pins a bit, so they line up on a 0.1" grid for Matrix board use. On this sort of level there are so many variants that it’s not doable to try to make them all. It’s much more usefull to have a decent base (1 variant), share that, and then let others modify it to their own needs or preferences.

@paulvdh : obviously, these files are shared ; but I’m redoing everything.


https://grabcad.com/library/stm32-blackpill-1
https://grabcad.com/library/stm32-bluepill-2

I had to upload the step files to GrabCad, they are too large for GitHub (max 25MB)

Why so much variants ? Imagine a BluePill. It can be mounted on pin headers, or be removable : pin sockets + pin headers. Then, the SWD header : there can be no SWD header (prog. with bootloader), or the SWD port can be broken out to the PCB, and connected to an externally accessible connector for maintenance, upgrade, etc. If it is still accessible on the BluePill, it can be a horizontal or vertical header. There’s even more vaiants for the Arduino ProMini’s I have by hand : programming serial port (+ access to DTR) or not, broken out to board or not, and the A4-A7 pins that can be used or not. This makes a lot of combinations for those modules ! Obviously, I make all possible combinations and footprints…

KLC : “The fabrication layers are used to display the simplified mechanical outline of components" Yes it is clear. But is such a module a component or not, in particular if it does not interfere with the main board components… It is a nearly a philosophic problem…

@SembazuruCDE : I read about that today, on the KiCadStepUp hoempage… But still didn’t experiment with. Anyway, a library should just not be needing for the user to do that work ! It’s up to the library designer to do it. It is easier to do it at the lowest possible CAD level, with an appropriate coordinate system.

I’m currently rebuilding the libraries… I think they will be Ok within 2 days (with Arduino ProMini, chinese “NanHe” pinout). Meanwhile, don’t download…

EDIT : there’s no KiCad STM32 project. The models are made with SW, and the 3D components library I’m building. It is pure CAD. I did not use KiCad, and KiCadStepup was used in order to get KiCad step and wrl compatible files. I mean : there’s no schematics, and no PCB routing. It’s cosmetic (but machanically correct).

EDIT 2 : not all variants will be usefull to others, but thay could be usefull for my projects. So why not ?

@Piotr : it would be fine to have one more pair of F & B user layers

Still don’t understant why the origin at pin 1 with KiCad… But : “dura Lex sed Lex” !

@paulvdh : finally all these variants are not that much work. It’s more the tedious exports and file format conversions. Even footprints are not that time consuming : after drawing the more complex one at first, other ones are made by dupliaction and “options” removal.
About STM32 modules and fake MCUs, some folks order the cheapest bluepills or whatever thay can find, order STM32F103C8 (or other STM variants) from a trustable source, and swap the MCU + the offending USB pullup. It’s probably more economical than ordering prepopulated PCBs with no MCU. I undersstand you are looking for BluePill routing in order to make your own ones (?)

This being said, could someone review one of my designs ? No need to download everything. Just one symbol + footprint + 3d model (I updated them late at night). They should now be KLC compliant. Will soon upload the chinese “NanHe” Arduino Pro Mini with 19 3D variants and 8 footprints.

I think that doing it like this (another today’s thread):

would be simpler.
Just build a (look alike) as a KiCad project, don’t spend any time on all those exports of different variants.

Then, when you want it for another project, throw in a suitable connector, export directly from Pcbnew, and off you go.

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