Questions about a Mezzanine Implementation in KiCAD

I’m in the process of doing a layout which will have a stacked mezzanine daughter board on top of the main board I’m laying out. It will use standard 0.1" vertical unshrouded headers. So alignment of all the connector through holes is nessesary. This is a multi page schematic with extensive use of hierarchical sheets and global labels to partition the design within the same project.

I have two separate schematic symbols with corresponding related footprints created for Main board and Daughterboard. My basic quandary now is how to exactly position the two footprints so that the two boards line up in Pcbnew with the proper connectors and 3D view of the connector from the library. I have the following:

NPTH, Mechanical holes in my mainboard footprint representing the standoffs and various mounting holes including the NPTH holes for the daughterboard mounts. I did not have any reference holes in that mainboard footprint but rather manual located the connector footprints in the PcbNew layout. Since these connectors were also on my schematic they have themselves separate footprints and I need a way to make sure all three are aligned. I did it manually once and probably already disturbed them which is why I’m looking to “do it another way”.

I have an imported DXF file saved as a footprint for the daughter board but it is missing all of the drill holes as part of the import. It does have an outline and some trace information so it is still useful.I have added the NPTH mounting holes to this foot print. Having already gone through the hassle of locating KiCAD Git library connector footprints onto the mainboard PCB corresponding to the daughterboard referenced connectors. I have probably moved them during the layout so before I try to place them accurately again I’m looking if there is not a better way to do this.

There are probably multiple ways to do it with pros and cons so was just looking at some feed back for how best to do it.

Is it best to put NPTH holes/connector into both footprints and just align them in Pcbnew (albeit with double holes for the NPTH’s). I don’t know if this creates an issue or not or If it simply means I pay for a second drill hole into the air made by the first drill holes at the same location (a non issue).

At this point I’m thinking I should:

1.) build my daughter board footprint to include reference “Through-holes” for all the headers that will go on that board.
2.) build the main board footprint to include reference through holes also with Through-hole or NPTH holes that I can use to align the two boards.
3.) Finally I would have connector foot prints that I would locate using these reference holes on teh other two board prints and the 3D files would still work as they are referenced to the connector footprints and not the board footprints.

What this approach amounts to is uses duplicate reference holes in the various foot prints and using that to align the foot prints. I get a positive visual feedback the alignment is correct and I don’t have to worry about anything being shifted and not being obvious.

So this is boiling down to how best to maintain alignment between 3 different footprints in the same Mezzanine PCB design (Main board, daughter board and connector in the same Pcbnew layout).

A secondary question is I’m assuming the edge cuts should only be in the layout and not in any of the other footprints.

I’m just not to anxious to go through the process as an experiment if someone already has been through it and has a way that works. Otherwise my design is progressing well other than these types of issues.

Jim

1 Like

I use this for aligning a RPi 2B to a motherboard… maybe it gives you an idea?

PCB_RPi-2B_noConn.kicad_mod (14.0 KB)

The I/O header won’t sit directly overhead as I need more than 18 mm space and the pin headers nor any header receptacles wont be long enough for that. That’s why I just put circles in place of the actual pads for alignment.
The mounting holes will be used directly, thus they are in the footprint.

Your approach is sound if you have more than one connector on the daughter board, otherwise I would incorporate the connector into the daughter board footprint and spare some hassles.
The downside is, one has to think backwards with this and put the correct device (plug or socket) into the respective footprint… the method with having only placeholders in the footprints and extra connector footprints will be less error prone if you do it more often I’d guess.

[UPDATE]
Thought about it some more… from a logical workflow point of view it should be like this:

  • motherboard footprint carries:
  • it’s outline (I use Dwgs.User)
  • it’s own mounting holes (PTH/NPTH - the real things that make it through to the gerbers)
  • any other information/markers (I use Dwgs/Cmts.User)
  • daughterboard carries:
  • it’s outline (I use Dwgs.User)
  • mounting holes (PTH/NPTH - the real things that make it through to the gerbers)
  • connector markers (I use Cmts.User)
  • any other information/markers (I use Dwgs/Cmts.User)

The pin/pad’s that go through to the gerbers will then come from the connectors that need to be placed in the layout.

Doing it this way you don’t need to track differences between mother/daughterboard in regards to positions… the daughterboard will be carrying this information alone. You only need to place it in the motherboard layout to get it and it will be the same information that you get in the daughterboard layout.
The connectors will need to agree with the daughterboard position markers only.
[END UPDATE]

Yep, it’s how I do it.

  1. you can adapt the outline to changing conditions if needed
  2. original outline (plus mount holes/etc…) will be there without a chance to screw them up
  3. KiCAD doesn’t like outlines in footprints and will modify it when you open it with the FP editor
3 Likes

Wow that was a much faster response that I as expecting. Happy Easter and don’t let me keep you up too long.

From what you are showing, I presume you have a RPi 2B daughterboard footprint in your library with the headers/pads located in that so when you overlay in Pcbnew with your motherboard outline (shown above) you get the holes in you mother board. You perform the alignment with a graphic to pad alignment rather than pad to pad alignment; it cuts down on the issue of a double hole. I can do that and not tempt any layout issues with double holes.

