Open source power analysis tool?

Hi,

I’ve been using Altium at work lately and one tool I’ve found incredibly useful is the PDN analyzer. (Power delivery network). It is super nice to be able to spot voltage drop issues among other things in a layout.

Does anyone know of a free or open source tool that does this?

Thanks!

3 Likes

This is kinda doable in FreeCad.

  1. Using fcad_pcb macro, you can import copper geometry of a net in question
  2. You make a thermal FEM in FreeCad, where you set constant temperature according for the source voltage pad and then you cet thermal flux on specific pads corresponding to the sink current.
  3. run the FEM

One of the issues here is that FreeCad will only show temperature (voltage) you can not observe heat flux density (current density)

1 Like

I also got interested in this topic and started gathering informations: https://gitlab.com/pointhi/kicad/-/wikis/SI-and-PI

I have the idea of at least integrating DC power delivery simulation into KiCad, but this will likely need to wait for KiCad 7. Unless someone else steps in.

3 Likes

The main bottleneck is just adding the missing information in a useful way, e.g. saying this node here is X voltage, these other nodes draw current A, B and C,

Thinking it through, for simple segment based traces with no forks, its almost trivial to calculate, its when you have a split, or a fill where the math suddenly gets more complex to simulate correctly,

I am very interested in this, but wondering if a proof of concept could be done by skipping the FEM smart meshing and just using a resistor grid masking model for the parts you cannot cheat with the segment simplification on.

V6 should support pin properties on the schematic level. So you could have a 7805 symbol with outpu pin properties Uout=5V, Imax=0.5A and an IC supplied by it with supply pin settings Umax=5.5V, Umin=4.5V, Iin=0.2A. With this info you could automate complete PDN. This would require some scripting as you would need to run KiCad and FreeCad at least if not Gmesh and other support programs. But it could be doable. And when run you would get just a simple Pass/Fail bool as an output.

This is doable completely within KiCad as long as you don’t have any zones. If there is a split in the track you just have to walk all the paths which I’ve done with recursion in Pad2pad plugin. Yes in python this might take some time, but it works. If there is somebody with CS background I am sure he/she can optimize it.

I am not really sure if this is wise. You would be bringing a lot of dependencies.

Personally I think it would be easier to implement DC PDN in FreeCad. There is already fcad_bcb macro available so you can import copper geometry easily. Now you either set the voltages and currents manually or you could grab them from KiCad project (this is the exact reason why I’ve requested for new schematics format to support pin properties). Now on linux with system python the pcbnew and promised eeschema python API should be also accessible within FreeCad, which would make gathering design info much easier. So the only thing missing is an electrostatic solver within FreeCad (as said currently you can misuse thermal solver for this).

1 Like

Is this Power Analysis purely resistive, or does it also keep track of frequency dependent stuff such as trace inductance and decoupling caps?

To me it seems that the most logical way to implement this is with extracting netlist info from the PCB and offload the computational stuff to ngSpice.

I’m a bit guessing here. To methis Power Delivery could be anything to me between simple resistive voltatage drop estimations to full magnetic and EMI field simulation. I do not (and will not) have nor use altium.

Full 3D EM modelling is hard, so a starting point could be resistive 2D, then 3D, then maybe EM 2D, and who knows someone might raise it up to 3D, but that is well past what I have experience with, as you can’t cheat 3D with 2D slices from memory.

If you have an overview of the math, then happy days, but it seems like its even harder then thermal / voltage FEM, as while the voltage gradient and magnetic field lines are always perpendicular, the air volume about the board plays a much larger role than the assumption of a fixed convective loss factor.

Things like how the dielectric factor changes how it curves, and how you calculate that curvature seem lost on me.

e.g.

or 0426stmicromode

For the best possible starting point of the understanding of 2D / 3D EM, I would probably start with this video.

1 Like

Yes the terminology is not clear across the industry.

DC analysis is way simpler, and as I’ve already said for tracks only can be done completely with KiCad today. There is no features missing. If you want to include complete copper into this (zones). You have to do electrostatic FEM. Which can be done in FreeCad.

As for AC analysis there are probably many ways of doing it. But one way could be as you’ve already said with spice simulation. You would ‘only’ need to obtain the parasitic parameters of the layout so that you build lumped circuit. This could be doable with fasthenry and fastcap tools (as in spiki). Any other FEM would also do. But then you need to limit yourself and only take into account those parasitics that are the most pronounced.

@MitjaN
have you seen these FreeCAD options/links?
FreeCAD: ElectroMagnetic Workbench
FreeCAD: FEniCS as Solver

Saying it is trivial and actually implementing it are two very different things! I do wonder how complicated it would be. Unfortunately I don’t have time to work on this until at least summer time, even if the basic case is reasonably simple.

This is interesting from a thermal analysis point IF you know what the heat will be like, but I don’t really care too much about thermal analysis right now. The more important thing for me is identifying power loss and voltage drop based on current flow.

Well, if I can’t find anything at least this is a good start!

I’m not sure I want something directly integrated in to KiCad (yet). That seems like it may add some extra limitations for development and reduces flexibility.

Thanks for the link, the FEM library looks particularly interesting.

As said, this is already done in pad2pad action plugin. For the trivial and nontrivial case.

You might have misunderstood me. FreeCad only has thermal FEM solver (besides mechanical ones). And the same way that you can treat heat dissipation problems with lumped circuit models (temperature becomes voltage, thermal resistance is electrical resistance, …) you can also use thermal FEM solver to solve for voltage drop

Interesting, does the solver have the ability to only solve with heat conduction?

Do you think it would be easy to get a fairly accurate mapping of temperature change to voltage drop? e.g. “0.1C temp drop = 0.1V drop”?

Technically not really as it is a combined thermomechanical solver, but you can disregard the mechanical part

You can get this, but I haven’t evaluated how accurate this is.

I’ve seen the EM workbench, I’ll have to look into FEniCS though.

With EM workbench you can construct the geometry which can be directly described with syntax of FastHenry/FastCap. You can not export common FreeCad geometry. With FastHenry/FastCap the work done in skipi is more inspiring. For designs without zones, you could translate KiCad geometry (track segments, vias) into fasthenry/fastcap geometry. So you could obtain lumped parameters of the circuit.

On thing that is becoming clear is that with all the open source/free tools available, anything can be done. But (and this is a big but) you have to write some code and you have to make the required infrastructure. For example if one would want to do a DC PDN analysis you have to:

  1. transform KiCad layout to .step file (can be done with fcad_pcb)
  2. mesh the geometry (gmesg, netgen/ngsolve, …)
  3. set boundary conditions and actualy run the FEM (can be done with FreeCad using thermal solver, or you can use some other solver)
  4. postprocess and present the results (Paraview, …)

All in all this can be a huge task for somebody without any CS experience, so making this accessible for an EE who knows how to use KiCad is still far away.

And based on our past work (your stepup workbench and my action plugins) I think that we are alike in thinking that any additional features have to be user friendly. Which means GUI only and with as few dependencies as possible. So currently I am focusing my research along this thinking (e.g. if there is a FEM solver for FreeCad which would be suitable for our purposes, but you need to write code to use it, I don’t really take it into account).

1 Like

Not sure if one of you is the guy who gave this talk at FOSDEM2020
https://fosdem.org/2020/schedule/event/sparselizard/
But it seems Sparselizard could be very interesting to you.