Things you should know about LTSpice - Page 3 - diyAudio
Go Back   Home > Forums > Design & Build > Software Tools

Software Tools SPICE, PCB CAD, speaker design and measurement software, calculators

Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 30th August 2009, 10:09 PM   #21
diyAudio Member
 
keantoken's Avatar
 
Join Date: Aug 2006
Location: Texas
Blog Entries: 2
Also, look at this page about capacitor distortion. He tries to models capacitance change with LTSpice.

http://www.cliftonlaboratories.com/c...age_change.htm

- keantoken
  Reply With Quote
Old 3rd September 2009, 01:41 AM   #22
diyAudio Member
 
unclejed613's Avatar
 
Join Date: Dec 2006
Quote:
Originally Posted by andy_c View Post
Not sure what you mean by "over a timeline"? If you use .step for a single parameter with N values, N simulations will be performed, and N curves will be shown on the output graph. Tuning is only useful IMO when the time duration of a simulation is very short, like AC analysis. Transient can take a while, which makes tuning clumsy. I worked as a developer on a simulation tool that had tuning, so I'm familiar with its uses. I'm not aware of any freeware that has it.
TI's Tina simulator has real-time features, but Tina is very limited in the demo version, and the full version is $omewhat expen$ive...... if you get too carried away with tweaking pots and such while Tina is running a real-time sim, the software gets confused and either gives you very strange results, or just plain locks up and crashes.... LTSpice on the other hand is very difficult to crash, even intentionally.... unless you simulate something really off the wall like a perfect current source charging a perfect capacitor, though even that doesn't seem to do it. LTSpice seems perfectly happy to give you an output ramp that goes from 0 to Petavolts and beyond. it only seems limited as to how many zeros it can put between the first digit and the TV (TeraVolt) designator.

another thing i've run into using LTSpice are amplifier circuits that never resolve, or that error out with "Time Step too small". usually now when i see this with an amplifier circuit, the first thing i double check is whether or not i have an inversion step i missed. when you apply what is supposed to be negative feedback to what you think is the inverting input (but ends up being the noninverting input), the solver will never find a stable operating point. instead it tries to hit a moving target, and finally gives up (after quite a wait, and continuous DEFCON 1 messages).

actually i tried to sim something like that now that i have LTSpice 4, and it doesn't seem to want to get confused.... it just gives me an off-the-wall result (2.4e+26 TV spike), but never goes into DEFCON.......
  Reply With Quote
Old 3rd September 2009, 01:54 AM   #23
diyAudio Member
 
keantoken's Avatar
 
Join Date: Aug 2006
Location: Texas
Blog Entries: 2
You can tick the "skip initial operating point solution" box, but this won't do well for your FFTs without adding some settling time to your simulation.

It turns out I can't (yet) indefinitely edit my first post, but will have to send my revision to moderators. I will do the next update when I have the time.

- keantoken
  Reply With Quote
Old 6th September 2009, 06:34 AM   #24
diyAudio Member
 
keantoken's Avatar
 
Join Date: Aug 2006
Location: Texas
Blog Entries: 2
I want to get a bunch of updates together and add them at once, and this includes adding some of my models.

For those watching this this thread, I want to discuss whether my models are good enough to add to the list I will eventually add to the first post. Discussion is here:

BJT SPICE Models, reality-check

I presently have these models. Please post if you have your own models or know of other user-made models I should add.

Andy_C:
MJL3281A
MJL1302A
2SA1837
2SC4793

Syn08:

2SA1407
2SC3601
2SA1930
2SC5171

Christer:

2SD669
2SB649

- keantoken
  Reply With Quote
Old 13th September 2009, 01:42 AM   #25
Bigun is offline Bigun  Canada
diyAudio Member
 
Bigun's Avatar
 
Join Date: Jan 2009
Blog Entries: 2
On the topic of good FFT's

Not sure if it is something I'm failing to understand, but I usually set up the Transient analysis to start recording after some period of time to allow biasses to stabilize, capacitors to charge etc. I find that you must arrange for the signal to start at zero when you begin recording data to avoid a dirty FFT. This is easily arranged by specifying a time delay for the signal source to start and use this also to establish the start time of transient data recording.

For example, define .param Tdelay = 1/F1
where F1 is the signal frequency.
In the signal source, usually with me a simple Voltage source (sinusoidal) set it turn on at {Tdelay} and in the transient analysis set the start recording to {Tdelay}

I've seen plenty of other people do this so please correct my explanation if it's not correct !
__________________
"The test of the machine is the satisfaction it gives you. There isn't any other test. If the machine produces tranquility it's right. If it disturbs you it's wrong until either the machine or your mind is changed." Robert M Pirsig.
  Reply With Quote
Old 13th September 2009, 02:12 AM   #26
diyAudio Member
 
unclejed613's Avatar
 
Join Date: Dec 2006
when you do the FFT, you can specify a time range to analyze, so if you know it takes let's say 5mS for a waveform to stabilize you can tell the FFT to use the time range of 5mS to the end of the plot
  Reply With Quote
Old 13th September 2009, 02:22 AM   #27
diyAudio Member
 
keantoken's Avatar
 
Join Date: Aug 2006
Location: Texas
Blog Entries: 2
I am aware of these tips, thank you for reminding me to add them to my eventual update.

