1
\$\begingroup\$

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
.include /path/to/ad8606.cir
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.

good simulation

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)

\$\endgroup\$
4
  • 2
    \$\begingroup\$ Why don't use a free "graphical" simulator spectrum-soft.com/download/download.shtm \$\endgroup\$
    – Antonio51
    Feb 25 at 10:39
  • 2
    \$\begingroup\$ This is the preferred down load link to the zip file: microcap: spectrum-soft.com/download/mc12cd.zip @Antonio51 \$\endgroup\$
    – Andy aka
    Feb 25 at 11:16
  • 1
    \$\begingroup\$ @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 \$\endgroup\$
    – Ste Kulov
    Feb 28 at 7:06
  • \$\begingroup\$ 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. \$\endgroup\$
    – Adrien
    Mar 2 at 15:48

1 Answer 1

1
\$\begingroup\$

Did you offset your input, because of single supply ?

Made a simulation. R=100 Ohm is a low load for the opamp.
Electrical characteristic: Output Current: IOUT ±30 mA.

See this ...

enter image description here

\$\endgroup\$
4
  • \$\begingroup\$ Thank you for running the simulations. As mentioned I also tested for 10kΩ, which should be okay (I = V/R = 0.11 mA- 0.9mA), but I still see the erratic behaviour of ngspice (running well for some loads around it, failing for others). Do you use ngspice for the simulation? \$\endgroup\$
    – Adrien
    Feb 25 at 10:37
  • \$\begingroup\$ Generally, failing .. is a parameters problem. if you use a "graphical" simulator, some parameters are adapted automatically. Sometimes, it really fails, but because the system matrix simulated is "singular". the, you must change something (i.e add a resistor). \$\endgroup\$
    – Antonio51
    Feb 25 at 10:44
  • 3
    \$\begingroup\$ @Adrien There is no single cause for a simulator failing: it can be a numeric problem, a wrong value that leads to a numeric problem, a node that changes too quickly and the derivative gets too large, a timestep that shrinks to its lowest limit, a butterfly, lots of things. And solving them can be quite an art. It could be that ngspice doesn't like the way the model is built, since MicroCap (Antonio's answer), and LTspice, can do it (most probably others, too). Try adding some small series R to the sources, or a small decoupling C for the supply. \$\endgroup\$ Feb 25 at 11:33
  • \$\begingroup\$ Thanks a lot for clarifying the fact that different spice simulator can have quite different behaviour and convergence may not be attained with some. I now use LTSpice and everything is working fine \$\endgroup\$
    – Adrien
    Mar 2 at 15:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.