KiCad StepUp: The Sketcher for Footprint generation

I was able to use the refine shape method after first doing a union each “U”. It seems to work, just a few extra steps to process each footprint.

Here some samples:
Hairpin 1
Step:Hairpin1.stp (297.0 KB)
DXF:Hairpin1.dxf (20.2 KB)

Hairpin 2
Step:Hairpin2.stp (210.4 KB)
DXF:Hairpin2.dxf (14.5 KB)

Stub Notch 1:
Step:Notch1.stp (84.0 KB)
DXF:Notch1.dxf (5.9 KB)

Stub Notch 2:
Step:Notch2.stp (81.0 KB)
DXF: Notch2.dxf (5.9 KB)
The stub filters are a little tricky because they technically have a through connection meaning pad 1 and pad 2 are electrically connected. I have not found a good way of handling this in kicad without getting DRC errors. Any ideas?

Edit: I wanted to add that I tried to pick some that were simulated by different means. For example some assume a PEC instead of air as the surrounding space so there is an extra air cube. Some were simulated with wave ports instead of lumped port etc. It shouldn’t make much of a difference as far the filter geometry goes, just thought it would be good to include a variety.

I take back what I said about the Refine Shape working. The footprint looks like this: image
Not sure what went wrong. It seems to think there are open vertices. I don’t understand…

Please post the Fc and step file… I will have a look later on

One: Hairpin-1-0.stp (294.3 KB)
and two:Hairpin_Bad_Footprint.FCStd (151.7 KB)

Once we figure out the best/easiest way to do this conversion I’ll write it up into a quick how-to. If you are open to it we could also have a brief discord call where I share my screen / show you my process and you can correct it where you see a better way.

Definitely the best option IMO is STEP.
With STEP format you can:

  1. select the shapes
  2. make a union
  3. refine the result
  4. project the refined shape to 2D (Draft Shape 2D view)
  5. convert the 2D to Sketch
  6. add circles inside each closed polygon
  7. rename the sketch to ‘Pads_Poly’
  8. export with ksu to fp

This schema worked with all your samples without issues and could be converted in a single macro button in Ksu.
nh2.FCStd (41.9 KB) hp2.FCStd (109.9 KB) nh1.FCStd (43.7 KB) hp1.FCStd (167.7 KB)

The DXF option is more difficult because the ‘refine’ action doesn’t remove internal edges.
I would definitely work with the STEP option.

you are most welcome! :smiley:

Have a look at NetTies in kicad
When a RF antenna has two different pads touching each others (and internally connected)
the net-tie is needed to decouple the net to allow the DRC not to fail.
Here a sample project
uw-net-tie.zip (41.8 KB)


splitting-nets-for-different-trace-widths

1 Like

Hi @dom11990
would you mind to post your DXF antenna model of this topic in STEP format?
I would like to test my new script on this too.

1 Like

Technically this is a splitter not an antenna :slight_smile: I can’t post on the old topic as it is locked. Here it is: Splitter.stp (299.0 KB)

I don’t understand how a net-tie solves this issue in the footprint. How would you recommend generating the pads for such a filter? The way I did it does not seem to work as the resulting kicad footprint has a 1um gap between the connections even though the two poly pads share a coincident edge. Are you saying I should make the footprint have only 1 pad? How does the net-tie resolve this issue? Thanks for your help! I will be an expert at this soon enough :slight_smile:
In case you want it: Notch-1-3.FCStd (20.0 KB)

image

I think what you want to do is look at how net-tie footprints are constructed in kicad, not literally use a net-tie footprint inside your footprint.

The short answer is you have pin 1 and pin 2, and draw a graphic polygon on a copper layer to connect the two pins. In your case the graphic polygon will probably just be the footprint design you exported from FreeCad (not sure if it’s exported as graphical copper, or a custom pad).

You’ll probably have to add the keyword “net-tie” to the footprint description to avoid DRC errors.

The above is from memory, and my memory may be faulty…

1 Like

Thanks @gkeeth I will give this a try. I was hoping StepUp would handle this. It would be a great feature to allow the user to place multiple pads that share an edge and the footprint is adapted with such a polygon to accommodate this electrical connection. At the least, how it is right now is somewhat misleading. I only found this 1um gap by chance!

Can confirm, this works. Your memory appears functional! You don’t need to name the footprint anything special, just place a polygon of F.Cu (or whatever layer you need) over the two pads and you are DRC violation free. This would work great for transition as well like a GCPW to Microstrip.

I have one more challenge and then I think we cover 90+% of what you need as far as RF footprints go. How about a footprint with lots vias? For example here, a waveguide to pcb transition:
image

What would be the smartest way to convert such a step model? The via sizes (drill at least) matter since they are included in the EM Simulation. Can they be translated into an appropriate via or a through-hole pad in the footprint? It seems silly to have each via be an independent pad, you would have 50+ connections all going to ground.

1 Like

Great :slight_smile:

Not sure what kicad version you’re using, the keyword thing might be >=5.99 specific.

edit: the keyword thing is that footprints with graphical copper bridging two pads need the keyword net tie as the first keyword in the footprint properties. Otherwise you get a net-to-net clearance violation in the board drc. Based on some tests I just did, looks like it only is needed in >= 5.99. 5.1 doesn’t care.

if you had open my net tie project there was exactly a schematic and a pcb with the solution adding an extra footprint (working on 5,1 and 5,99)… but the trick suggested above is interesting to circumvent DRC.

post a sample STEP or dxf model and I’ll have a look for a fp solution

I did open it, it just didn’t click immediately how I would apply this to my use case. Having the antenna have only Pad 1’s seemed strange because you can not connect one without a DRC violation. I like the Polygon solution because you can have two distinct pads that the user is forced to connect properly.

Here the is the waveguide transition I mentioned. Note there are mechanical parts that are obviously not a part of the footprint but they are needed for the mode transformation of the wave.TransitionWithAntenna.step (1003.2 KB)

This FP requires some manual rework (i.e. for the bottom Cu zone).
But the most annoying part is that the drills from the STEP file are represented as two semi-circles instead of one single circle.
Manually fix this could be a quite long work because of the number of shielding drills.
I see if I can arrange some code to simplifying this phase.
Edit: do you have also the DXF file of this TwA?

This is among the simplest of my tricks: TransitionWithAntenna.zip (29.5 KB)

OK, I will have a look at a way to make a FP of these files. It will take a bit because I’m on holiday, but I have already some ideas.
:smiley:

I have something usable…
I need to clean up the code and I will update the WB

3 Likes