Opamp again, MCP6001

Hi there
I again try to simulate with an Opamp, the MCP6001.

Using “ngspice-30”, kicad-5.0.2-25…

I built a simple integrator circuit derived from the tutorial there:
http://ngspice.sourceforge.net/ngspice-eeschema.html#OpAmp

With the LF356 from the tutorial the simulation runs without issues.
I then changed the opamp to a MCP6001
downloaded this spice model
MCP6001.txt (5.8 KB)
and inserted into kicad with alternate node sequence “3 4 2 5 1”.

Thats the schematic:

This is the netlist:

.title KiCad schematic
.include "/home/p/store/projekte/kicad/mcp6001_spiceModel/MCP6001.txt"
V1 +5V 0 5
V2 -5V 0 -5
V3 IN 0 dc 0 ac 2
R1 Net-_C1-Pad2_ IN 15k
C1 OUT Net-_C1-Pad2_ 10n
R2 OUT Net-_C1-Pad2_ 380k
XU1 0 Net-_C1-Pad2_ +5V -5V OUT MCP6001
.ac dec 10 1 1k
.end

When I run the simulation i get this output/errors:

Circuit: KiCad schematic
Error on line 0 :
r.xu1.r61 0 xu1.61 100 tc 3.11m 4.51u
unknown parameter (4.51u) 
Error on line 0 :
r.xu1.r62 0 xu1.62 xu1:rexp 58.2u 
unknown parameter (xu1:rexp) 
Warning: Model issue on line 0 :
.model xu1:rexp res tce=10.1 ...
Unknown model type res - ignored
Reducing trtol to 1 for xspice 'A' devices
Doing analysis at TEMP = 27,000000 and TNOM = 27,000000
Warning: r.xu1.r62: resistance to low, set to 1 mOhm
Note: Starting dynamic gmin stepping
Trying gmin =   1,0000E-03 Warning: Further gmin increment
Trying gmin =   5,6234E-03 Warning: Further gmin increment
Trying gmin =   8,6596E-03 Warning: Further gmin increment
Trying gmin =   9,6466E-03 Warning: Further gmin increment
Trying gmin =   9,9105E-03 Warning: Further gmin increment
Trying gmin =   9,9775E-03 Warning: Further gmin increment
Trying gmin =   9,9944E-03 Warning: Further gmin increment
Trying gmin =   9,9986E-03 Warning: Further gmin increment
Trying gmin =   9,9996E-03 Warning: Last gmin step failed
Warning: Dynamic gmin stepping failed
Note: Starting source stepping
Supplies reduced to   0,0000% 
Trying gmin =   1,0000E-02 Warning: gmin step failed
Warning: source stepping failed
AC operating point failed -
Last Node Voltages
------------------
Node                                   Last Voltage        Previous Iter
----                                   ------------        -------------
+5v                                               0                    0
-5v                                               0                    0
in                                                0                    0
net-_c1-pad2_                           7,78357e-05          -7,7828e-05 *
out                                        0,297825            -0,297825 *
xu1.10                                            0                    0
xu1.11                                            0                    0
xu1.12                                            0                    0
xu1.20                                            0                    0
xu1.21                                            0                    0
xu1.26                                  0,000108911          0,000108911
xu1.27                                 -0,000435641         -0,000435647
xu1.71                                            0                    0
xu1.14                                 -0,000680071         -0,000680065
xu1.62                                            0                    0
xu1.15                                            0                    0
xu1.16                                            0                    0
xu1.gd16_int1                                     0                    0
xu1.13                                            0                    0
xu1.gd13_int1                            7,7065e-19         -7,70575e-11
xu1.30                                       -90099                90099 *
xu1.31                                      1065,44              84,1682 *
xu1.gd31_int1                               990,099            -0,990099 *
xu1.32                                     -111,594             -1092,87 *
xu1.gd32_int1                              0,990099             -990,099 *
xu1.33                                     -8280,83              8280,83 *
xu1.34                                      -319941               319941 *
xu1.37                                     -29085,6              29085,6 *
xu1.38                                     -2592,04              2592,04 *
xu1.39                                     -2617,96              2617,96 *
xu1.35                                     -2566,38              2566,38 *
xu1.g35_int1                               0,990099         -9,90099e-10 *
xu1.g36_int1                            9,90099e-10            -0,990099 *
xu1.50                                      -325,11               325,11 *
xu1.57                                     -227,529              227,529 *
xu1.96                                     -226,398              226,398 *
xu1.55                                     -3,56541         -0,000693066 *
xu1.gd55_int1                             -0,990099          9,90099e-10 *
xu1.56                                   0,00118812              3,29855 *
xu1.gd56_int1                           9,90099e-10            -0,990099 *
xu1.51                                       90,009          -9,0009e-08 *
xu1.52                                   9,0009e-08              -90,009 *
xu1.gd51_int1                              0,990099         -9,90099e-10 *
xu1.gd52_int1                           9,90099e-10            -0,990099 *
xu1.99                                   0,00297904          -0,00297904 *
xu1.98                                   0,00980296          -0,00980296 *
xu1.g97_int1                             0,00990099          -0,00990099 *
xu1.e97_int1                             0,00300883          -0,00300883 *
xu1.61                                            0                    0
xu1.g60_int1                                      0                    0
xu1.70                                            0                    0
b.xu1.bg60#branch                                 0                    0
b.xu1.be97#branch                                 0                    0
b.xu1.bg97#branch                                 0                    0
b.xu1.bgd52#branch                                0                    0
b.xu1.bgd51#branch                                0                    0
b.xu1.bgd56#branch                                0                    0
b.xu1.bgd55#branch                                0                    0
b.xu1.bg36#branch                                 0                    0
b.xu1.bg35#branch                                 0                    0
b.xu1.bgd32#branch                                0                    0
b.xu1.bgd31#branch                                0                    0
b.xu1.bgd13#branch                                0                    0
b.xu1.bgd16#branch                                0                    0
l.xu1.l38#branch                           -28,7976              28,7976 *
e.xu1.e75#branch                                  0                    0
e.xu1.e97#branch                                  0                    0
e.xu1.e38#branch                                  0                    0
v.xu1.v13#branch                       -7,78435e-19          7,78358e-11 *
v.xu1.v16#branch                                  0                    0
v.xu1.v10#branch                                  0                    0
v3#branch                               5,13767e-09         -5,13716e-09 *
v2#branch                              -4,85128e-05            0,0890693 *
v1#branch                                -0,0890693          4,85127e-05 *
a$poly$e.xu1.e56#branch_1_0             9,80296e-10            -0,980296 *
a$poly$e.xu1.e55#branch_1_0                0,980296         -9,80296e-10 *
a$poly$e.xu1.e12#branch_1_0                       0                    0
doAnalyses: Too many iterations without convergence detected in routine "RESask"
run simulation(s) aborted

