KiCAD to OpenEMS (PCB export)

How to use openEMS. Discussion on examples, tutorials etc

Moderator: thorsten

Post Reply
Janis
Posts: 3
Joined: Thu 07 Dec 2017, 03:16

KiCAD to OpenEMS (PCB export)

Post by Janis » Thu 07 Dec 2017, 03:29

Hello

I've created utility software that converts KiCAD PCB files to octave/matlab function files, that can be used with openEMS. You can take advantage of drawing capabilities in KiCAD to draw geometry faster and more complex. It also automatically creates mesh lines.

Check out 'pcbmodelgen' at https://github.com/jcyrax/pcbmodelgen

This is very new project so some bugs may be found. Feel free to submit them or features you would want on github.

Janis

thorsten
Posts: 1411
Joined: Mon 27 Jun 2011, 12:26

Re: KiCAD to OpenEMS (PCB export)

Post by thorsten » Thu 07 Dec 2017, 08:49

Hello Janis,

thank you very much for this nice utility. I will soon give it a try. Unfortunatly I have no KiCAD experience. Maybe I should change that too ;)

best regards
Thorsten

Slowrunner
Posts: 1
Joined: Mon 17 Dec 2018, 21:48

Re: KiCAD to OpenEMS (PCB export)

Post by Slowrunner » Mon 17 Dec 2018, 22:11

Hi Thorsten

I see that both you and Wayne Stambaugh from KiCad are scheduled to speak at the same day in the same room at Fosdem 2019.
Maybe the two of you can have a chat to figure out what it would take for the two best open source software packages in their respective fields to be able to talk together. I believe both Kicad users and OpenEMS users will find this very interesting.
pcbmodelgen is a great start, but currently only works under Linux. That is a limitation for many users, Linux has not conquered the world quite yet.
The ideal scenario would be an export function in KiCad that would export to a file format that OpenEMS could read directly. I have no idea exactly what that file format should be to minimize the amount of work required for the development teams on each side. But hopefully you and Wayne can figure that out.

Bård

PaulUK
Posts: 76
Joined: Wed 28 Oct 2015, 14:23

Re: KiCAD to OpenEMS (PCB export)

Post by PaulUK » Thu 20 Dec 2018, 13:01

Thanks, Janis. I was an EagleCAD user for a long time and was considering to buy the full version until I realised that you can only have it as a rental unless you stay with the free version. As a result I will be making the transition to KiCAD, so I'm sure this will be useful for me in the future.

Paul

nats
Posts: 4
Joined: Sat 01 Dec 2018, 12:37

Re: KiCAD to OpenEMS (PCB export)

Post by nats » Fri 21 Dec 2018, 16:23

Hello Janis, I started writing something in python but since your project already exists I'll try to add feature in your code.
I forked it on github. I'm using kicad since 10 years and have a lot of RF project to simulate with openems :)

Janis
Posts: 3
Joined: Thu 07 Dec 2017, 03:16

Re: KiCAD to OpenEMS (PCB export)

Post by Janis » Sun 23 Dec 2018, 15:20

Hi to everybody, didn't check this for some time.

pcbmodelgen is very basic, but you may get some work done. As for future integration into KiCAD I have different opinion. I think correct route is to create FreeCAD workbench. When simulating you always need some geometry operations on model and simulation space. Implementing that in KiCAD would be waste if its already made FreeCAD. Also that would be usefull for other simulations types not just PCB. I wan't to write workbench that creates OpenEMS xml simulation source file. Baically KiCAD->FreeCAD->OpenEMS.

nats
Posts: 4
Joined: Sat 01 Dec 2018, 12:37

Re: KiCAD to OpenEMS (PCB export)

Post by nats » Sun 23 Dec 2018, 18:41

Hi Janis,
I mainly agree with your workflow idea, I did the same for kicad/qucs/(in futur openems) my idea is to be able to generate the data from a model for the different CAD system, from a model I generate schematic/footprint for kicad (to do the layout) and schematic for qucs.
If you ever used Genesys, AWR or ADS that's how they work, you draw a schematic and they generate different part like the PCB etc...

I never thought about Freecad to do that. I'm wondering how hard it could be !

Hale_812
Posts: 172
Joined: Fri 13 May 2016, 02:54

Re: KiCAD to OpenEMS (PCB export)

Post by Hale_812 » Tue 25 Dec 2018, 02:05

I do not use KiCAD much, but holding such tool in the pocket sounds great!
I just want to ask, how does it create meshlines? using line-edge vertices, or taking 1/3 rule into account for every edge? in between the main coordinates, what distribution do you use? Can important vertex and main edge coordinates be exported for referring to them during mesh optimizations? I.e., when the board is wide, you will get a grid coordinates overlapping with very small difference, which should be eliminated smartly, and the coordinate reused, but this depends on importance of the vertex.

Janis
Posts: 3
Joined: Thu 07 Dec 2017, 03:16

Re: KiCAD to OpenEMS (PCB export)

Post by Janis » Tue 25 Dec 2018, 14:30

Hale_812 wrote:
Tue 25 Dec 2018, 02:05
how does it create meshlines? using line-edge vertices, or taking 1/3 rule into account for every edge?
There is switch to select between using exact edges and 1/3 rule: 'boundary_one_third_rule' selects that. You must also set 'min_cell_size' and 'max_cell_size'. This controls minimal/maximal gap between mesh lines.
Hale_812 wrote:
Tue 25 Dec 2018, 02:05
in between the main coordinates, what distribution do you use?

It tries to make mesh line gaps as large as possible while not getting bigger then specified 'max_cell_size' and also so neighboring mesh gap ratio is within 'smth_neighbor_size_diff' to prevent abrupt changes in spacing between mesh lines.
Hale_812 wrote:
Tue 25 Dec 2018, 02:05
Can important vertex and main edge coordinates be exported for referring to them during mesh optimizations?
There is possibility to only create mesh lines for actual pcb/copper geometry. Then you can use other tools to create needed mesh.

The important thing is algorithm may not always generate mesh according to constraints set, but it will give warning/error if it failed at some point. It will still produce mesh, but may fail at something like neighboring mesh gap ratios.

Post Reply