how to simulate an audio amplifier using ltspice

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
I've made a project of an amplifier and now i've made some simulations but I don't know if they are completely right.
So my biggest worry is about stability: the feedback network of my amplifier is made of two simple resistors the one wich goes from the output to the imput of the differential pair is 20k while the other is 1k and goes from the diff input to ground giving a closed loop gain of 26 dB. In order to valutate stability I changed the 20k resistor with a 1M ohm one thus i have increased a lot the closed loop gain to expose the open loop gain.
After that i did an AC analysis and i checked the phase at the point where the gain is 26dB and it's 110° giving 70° of phase margin. Is right to check stability in this way or is wrong? I say that because if I do an AC analysis of the amplifier with the normal value of the feedback resistors when the gain falls at 0dB the phase lag is more than 135°. This analysis has been done with the AC signal connected directly on the base of the input stage (without any low pass and high pass filters) and in series with it a DC generator in order to make the output voltage 0 at quiescent conditions, while at the output i connected a 8 ohm resistor directly without any zobel network and the usual inductor.
Then how to check the slew rate?
Usually a square wave input is used where the rise and fall time are really small like 10ns but how can i choose the right frequency and amplitude?
To find the slew rate is right to do a transient analysis and then put two cursors at a distance of 1us in the point of the plot where the output goes from the max value to the min and the slope of that is the slew rate?
Last question, when i do a transient analysis with square wave input the output waveform presents spikes just after the rising edge and after the falling edge wich decay in a small time. What's that mean?
Tell me if what i did is right or if i've made a lot of errors.
thanks everybody
 
How does the win7 directory structure work with LTspice.

I tried to run an asc with the models in the text file that was in the same directory. Cannot find model.

Copied the asc and the text files to LTC/LTspiceiv
re-opened LTspice and the asc. Again cannot find model.

I downloaded the pdf of how to use ltspice all 308 pages of it.
Where do I find an explanation of where to locate files to enable ltspice to run?
 
Have you sorted it out, Andrew? If not, do you have a .include Spice directive somewhere in the .asc pointing to the text file? If you think it's there but can't find it easily use <Ctrl> F for a Find dialogue box, the found items are highlighted ...

308 page pdf? Is this scad3.pdf, mine is 206 pages ... :confused: ? In my copy of scad3.pdf the relevant page is 69, .INCLUDE -- Include Another File.

Frank
 
Last edited:
Okay, correction needed ... up until recently a .pdf version of the help file that comes with the program was available on the Linear website, was called scad3.pdf. This no longer exists there but can be found elsewhere on the net, will therefore be very slightly out of sync with the current executable.

Annoying, because I don't like .chm files, hopeless things to move around in easily ...

Getting back to an answer about including files, this is in the help .chm, in the Contents window under LTspice, and then Dot Commands ...

Sorry,
Frank
 
Annoying, because I don't like .chm files, hopeless things to move around in easily ...
But, there are myriads of ways of creating a .pdf from a .chm, so long since I've done this I had forgotten I had installed something called PrimoPDF that does the job -- my version is rather primitive and doesn't do a full job of it, I'm sure there's plenty better out there if one hunts around ...

Frank
 
the file is a working version kindly passed on by a Member.
I thought all I had to do was start up clicked on the .asc and RUN.
But it came back saying cannot find model for ONE transistor. The text file includes that transistor and I don't expect the file to be corrupted.
I tried again, still cannot find.
I then looked for and found the LTspice program. It was in LTC/LTspiceiv
I copied the extracted files from the .zip to this directory and started the .asc
RUN showed the same cannot find model

I can't see an include directive, but the other non standard models are not flagged as missing eg there is a Bob79 model.
 
Hmmm ... in my workings with LTspice I always need an .include statement to pull in outside files; if I comment it out then I also get such an error message. I would suggest adding a Spice directive to do it in the .asc, very easy to make happen: click on the funny looking .op button on the right end of the toolbar, comes up with a textbox for entry, type in ".include <name of file>". OK it, cursor changes to I bar and border of the text entered, just click anywhere, in open space, on the schematic to paste the directive. Then, you should be right to Run ...

Frank
 
...it came back saying cannot find model for ONE transistor. The text file includes that transistor and I don't expect the file to be corrupted.

That's a different matter. You may not expect it to be corrupted, but it almost certainly has some error that has crept in somehow. Software can be very fussy, and the omission of as little as a period or semicolon is sufficient to cause errors such as 'not found' errors.
Of course it's possible that it's bugging out on the first error found, and that if this is corrected it will go on to find subsequent errors, although I am an LTSpice user my memory is a bit vague on this point.

Substitute a transistor from the regular library and see if you can get the sim to run, if it works, then make some comparisons between working models and the nonfunctional one, there are many functional models you can download if you don't know how to peek at the existing ones you have. You have to make sure the format matches exactly, although this may not be easy. They are all text files. It's best to manipulate these in an editor specifically intended for editing code, other editors sometimes manipulate the formatting in unseen ways behind your back. Best to steer clear of Notepad, the Windows .txt editor. You want one that does not wrap lines. A good graphical free editor under Windows is PFE32, Programmers File Editor (32-bit).

Otherwise ask the supplier of the .asc file to verify his own copy and send you a new one.
 
Last edited:
If you want to play around with the text file you don't have to go to the effort of a separate editor. LTspice will happily open the text file, with a nice syntax highlighting editor, you can do all the fiddling there.

A simple thing to try: open the text file, copy the model details you want -- the name should be blue, the parameters red, if they're not then you have a corruption of the file -- and paste into a Spice directive textbox in the .asc window just like the .include line I mentioned before, and then paste the model details on the schematic somewhere. The names should obviously match, if it still can't find the model then there's some really weird problem there ...

Frank
 
Lots of chatter in this thread, few addressing the OP questions. I'll take a crack at a couple.
Then how to check the slew rate?
Usually a square wave input is used where the rise and fall time are really small like 10ns but how can i choose the right frequency and amplitude?
To find the slew rate is right to do a transient analysis and then put two cursors at a distance of 1us in the point of the plot where the output goes from the max value to the min and the slope of that is the slew rate?
Slew rate is the rate of change of output voltage. To measure it, you must use an input signal that induces slew-rate limiting, that is, the output can't change fast enough to track the input (that is very important). The output will increase at a fairly constant rate to catch up to the input signal, this is the slew rate. Just calculate the slope of the line. Slew rate is usually expressed in V/µs.

Last question, when i do a transient analysis with square wave input the output waveform presents spikes just after the rising edge and after the falling edge wich decay in a small time. What's that mean?
That is overshoot. If the signal bounces back too far (below the stable level) that is called undershoot. If the signal continues to bounce up and down several times before settling down, this is called ringing. The amount of time that it takes for the signal to settle down to the stable/desired level is called settling time. This is usually expressed with a percentage like 1%, meaning it takes that long for the response to settle to within 1% of the stable level. Excessive overshoot or ringing may indicate a (nearly) unstable, or under-compensated amp.

Now that you know what these are called you can Google overshoot, undershoot, ringing, settling time, slew rate, etc., and learn more. Add 'measure' and/or 'calculate' to the search to get practical information instead of just theory.
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.