I’ve been using code models with verilog to simulate various power electronics ( Mixed mode simulation including C code and verilog - #22 and Another, tidier, mixed mode simulation model. Dual phase IPT buck converter - #8 ).
I’ve just got a power factor stage running with a proportional resonant controller and am probably starting to run into the limits of how things currently are. I just wanted to see if there are any useful features that I’m not familiar with yet before I put some feature requests in.
I think the most important thing that I’d like is a way to send variables from the c-code back to the graph (to plot controller errors, states etc). For now I could save them to a file with a timestamp and post process it in octave and plot the spice output at the same time but ideally I’d be able to display it on the kicad graph at the same time as the simulation.
-
Is it possible for the kicad simulation graph to read in other files to plot at the same time?
-
If not, is this out of the question?
-
Is these another way we could do this?
More for @holger and I probably ought to address this via ngspice forums but is there a way to send floating point values from c-code back to spice? I think that the verilog PWM generation slows down when the clock gets too high and it would be nice to do some simulations by setting pulsed voltage sources rise/fall times instead. Not essential but I think it might run faster.
I appreciate that I’m very much pushing the limits of what this tool can do. When ngspice was integrated I don’t expect that anyone thought “Yes, kicad will become a digitally controlled power simulation tool as well as a PCB design tool” but I am very grateful to everyone who has made possible!