Cant I use this opamp model in kicad? Or I am doing it wrong?

No personal experience, but if my memory serves me . . . . the Microchip opamp models have a reputation for being troublesome. I’d suggest poking around in some of the Forums and discussion groups with a specific emphasis on SPICE simulation to see if I recall correctly.

You seem to be doing some basic experimentation and investigation, primarily for your own enlightenment and education. (Nothing wrong with that! In fact, I commend you for doing so! :clap: ) If there is no compelling reason to use this specific Microchip part, your progress may be accelerated by working with parts that are better behaved in Ngspice. Linear Technology/Analog Devices, TI, STMicro, On Semiconductor, Maxim, and others offer a wide range of opamps, and in many cases provide SPICE models that work. After you have built a better understanding of both circuit theory and simulation tools, you can return to the MCP6001 and figure out why this SPICE model is causing problems.

Dale

Thanks. The only reason I use that model is that I have those opamps laying around and I use them in my real cicuit. I am quite a newbie in electronics but do you think I can simply look for another opamp with simmilar specs to get an idea on the MCP6001s behavior with different capacitance value in the feedback loop? (just looking for the frequency response of this integrator…)

Microchip claims that the models are made for PSPICE.

Both ngspice and LTSPICE fail with the MCP6001.

MCP6041 is o.k. with both.

MCP6561 again fails.

some editing of the model is required:

R61 0 61 100 TC 3.11M 4.51U
will become
R61 0 61 100 TC1=3.11M TC2=4.51U

.MODEL REXP RES TCE=10.1
will become
.MODEL REXP R TCE=10.1

But still no convergence.

Have you tried to look for a different spice model for your opamp?
Sometimes there are even different spice models from the original vendor of the part, depending on what aspect you want to emfasize.
Sometimes there are also spice models made by “others”, with various degrees of (in) -accuracies.

Yes, sure. But it seems there is no alternative model for that opamp.
All models I found are just this Microchip one:
SPICE Model for MCP6001/1R/1U/2/4 Devices 02/05/2013 2KB

My results contradict @holger 's results. I get it working no problem within LTspice (using either matrix solver), but still can’t get it working within ngspice/KiCad. Not sure why this is the case, but it’s sounds like it’ll take a lot of effort to debug. You might need to do some .ic or .nodeset on internal nodes to jumpstart it. I see a few E sources in their model, and those tend to cause convergence nightmares.

Another side note here. You are exercising the source with a 2V sine wave and your opamp gain is like 25. Your rails only go between -5V and +5V so you’re technically saturating the opamp during your simulation. Depending on how the subcircuit is constructed, this might affect your results even in AC small signal analysis. So I would recommend something like “ac 0.2” instead of “ac 2” when doing such a simulation. Doesn’t solve the convergence problem since it doesn’t seem to affect this particular model but I thought I would mention it.

1 Like

used this one, that failed with both simulators:

