Spice simulation - Page 13 - 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 18th May 2007, 03:50 PM   #121
diyAudio Member
 
Edmond Stuart's Avatar
 
Join Date: Nov 2003
Location: Amsterdam
Quote:
Originally posted by estuart
Hi Grey,
You're really lazy, aren't you. Never mind, his nick is MarcelvdG, or look at:
http://www.diyaudio.com/forums/membe...fo&userid=5881
Cheers,
Hi Grey,

This is the article: "Noise and moving-magnet cartridges", Marcel van de Gevel, EW, October 2003, pp. 38...41.
Theoretical noise reduction: 6dB, in practice: 3dB. If you promise you'll make no more nasty remarks about simulators, I'll scan it for you.

Cheers,
__________________
Een volk dat voor tirannen zwicht, zal meer dan lijf en
goed verliezen dan dooft het licht…(H.M. van Randwijk)
  Reply With Quote
Old 18th May 2007, 06:08 PM   #122
diyAudio Member
 
ashok's Avatar
 
Join Date: Jun 2002
Location: 3RS
estuart : ".........remarks about simulators, I'll scan it for you.........."

Copy for me too please .
ashokm(at)sify(dot)com
Thanks.
__________________
AM
  Reply With Quote
Old 18th May 2007, 06:35 PM   #123
diyAudio Member
 
Join Date: Sep 2006
Quote:
Originally posted by andy_c


I looked for them and couldn't find them either. What's worse, vendors will sometimes supply models that are totally wrong. Examples of this are the OnSemi MJL3281A/1302A. I've documented the problems with these and fit new models to the datasheet parameters on one of my web pages.

Nice work Andy!

Bob
  Reply With Quote
Old 18th May 2007, 06:39 PM   #124
diyAudio Member
 
Join Date: Sep 2006
Quote:
Originally posted by john curl
Well, I hope this gets me off the hook! I didn't want to 'Spice' the design anyway. It already works.

Yep, you're officially off the hook. But we'll continue to try to lure you in :-).

Bob
  Reply With Quote
Old 18th May 2007, 07:21 PM   #125
diyAudio Member
 
Join Date: Feb 2001
Location: Columbia, SC
Quote:
Originally posted by estuart


Hi Grey,

You're really lazy, aren't you. Never mind, his nick is MarcelvdG, or look at:
http://www.diyaudio.com/forums/membe...fo&userid=5881

Regarding simulator version xx.01 vs xx.02 etc., you probably missed my point. If we are dicussing the merits and flaws of simulators, it's not unreasonable to suppose that we mean today's simulators. So, if someone is complaining about missing features of a 25 years old version or so, that is totally irrelevant IMHO.



Cheers,

I don't recall mentioning 25 year old software...but that's okay, I've about used up all my grumble quotient for this week. (Having a six month-old throw up on you kinda causes you to refocus...) Bear in mind that I'm not John Curl. He's mentioned older hardware/software several times, but I don't recall doing so, myself. Yes, I know it seems silly that someone might mistake me for John Curl, but I've been accused of being Nelson Pass's doppleganger enough times that I'm wary of the possibility.
As for MarcelvdG, thanks. To the best of my knowledge they don't have an "actual name" search function here and for all I know he'd be one of these members who feels they have to come up with something cutsie like PhrostyPhono or ChillyCircuit for a user ID.
As for a scan, yes I'd love one if it's not too much trouble.

Grey
  Reply With Quote
Old 18th May 2007, 07:34 PM   #126
andy_c is offline andy_c  United States
Banned
 
Join Date: Apr 2003
Default LTSpice techniques for simulation of loop gain

Over in the error correction thread I posted an LTSpice simulation of Bob's EC output stage that used a loop gain probe component for doing stability analysis of the EC loop. There are some special configuration settings that need to be used for such simulations, which I mentioned in that thread. Anatech asked me to post that info in this thread, so I am doing so here.

The whole loop gain/stability simulation thing in LTSpice is confusing because there have been a number of methods used over the past few years. I'll describe them in chronological order below. All the LTSpice examples I'll refer to below are in the LTSpice installation in examples\Educational.

1) Easiest but can be inaccurate The simplest way to simulate loop gain is documented in the LTSpice example project "audioamp.asc". Only a single voltage is used to inject a test signal. Depending on the impedance levels where this voltage is injected, accuracy can range from very good to completely wrong. For this reason, I'd recommend avoiding this technique. No special setup of LTSpice is required.

2) Accurate but a total PITA This technique and the rest that follow make use of the "double injection" technique (voltage and current) due to R.D. Middlebrook. The earliest LTSpice example of this in the LTSpice example file "LoopGain.asc". This technique is a PITA because it must be done with two copies of the circuit under test. For this reason, it's best avoided. Still, it does illustrate the concept. To use this technique, you must go into the LTSpice control panel and enable "Save Device Currents" on the "Save Defaults" dialog tab.

