Spice simulation - Page 114 - 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 5th April 2012, 10:29 PM   #1131
tvrgeek is offline tvrgeek  United States
diyAudio Member
 
Join Date: Dec 2009
Location: Md
Amplifier stability and Bode plots.

I am using LTSpice. It is rather handy as it already gives both voltage and phase in the AC analysis. What I am interested in is playing with different compensation methods in an amplifier. Let's take a traditional long tail pair differential input. Feedback is returned to the negative side. My assumption is that I should be looking at the difference in phase between the signal at the positive node and comparing that to the negative node. I want as little deviation as possible. ( a perfect amplifier returning a perfect copy and no need for correction) I need less that 40 degrees by the time the gain has fallen off to one. When I have done this, sometimes the simulation of a square wave shows instability. Is either my logic or understanding of stability in error?
  Reply With Quote
Old 6th April 2012, 02:06 AM   #1132
diyAudio Member
 
keantoken's Avatar
 
Join Date: Aug 2006
Location: Texas
Blog Entries: 2
Looking at "loopgain2.asc" in the Examples directory in your LTSpice folder will give you a method for plotting open-loop phase margin. Most people prefer a phase margin of 80 degrees, or an open-loop unity phase of 100 degrees. (I've heard of the 40 degree figure, but I think it is either a mistake or it was taken out of context)

Smaller phase margins tend to cause overshoot in the square wave response, and more risk of anomalous oscillation. However the phase margin changes with loading, so you will need to look at phase margin with a number of different loads.

If you want a masterful example of stability compensation, look at Symasym.
  Reply With Quote
Old 6th April 2012, 08:50 AM   #1133
diyAudio Member
 
Join Date: Nov 2007
Location: Dallas
Quote:
Originally Posted by tvrgeek View Post
Amplifier stability and Bode plots.

I am using LTSpice. It is rather handy as it already gives both voltage and phase in the AC analysis. What I am interested in is playing with different compensation methods in an amplifier. Let's take a traditional long tail pair differential input. Feedback is returned to the negative side. My assumption is that I should be looking at the difference in phase between the signal at the positive node and comparing that to the negative node. I want as little deviation as possible. ( a perfect amplifier returning a perfect copy and no need for correction) I need less that 40 degrees by the time the gain has fallen off to one. When I have done this, sometimes the simulation of a square wave shows instability. Is either my logic or understanding of stability in error?
Closing a big loop can make the Bode plot appear stable, maybe it isn't.
You should only ever blindly close small local loops of one pole or less.
If there could be more than one pole, it might oscillate.

The easy way to break a loop (and you might have loops inside loops to
test for stability too), maybe not the right or best way, is put 999MegH
simulated inductor into the feedback path. This cuts off all but DC.

Now you can see the output, and tell if amplitude is below unity before
phase rolls completely around. And you probably want some 60 or more
degrees of safety margin... But more will needlessly hurt performance.

I've seen the right way to do this, but still have no understanding of it.
My inductor is a cheat, and will make low frequency appear to roll phase.
Just remember that low roll it isn't really there, you can ignore it...

-----

I am comping an input pair with a capacitively coupled positive feedback
from the opposite collector, called "neutralization". This is a trick to make
Miller capacitance dissapear, so that your dominant pole somewhere else
is acting alone, and not rolling phase cumulatively with the input pair...

In each transistor there is parasitic capacitance from collector to base.
You add an external cap (almost same amount) from base to the other
side of the LTP's collector. Not too much, else you make another fine
oscillator....

I am not a fan of setting the dominant pole's corner just above 1KHz,
and then test for distortion at 1KHz, the sim fakes too low distortion.
Well, its real, bit only for low frequencies... Your distorion is inverse
to how much open loop gain you can afford to throw away in closing.
You have worse distortion than you might imagine at the high end,
cause the open loop gain is rolling away at -6 or -12dB while there
are still more than 4 octaves to be covered.

Mind you, this plot is inverting, so 180 is straight up...
Attached Images
File Type: gif neutralization1.gif (58.9 KB, 299 views)
Attached Files
File Type: asc Draft9985.asc (9.0 KB, 17 views)

Last edited by kenpeter; 6th April 2012 at 09:17 AM.
  Reply With Quote
Old 6th April 2012, 10:11 AM   #1134
diyAudio Member
 
keantoken's Avatar
 
Join Date: Aug 2006
Location: Texas
Blog Entries: 2
The problem with using large capacitors or inductors for this is that if you're not careful your feedback impedance will be different, causing the loopgain plot to not be the same as it is with a closed loop. That is why perfect components are used in SPICE.
  Reply With Quote
Old 6th April 2012, 10:49 AM   #1135
diyAudio Member
 
keantoken's Avatar
 
Join Date: Aug 2006
Location: Texas
Blog Entries: 2
Also Kenpeter. You happen to have downloaded my 5200/1943 models before I quickly edited in a last improvement... Look again and you will see the value of VAF has changed.
  Reply With Quote
Old 6th April 2012, 11:50 AM   #1136
diyAudio Member
 
keantoken's Avatar
 
Join Date: Aug 2006
Location: Texas
Blog Entries: 2
Here is a version of your schematic with an example of how feedback impedance matters. This time the feedback network doesn't have a series inductor causing high impedance. Open-loop gain is greatly altered.
Attached Files
File Type: asc Draft9985_Kmods.asc (9.8 KB, 22 views)
  Reply With Quote
Old 6th April 2012, 02:22 PM   #1137
diyAudio Member
 
Join Date: Nov 2007
Location: Dallas
Reason gain went up is that you changed the configuration of the output stage
from A+B to class AB. The big transistors used to be OFF through zero crossing.
The crossing was driven at known current in Class A by BD139/140 exclusively.
Now there is 30dB more crossing (and open loop) gain, but nothing to prevent
thermal run-away.

I am a thankful the finals added gain changed the stability picture so little.
Was a bit concerned that once those outputs conduct, it might be different.
Can see now, I had nothing to worry about. We still need look at condition
where only one side is On, and the other Off. Try a DC offset or something...

Distortion should sim less with AB's added gain and smooth crossing. But you
can't bias a hot output that way without adding parts to watchdog the current.
Emitter resistors at the very least....

I put back to class A+B and observe the open gain hasn't changed at all.
I'm not saying it distorts less in this class, definitely not. Just saying the
open loop gain change you observed, had nothing to do with my 999H being
different (gainwise) than your 100K + 1u + E (Voltage Dependant Voltage).
Attached Files
File Type: asc Draft9985_Kmods2.asc (9.9 KB, 11 views)

Last edited by kenpeter; 6th April 2012 at 02:51 PM.
  Reply With Quote
Old 6th April 2012, 03:39 PM   #1138
diyAudio Member
 
Join Date: Sep 2006
Quote:
Originally Posted by keantoken View Post
Looking at "loopgain2.asc" in the Examples directory in your LTSpice folder will give you a method for plotting open-loop phase margin. Most people prefer a phase margin of 80 degrees, or an open-loop unity phase of 100 degrees. (I've heard of the 40 degree figure, but I think it is either a mistake or it was taken out of context)

Smaller phase margins tend to cause overshoot in the square wave response, and more risk of anomalous oscillation. However the phase margin changes with loading, so you will need to look at phase margin with a number of different loads.

If you want a masterful example of stability compensation, look at Symasym.
Even 60 degrees of phase margin is OK, IF it is real (meaning SPICE is really capturing and modeling properly all of the sources of excess phase in the real world). Chapeter 4 in my book "Designing Audio Power Amplifiers" covers a lot of this and has a useful plot, 4.10, that shows gain peaking and overshoot as a function of phase margin for a typical arrangement.

Very importantly, gain margin must also be good in order to achieve an amplifier with robust stability. One should have at least 6 dB of gain margin, meaning that the loop gain has fallen to -6dB by the time the phase reaches 180 degrees. Sometimes a designer will inadvertantly do something to a circuit to improve phase margin that only lessens gain margin, and this can be dangerous.

Cheers,
Bob
  Reply With Quote
Old 6th April 2012, 04:15 PM   #1139
diyAudio Member
 
keantoken's Avatar
 
Join Date: Aug 2006
Location: Texas
Blog Entries: 2
You're right Ken, my mistake. I thought something was off...

It seems nice to have textbook geometric response curves. While marginal phase margins can offer extra bandwidth and low HF distortion, they generally result in overshoot or ringing, even if very slight. This quality is known as phase-linearity, AKA constant group delay. You can add this to the long list of potential design objectives... Few people talk about it though.

I wonder if more than 6db gain margin is needed. After all, under heavy loading, gain can change more than 6db. BJTs can be a lot faster, especially outputs, at higher currents, and more at risk for oscillation.
  Reply With Quote
Old 6th April 2012, 05:11 PM   #1140
diyAudio Member
 
Join Date: Nov 2007
Location: Dallas
In conflict of poles, wonder why so many aim for the slowest make it even slower?
If you instead speed one up, the other automagically becomes dominant. There is
much to be said for an open loop gain that can truly cover the whole audio range.

Compensation by a stOOpid slug that kicks in at 1K or worse, this is gonna ruin
any chance for a similar low closed loop distortion at 20KHz. Won't see the prob
in .FOUR passes run at 1KHz, as this is below the usual slug's knee anyway.

Last edited by kenpeter; 6th April 2012 at 05:13 PM.
  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 05:58 PM


New To Site? Need Help?

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