With respect to the connector mating whatever I’m doing now is probably an interim solution before being able to render both boards in the 3D viewer which is something I will eventually want to be able to do. Thinking ahead that means you would need to have a primary board layout with the complementary daughter board footprint and then a main daughter board layout and a complementary mainboard footprint for its mating connector. At some point you move into a CAD package and so I’m also interested in the links to using FreeCAD but again both of these visualization enhancements will have to wait.

When you say the FP Editor does not like outlines you are referring to the “edge.Cuts” I have graphic outlines of both by boards including the DFX graphic import and it all renders in the 3D view. The only thing I noticed is I can turn off a layer in the 2D layout but it still renders in 3D regardless.

I’m finding for various reasons I would like to mix layout with either just references of actual holes. For example I made one of the mounting holes on my main board an actual through hole with ground connection so I had to go back and change that particular mounting hole from NPTH,Mechanical to Through hole to do that.

Thanks for the response.

See update above please.

you may consider to use kicad StepUp to create the 3D model of your daughter board from the kicad 3D itself



you can align the daughter board to its footprint with StepUp tools



Maurice

1 Like

yes, anything that is on Edge.Cuts in a footprint will be changed into some other ‘harmless’ layer when you open a footprint in the FP editor… to get the layer to Edge.Cuts you just modify the kicad_mod file with a text editor.
But it’s not advised.

Yeah, for that reason the mounting holes in the motherboard footprint could be just markers instead of the real thing (PTH/NPTH)… pro: one can change type on the fly, con: one can screw them up
Same for the daughterboard footprint…
Really depends on how you feel about it and what you prefer… more risk/modificability or less risk/safer.

If you stick with this scheme:

  • board footprint carries:
  • it’s outline (I use Dwgs.User)
  • mounting holes (PTH/NPTH or markers on Cmts.User)
  • connector markers (I use Cmts.User)
  • any other information/markers (I use Dwgs/Cmts.User)

You will be able to use any board footprint as either mother or daughter board and the important information will be handed through without any further work to keep stuff in sync and a low chance to screw things up.

1 Like

Yes Maurice, thanks for the repost, in fact when I referred to a “interim solution” I had your posts in mind :).

I do a lot of embedded C/C++ and you can always just run a build and see what happens. I do a lot of code refactoring and am in constant recompile mode and then setup units tests for all modules. You just don’t have that with a physical product unless you have some full block p-spice model with all of the parts model (both physical and electrical which I do not). 3D modeling capability is a must; thanks for contributing.

At the moment I’m under the gun and need to defer more advanced 3D but it is clear that the 3D rendering are absolutely a game changer when trying to be through a design. The daughter board is a purchased product so I’m not doing that layout at the moment either and do not want to have to create a model of it.

Jim

1 Like

Thanks, I actually prefer to have the physical properties of the holes in the various footprints even if it is duplicated in another footprint. Then the layout only carries the Edge-Cuts. Maybe it is for no other reason than I know I have the exact same thing to alighn between the various footprints instead of worrying if a graphics is the same as a PTH or NPTH.

I played around with the 3D settings in the FP editor and you can have multiple ,wrl files all with different orientations specific to each wrl rendering.

Maybe I can take a wrl at creating a daughterboard rendered image out of composite wrl’s that would mimic the daughter board placement with all of its connectors?

PcbNew only renders one board for the layout ( I’m guessing )based on the Edge.Cuts but for a simple rectangular daughter board that can be done of the canned shapes scaled to the correct size.

BTW I found this site and had started to download the project thinking I would not get an answer for days. I’m not going to start a new project but I will open it up to see how it is setup.

this is strange… have you tried to export DXF in R12 version? … this is much more compatible with kicad…

here the mezza.dxf mezza.step mezza.wrl mezza.kicad_mod coming from mezza.kicad_pcb converted with Stepup and FreeCAD
I have not added connectors (I don’t have the STEP model but it would be easily to find at some online libs)
mezza.7z (21.9 KB)

Yes I recalled such limitations, but no time now to install another program just to locate some holes. I’m focusing now on how to store the location info (which I have in a dimensioned graphic file) into my project with hopefully a view to reuse.

I have been playing around with the template file from 96boards.org

This looks like it will be useful. I’m wondering if I could not keep an entire reference circuit block design library in a common template file and just delete the stuff you don’t want. Even better would be to have a program select with checkboxes so that you just select what to include from the standard circuit block library.

From what I see with the template they have located the connector on the board which through the netlist is already connected to the schematic.For a single connector design this is kind of the degenerate case where the location doesn’t matter nearly ass much as having multiple mezzanine connectors that have to all align.

The other great thing is many of the common arduino boards are already in the template files. uno,nano,mini, etc.

Maui, You are really being persuasive:blush:

EDIT:
I had FreeCAD installed after reading some of the posts but could not find anyway to change the ellipses. I then downloaded LibreCAD and did a save as R12 and then imported into KiCAD. Ironically I got the mounting holes but none of the connector info which is really what I was missing from the mechanical drawing I already had.

