Is it possible to calculate capacitance between filled zones on two layers?

I have a filled zone that is connected to a net in my schematic. This node is also above a ground plane. I want to calculate the capacitance of the zone to ground. Any tips how I can accomplish this?

I am using KiCAD nightly.

Have you tried KiCad’s Calculator Tools -> TransLine?

In general the capacity is e0 * er * area / distance
er of FR4 prepreg is between 4.0 - 4.6 (check with your PCB fab), the core is usually less well defined
I don’t think there is a tool in KiCad to calculate the filled area, you will have to estimate it.

I took a look at it, it’s not the right tool for the job.

I am aware of this approach.
But the area of the zone is not a simple shape. And its even more complicated after filling.
And calculating its area by hand is not simple.

Is there a way to find out the zone area in KiCAD?

There are several programs that calculate the Area of closed objects (of DXF and other types). In fact, you can take a simple closed object and extrude it in many 3D-Print programs and it will calculate the Volume. If you extrude it 1mm, then, you know how to calculate Area from Volume and Height.

Even easier, Using LibreCad, simply open a DXF and use the tools to get the info (screenshot below).

You can export the DXF from Kicad…


Screen Shot 2021-06-28 at 7.50.02 AM

Print out the layer with the zone.
Manually draw an 8x8 grid, count the filled blocks, then the 50% filled blocks.

This estimate will be ok as you’re never going to get more than 1-2 digits of accuracy.

There is some work in progress code which might already allow what you want: https://gitlab.com/pointhi/kicad/-/merge_requests/8

2 Likes

Just to explain a little as this is a very new and experimental feature that is not in the main kicad repository ( yet :smiley: ) . This code can calculate the capacitance between any 2 nets in pcbnew, using a 3D electromagnetic simulation.

If your board is not confidential, you can upload it and I can send you the result. If you want it to do by yourself, you’ll have to build that kicad branch and the solver.

The results have been tested with simple shapes ( because we can easily validate the result ), but you can use any shape.

There is an ugly, yet simple GUI under inspect -> Simulation
As an extra, you can have some pretty 3D views :slight_smile:

In order to use this branch, you’ll have to install sparselizard as a shared libarry.
You’ll have to build sparselizard by yourself, ( The lastest commit should be fine for now )
Here is a tutorial about how to build / install it as a shared library on ArchLinux:


( It also works on Manjaro )

Once sparselizard and kicad are installed, using the tutorial, you’re good to go.

4 Likes

Unfortunately, I can’t share the design, but I will try this branch when I get the time. I am stuck with windows on work machine, is it hard to compile on windows?

For the moment, I got a rough estimate by exporting to dxf, importing to freecad and messing around to find the zone area, based on suggestion by @BlackCoffee.

Sparselizard can be built for Windows, this is a cross-plateform library:
http://www.sparselizard.org/

You’ll also have to build Kicad, by yourself ( if you’re using the nightly you might have never built it by yourself ):
https://dev-docs.kicad.org/en/build/

Though, you’ll have to install sparselizard in a repertory, and tell kicad where to find it. I don’t know how it is supposed to be done on Windows, but I am sure some people will.

And if building everything on windows is a problem, you could still install a VM running Manjaro. ( which might be faster to get running than Arch )

The rough estimate could be enough, but in reality, your capacitance will be different because of fringe fields. ( And basically if you have a complex shape, the “capacitor surface” is not well defined )

Hopefully, we’ll be able to merge this branch with the official repo. ( but don’t expect this soon )

I really like where this is going!

John

A hidden Gem…

If using FreeCAD, you can select the Object and use the Python Console Panel…

Close the lines with a Face (there’s a Make Face from wires tool. Then,

View>Panels>Python_Console then enter the command:
FreeCAD.ActiveDocument.ActiveObject.Shape.Area

And see the Area value… Example below shows command and result
(note: Can use different ways to get the object of interest - I used the Active Document but can use the object Label… Google around to learn what/how…)

[EDIT] Follow-up with another Example: Loaded a test PCB’s traces (using Stepup) and calculated the Trace/Pad area…

This is awesome. Hope it will be in nightly builds soon

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