Hi folk, I try to simulate a simple AOP square/triangle generator using Kicad 5.0.2.
On my schematic I add a ngspice model for 741 Opamp found on the web, here it is :
Thanks holger, I’ll check and return if I found a solution.
In fact that’s thé référence site I use for my exemple. It works partially for transistor but not for OpAmp.
If you’re using the LM741 symbol that comes with KiCad, it has 7 ports instead of the 5 that your UA741 model requires (i.e. no offset null pins). Therefore, you should put the following for Alternate Node Sequence: 3,2,7,4,6
Hi Ste, you’re right, by adding this pin assign that remove first :
Too many parameters for subcircuit type “ua741” (instance: xxu1)
and
Too many parameters for subcircuit type “ua741” (instance: xxu2)
but it seems not suffisant, at the end no simulation start, here the complete report :
Circuit: KiCad schematic
Reducing trtol to 1 for xspice ‘A’ devices
Doing analysis at TEMP = 27.000000 and TNOM = 27.000000
Note: Starting dynamic gmin stepping
Trying gmin = 1.0000E-003 Warning: Further gmin increment
Trying gmin = 5.6234E-003 Note: One successful gmin step
Trying gmin = 4.2170E-003 Note: One successful gmin step
Trying gmin = 2.7384E-003 Note: One successful gmin step
Trying gmin = 1.4330E-003 Note: One successful gmin step
Trying gmin = 5.4247E-004 Note: One successful gmin step
Trying gmin = 2.0535E-004 Note: One successful gmin step
Trying gmin = 7.7737E-005 Note: One successful gmin step
Trying gmin = 1.8106E-005 Note: One successful gmin step
Trying gmin = 2.0351E-006 Note: One successful gmin step
Trying gmin = 6.8231E-007 Warning: Further gmin increment
Trying gmin = 1.5486E-006 Warning: Further gmin increment
Trying gmin = 1.9008E-006 Note: One successful gmin step
Trying gmin = 1.7753E-006 Note: One successful gmin step
Trying gmin = 1.6581E-006 Note: One successful gmin step
Trying gmin = 1.6024E-006 Warning: Further gmin increment
Trying gmin = 1.6440E-006 Note: One successful gmin step
Trying gmin = 1.6231E-006 Note: One successful gmin step
Trying gmin = 1.6024E-006 Note: One successful gmin step
Trying gmin = 1.5922E-006 Note: One successful gmin step
Trying gmin = 1.5770E-006 Note: One successful gmin step
Trying gmin = 1.5544E-006 Note: One successful gmin step
Trying gmin = 1.5432E-006 Warning: Further gmin increment
Trying gmin = 1.5516E-006 Note: One successful gmin step
Trying gmin = 1.5488E-006 Note: One successful gmin step
Trying gmin = 1.5446E-006 Warning: Further gmin increment
Trying gmin = 1.5478E-006 Note: One successful gmin step
Trying gmin = 1.5467E-006 Note: One successful gmin step
Trying gmin = 1.5457E-006 Note: One successful gmin step
Trying gmin = 1.5452E-006 Note: One successful gmin step
Trying gmin = 1.5446E-006 Warning: Further gmin increment
Trying gmin = 1.5450E-006 Note: One successful gmin step
Trying gmin = 1.5450E-006 Note: One successful gmin step
Trying gmin = 1.5449E-006 Note: One successful gmin step
Trying gmin = 1.5448E-006 Warning: Last gmin step failed
Warning: Dynamic gmin stepping failed
Note: Starting source stepping
Supplies reduced to 0.0000% 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.3000% Note: One successful source step
Supplies reduced to 0.4500% Note: One successful source step
Supplies reduced to 0.6750% Note: One successful source step
Supplies reduced to 1.0125% Note: One successful source step
Supplies reduced to 1.5188% Note: One successful source step
Supplies reduced to 2.2781% Note: One successful source step
Supplies reduced to 3.4172% Note: One successful source step
Supplies reduced to 5.1258% Note: One successful source step
Supplies reduced to 6.8344% Note: One successful source step
Supplies reduced to 7.6887% Supplies reduced to 6.8344% Note: One successful source step
Supplies reduced to 6.8771% Note: One successful source step
Supplies reduced to 6.9198% Note: One successful source step
Supplies reduced to 6.9839% Note: One successful source step
Supplies reduced to 7.0479% Note: One successful source step
Supplies reduced to 7.1441% Note: One successful source step
Supplies reduced to 7.2882% Note: One successful source step
Supplies reduced to 7.5045% Note: One successful source step
Supplies reduced to 7.8288% Note: One successful source step
Supplies reduced to 8.1532% Note: One successful source step
Supplies reduced to 8.4776% Note: One successful source step
Supplies reduced to 8.9641% Note: One successful source step
Supplies reduced to 9.4507% Note: One successful source step
Supplies reduced to 9.6939% Supplies reduced to 9.4507% Note: One successful source step
Supplies reduced to 9.4750% Note: One successful source step
Supplies reduced to 9.5115% Note: One successful source step
Supplies reduced to 9.5662% Note: One successful source step
Supplies reduced to 9.6483% Note: One successful source step
Supplies reduced to 9.7715% Note: One successful source step
Supplies reduced to 9.9562% Note: One successful source step
Supplies reduced to 10.2333% Supplies reduced to 9.9562% Note: One successful source step
Supplies reduced to 9.9839% Note: One successful source step
Supplies reduced to 10.0255% Note: One successful source step
Supplies reduced to 10.0878% Note: One successful source step
Supplies reduced to 10.1814% Note: One successful source step
Supplies reduced to 10.3216% Note: One successful source step
Supplies reduced to 10.5321% Note: One successful source step
Supplies reduced to 10.8477% Note: One successful source step
Supplies reduced to 11.3212% Note: One successful source step
Supplies reduced to 12.0314% Note: One successful source step
Supplies reduced to 12.7415% Note: One successful source step
Supplies reduced to 13.4517% Note: One successful source step
Supplies reduced to 14.1619% Note: One successful source step
Supplies reduced to 14.8721% Note: One successful source step
Supplies reduced to 15.5823% Note: One successful source step
Supplies reduced to 16.2925% Note: One successful source step
Supplies reduced to 17.0027% Note: One successful source step
Supplies reduced to 17.7129% Note: One successful source step
Supplies reduced to 18.4231% Supplies reduced to 17.7129% Note: One successful source step
Supplies reduced to 17.7839% Note: One successful source step
Supplies reduced to 17.8549% Note: One successful source step
Supplies reduced to 17.9614% Note: One successful source step
Supplies reduced to 18.1212% Note: One successful source step
Supplies reduced to 18.3609% Note: One successful source step
Supplies reduced to 18.7205% Note: One successful source step
Supplies reduced to 19.2598% Note: One successful source step
Supplies reduced to 20.0687% Note: One successful source step
Supplies reduced to 20.8777% Note: One successful source step
Supplies reduced to 21.6866% Note: One successful source step
Supplies reduced to 22.4956% Note: One successful source step
Supplies reduced to 23.3045% Note: One successful source step
Supplies reduced to 24.1135% Supplies reduced to 23.3045% Note: One successful source step
Supplies reduced to 23.3854% Note: One successful source step
Supplies reduced to 23.4663% Note: One successful source step
Supplies reduced to 23.5876% Note: One successful source step
Supplies reduced to 23.7696% Note: One successful source step
Supplies reduced to 24.0427% Note: One successful source step
Supplies reduced to 24.4522% Note: One successful source step
Supplies reduced to 25.0665% Note: One successful source step
Supplies reduced to 25.6808% Note: One successful source step
Supplies reduced to 26.2951% Note: One successful source step
Supplies reduced to 26.9094% Note: One successful source step
Supplies reduced to 27.5237% Note: One successful source step
Supplies reduced to 28.1380% Note: One successful source step
Supplies reduced to 28.7523% Note: One successful source step
Supplies reduced to 29.3666% Note: One successful source step
Supplies reduced to 29.9809% Note: One successful source step
Supplies reduced to 30.5952% Note: One successful source step
Supplies reduced to 31.2095% Note: One successful source step
Supplies reduced to 31.8238% Note: One successful source step
Supplies reduced to 32.4381% Note: One successful source step
Supplies reduced to 33.0523% Note: One successful source step
Supplies reduced to 33.6666% Supplies reduced to 33.0523% Note: One successful source step
Supplies reduced to 33.1138% Note: One successful source step
Supplies reduced to 33.1752% Note: One successful source step
Supplies reduced to 33.2674% Supplies reduced to 33.1752% Note: One successful source step
Supplies reduced to 33.1890% Note: One successful source step
Supplies reduced to 33.2098% Note: One successful source step
Supplies reduced to 33.2409% Note: One successful source step
Supplies reduced to 33.2875% Supplies reduced to 33.2409% Note: One successful source step
Supplies reduced to 33.2479% Note: One successful source step
Supplies reduced to 33.2584% Note: One successful source step
Supplies reduced to 33.2741% Note: One successful source step
Supplies reduced to 33.2977% Note: One successful source step
Supplies reduced to 33.3331% Note: One successful source step
Supplies reduced to 33.3863% Note: One successful source step
Supplies reduced to 33.4660% Note: One successful source step
Supplies reduced to 33.5855% Supplies reduced to 33.4660% Note: One successful source step
Supplies reduced to 33.4839% Note: One successful source step
Supplies reduced to 33.5108% Note: One successful source step
Supplies reduced to 33.5512% Note: One successful source step
Supplies reduced to 33.6117% Note: One successful source step
Supplies reduced to 33.7025% Note: One successful source step
Supplies reduced to 33.8386% Note: One successful source step
Supplies reduced to 34.0429% Note: One successful source step
Supplies reduced to 34.3493% Note: One successful source step
Supplies reduced to 34.8089% Supplies reduced to 34.3493% Note: One successful source step
Supplies reduced to 34.4183% Note: One successful source step
Supplies reduced to 34.5217% Note: One successful source step
Supplies reduced to 34.6768% Note: One successful source step
Supplies reduced to 34.9095% Supplies reduced to 34.6768% Note: One successful source step
Supplies reduced to 34.7117% Note: One successful source step
Supplies reduced to 34.7640% Note: One successful source step
Supplies reduced to 34.8426% Note: One successful source step
Supplies reduced to 34.9604% Note: One successful source step
Supplies reduced to 35.1370% Note: One successful source step
Supplies reduced to 35.4021% Note: One successful source step
Supplies reduced to 35.7996% Note: One successful source step
Supplies reduced to 36.3960% Note: One successful source step
Supplies reduced to 36.9923% Supplies reduced to 36.3960% Note: One successful source step
Supplies reduced to 36.4556% Note: One successful source step
Supplies reduced to 36.5152% Note: One successful source step
Supplies reduced to 36.6047% Note: One successful source step
Supplies reduced to 36.7388% Note: One successful source step
Supplies reduced to 36.9401% Note: One successful source step
Supplies reduced to 37.2420% Note: One successful source step
Supplies reduced to 37.5439% Note: One successful source step
Supplies reduced to 37.9967% Note: One successful source step
Supplies reduced to 38.6759% Note: One successful source step
Supplies reduced to 39.3552% Note: One successful source step
Supplies reduced to 40.0344% Note: One successful source step
Supplies reduced to 40.7137% Note: One successful source step
Supplies reduced to 41.3929% Note: One successful source step
Supplies reduced to 42.0722% Supplies reduced to 41.3929% Note: One successful source step
Supplies reduced to 41.4609% Note: One successful source step
Supplies reduced to 41.5288% Note: One successful source step
Supplies reduced to 41.6307% Note: One successful source step
Supplies reduced to 41.7835% Note: One successful source step
Supplies reduced to 42.0128% Note: One successful source step
Supplies reduced to 42.3566% Note: One successful source step
Supplies reduced to 42.8724% Note: One successful source step
Supplies reduced to 43.6461% Note: One successful source step
Supplies reduced to 44.4198% Supplies reduced to 43.6461% Note: One successful source step
Supplies reduced to 43.7235% Note: One successful source step
Supplies reduced to 43.8009% Supplies reduced to 43.7235% Note: One successful source step
Supplies reduced to 43.7351% Note: One successful source step
Supplies reduced to 43.7525% Note: One successful source step
Supplies reduced to 43.7786% Note: One successful source step
Supplies reduced to 43.8178% Note: One successful source step
Supplies reduced to 43.8766% Note: One successful source step
Supplies reduced to 43.9647% Supplies reduced to 43.8766% Note: One successful source step
Supplies reduced to 43.8898% Supplies reduced to 43.8766% Note: One successful source step
Supplies reduced to 43.8785% Note: One successful source step
Supplies reduced to 43.8815% Note: One successful source step
Supplies reduced to 43.8860% Note: One successful source step
Supplies reduced to 43.8927% Note: One successful source step
Supplies reduced to 43.9027% Note: One successful source step
Supplies reduced to 43.9178% Note: One successful source step
Supplies reduced to 43.9403% Supplies reduced to 43.9178% Note: One successful source step
Supplies reduced to 43.9211% Note: One successful source step
Supplies reduced to 43.9262% Note: One successful source step
Supplies reduced to 43.9339% Note: One successful source step
Supplies reduced to 43.9453% Note: One successful source step
Supplies reduced to 43.9624% Supplies reduced to 43.9453% Note: One successful source step
Supplies reduced to 43.9479% Supplies reduced to 43.9453% Note: One successful source step
Supplies reduced to 43.9457% Note: One successful source step
Supplies reduced to 43.9463% Note: One successful source step
Supplies reduced to 43.9471% Note: One successful source step
Supplies reduced to 43.9484% Note: One successful source step
Supplies reduced to 43.9504% Note: One successful source step
Supplies reduced to 43.9533% Note: One successful source step
Supplies reduced to 43.9577% Note: One successful source step
Supplies reduced to 43.9643% Note: One successful source step
Supplies reduced to 43.9742% Supplies reduced to 43.9643% Note: One successful source step
Supplies reduced to 43.9658% Note: One successful source step
Supplies reduced to 43.9680% Note: One successful source step
Supplies reduced to 43.9713% Note: One successful source step
Supplies reduced to 43.9764% Note: One successful source step
Supplies reduced to 43.9839% Note: One successful source step
Supplies reduced to 43.9951% Note: One successful source step
Supplies reduced to 44.0120% Supplies reduced to 43.9951% Note: One successful source step
Supplies reduced to 43.9977% Note: One successful source step
Supplies reduced to 44.0015% Note: One successful source step
Supplies reduced to 44.0072% Supplies reduced to 44.0015% Note: One successful source step
Supplies reduced to 44.0023% Note: One successful source step
Supplies reduced to 44.0036% Note: One successful source step
Supplies reduced to 44.0055% Note: One successful source step
Supplies reduced to 44.0084% Note: One successful source step
Supplies reduced to 44.0127% Note: One successful source step
Supplies reduced to 44.0192% Note: One successful source step
Supplies reduced to 44.0290% Note: One successful source step
Supplies reduced to 44.0436% Note: One successful source step
Supplies reduced to 44.0655% Note: One successful source step
Supplies reduced to 44.0984% Note: One successful source step
Supplies reduced to 44.1478% Note: One successful source step
Supplies reduced to 44.2218% Note: One successful source step
Supplies reduced to 44.3328% Note: One successful source step
Supplies reduced to 44.4993% Note: One successful source step
Supplies reduced to 44.6658% Note: One successful source step
Supplies reduced to 44.9155% Note: One successful source step
Supplies reduced to 45.2901% Note: One successful source step
Supplies reduced to 45.8521% Note: One successful source step
Supplies reduced to 46.4140% Note: One successful source step
Supplies reduced to 46.9759% Supplies reduced to 46.4140% Note: One successful source step
Supplies reduced to 46.4702% Note: One successful source step
Supplies reduced to 46.5264% Note: One successful source step
Supplies reduced to 46.6107% Note: One successful source step
Supplies reduced to 46.7371% Note: One successful source step
Supplies reduced to 46.9268% Note: One successful source step
Supplies reduced to 47.2112% Note: One successful source step
Supplies reduced to 47.6380% Supplies reduced to 47.2112% Note: One successful source step
Supplies reduced to 47.2752% Note: One successful source step
Supplies reduced to 47.3713% Note: One successful source step
Supplies reduced to 47.5153% Note: One successful source step
Supplies reduced to 47.7313% Note: One successful source step
Supplies reduced to 48.0553% Supplies reduced to 47.7313% Note: One successful source step
Supplies reduced to 47.7799% Note: One successful source step
Supplies reduced to 47.8528% Note: One successful source step
Supplies reduced to 47.9622% Supplies reduced to 47.8528% Note: One successful source step
Supplies reduced to 47.8692% Note: One successful source step
Supplies reduced to 47.8938% Note: One successful source step
Supplies reduced to 47.9307% Supplies reduced to 47.8938% Note: One successful source step
Supplies reduced to 47.8994% Note: One successful source step
Supplies reduced to 47.9077% Note: One successful source step
Supplies reduced to 47.9201% Supplies reduced to 47.9077% Note: One successful source step
Supplies reduced to 47.9095% Note: One successful source step
Supplies reduced to 47.9123% Note: One successful source step
Supplies reduced to 47.9165% Note: One successful source step
Supplies reduced to 47.9229% Note: One successful source step
Supplies reduced to 47.9323% Note: One successful source step
Supplies reduced to 47.9465% Note: One successful source step
Supplies reduced to 47.9678% Note: One successful source step
Supplies reduced to 47.9997% Note: One successful source step
Supplies reduced to 48.0476% Note: One successful source step
Supplies reduced to 48.1194% Note: One successful source step
Supplies reduced to 48.2272% Note: One successful source step
Supplies reduced to 48.3888% Note: One successful source step
Supplies reduced to 48.6313% Note: One successful source step
Supplies reduced to 48.9949% Note: One successful source step
Supplies reduced to 49.5404% Note: One successful source step
Supplies reduced to 50.0859% Note: One successful source step
Supplies reduced to 50.6314% Note: One successful source step
Supplies reduced to 51.1769% Note: One successful source step
Supplies reduced to 51.7224% Note: One successful source step
Supplies reduced to 52.2679% Note: One successful source step
Supplies reduced to 52.8134% Note: One successful source step
Supplies reduced to 53.3589% Note: One successful source step
Supplies reduced to 53.9044% Note: One successful source step
Supplies reduced to 54.4498% Note: One successful source step
Supplies reduced to 54.9953% Note: One successful source step
Supplies reduced to 55.5408% Note: One successful source step
Supplies reduced to 56.0863% Note: One successful source step
Supplies reduced to 56.6318% Note: One successful source step
Supplies reduced to 57.1773% Supplies reduced to 56.6318% Note: One successful source step
Supplies reduced to 56.6864% Note: One successful source step
Supplies reduced to 56.7409% Note: One successful source step
Supplies reduced to 56.8227% Note: One successful source step
Supplies reduced to 56.9455% Note: One successful source step
Supplies reduced to 57.1296% Supplies reduced to 56.9455% Note: One successful source step
Supplies reduced to 56.9731% Note: One successful source step
Supplies reduced to 57.0145% Note: One successful source step
Supplies reduced to 57.0767% Note: One successful source step
Supplies reduced to 57.1699% Note: One successful source step
Supplies reduced to 57.3097% Note: One successful source step
Supplies reduced to 57.5194% Note: One successful source step
Supplies reduced to 57.8339% Note: One successful source step
Supplies reduced to 58.3058% Note: One successful source step
Supplies reduced to 59.0135% Note: One successful source step
Supplies reduced to 59.7213% Note: One successful source step
Supplies reduced to 60.4290% Note: One successful source step
Supplies reduced to 61.1368% Note: One successful source step
Supplies reduced to 61.8445% Supplies reduced to 61.1368% Note: One successful source step
Supplies reduced to 61.2076% Supplies reduced to 61.1368% Note: One successful source step
Supplies reduced to 61.1474% Note: One successful source step
Supplies reduced to 61.1633% Note: One successful source step
Supplies reduced to 61.1872% Note: One successful source step
Supplies reduced to 61.2230% Supplies reduced to 61.1872% Note: One successful source step
Supplies reduced to 61.1926% Supplies reduced to 61.1872% Note: One successful source step
Supplies reduced to 61.1880% Note: One successful source step
Supplies reduced to 61.1892% Note: One successful source step
Supplies reduced to 61.1910% Note: One successful source step
Supplies reduced to 61.1938% Supplies reduced to 61.1910% Note: One successful source step
Supplies reduced to 61.1915% Note: One successful source step
Supplies reduced to 61.1921% Note: One successful source step
Supplies reduced to 61.1930% Note: One successful source step
Supplies reduced to 61.1944% Supplies reduced to 61.1930% Note: One successful source step
Supplies reduced to 61.1932% Supplies reduced to 61.1930% Note: One successful source step
Supplies reduced to 61.1930% Warning: source stepping failed
Transient solution failed -
Last Node Voltages
First to check if the 741 model is o.k. (not guaranteded, especially when “found on the web”).
The following is a simple OpAmp amplifier, including your model as ua741.lib and running in discrete ngspice:
OpAmp 741 simple inverting amplifier
.include ua741.lib
X741 in+ in- v+ v- out UA741
VCC v+ 0 15
VSS v- 0 -15
Vz in+ 0 0
Rin in in- 10k
Rfb out in- 100k
Vin in 0 dc 0 SIN (0 0.1 10k)
.tran 1u 1m
.control
run
plot v(out) v(in)
.endc
.end
The plot output is o.k., thus the model is probably o.k. as well.
The simulator tells us that he is not finding the operating point of the circuit. This may happen when you try to simulate an oscillator. You may skip using the op by adding uic to the .tran line.
Edit the text box with the .tran line (double click onto the box on the circuit diagram) and add iuc like this .tran 1u 1m uic
If this does not help, please post the netlist here.
Typical order for troubleshooting convergence issues:
Something is wrong with your circuit. You either made an unintentional drafting mistake, or the design is horribly wrong which results in wacky voltages & currents.
You’re simulating a behavior which has no valid DC operating point, such as an oscillator as mentioned above. You need to use either .ic or .nodeset commands to help the program arrive at an initial solution. Sometimes GMIN needs to be adjusted in extreme cases.
The subcircuit supplied from the manufacturer (or elsewhere) is garbage and was poorly tested prior to release.
Usually #1 is the most common, and it is also true in this specific case. In your circuit, VEE is at higher potential than VCC. Flip your batteries around and you should get different results.
By using the .tran 1u 5ms uic (or without uic) I don’t see any differences.
Not sure ti understand the .control (then .endc) is this mean automatic plot of v(Name) when running simulation ?
Thanks again.
PS: For all interested I’m able to joint the schematic and lib file, do you know how to joint to this post ?
Hi Holger, thanks, I’m self learning ngspice and I discover it step by step. Is there a way when you run the Kicad simulator to highlight specific signal ? Thanks again. Vincent.