Custom shape TH footprint

Hi,

I’m trying to design a custom through-hole footprint for a large circular pin that has flats milled onto two sides (for a spanner/wrench to hold the pin whilst a nut is fixed on it).

Is there a way to make this cutout in a footprint? I’ve been looking at the new “Custom Shape Primitives” in Pad Properties but can’t see how to use those for the hole rather than just the pad.

My initial reaction would be to put a pad on both top and bottom layers (2-layer PCB) in the footprint, and then use edge cuts to create the correct shape hole in the layout, and then tell the fab-house that I want the hole plated, but that seems a bit hacky!

The image shows what I’m trying to achieve. It looks similar to a slot, but the corners need to be sharper (although they can have a 1mm fillet on them as the drill will need that).

thanks,
Danny

KiCAD 5.1.8
Win 10 Pro

Can you show an example, or maybe a datasheet of the component, or a photo, so that we can tell what you actually need or can do?

EDIT: simultaneous edit…

:smiley:

In the corners I’d probably try to do something more like this in the top-left corner.

Are those sizes in millimeters?

Also, would it be OK if the outside of the pad is a circle?
From you description it seems that a big nut should fit on it, which makes it circular anyway.
It’s probably also a good idea to add a circle of via’s through the pad. Via’s make the adherence between the Pad and the PCB a lot more reliable. There are a few mounting holes with via’s in KiCad’s default libraries.

For you hole with the flat sides, it’s probably easiest to design them in a CAD package, save as DXF and then import it in the footprint editor on the Edge.Cuts layer.

Good questions - yes all dims in millimeters
The outside pad could be a circle, if I can put an edge cut through the edge of it!?
Adding vias would not be a problem so I can definitely do that.

The reason it isn’t a circle, is that the pin has flats on it for a wrench to hold it, but the threaded part is thinner (M6 thread), so the flats are larger than the threaded section. Does that make sense?

I’ll try exporting/importing as a DXF. I presuem I don’t do the import into the footprint in that case - just into the layout?

Because you show a ‘Filled’ shape, It isn’t clear to me if you want just a Hole in the PCB or the ‘filled’ shape around the hole (to, perhaps use as a Copper PAD).

Some options - general idea’s:

For the DXF ( #1), I drew it in Kicad. Then, used it as indicated below…

#1) For filled Shape to use as a Footprint, Draw it and save as DXF in whatever program you prefer, including Kicad). Export as DXF and use it when making a Footprint.
The Shape on the Left Side.

To use it as a Copper-Filled shaped Pad, Move it to a Copper-Layer by editing the .mod file (change layers).

If you ‘Also’ want a hole in the Copper-filled shape, you can either Overlay the Shape and the Hole. Or, add the hole to the filled shape Footprint by drawing hole on Eco layer, then edit the .mod and change layer to Edge.Cut .
The Shape in the Center.

#2) For an Unfilled shape to use for a Hole, just draw it on the Edge-Cut layer.
The Shape on the Right Side.

1 Like

Thanks for the reply - that’s really helpful! I’ve tried copying the middle one (TH composed of edge-cuts + pad).

The hole works so the edge-cuts are pulling through from the footprint into the PCB and are showing correctly in the 3D viewer, but I haven’t got it to show the copper edge around the cut-out yet. Initially I made the mistake of thinking it was a pair of lines (inner and outer) and the gap would be filled to give the exposed copper, but realised it should be a single line with a width.

It might be because my shape is quite complicated and so the ends of the lines haven’t quite connected properly? They are arcs, so working out whether two arcs have met at a point doesn’t seem easy! To solve that I have changed the footprint so that the arcs finish short of each other, and then I added a straight line in between them using the crosshairs so the straight line joins the ends of the two arcs, so presuambly KiCAD should be happy that it’s a complete polygon without any breaks…

I tried increasing the thickness of the line to cover the edge-cut but that hasn’t worked.

I think I need to try a simpler shape first so I’ll try that next.


As long as there are No gaps (and non-realistic) connecting lines and, No complaint message in 3Dviewer, the shape should be good…

… there are multiple ways of doing it and from trying out various solutions along the way, you may choose one over the other for a given situation.

Perhaps this Summary would be the Simplest approach…

1) Start a New Footprint with or, without connection Pads. Example below uses Pads.
• Draw something on a Silk-Layer for the silkscreen as desired
• Draw your Shape on Eco1.User (this will be converted to the Copper Layer)
• Double-Click the Lines drawn on Eco1 and set the Line-Width as needed for the Copper and set the Layer to Desired Copper Layer.
Repeat for Each Line on Eco1. Use the 3D viewer to see it.
• Draw the shape for the Hole/cutout on the Dwgs.User Layer. Draw as desired with respect to gap/etc… (this will be ‘Manually’ converted to the Edge.Cuts layer by Editing the .MOD file)

2) Open the .MOD file in a TextEditor and change All Dwgs.User to Edge.Cuts. Can do Replace-All if knowing your editor…)

Save the file. You now have a Footprint with Shape, Silkscreen and Cutout. You need to place it on PCB and draw the PCB edges…

Images below show the steps…

Thanks again. I’ve recreated your footprint by typing out the text in your footprint to create a new one. That all seems to be working, in that it doesn’t give any errors, but again it shows the hole created by the edge cuts, but it doesn’t show up with the exposed copper annulus - there is still solder mask showing in the 3D viewer for both my footprint and yours.

I’ve just realised though, is the 3D view of your footprint done in the footprint 3D viewer or the layout 3D viewer? Mine works in the footprint viewer but then the mask appears over the copper once I import it into my layout, presumably because it doesn’t have a net associated with it.

If (in my PCB layout) I try to connect a track to the vias in the footprint, or any part of the copper in that section of the footprint, I get an error which says:

Warning
Cannot start routing inside a keepout area or board outline.
OK

And also the pour isn’t connecting to it, again, presumably because i can’t set a net for the copper in it.

Do I need to drop a copper pad over it in the footprint editor so I can link to it?

thanks,
D

The 3Dview in the Footprint making tool does Not show the complete story. Hence, my comment to draw a PCB shape and view in PCB 3Dviewer. (Need outer shape to enable subtracting Hole from footprint and can’t do that in footprint tool)

It’s not a perfect world… but, often cleverness can prevail to yield something acceptable, recognizing acceptance of short-comings.

The Copper will be connected. But, DRC and Net-highlighting may not play well. Note, there are other ways to get there but, I’d be repeating previously posted info; i.e., consider a PNG and use the Bitmap tool to make a real Footprint. Or, Use the Custom pad making ability (screenshot below)… Or, learn to use FreeCAD and make your own…

Unlike a THT (with Cu in the hole’s wall) doing what I showed does Not provide a connection between Front and Back Cu.
You can place a THT Pad on it and that will connect them.

You can use an SMD Pad on the Cu if needing that as a ‘Trick’

Screenshot below shows THT and SMDpad relating to my comments… Also shows Custom/Primatives Pad tool with partially drawn semi-circular pad…

Got it working - thanks!

There were a few things I was missing:

  1. In the footprint editor, I needed to:
    a) add a small normal pad within the custom drawn copper area as an anchor point, and give that pad a number.
    b) select all the parts of the copper ring, plus the pad, and then right-click and select “Create pad from selected shapes”.

That gave the ring a pad number in the layout so I could assign a net to it. The footprint would then let me connect traces to it, but the pour around it still didn’t connect.

  1. In the footprint again, under Pad Properties, I changed the “Pad connection” (under the Local Clearance and Settings tab) to “Solid”.

Thanks for all of the pointer!