Things you should know about LTSpice - Page 11 - 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 6th January 2010, 05:34 PM   #101
diyAudio Member
 
Join Date: Dec 2009
Hello Friends.
Might be easier if I explain what I'm doing. I have an opamp constant current source that is varied by the voltage on its non-inverting input. I want to model the current through the load output by varying a potentiometer on the non-inverting input. I started out varying the value of the resistive elements of the pot and plotting on a paper graph the load current but was thinking there must be an easier way to do this with such a basic circuit / simulation.

The step does work as it gives me various curves, except its difficult to work out what curves (flat DC current lines actually) relate to what values.
__________________
Would you be my valentine ?
  Reply With Quote
Old 13th January 2010, 09:56 AM   #102
diyAudio Member
 
Join Date: Apr 2007
Hello

I've done many sim with LTspice. But wen, in some amps circuits, I ad a boost filter it's change totally the distortion FFT spectrums, boosting much more the distortion than it could possibly normally happen.

I have done a small 50 w amp sim, as an example, to show the problem, in the second amps I've add a 5 db treble boost in the gnfb. Even if we count the 5 db boost, it should not do so much more distortions.

Which setting I have to change to get it right ?

I include a zip file of the .asc files of the two amps.

Thank you

Bye

Gaetan
Attached Files
File Type: zip 50watt_amps_2examples.zip (4.4 KB, 27 views)
  Reply With Quote
Old 14th January 2010, 05:31 AM   #103
diyAudio Member
 
Join Date: Dec 2006
Location: Where the sky loves the sea
Quote:
Originally Posted by gerrydevis View Post
Hello Friends.
Might be easier if I explain what I'm doing. I have an opamp constant current source that is varied by the voltage on its non-inverting input. I want to model the current through the load output by varying a potentiometer on the non-inverting input. I started out varying the value of the resistive elements of the pot and plotting on a paper graph the load current but was thinking there must be an easier way to do this with such a basic circuit / simulation.

The step does work as it gives me various curves, except its difficult to work out what curves (flat DC current lines actually) relate to what values.
see the wiki description of the .step command (Useful Commands - diyAudio) it has a description of how to understand which trace is which value.
  Reply With Quote
Old 14th January 2010, 05:53 AM   #104
diyAudio Member
 
Join Date: Dec 2006
Location: Where the sky loves the sea
Gaetan -

you need to name the net you want to run the FFT on (for example amp_out) and change your .four command:

.four {freq} 9 8 V(amp_out)

That will run the FFT over 8 cycles of the node named amp_out and display results for 9 harmonics.

Try running the basic simulation for different time periods and seeing if the .four results stay constant. If not then it is probably caused by voltage drift on C14. Try replacing C14 with a voltage source (set it to 0) and see if you get consistent .four results.

Discussion of all of the above is on the wiki Common Issues Encountered By New Users - diyAudio

see THD measurement and Slanted FFT topics
  Reply With Quote
Old 14th January 2010, 11:06 AM   #105
diyAudio Member
 
Join Date: Apr 2007
Hello

Here is my the parameter that I use.


;ac oct 10 10Hz 10000000Hz
;op
.param num_fft_pts 65532
.param freq 20k
.param timestep {1/((num_fft_pts-1)*freq)}
.options plotwinsize=0
.tran 5m


Thank

Bye

Gaetan
  Reply With Quote
Old 14th January 2010, 11:25 AM   #106
diyAudio Member
 
Join Date: Nov 2008
Location: Brazil
Try this:

SINE(0 1 {freq}) (source)

.four {freq} V(OUT)
.options plotwinsize=0
;tran 0 2m 0 {timestep}
.param timestep {1/((num_fft_pts-1)*freq)}
.param freq 20k
.param num_fft_pts 6550
  Reply With Quote
Old 14th January 2010, 11:52 AM   #107
diyAudio Member
 
Join Date: Apr 2007
Hello

Reading the Common_Issues_Encountered_By_New_Users wiki, it seem that my problem is a Slanted FFT.

I did replace c14 with a voltage sources but nothing changed.

The image are the circuit before replacing c14 with a voltage sources, the fft are same with and without replacing c14 with a voltage sources.

Bye

Gaetan
Attached Images
File Type: jpg Capture.jpg (196.5 KB, 206 views)
File Type: jpg Capture2.jpg (182.6 KB, 200 views)

Last edited by gaetan8888; 14th January 2010 at 12:01 PM.
  Reply With Quote
Old 14th January 2010, 01:16 PM   #108
jcx is offline jcx  United States
diyAudio Member
 
Join Date: Feb 2003
Location: ..
may be slow transient settling - give a start time in the .tran that allows it to settle out

windowing also reduces the settling time effect - try Blackman window

.four and assoc params only applies to the legacy numerical output in the error log - not the graphic plot fft - you have to setup the graphic fft length, windowing, ect in the pop up window

you can experiment with the fft start, end time in the pop-up window

Last edited by jcx; 14th January 2010 at 01:20 PM.
  Reply With Quote
Old 15th January 2010, 05:26 AM   #109
diyAudio Member
 
Join Date: Dec 2006
Location: Where the sky loves the sea
Run the .tran for a long time (maybe 100m) and find where in the circuit there is DC drift. Since it is a bootstrapped design C9 is another likely suspect.
  Reply With Quote
Old 15th January 2010, 05:47 AM   #110
diyAudio Member
 
Join Date: Apr 2007
Hello

I did run the .tran at 200ms

At the node C14 and R6 it seem to be the dc drift, I've include an image of the sinewave.

Than

Bye

Gaetan
Attached Images
File Type: jpg Capture.jpg (252.1 KB, 179 views)
  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 13 17th August 2014 11:49 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 10:17 AM.


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