Simulation of a LM293

I’m trying to simulate a circuit with a LM393. Since there is a Symbol for this device already in the standard program libraries I have used this in the circuit. For the simulation I have downloaded different PSpice-Models from various manufacturers but none of them seem to work. Sometimes there are no proper pin-assignments possible, sometimes there are no power-supply-pins assignable, non of them seem to work. This is a standard device, I’m not sure why it is so difficult to get a simple simulation running. Has anyone successfully simulated a LM393 in KiCad and can point me in the right direction to find a working Spice-model?

I use ST’s spice model, which so far works as expected. The tricky thing with mutli part components is to assign the pins. Not that tricky, but the spice model pins will not match the schematic pins, if they do it’s pure luck. The models provided by vendors are only for one device and not for multi part devices such as the LM393. So I create a small model file that references the vendor provided model and matches up all the pins. This is also how it is described in the very good tutorial on the ngspice website.

So at the top of the file you can add something like this:

*============================================================
* Kicad device 
*============================================================
.SUBCKT LM393 1 2 3 4 5 6 7 8
XUA 3 2 8 4 1 LMx93
XUB 5 6 8 4 7 LMx93
.ENDS

Here is also the complete simulation file that I use for the LM393:
LM393.mod (2.7 KB)

You can add this as is to your symbol since it already includes the matching of the pins at the top.

You can create a Custom Symbol in KiCad. You can modify the existing LM393 symbol to match your model pinout (especially power pins!), or create a new symbol (Symbol Editor > New Symbol) that maps your subcircuit pins properly.

Assign pins as:

  • Pin 1 = OUT
  • Pin 2 = IN-
  • Pin 3 = IN+
  • Pin 4 = VCC
  • Pin 5 = GND

KiCad sometimes uses dual-comparator symbols. Be careful to match a single subcircuit to a symbol. To keep all information about LM293, including the pinout, package dimension, etc., you can see here:

I tried various models and was able to produce satisfactory results with the following:

LM393.zip (12.1 KB)