Setting margin on a balanced line receiver

GroupDIY Audio Forum

Help Support GroupDIY Audio Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

5v333

Well-known member
Joined
Jun 30, 2013
Messages
631
Location
Gothenburg
I am experimenting with a regular balanced input stage which is made of an op amp and 4 resistors. Since all resistors are equal in value, i can only see what the gain margin is on my scope.
The amp is stable but i would like to know what the phase margin is as well. Is it possible to find out?
I think I have read that you can set the amp with a little higher gain than unity (10 dB-20 dB) and then play with compensation before you close the amp o unity.
 
According to definitions, you need to measure the amplitude and phase of the output with NFB disabled, which supposes replacing the FB resistors with ilarge perfect nductors and shorting the input resistors, but wait, isn't it the actual gain that's in the specs?
So look at the phase angle when gain crosses the unity line, add 180° and you have a good approximation. Of course, imperfections in resistors and layout will modify that, but rarely are enough to create instability.
So basically, the stability criterions are about the same as a unity-gain stage (knowing that a follower has a slightly different behaviour than a unity gain inverter.
 
Last edited:
The op amp being used is the opa1612.

I had another, non inverting, stage with 13 dB´s of gain and was stable. something a little bit wrong in the sound. found out that there were basically no margins. So i added a tiny lead comp and it did about 60degrees and 6 dB. The sound was noticeably improved. So i wanted to study the input stage as well.

Its good that you say one can look in the data sheet. But as you say, in the real world stuff happens because of the environment of the circuit.

It is interesting to investigate the sound effects of these parameters basically.
 
From listening to the results i get the impression that measuring margins in a closed circuit like this is ok. am i wrong?

measuring with loops set at full gain or unity seems to be problematic...
 
My scope (Fluke PM3084) has cursor features.
I put one probe before and one after the amp, hook the ground clips to the nearest reference ground, set probes to x10 and same sensitivity on the scope, sweep till i find A: unity gain and B: 180 degrees (i can use the XY function but i don't get correlation with just looking at the waveforms).

At A
With the cursors i can first find positions for a whole cycle of one wave. There is a button which tells the scope that this is equal to 360 degrees. I then find a new position with the right cursor where the lagging waveform starts. And finally read the value of phase on the scope.

At B
Finding a freq where it seems like the waveforms are at 180 degrees and try to read the difference in magnitude. Also check what happens if i sweep little bit more for suprises such as a sudden rise in gain.
 
How do you measure it in closed loop?

The closest technique I have heard is a kind of indirect measure by using a step input, and measuring overshoot and ringing time. It is probably difficult to measure accurately enough to get a margin value accurate to single digit degrees, but you can quickly get a feel for "plenty of margin" or "on the edge of oscillating" kind of values. The middle range where it overshoots just a little, and rings for a little while gets a little tricker to decide. That's when you have to start looking up the tables and trying to figure out the percentage of overshoot and ring down time so you can use the tables to convert to an approximate phase margin.
 
My scope (Fluke PM3084) has cursor features.
I put one probe before and one after the amp, hook the ground clips to the nearest reference ground, set probes to x10 and same sensitivity on the scope, sweep till i find A: unity gain and B: 180 degrees (i can use the XY function but i don't get correlation with just looking at the waveforms).

At A
With the cursors i can first find positions for a whole cycle of one wave. There is a button which tells the scope that this is equal to 360 degrees. I then find a new position with the right cursor where the lagging waveform starts. And finally read the value of phase on the scope.

At B
Finding a freq where it seems like the waveforms are at 180 degrees and try to read the difference in magnitude. Also check what happens if i sweep little bit more for suprises such as a sudden rise in gain.
I'm not sure I get a full image of your method, but I think you are actually measuring the closed-loop response, which includes both the opamp characteritics and all the effects of NFB and parasitics.
LTspice offers several methods of evaluating gain and phase margin. They are all extremely unlikely to be put in practice, involving perfect resistors and perfect inductors, floating AC voltage sources and all sorts of unobtainium.
 
Last edited:
Yes. Measurements are done with closed loops.
Are there any real alternatives?

I shall see if i can do some sort of impulse response with my signal generator.
 
Yes. Measurements are done with closed loops.
Are there any real alternatives?
Google "measurement phase margin". On the first page you will find links to documents that use the same method, although not for amps, but for SMPS. As I said earlier it involves a floating AC source.
A lnik there describes the square-wave method.
https://www.google.com/search?clien...hase+margn#kpvalbx=_owf8YvyUFO2Hxc8P0oyesA018Or you can determine it from the opamp's litterature, provided the OLG Bode plot is in it.
 
Yes. Measurements are done with closed loops.
Are there any real alternatives?

I shall see if i can do some sort of impulse response with my signal generator.

For clarity - are you doing this as an academic experiment / investigation or primarily as a practical solution that you want to achieve ?
If the latter then it's a circuit implementation that has been realised in thousands of instances. Just needs a suitable op amp that is good for audio. Use one that is "Unity Gain Stable" or compensated to be so. Actually I'm not certain if unity gain stable parameter applies to a simple diff amp given that stability parameter for inverting and non-inverting op amp stages are not the same - and a simple diff amp is sort of both of these.
 
Thanks I will check it out.

Nothing academical here.
Im trying to make something sound as good as i can and understand how to work with stuff like margin.
Datasheet seems not sufficiant for this. (except for having "Superior sound quality" and being "Unity gain stable"...)
 
Thanks I will check it out.

Nothing academical here.
Im trying to make something sound as good as i can and understand how to work with stuff like margin.
Datasheet seems not sufficiant for this. (except for having "Superior sound quality" and being "Unity gain stable"...)

Well in that case it's all been done for you. Just look at any "standard" line input that uses a "simple " diff amp line input. DDA stuff eg AMR 24 comes to mind IIRC but only because I worked on DDA stuff "back in the day" :). Probably a TL072 stage with 10K resistors and some small value caps across the the feedback.
You can improve on a TL072 now in terms of noise etc eg OPA13x and more.
And use higher tolerance / lower tempco resistors for better CMRR.
But CMRR is the real parameter imo for diff amps (and it might be wrecked* by imbalanced source impedances in any case). But stability margin isn't a problem in a competently designed stage.
Or go better and look at the THAT Ingenius ICs ( fwiw I have no professional connection with them).

* "Wrecked" may be a bit strong there tbh - it'll still usually be enough to bury "Ground Noise" that is the major thing with Line Level inputs,
 
Back
Top