I personally have found using voltage sources as caps to be a better solution; look at it in terms of the logarithmic scale. 5mS of delay might get you a noise floor some decibels lower, but in order to get the same number of decibels lower you will have to use 20mS of delay! The simulation time adds up (I'm "absolutely approximate" on my math here, but you can see the pattern). I want to know how well my circuits really work before I change the design to compensate for simulator errors. This is my personal preference, it won't affect the update.

- keantoken
  Reply With Quote
Old 27th September 2009, 10:40 PM   #28
diyAudio Member
 
Russ White's Avatar
 
Join Date: Jan 2005
Location: Nashville, TN, USA
Send a message via Yahoo to Russ White
Default Measuing the difference between the result of two .measure statements

Hi Folks,

I am trying to model a RIAA filter in LTSpice. But I am not getting the results I expect. The curve is pretty close. But I am trying to produce a report in the log.

I am trying to show the relative ac voltage difference between the 1Khz reference point and the measured AC voltage at he current step point frequency.

Here are the relevant .step and .measure commands and the results which I find puzzling.

The measurement for ref is correct.

The measurement for fs is correct.

But when I try to measure the difference between fs and ref (fs - ref) the answer does not make any sense to me.

And ideas you folks have to get the correct answer would be very much appreciated.

Code:
.step oct param fac 20 20K 1
.meas AC REF find V(out+,out-) when freq = 1000
.meas AC FS find V(out+,out-) when freq = fac
.meas RESULT param FS - REF

and in the log:

Direct Newton iteration for .op point succeeded.
.step fac=20
.step fac=40
.step fac=80
.step fac=160
.step fac=320
.step fac=640
.step fac=1280
.step fac=2560
.step fac=5120
.step fac=10240
.step fac=20000


Measurement: ref
  step	v(out+,out-)	at
     1	(0.0206938dB,131.159°)	1000
     2	(0.0206938dB,131.159°)	1000
     3	(0.0206938dB,131.159°)	1000
     4	(0.0206938dB,131.159°)	1000
     5	(0.0206938dB,131.159°)	1000
     6	(0.0206938dB,131.159°)	1000
     7	(0.0206938dB,131.159°)	1000
     8	(0.0206938dB,131.159°)	1000
     9	(0.0206938dB,131.159°)	1000
    10	(0.0206938dB,131.159°)	1000
    11	(0.0206938dB,131.159°)	1000

Measurement: fs
  step	v(out+,out-)	at
     1	(19.3631dB,159.807°)	20
     2	(17.8642dB,144.625°)	40
     3	(14.5555dB,128.718°)	80
     4	(9.84162dB,120.591°)	160
     5	(5.09813dB,122.76°)	320
     6	(1.58234dB,129.662°)	640
     7	(-0.795996dB,129.994°)	1280
     8	(-3.72349dB,119.763°)	2560
     9	(-8.21593dB,106.678°)	5120
    10	(-13.7368dB,96.7739°)	10240
    11	(-19.4281dB,89.5999°)	20000

Measurement: result
  step	fs - ref
     1	(18.5135dB,163.076°)
     2	(16.7128dB,146.578°)
     3	(12.753dB,128.154°)
     4	(6.55826dB,115.634°)
     5	(-1.7234dB,112.474°)
     6	(-14.0009dB,122.118°)
     7	(-20.7212dB,-37.2088°)
     8	(-8.26935dB,-29.3612°)
     9	(-3.49641dB,-34.9139°)
    10	(-1.50696dB,-40.8994°)
    11	(-0.675443dB,-44.4484°)


Date: Sun Sep 27 17:38:17 2009
Total elapsed time: 0.468 seconds.

tnom = 27
temp = 27
method = trap
totiter = 10
traniter = 0
tranpoints = 0
accept = 0
rejected = 0
matrix size = 137
fillins = 264
solver = Normal
Matrix Compiler1:    1286 opcodes
Matrix Compiler2: 16.5 KB object code size
Cheers!
Russ
__________________
Less pulp more juice Twisted Pear Audio.

Last edited by Russ White; 27th September 2009 at 10:53 PM.
  Reply With Quote
Old 27th September 2009, 11:04 PM   #29
diyAudio Member
 
keantoken's Avatar
 
Join Date: Aug 2006
Location: Texas
Blog Entries: 2
This is the best place to go for help in LTSpice. This is a starter thread for those having trouble acclimating to LTSpice.

http://tech.groups.yahoo.com/group/LTspice/

To use it, you'll have to register with Yahoo.

Anyways, I don't know the solution to your problem. Maybe someone else can help.

- keantoken
  Reply With Quote
Old 28th September 2009, 12:48 PM   #30
diyAudio Member
 
Russ White's Avatar
 
Join Date: Jan 2005
Location: Nashville, TN, USA
Send a message via Yahoo to Russ White
I found the issue.

It was a silly mistake. I should have been measuring the ratio, not the difference.

Cheers!
Russ
__________________
Less pulp more juice Twisted Pear Audio.
  Reply With Quote

Reply


Hide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LTSpice and subcircuits millwood Solid State 12 27th April 2011 09:03 AM
Using LTSpice gaetan8888 Solid State 6 19th July 2007 12:33 AM
UcD / LTSpice help fokker Class D 94 1st October 2006 01:12 PM
Things important to be said..helped by Mr. John Mateus to express things. destroyer X Solid State 22 31st July 2006 07:21 PM
Ltspice.... mikeks Solid State 10 13th June 2004 08:10 PM


New To Site? Need Help?

All times are GMT. The time now is 04:54 PM.


vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2014 DragonByte Technologies Ltd.
Copyright 1999-2014 diyAudio

Content Relevant URLs by vBSEO 3.3.2