Spice simulation

jcx, you make a good point there. A single THD number is of no worth compared to another single THD number. Let's leave that kind of comparison to the sales people :hot:

With SPICE and with good FFT meters we can examine the components (mag and phase) which sum up to the THD number. I recall that more relevant weightings of the components have been proposed by several people, instead of the simple sqrt of sum of squared magnitudes, weighting the harmonics with order (Mr. Curl would weigh the 7th rather high, for example). In the simple weighting scheme any harmonics which are below 25% level relative to the most dominant harmonic are effectivly ignored...

Btw, I added cascodes to my stage, now it sims at sub 1ppm THD20 (0.000091%), almost purely 3rd order... now I gotta get rid of that 7th at 2.7e-08 below fundamental :D

- Klaus
 
jcx said:
Glen,
I claim there is little point in better than 1 digit accuracy THD numbers from a Sim

THD is a poor guide to quality of an audio circuit, and a very indirect guide to what’s going on - you should be looking at the fft to see the relative order of all the harmonics magnitudes at once, along with the distortion residual you actually can make informed guesses on what needs changing in a circuit

in my example distortion null circuit inspecting the distortion residual trace quickly shows that there is asymmetric clipping at the negative peak V swing, and the sharp zero crossing discontinuities show the output devices are under biased - try learning much that from a single THD number

also Parseval's theorem says the rms values/THD calculation are not affected by the relative phase of the components


I agree that single-number THD-20 does not tell enough of the story, and that using a nulling circuit to look at the residual is especially informative, particularly for looking at crossover distortion in output stages. Nevertheless, even the .four command is very useful in that it spits out not only THD, but also the relative level of each of the spectral components up to as many as you specify (I usually ask for 10).

When you look at the complete spectrum, it is quite revealing of how certain techniques work, such as TMC, NDFL, two-pole compensation, where the effectiveness of the technique can be seen to be decreasing with increased frequency.

It would be really nice if there was the equivalent of a .four command for twin-tone stimulous, like CCIF 19+20 kHz, as this is a very useful test. Note that the effect of things like TMC on CCIF is a bit different than THD, since even the higher order IM products are largely "in-band".

So, an interesting question is (especially if you are using something like TMC), if we have moderately high 7 th harmonic of 20 kHz due to the steeply falling net effectiveness of NFB vs frequency (the 7th harmonic is out at 140 kHz), but we still see the 7th order CCIF IM component being very low at -120 dB due to the high in-band effectiveness of TMC (at, I believe 16 kHz, in-band, and 23 kHz just out of band), which one is a better predictor of the sound quality?


Cheers,
Bob
 
Bob,

You can get IMD components with the .four command. You can specify upon which fundamental freq the DFT will be calculated. For a 19.5kHz+20.5kHz IMD test signal all components are at multiples of 0.5kHz, so this should be chosen for the "fundamental" in the .four command as the DFT frequency. The output data must obviously contain at least one period of that DFT frequency.

And you need 41 harmonics then to catch the upper of the base frequencies (or even more if you want to see stuff above 20.5kHz), in this example. Then one can transfer the non-normalized results into a little spreadsheet that does the IMD calculations.

- Klaus
 
KSTR said:
Bob,

You can get IMD components with the .four command. You can specify upon which fundamental freq the DFT will be calculated. For a 19.5kHz+20.5kHz IMD test signal all components are at multiples of 0.5kHz, so this should be chosen for the "fundamental" in the .four command as the DFT frequency. The output data must obviously contain at least one period of that DFT frequency.

And you need 41 harmonics then to catch the upper of the base frequencies (or even more if you want to see stuff above 20.5kHz), in this example. Then one can transfer the non-normalized results into a little spreadsheet that does the IMD calculations.

- Klaus


Thanks Klaus, I'll give it a try.

Bob
 

GK

Disabled Account
Joined 2006
jcx said:
Glen,
I claim there is little point in better than 1 digit accuracy THD numbers from a Sim

THD is a poor guide to quality of an audio circuit, and a very indirect guide to what’s going on - you should be looking at the fft to see the relative order of all the harmonics magnitudes at once, along with the distortion residual you actually can make informed guesses on what needs changing in a circuit

in my example distortion null circuit inspecting the distortion residual trace quickly shows that there is asymmetric clipping at the negative peak V swing, and the sharp zero crossing discontinuities show the output devices are under biased - try learning much that from a single THD number

also Parseval's theorem says the rms values/THD calculation are not affected by the relative phase of the components


OK, cool.
But the .four command gives the amplitude of the harmonics (up to the 9th by default) as well as a single THD number.
:confused:

Cheers,
Glen
 
I tested (took almost 30min sim time) the IMD via .four method, 19.5k+20.5k, 20.0k BW, with my simmed class-a stage, I got 0.08ppm IMD (with the stage having a tweaked THD20 of 0.3ppm. Pls don't comment on that, it's only a sim ;-).

