# Ngspice convergence problem AD8606 simple simulation

I am new to electrical circuit simulation and I would like to simulate the behaviour of the operational amplifier AD8606 in a simple follower configuration, facing different loads.

In order to do that I am using ngspice and I generate the simulation netlist through the python library pyspice. Here is an example of transient simulation I run:

.title Amplifier test
VCC VCC 0 3.2V
VIN VIN 0 SIN(1 0.1 1000)
Xopamp VIN VA VCC 0 VA ad8606
R1 VA 0 100.0Ohm
.options TEMP = 27C
.options TNOM = 27C
.tran 1e-05s 0.01s 0s
.end


I want to change the value of the resistor R1 (here 100 Ω) from 100 Ω to 1000 Ω. I use the ad8606 spice model freely available on the analog circuit website, whose layout is as follows:

.* Node Assignments
*           noninverting input
*           |   inverting input
*           |   |    positive supply
*           |   |    |   negative supply
*           |   |    |   |   output
*           |   |    |   |   |
*           |   |    |   |   |
.SUBCKT AD8606          1   2   99  50  45
...


When I try to run this simulation, for some values of R1 (for instance 100 Ω, 120 Ω, 140 Ω, 220 Ω ), I have the expected output at VA, ie a DC value of 1 V plus a sine wave of frequency 1000 Hz and amplitude 0.1.

For other values (for instance 110 Ω or 140 Ω), the simulation fails with the following error:

Note: Starting true gmin stepping
Trying gmin =   1.0000E-03 Note: One successful gmin step
Trying gmin =   1.0000E-04 Note: One successful gmin step
Trying gmin =   1.0000E-05 Note: One successful gmin step
Trying gmin =   1.0000E-06 Note: One successful gmin step
Trying gmin =   1.0000E-07 Note: One successful gmin step
Trying gmin =   1.0000E-08 Note: One successful gmin step
Trying gmin =   1.0000E-09 Note: One successful gmin step
Trying gmin =   1.0000E-10 Note: One successful gmin step
Trying gmin =   1.0000E-11 Note: One successful gmin step
Trying gmin =   1.0000E-12 Note: One successful gmin step
Trying gmin =   1.0000E-12 Note: One successful gmin step
Note: True gmin stepping completed

Reducing trtol to 1 for xspice 'A' devices
Doing analysis at TEMP = 27.000000 and TNOM = 27.000000
Initial Transient Solution
--------------------------
Node                                   Voltage
----                                   -------
vcc                                        3.2
vin                                          1
xopamp.14                             0.199992
xopamp.7                              0.999947
xopamp.8                               1.40652
xopamp.16                             0.200008
va                                    0.999944
xopamp.17                              2.99999
xopamp.10                             0.593845
xopamp.18                              3.00001
xopamp.9                                   2.9
xopamp.13                                  0.3
xopamp.22                              1.59999
xopamp.98                                  1.6
xopamp.73                              1.59994
xopamp.81                                  1.6
xopamp.21                             0.999972
xopamp.72                                 -1.6
xopamp.80                                  1.6
xopamp.97                                  2.6
xopamp.51                                  0.6
xopamp.30                             0.599045
xopamp.46                              1.73464
xopamp.47                            -0.561555
h.xopamp.hn#branch                           0
v.xopamp.vn1#branch                          0
v.xopamp.v2#branch                 3.03847e-13
v.xopamp.v1#branch                 1.50348e-12
vin#branch                               -0.01
vcc#branch                         -0.00734246
a$poly$e.xopamp.eg2#branch_1_0               0
a$poly$e.xopamp.eg1#branch_1_0               0
a$poly$e.xopamp.evn#branch_1_0    -1.33227e-15
a$poly$e.xopamp.evp#branch_1_0    -2.01096e-12
a$poly$e.xopamp.eref#branch_1_0     -1.8619e-15
a$poly$e.xopamp.epsy#branch_1_0    -5.69041e-05
a$poly$e.xopamp.ecm1#branch_1_0     6.00022e-06
a$poly$e.xopamp.eos#branch_1_0               0
Reference value :  0.00000e+00
No. of Data Rows : 1008
Command 'run' failed


The most puzzling fact is that there seems to be no clue on the value of the resistor that make it fail (100 Ω is OK, 100.1 Ω is not, but 100.6 Ω is OK again, etc.). I also see this kind of behaviour for higher R1 (around 10 kΩ for instance).

As I am new to this, I am wondering if I am missing something obvious or if I am making my simulation wrong?

I also tried to change the time step but it did not affect the result (fail or no fail)

• @Adrien What version of ngspice are you using? I am unable to duplicate your issue. Your error is very vague in saying that the 'run' command failed without any hints of saying what failed. I get the same exact output as you (for all resistances), except for the final line which says the error never comes up for me. You may also try to get more nuanced help by visiting the ngspice help page: sourceforge.net/p/ngspice/discussion/120973 Commented Feb 28, 2022 at 7:06
• I am using ngspice 35 for linux. I think the significant parts of the error are the lines 'Trying gmin = ... Note: One successful gmin step', which means (I think) that the fixed point algorithm did not converge. Commented Mar 2, 2022 at 15:48