*vvvvvvvv  Included SPICE model from MCP6001.txt vvvvvvvv
*.include MCP6041.txt
*X1 2 3 vdd vss out MCP6041
.include MCP6001.txt
X1 2 3 vdd vss out MCP6001
*               | | | | |
*               | | | | Output
*               | | | Negative Supply
*               | | Positive Supply
*               | Inverting Input
*               Non-inverting Input

Vdd vdd 0 2.5
Vss vss 0 -2.5
Vninv 2 0 0
Rin in 3 1k
Vin in 0 0
Rfb 3 out 10k

.dc Vin -0.1 0.1 -0.01

.end

When I start the .dc at 0, LTSPICE is o.k., ngspice still not. Seems to be at least a weak model.

Ok so out of pure despair :grin: I added GMIN=100 to the .option … option.
Using the unmodified model.
Now I get some kind of simulation but I doubt that this is somehow correct…

Bildschirmfoto_2019-06-01_17-04-29

But there are still errors in the log and the curve looks somehow the opposite it should look like…

Circuit: KiCad schematic
Error on line 0 :
r.xu1.r61 0 xu1.61 100 tc 3.11m 4.51u
unknown parameter (4.51u) 
Error on line 0 :
r.xu1.r62 0 xu1.62 xu1:rexp 58.2u 
unknown parameter (xu1:rexp) 
Warning: Model issue on line 0 :
.model xu1:rexp res tce=10.1 ...
Unknown model type res - ignored
Background thread stopped with timeout = 0
Reducing trtol to 1 for xspice 'A' devices
Doing analysis at TEMP = 27,000000 and TNOM = 27,000000
Warning: r.xu1.r62: resistance to low, set to 1 mOhm
Note: Starting dynamic gmin stepping
Trying gmin =   1,0000E-03 Warning: Further gmin increment
Trying gmin =   5,6234E-03 Warning: Further gmin increment
Trying gmin =   8,6596E-03 Warning: Further gmin increment
Trying gmin =   9,6466E-03 Warning: Further gmin increment
Trying gmin =   9,9105E-03 Warning: Further gmin increment
Trying gmin =   9,9775E-03 Warning: Further gmin increment
Trying gmin =   9,9944E-03 Warning: Further gmin increment
Trying gmin =   9,9986E-03 Warning: Further gmin increment
Trying gmin =   9,9996E-03 Warning: Last gmin step failed
Warning: Dynamic gmin stepping failed
Note: Starting source stepping
Supplies reduced to   0,0000% 
Trying gmin =   1,0000E+12 Note: One successful gmin step
Trying gmin =   1,0000E+11 Note: One successful gmin step
Trying gmin =   1,0000E+10 Note: One successful gmin step
Trying gmin =   1,0000E+09 Note: One successful gmin step
Trying gmin =   1,0000E+08 Note: One successful gmin step
Trying gmin =   1,0000E+07 Note: One successful gmin step
Trying gmin =   1,0000E+06 Note: One successful gmin step
Trying gmin =   1,0000E+05 Note: One successful gmin step
Trying gmin =   1,0000E+04 Note: One successful gmin step
Trying gmin =   1,0000E+03 Note: One successful gmin step
Trying gmin =   1,0000E+02 Note: One successful gmin step
Note: One successful source step
Supplies reduced to   0,1000% Note: One successful source step
Supplies reduced to   0,2000% Note: One successful source step
Supplies reduced to   0,3500% Note: One successful source step
Supplies reduced to   0,5750% Note: One successful source step
Supplies reduced to   0,9125% Note: One successful source step
Supplies reduced to   1,4188% Note: One successful source step
Supplies reduced to   2,1781% Note: One successful source step
Supplies reduced to   3,3172% Note: One successful source step
Supplies reduced to   5,0258% Note: One successful source step
Supplies reduced to   7,5887% Note: One successful source step
Supplies reduced to  11,4330% Note: One successful source step
Supplies reduced to  17,1995% Note: One successful source step
Supplies reduced to  25,8493% Note: One successful source step
Supplies reduced to  38,8239% Note: One successful source step
Supplies reduced to  58,2859% Note: One successful source step
Supplies reduced to  87,4788% Note: One successful source step
Supplies reduced to 100,0000% Note: One successful source step
Note: Source stepping completed
 Reference value :  1,00000e+00
No. of Data Rows : 31

I would suggest contacting Microchip for help. If you’re making several thousand units with this part, then they should want to help support your design with your preferred tools. If not, then you can try finding a different opamp from a different manufacturer who will.

Alternatively, if you are dead-set on getting this working so you can see the frequency response, you can try dumping as much time as you want into messing around with the subcircuit parameters yourself. Or you can try a different simulator, since I was able to get your exact simulation running in LTspice. It could easily break though when setting different operating conditions, as shown above.

You are right, I will not spend more time on that and use LM358, that model works and it suits my needs too and I got a lot of them. Anyway, thanks for the efforts :slight_smile:

With current KiCad 6.0.6 and ngspice-37 it is no problem to run this OpAmp in dc, ac or tran simulation, see project attached.
MCP6001.7z (7.6 KB)

2 Likes