Simulation not converging upon changing resitance value - Solved

Hi everyone!

Im very new to ngspice and using it in KiCad, so please forgive me if im being stupid.
I was experimenting with a simple differential amplifier that I plan to use for measuring temperature.
When i set R5 to 1k, the simulation runs perfectly. The problem arises when i cange the value to any other value. At first I thought it had to do with “uneven” numbers like 1.3k, but with anything above 1.1k I do not get any results.

Error Message:
“doAnalyses: OP: Timestep too small; trouble with xu1.xi_nn:dvnf-instance d.xu1.xi_nn.d1
run simulation(s) aborted”

If i need to provide the original project for you to help, please tell me how its done.
This is my first post in a forum of any sort.

Thank you very much for your help!

Application: KiCad x64 on x64
Version: 9.0.4, release build
Libraries:
wxWidgets 3.2.8
FreeType 2.13.3
HarfBuzz 10.2.0
FontConfig 2.15.0
libcurl/8.13.0-DEV Schannel zlib/1.3.1
Platform: Windows 11 (Erzeugungsversion 26100), 64-bit Edition, 64 bit, Little endian, wxMSW
OpenGL: NVIDIA Corporation, NVIDIA GeForce RTX 4060 Laptop GPU/PCIe/SSE2, 4.6.0 NVIDIA 572.83
Build Info:
Date: Aug 18 2025 00:41:45
wxWidgets: 3.2.8 (wchar_t,wx containers)
Boost: 1.88.0
OCC: 7.9.1
Curl: 8.13.0-DEV
ngspice: 44
Compiler: Visual C++ 1942 without C++ ABI
KICAD_IPC_API=ON
Locale:
Lang: de_DE
Enc: UTF-8
Num: 1.234,5
Encoded кΩ丈: D0BACEA9E4B888 (sys), D0BACEA9E4B888 (utf8)

Basically R5 should be o.k. between 1k and 2k. If you are interested in exploring basic circuit ideas, it may be wise to use the generic opamp from the Simulation_SPICE library. It is with a model which is much more robust than any model from ‘real’ opamps.

The LM358 model may be picky when the output saturates near VCC or VEE, especially when VCC-VEE is on the lower end of the allowed range. Its output will never reach VCC or VEE.

Firstly it may help to uncheck the ‘Save all Power, Save all Digital’ in the Simulation Tab.

If there is such a non-convergence, sometimes it helps to add a ‘.options rshunt=1G’ into a text box. All nodes, also inside of the model, then are connected to ground via 1G resistors. Floating nodes may then settle to reasonable values.

With these actions I have been able to run a dc sweep simulation sweeping R5 from 1k to 2k and watching the output voltage, using the TI LM358 PSPICE model. The output saturation is obvious, it does not reach 4 V.

1 Like

Thanks for the help!
I also noticed that the problem dissappears when I connect the negative supply pin of the opamp to a negative voltage instead of GND. Just in case someone runs into to same issue.

Edit: Connecting an additional VDC-Source below GND potential with the voltage 0 seems to solve the problem, even without a real negative supply.