Sanity check with a one transistor (MJL3281 into 2.4A CCS, no load) SE EF stage: THD 0.0243%, IMD 0.0165%

Algorithm was (IIRC also the CCIR definition):
.............RMS sum of IM components
IMD = ---------------------------------
..............RMS sum of base tones

Of course a 20.0k BW misses about the half of IMD, so one might have to double the values.

- Klaus
 
2SA1407 2SC3601 Spice Models

Ovidiu,

I'm looking at the 2SA1407 and 2SC3601 transistors you use in your VAS. These are very good performers.

However, I'm seeing some significant dc Vbe - Ic departures from the Sanyo spec sheet I am looking at.

At 10ma, the spec sheet says Vbe is 0.68 and 0.68 V for the 2SA1407 and the 2SC3601, respecyively.

At 10 mA, the SPICE model is showing vbe of 0.78 and 0.76 V, respectively.

At 40 mA, the spec sheet shows Vbe of 0.72 and 0.72.

At 40 mA, the SPICE model is showing 1.03 and 0.95 V.

This seems to be a fairly big discrepency. Am I doing something wrong? Where did you get these models. It looks like they may have a high RE or something.

Thanks,
Bob
 
Re: 2SA1407 2SC3601 Spice Models

Bob Cordell said:
Ovidiu,

I'm looking at the 2SA1407 and 2SC3601 transistors you use in your VAS. These are very good performers.

However, I'm seeing some significant dc Vbe - Ic departures from the Sanyo spec sheet I am looking at.


Bob,

We (myself and Edmond) noticed the same Vbe issue. Unfortunately Sanyo does not disclose any Spice models. The models I have posted are coming with the IntuSoft's ICAP/4 simulator, that's all I know.

The quality of these models is the reason why I was hoping for somebody to pick up and further refine and develop them. Unfortunately, as much as I would like to, I don't have the time to get into this.
 
Re: Re: 2SA1407 2SC3601 Spice Models

syn08 said:


Bob,

We (myself and Edmond) noticed the same Vbe issue. Unfortunately Sanyo does not disclose any Spice models. The models I have posted are coming with the IntuSoft's ICAP/4 simulator, that's all I know.

The quality of these models is the reason why I was hoping for somebody to pick up and further refine and develop them. Unfortunately, as much as I would like to, I don't have the time to get into this.


Thanks Ovidiu. I understand. We are indeed at the mercy of our models.

Best,
Bob
 
I'm trying to understand the limitations (if any) of the Gummel-Poon model. I'm looking to what happen with different values of VCE. The effect seems quite dramatical:
betadroop.JPG

The gain is sightly modified, but the beta droop is highly enhanced. I see that in every case the two diagrams are provided.
However, even using the (widely accepted parameters proposed by andy_c) parameters the effect is much milder.
Is there any explanation ?
Thanks
 
Tweaking SPICE Models

I've been thinking a little more about my post above regarding the SPICE models for the 2SA1407 and 2SC3601 transistors.

It's a shame that the dc vbe-IC is so far off, and I was wondering if it is at all legitimate to tweak the models to get them a little closer to published data (on the naive assumtion that the other stuff isn't too far off).

What I'm thinking of is just tweaking IS and RE. Currently for the 2SA1407, IS=15.2n and RE=7.63 ohms. The low-current vbe spec sheet behavior suggests IS is on the low side, while the high current data suggests that RE is way high.

Is it legit to just tweak these two parameters to get closer?

BTW, it looks like the automated modeling that some manufacturers use comes up with some ridiculous, non-physically reasonable values in attempting to fit data. For example, RB in my MJE15030 model is 267 ohms. Unless I'm terribly mistaken, this is a ridiculous value for that transistor.

Cheers,
Bob
 
Disabled Account
Joined 2004
Re: Tweaking SPICE Models

Bob Cordell said:
I've been thinking a little more about my post above regarding the SPICE models for the 2SA1407 and 2SC3601 transistors.

It's a shame that the dc vbe-IC is so far off, and I was wondering if it is at all legitimate to tweak the models to get them a little closer to published data (on the naive assumtion that the other stuff isn't too far off).

What I'm thinking of is just tweaking IS and RE. Currently for the 2SA1407, IS=15.2n and RE=7.63 ohms. The low-current vbe spec sheet behavior suggests IS is on the low side, while the high current data suggests that RE is way high.

Is it legit to just tweak these two parameters to get closer?

BTW, it looks like the automated modeling that some manufacturers use comes up with some ridiculous, non-physically reasonable values in attempting to fit data. For example, RB in my MJE15030 model is 267 ohms. Unless I'm terribly mistaken, this is a ridiculous value for that transistor.

Cheers,
Bob


