# EEVblog Electronics Community Forum

## EEVblog => EEVblog Specific => Topic started by: EEVblog on June 28, 2012, 08:10:13 am

Title: EEVblog #301 - LTspice Temperature Sweep Tutorial
Post by: EEVblog on June 28, 2012, 08:10:13 am
EEVblog #301 - LTspice Temperature Sweep Tutorial (https://www.youtube.com/watch?v=eRtO3EZK_Cc#ws)

Dave.
Title: Re: EEVblog #301 - LTspice Temperature Sweep Tutorial
Post by: jahonen on June 28, 2012, 10:32:01 am
One thing that should be noticed, not all component models have temperature effects modeled. Even for resistors, you must put temperature coefficient in by yourself. So instead of 10k, you put something like "10k tc=100e-6" to have 10k 100PPM resistor.

Regards,
Janne
Title: Re: EEVblog #301 - LTspice Temperature Sweep Tutorial
Post by: Stephen Hill on June 28, 2012, 11:52:48 am
One thing that should be noticed, not all component models have temperature effects modeled. Even for resistors, you must put temperature coefficient in by yourself. So instead of 10k, you put something like "10k tc=100e-6" to have 10k 100PPM resistor.

Regards,
Janne

Good tip :)
Title: Re: EEVblog #301 - LTspice Temperature Sweep Tutorial
Post by: Stephen Hill on June 28, 2012, 11:55:34 am
On that very last oscillator circuit it was interesting to see that temperature not only affected the amplitude but also the phase of the sine wave.
Title: Re: EEVblog #301 - LTspice Temperature Sweep Tutorial
Post by: EEVblog on June 28, 2012, 12:00:26 pm
One thing that should be noticed, not all component models have temperature effects modeled. Even for resistors, you must put temperature coefficient in by yourself. So instead of 10k, you put something like "10k tc=100e-6" to have 10k 100PPM resistor.

Yes, good point. Should have mentioned that.

Dave.
Title: Re: EEVblog #301 - LTspice Temperature Sweep Tutorial
Post by: nitro2k01 on June 29, 2012, 03:45:38 pm
One minor complaint. In the two transistor circuit, you're probing the current through R1. What you should have done is place a dummy load at the collector of Q1 and measure the current through that resistor. (I believe that's where you'd typically place the load in this type of constant current circuit.) Currently a tiny bit of current will escape through the base of Q2, which might distort the values you're after when you're comparing tenths of milliamps. I know it's a tiny detail, but what do you call it, "a trap for young players."
Title: Re: EEVblog #301 - LTspice Temperature Sweep Tutorial
Post by: codeboy2k on July 01, 2012, 12:06:49 pm
There's many unknown things about LTSPICE.

You can easily step the values of resistors, capacitors, voltages and other numeric quantities.
The .STEP spice command only takes a numeric list.

But you can also alias a number to a spice model using the ako: notation (A Kind Of)
then you can step the list of numbers if you wanted to step a transistor over 4 different values.

So in Dave's 2-transistor current source, he could set the transistor value to {Qx}

.model 2222 ako:2n2222
.model 3904 ako:2n3904
.model 4124 ako:2n4124
.model 849   ako:ztx849
.step param Qx list 2222 3904 4124 849

and you would see the effects of changing transistors.

You can also have multiple .step spice commands, it will run them all, so you can step temperature over each transistor change.
Title: Re: EEVblog #301 - LTspice Temperature Sweep Tutorial
Post by: Bored@Work on July 01, 2012, 12:25:52 pm
There's many unknown things about LTSPICE.

Like all the stuff listed here http://ltwiki.org/index.php5?title=Undocumented_LTspice (http://ltwiki.org/index.php5?title=Undocumented_LTspice) ?

Quote
You can easily step the values of resistors, capacitors, voltages and other numeric quantities.

Like  http://ltwiki.org/index.php5?title=Undocumented_LTspice#Stepping_a_Model (http://ltwiki.org/index.php5?title=Undocumented_LTspice#Stepping_a_Model) ?
Title: Re: EEVblog #301 - LTspice Temperature Sweep Tutorial
Post by: codeboy2k on July 01, 2012, 01:14:38 pm
Wow! there's lots more.  I'm reading.

I learned that stepping transistors trick from a guy at work. I thought it was pretty cool.  I've used it for stepping diodes too.