3) Accurate but easier than (2) In the LTSpice users' group, people were looking for a way to do double injection without needing to make two copies of the circuit under test. An improved technique was developed by Frank Wiedmann, and used a subcircuit to inject the test voltage and current. This, combined with a .STEP PARAM command to turn the voltage and current sources in the subcircuit on and off, and some strange looking syntax to access voltages and currents for the different STEP states allowed loop gain calculations without circuit replication. In addition, results from a paper by Tian were incorporated, which take into account reverse transmission of the network (non-unilateral behavior). This particular approach does not have an example in the LTSpice installation, but can be found in the files section of the LTSpice users' group. I posted the loop gain probe subcircuit and symbol files here, and an example of its use in analyzing stability of Bob's EC output stage here.

There was a quirk in the history of Frank's solutions. Frank created his original examples and uploaded them to the LTSpice users' group files area. Then the LTSpice developer, Mike Englehardt, needed to make some changes to the syntax for referring to voltages and currents in different states of the STEP command. These syntax changes invalidated Frank's original examples, so Frank uploaded new examples using the new syntax. The old and new examples are both still in the LTSpice users' group files area, so be aware that you may run across the older ones if you get all the loop gain probe examples from there. These older examples won't work with the latest LTSpice version.

In order to use this technique, you'll need to go into the LTSpice control panel and enable the following three items on the "Save Defaults" tab

Save Device Currents
Save Subcircuit Node Voltages
Save Subcircuit Device Currents

This results in large ".raw" files being left behind. To fix this problem, you can go into the "Operation" tab of the LTSpice control panel and set "Automatically delete .raw files" to "yes".

I've posted a bunch of examples using Frank's loop gain probe, but that was before I found out there was a slightly easier way. I'll describe that next.

4) Easiest of the accurate approaches Sometime after Frank posted his loop gain probe solution, Mike Englehardt added a loop gain example to the standard LTSpice examples in examples\Educational. This is a slight simplification of Frank's technique which avoids the subcircuit, resulting in cleaner syntax. In addition, the full description of how to use it correctly is all in one file. That file is called "LoopGain2.asc". I'd recommend using the technique described in that file, since it's now part of the standard examples and is the simplest of the accurate approaches. Using this approach only requires that the "Save Device Currents" option be checked on the "Save Defaults" dialog tab of the LTSpice control panel. Subcircuit voltage and current saving is not required. I'd still recommend using "Automatically delete .raw files" on the "Operations" tab of the LTSpice control panel to keep the largely useless ".raw" files from piling up.
  Reply With Quote
Old 18th May 2007, 07:37 PM   #127
andy_c is offline andy_c  United States
Banned
 
Join Date: Apr 2003
Quote:
Originally posted by Bob Cordell
Nice work Andy!
Thank you very much Bob!
  Reply With Quote
Old 18th May 2007, 07:49 PM   #128
anatech is offline anatech  Canada
diyAudio Moderator
 
anatech's Avatar
 
Join Date: Jun 2004
Location: Georgetown, On
Hi Andy,
Nice job! I don't understand it but I'm hoping this will help other members who do.

Thanks again Andy,
-Chris
__________________
"Just because you can, doesn't mean you should" © my Wife
  Reply With Quote
Old 18th May 2007, 10:51 PM   #129
diyAudio Member
 
Join Date: Sep 2006
Hi all

correct me if I'm wrong but all these loop simulations are calculated under AC condictions. Class AB amps run the transistors through a wide dynamic range, so the small-signal values cannot be accurate as the simulator probably uses the prevailing DC conditions (i.e. quiescent) - only applying therefore to small perturbations about the quiescent (100 mW output for a 100W amp?). Sometimes instabilities in the output stage occurs in one side rather than the other due to changes in Cin for example with current.

Therefore transient simulations must be used, which is a problem because you need to sweep across lots of frequencies to build the "large signal" phase diagram - or at least check everything is stable.

Loop gain simulations should work for class A amps!

cheers
John
  Reply With Quote
Old 18th May 2007, 11:09 PM   #130
andy_c is offline andy_c  United States
Banned
 
Join Date: Apr 2003
With a little work, you can adapt them. I was recently working on a sim of an amp whose small-signal loop gain showed a phase margin of nearly 90 degrees. But I looked at the error current in the input diff amp when simulating a square wave input that drove the output almost to clipping. There was some really bad ringing in the error current. The ringing was at a frequency near the unity loop gain frequency of the global feedback loop. It was worst when the output voltage was near the negative rail.

So I set up the sim so the amp had a closed-loop gain that was flat to DC. I set the input signal to a simple DC value that put the amp's output almost to the negative rail where the ringing in the error current was worst in the transient sim. Then I did a loop gain test. Sure enough, the phase margin wasn't much better than zero. I modified the compensation so the phase margin was about 80 degrees. When I re-ran the square wave transient test, the error current looked nearly perfect, like a first-order system.

So yes, the transient response test is necessary, and tells you there's something wrong, but doesn't tell you the best way to fix it. A loop gain test with DC offset can be a good tool to determine how to fix it without overcompensating.

Another sim, suggested by mikeks, is to have a low-frequency sine wave input whose amplitude almost drives the amp into clipping. Then you can add a small-amplitude square wave of a frequency about 10-20x higher than the sine wave. You look at ringing on each little pulse on the output. In practice, it seems to be worst when the output is near the rail.
  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
Need help with Spice simulation overmind Everything Else 4 23rd December 2002 04:58 PM


New To Site? Need Help?

All times are GMT. The time now is 06:15 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