You're right Bob, brainless multi-parameter fitting can lead to silly answers. I have fought this in the past. rbb and RE have very weak sensitivity in some parameter fitting algorithms. Imagine trying to extract rbb where its effect is only manifest by 1/beta. You need good old fashion experiments designed to extract each parameter separately (sometimes).
 
Re: Tweaking SPICE Models

Bob Cordell said:
I've been thinking a little more about my post above regarding the SPICE models for the 2SA1407 and 2SC3601 transistors.

It's a shame that the dc vbe-IC is so far off, and I was wondering if it is at all legitimate to tweak the models to get them a little closer to published data (on the naive assumtion that the other stuff isn't too far off).

What I'm thinking of is just tweaking IS and RE. Currently for the 2SA1407, IS=15.2n and RE=7.63 ohms. The low-current vbe spec sheet behavior suggests IS is on the low side, while the high current data suggests that RE is way high.

Is it legit to just tweak these two parameters to get closer?

BTW, it looks like the automated modeling that some manufacturers use comes up with some ridiculous, non-physically reasonable values in attempting to fit data. For example, RB in my MJE15030 model is 267 ohms. Unless I'm terribly mistaken, this is a ridiculous value for that transistor.

Cheers,
Bob


I imported the LTspice BJT library into a spread sheet that makes it a bit easier to look up and compare various model values.
I have about 10 of the older common small signal transistors, 2N2222, 2N2907, 2N5401, 2N5550, 2N4401, 2N4403 etc. mixed from Fairchild and Phillips and they all have Rb = 10 ohms. 2N3906/04 have Rb = 20 ohms.

The Onsemi models seem to have Rb ranging from below 1 ohm to several hundreds of ohms - probably the result of a poor curve fit and blindly trusting the results. I'd rather have a reasonable default value than an erroneous value resulting in a worthless model.

Nearly all of the models either do not spec Re, it defaults to zero as I recall, and those that do seem to have values below .1, even .01 ohms.

Rc seems to range from .01 ohm or less to 2 or 3 ohms max for the small sample that I'm looking at.

Seems Vce sat provides at least a sanity check for Re and Rc. It is less than .2 V @ 100 mA for the 2SC3601. Re is 5.63, Rc = 2.25 for the model provided on the forum here for that transistor. At 100 mA we have: .1 * (5.63+2.25) = .79 V which indicates that they're far too high. Rc alone is too high.

I too am trying to find a way to do a sanity check and determine a good enough fix for many of these models.

I started looking at Rb when I noticed that some med power transistors used as drivers tended to oscillate without base stoppers. Then checked the model to see that they often had less than 1 ohm Rb, those that were more stable had a value of 2 ohms or more and I think were all around better models which probably also contributed to better stability.

Would be nice if a semiconductor design specialist would comment on the Rb issue.

Pete B.
 
Re: Re: Tweaking SPICE Models

scott wurcer said:



You're right Bob, brainless multi-parameter fitting can lead to silly answers. I have fought this in the past. rbb and RE have very weak sensitivity in some parameter fitting algorithms. Imagine trying to extract rbb where its effect is only manifest by 1/beta. You need good old fashion experiments designed to extract each parameter separately (sometimes).


Thanks, Scott. It is indeed a shame that many manufacturers don't even seem to do a quick sanity check on their SPICE models before publishing them. Given all the work they do in collecting the data for the data sheets, it is especially a shame.

What is your opinion on just tweaking IS and RE to get existing models a little closer to reality?

What rule of thumb would you suggest for reasonable values of Rb for given types of devices?

Thanks,
Bob
 
Bob,
I have just developed (with Mathematica) a procedure able to extract (without any explicit, manual, recursion) those static, forward, parameters. For the others I assume the "typical" value.
The great uncertainty is the value of VAF: many times there is no way to get it.
I've got reasonable results for MJL1302A, MJL3281A, MJL4302A, MJL4281A. With the MJE15030 I had some problems (BF too high, when compared to hFE, convergence problems).
More over I have problems with the displacement of the "beta droop" when varying VCE (I guess it is a problem of the SGP model).
Thanks
 
Disabled Account
Joined 2004
Re: Re: Re: Tweaking SPICE Models

Bob Cordell said:



Thanks, Scott. It is indeed a shame that many manufacturers don't even seem to do a quick sanity check on their SPICE models before publishing them. Given all the work they do in collecting the data for the data sheets, it is especially a shame.

What is your opinion on just tweaking IS and RE to get existing models a little closer to reality?

What rule of thumb would you suggest for reasonable values of Rb for given types of devices?

Thanks,
Bob

You're on the right track. You want to get the collector current vs. Vbe right first. rbb and RC and beta are second order, but keep in mind beta and Early voltage tend to be a constant product and a very low early voltage can complicate things a little (start at low Vcb for your first shot). I do rbb by measuring noise on a small signal transistor. Those 10-20 Ohm values are off for all but really low noise small signal transistors. Power devices OTOH have very low parasitic resistances by necessity.