PI regulator

I would like to include a PI regulator which generates a PWM pulse for a DC/DC converter in my model. Input is a voltage 0-3.3V

What is the easiest way to do this in NG-Spice? Right now I am using an analog solution with several elements but is there another way? Perhaps some kind of CPU emulation block?

in the ngspice examples is an exampe of a PWM enerator that might help.

1 Like

Here you will find a PWM generator (symbol and model) ready for use: Simulation with XSPICE code models

1 Like

Fantastic! Thank you both.
The models would make a great addition to the default installation of KiCad in the future.

1 Like

It seems to me that your elements Holger gives KiCad/ngspice the capabilities similar to PLECS?

https://www.plexim.com/products/plecs