He who controls the SPICE, controls the universe!

General discussion area for tube amps.

Moderators: pompeiisneaks, Colossal

User avatar
martin manning
Posts: 14308
Joined: Sun Jul 06, 2008 12:43 am
Location: 39°06' N 84°30' W

Re: He who controls the SPICE, controls the universe!

Post by martin manning »

Have a look at this .pdf on biasing the D FET booster, page 3. Disclaimer, like all such things, it's only as good as the component models.
https://ampgarage.com/forum/viewtopic.p ... 91#p211891
R.G.
Posts: 1579
Joined: Tue Dec 02, 2014 9:01 pm

Re: He who controls the SPICE, controls the universe!

Post by R.G. »

solderhead wrote: Sat May 03, 2025 12:53 pm What kind of results are you getting when you try to model the non-linearities of a system? IME Spice is great for modelling in the linear range, not so great for the non-linear range of behaviors, which tend to be the more interesting operating areas in many applications.
The older variants of Spice had issues with this, but the later variants now do a much better job. I've been doing simulation since I had to submit spice runs on punched cards, and it's improved hugely. There are still situations where a solution cannot converge, but equation-based component models have helped that hugely.

People who have done a lot of spice simulation have accumulated a lot of tricks to avoid the lockups and zig-zag stepping that can happen. These usually amount to sprinkling in some "real world" items in the model. For instance, my variant of spice simply includes a very large resistor to ground from every analog node. In older spice versions, a clever programmer would add resistors to ground explicitly to cure lockups. This is much more like the real world. Inserting 1milliohm resistors to fake "traces" generally helps with the unreal purity of ideal capacitor models; my variant of spice has capacitor models with ESR, ESL, etc. and this prevents some of the edge-case issues, especially with nonlinear parts other places.

One trick that I came up with - although I'm sure someone else thought of it first - is to include a periodic voltage source with only a resistor across it, at a frequency that is higher than the nominal frequencies of the circuit, and at a non-harmonic multiple of the main frequency. This forces the program to do more simulation steps at intervals that don't match/reinforce the main operating frequencies. It's a huge help in avoiding convergence errors and smoothing the visible results.

I recently had to do some modeling with high pulse currents, saturating inductors, electrolytic caps, high current diodes and MOSFETs. I was looking for the avalanche behavior of the MOSFETs and diodes when the inductor transitioned into and out of saturation. Worked fine.

Overall, the programs can handle it; the limitation is the understanding of the person driving. It's a powerful tool, and capable of great subtlety, including in nonlinear situations. I certainly don't know everything there is to know about simulation, but it works well - and much, much better than older versions.
"It's not what we don't know that gets us in trouble. It's what we know for sure that just ain't so"
Mark Twain
Lauri
Posts: 126
Joined: Sun May 13, 2007 6:35 pm
Location: Finland

Re: He who controls the SPICE, controls the universe!

Post by Lauri »

solderhead wrote: Sat May 03, 2025 12:53 pm What kind of results are you getting when you try to model the non-linearities of a system? IME Spice is great for modelling in the linear range, not so great for the non-linear range of behaviors, which tend to be the more interesting operating areas in many applications.
Non linear range behavior is fairly close to real world if the models are good and the whole circuit is modeled without too many simplifications. I've used LTspice to create models for Neural Amp Modeler and they sound close to models created from real amps. It does take several hours to put a 3 minute long wav file through a simulation of a whole amp but the end result is good enough to get an idea what the circuit would sound like in real life.
User avatar
martin manning
Posts: 14308
Joined: Sun Jul 06, 2008 12:43 am
Location: 39°06' N 84°30' W

Re: He who controls the SPICE, controls the universe!

Post by martin manning »

Lauri wrote: Sat May 03, 2025 2:10 pm I've used LTspice to create models for Neural Amp Modeler...
Truly a Through the Looking Glass moment... A model of a model of an amp that never existed.
nuke
Posts: 279
Joined: Tue Sep 17, 2024 6:59 pm
Location: Silicon Valley

Re: He who controls the SPICE, controls the universe!

Post by nuke »

Lauri wrote: Sat May 03, 2025 9:07 am I also tried simulating it with Kicad and it works with spice model from Onsemi.

Code: Select all

.model BC546B NPN(IS=2.39E-14 NF=1.008 ISE=3.55E-15 NE=1.541 BF=294.3 IKF=0.1357 VAF=63.2 NR=1.004 ISC=6.27E-14 NC=1.243 BR=7.946 IKR=0.1144 VAR=25.9 RB=1 IRB=1.00E-06 RBM=1 RE=0.4683 RC=0.85 XTB=0 EG=1.11 XTI=3 CJE=1.36E-11 VJE=0.65 MJE=0.3279 TF=4.39E-10 XTF=120 VTF=2.643 ITF=0.7495 PTF=0 CJC=3.73E-12 VJC=0.3997 MJC=0.2955 XCJC=0.6193 TR=1.00E-32 CJS=0 VJS=0.75 MJS=0.333 FC=0.9579 Vceo=65 Icrating=100m mfg=NXP)
kicaddarlingtonlfosim.png


Thanks Lauri,

I'll have to give it another shot. I don't know what model I pulled in for the transistors, and I've updated KiCad a couple of times since then.

I wonder if it was something about the MacOSX version of KiCad, because I think I was working from my MacBook. I'll have to try it from a Windows system.
Post Reply