Anyway, I tried, will have to sort this later.

The DXF import capability in KiCad does not support DXF
features like POLYLINES and ELLIPSIS;
any POLYLINES need to be split (Exploded) and your DXF has to be saved in R12 version/format
Anyway if you upload the DXF I will have a look… :wink:

Thanks for the extra effort; as mentioned above I did use LibraCAD to save in a R12 format and I then still lost pin graphics. As it turns out I don’t need them and the ones I do need are now located in my layout (as long as I don’t move them). I have pushed on now back to the layout. I’ll just have to get back to this later.

This is kind of an interim solution anyway, I was mainly looking for ways to locate mounting holes in my daughterboard footprint so I can’t move the connector holes without shifting the entire footprint. Right now I can have my daughterboard footprint well placed and inadvertently move one of the correctors(because they are all separate). I’m using some graphics now as Joan had used above but I don’t really like it.

Making the connector references electrical (PTH) causes schematic problems (they have to be on the schematic) and I’m still not absolutely sure that having a NPTH on top of a NPTH is a good idea and I don’t think having a NPTH on top of a PTH is very good either.

EDIT: I reread your comments and the “EXPLODE” is another step separate from the save as R12? Again I’m not familiar at all with these CAD packages.

In LibreCAD select i.e. ellipsis and explode it (it is an option in the Modify menu) then export w R12 version

Call me old school, but I just used a pen and paper and noted down the X, and Y co-ords of the connectors in the first PCB. I had 2 connectors to line up. When I did the next schematic, and export netlist to PCB, and set the 2 connectors to the correct rotation, and set the X and Y co-ords the same as the previous PCB. I then built the rest of the PCB around them locking them in place. Getting the edge.cuts the same was not the highest priority, but I could do the same with that or import the DXF, which has worked well so far.
The PCB’s actually stacked when I had them made. Kicad has been nice to me.

I’ve usually just done this as a footprint for the connector and mounting holes with a few tics on the silkscreen layer to show suggested board edges. That way you can make daughter-boards that aren’t full size if needed.

I guess it almost goes without saying that a manual process you describe would work if you are extremely careful. In this case extremely careful means taking an inordinate amount of time to check and recheck after every time you think you are at a final till you eventually forget and make a mistake and invalidate the whole PCB design without even knowing it.

Not having to be extremely careful is the objective. Being able to simply check one index on the layout and be sure that the entire mezzanine footprint is locked is what this question is about. Your manual method obviously does not do that.

In my case I have a daughter board footprint is that relatively complex (4 mounting holes and 7-8 fine pitch connectors). I want a method to insure that following a layout of the main board, that I had not inadvertently shifted one of the element of the daughterboard footprint. It would appear that making all elements of the daughterboard a single footprint somewhat is required so that you literally have to go into the footprint editor to alter the locked relationship and you can not do that in the layout.

From here there are various implications as to exactly how to incorporate the various elements with symbologies seeming to be the most straightforward.

Importing the DXF files has challenges, but in effect having the mezzanine footprint in a single a graphics layer seems to be the easiest. At this point I’m only using 4 of those 7-8 connectors so hopefully I can just be careful and place the foot prints over the graphics and keep it aligned.

@midworld08
this is a good method for simple mechanical situations… but if you try to have a 3D module of your daughter board, next time you will not come back :smiley:
The best of creating a 3D model of your daughter board is that, after fist attempt, you will find that this method is really fast and reliable…
Typically you need just the edges with mounting holes and connector positions…
if you have a dxf then everything can be just fast:

  1. import dxf in module editor in Front Silk to have the margin dimensions and connector positions; add mounting holes where needed and save it as a kicad footprint module; that will be used in your board to position the daughter board where you need it
  2. create a new pcb board importing again the dxf but this time assign the layer to Edge; if your dxf is good you could see your pcb in 3D-viewer; manually add to this pcb the connector that are needed for mechanical purposes and save it
  3. open the kicad_pcb board in kicad StepUp and save the STEP and wrl 3D model of the populated daughter board (you will need 3D STEP models of your connectors)
  4. open the footprint of the daughter board with kicad StepUp, import the 3D model of the daughter board itself and visually align it (if needed) to the footprint; save the updated and aligned 3D model again to STEP and wrl.
  5. place your daughter board in your pcb design and see in 3D-viewer the 3D as a daughter model of your design… and if you move it all the connectrs will follow the footprint :smiley:
    I know that it seems a quite complex process, but when you do it ones, next time will be so easy compared to all the checking needed for a manual 3D manipulation, that you will not come back IMO to old way; at least that was for me :smiley:
    @posplayr if you send me the DXF I could convert it to the daughter footprint and board …
    PS I used this method to create the 3D model of the crazyflie board adding the motor holder, motors, propellers and shield obtaining this result:
    https://cdn.hackaday.io/images/7537561443908546062.png

Maurice

Thanks, I know I have more work to do this is a controlled way. I’m back in BOM He## now and it is the Digkey website causing the frustration.