Differential amplifier issue. Getting an "asymmetrical" up-down output

Thread Starter

Elerion

Joined Sep 11, 2017
125
Hi everyone.
Sorry, I didn't know a better tittle for this thread... but the issue is very simple.
I'm working on a plain differential amplifier, using a single OP07 and dual supply +9/-9 V (regulated).
dual trace_op07.png
The input is close to being a sinusoidal. The frequency is less than 500 Hz, so, pretty low.
Using a scope to look at the output, I'm getting what looks like a capacitive loading effect.
In XY mode, instead of getting a single trace, I get two (the movement is counter-clockwise).

Here's an image to show the effect. The right one is what I'm getting, even though I get a single trace (left) if probing the input voltage (R5, in this case). So, whatever is happening, is happening in the opamp section.
dual trace.png
Y channel is the output voltage. It goes from about 0 to 2 V (so, low amplitude/low frequency here, and I doubt that slew rate could be of any concern).

Everything is soldered using short leads. No breadboarded.

Any clue? What/where could I start looking at?
Thank you!
 

Thread Starter

Elerion

Joined Sep 11, 2017
125
X channel is a signal which is close to a low frequency sinusoidal, and drives the input of the circuit.
Y channel is the circuit's output.
The circuit is just measuring the current through a sense resistor (R5).

The XY mode helps me describe the issue.
The expected behaviour is that of a single trace in XY mode: the output should have the same "shape" weather it goes from low to high or from high to low, which is not the case.
 

Audioguru again

Joined Oct 21, 2019
6,673
Of course the opamp delays the output signal a little. The OP07 opamp is fairly old so its delay is a little more than most modern opamps. The delay does not matter.

The old OP07 opamp is not an audio opamp so maybe it has asymmetric distortion at your high gain.
 

BobTPH

Joined Jun 5, 2013
8,813
A pure phase difference would cause a circle or ellipse, no?

If the output is 0 to 2V it is not a pure sine. It has a DC component.

Why not look at a normal trace of the output and see if there is distortion?

Bob
 

Thread Starter

Elerion

Joined Sep 11, 2017
125
Of course the opamp delays the output signal a little. The OP07 opamp is fairly old so its delay is a little more than most modern opamps. The delay does not matter.
I wasn't expecting a delay at such low frequencies.
Imagine a simple curve tracer or any circuit where you sweep an input and want to measure the output. The result should be the same no matter if the input sweep is "upwards" or "downwards", shouldn't it?

Why not look at a normal trace of the output and see if there is distortion?
Yes, it does have a DC component. I thought that should not matter much being so far from saturation.
Didn't see distortion. I'll repeat the measurements with pure sinusoidal and take some captures.
 

Thread Starter

Elerion

Joined Sep 11, 2017
125
I cannot get my LTspice simulation of your circuit to work.
Neither me.

But here's what happends when using a pure 100 Hz sinusoidal input from a signal generator. Same behaviour. Not a straight line but an ellipse.
(Note: due to the high gain of the circuit, which I reaised to about 500x, I had to use averaging to get a good looking trace.)

Why not look at a normal trace of the output and see if there is distortion?
No measurable distortion. The signal generator output is quite nice (THD < 1%) and the output from the op amp is also a nice looking sinewave, almost up to clipping level.
 

Attachments

Thread Starter

Elerion

Joined Sep 11, 2017
125
That trace is an ellipse, showing a slight phase difference, not asymmetry.
Yes. That's why I put it in quotes and used XY mode to show it.

Is there anyway I could fix this behaviour? Or anything I can look at to find the way?
I'd like to get a single trace when sweeping the input up and down.
 

Audioguru again

Joined Oct 21, 2019
6,673
Your opamp circuit is not differential since it has only one input. The inverting input resistor connects to ground.
So why are you measuring the difference between the opamp input and its output? Of course there will be a little delay and phase shift.

If you use a modern half-decent opamp then the output levels should be the same as the input levels except the output will have gain.
 

Thread Starter

Elerion

Joined Sep 11, 2017
125
Your opamp circuit is not differential since it has only one input.
Well, yes. But I'd like to be able to measure the current flowing through the sense resistor even if it is not grounded. That's why I used the differential amplifier instead of a plain non-inverting amplifier. I just reduced the issue to its minimum to describe it here.

From the OP07 datasheet, it seemed to me like quite a good opamp. Very low offset and drift compared to others like LM358, TL07x, etc. Seemed to me totally capable of doing this simple task at such low frequencies.
Isn't it too much delay?
 

TeeKay6

Joined Apr 20, 2019
573
Well, yes. But I'd like to be able to measure the current flowing through the sense resistor even if it is not grounded. That's why I used the differential amplifier instead of a plain non-inverting amplifier. I just reduced the issue to its minimum to describe it here.

From the OP07 datasheet, it seemed to me like quite a good opamp. Very low offset and drift compared to others like LM358, TL07x, etc. Seemed to me totally capable of doing this simple task at such low frequencies.
Isn't it too much delay?
In the OP07 datasheet, look at the graph of gain vs frequency (if your datasheet has the graph; not all datasheet versions include the graph!). The gain begins to drop at about 1Hz and above that frequency there will be obvious phase shift. The OP07 is a relatively slow opamp, intended (at the date of its release) for low noise/low input-offset operation. Your differential amp circuit is correct, but at 500Hz there will be noticeable effect from the reduced gain at that frequency. Here's the graph from a 1995 version datasheet:
OP07 gain.JPG
 

Thread Starter

Elerion

Joined Sep 11, 2017
125
The gain begins to drop at about 1Hz and above that frequency there will be obvious phase shift. The OP07 is a relatively slow opamp, intended (at the date of its release) for low noise/low input-offset operation. Your differential amp circuit is correct, but at 500Hz there will be noticeable effect from the reduced gain
Please, correct me if I'm wrong. The phase shift happends at 100 Hz (post #8), and the OP07 is still capable of 80 dB gain (open-loop gain). I'm now using a gain of about 500 (54 dB). There shouldn't be such a noticiable shift, should it?
op07_olg.png




Also, why is this other opamp phase shift only happend close to 0 dB gain?
tl2021_olg.png
 

Audioguru again

Joined Oct 21, 2019
6,673
Without negative feedback, "this other opamp" has 90 degrees of phase shift from 1Hz to about 100kHz then has more phase shift at higher frequencies. Adding negative feedback reduces the gain and reduces the phase shift until the gain meets the phase shift diagonal line when the negative feedback does not work at higher frequencies.
 

TeeKay6

Joined Apr 20, 2019
573
Please, correct me if I'm wrong. The phase shift happends at 100 Hz (post #8), and the OP07 is still capable of 80 dB gain (open-loop gain). I'm now using a gain of about 500 (54 dB). There shouldn't be such a noticiable shift, should it?
View attachment 199205




Also, why is this other opamp phase shift only happend close to 0 dB gain?
View attachment 199206
Open loop, the OP07 exhibits 0° phase shift at very low frequencies (e.g. 0.01Hz); the shift increases gradually until by a bit above 2Hz the shift has reached 90°. The shift remains essentially constant at 90° until about 100kHz above which frequency the phase increases a bit more. I am inferring the phase shift from the slope of the gain curve.

Have you verified that your scope probes/channels are matched? If you connect both probes to the (same) input signal, is the trace then a single, straight line? If you have to use greatly different scope sensitivity settings to compare the input & output, then the matching of signals within the scope also becomes an issue to be verified as not a problem.
 

Thread Starter

Elerion

Joined Sep 11, 2017
125
Without negative feedback, "this other opamp" has 90 degrees of phase shift from 1Hz to about 100kHz then has more phase shift at higher frequencies.
Yes, but thats because of the internal compensation, and I assume that for low enough close-loop gains the phase shift will reach 0º at 100 Hz.

Adding negative feedback reduces the gain and reduces the phase shift until the gain meets the phase shift diagonal line when the negative feedback does not work at higher frequencies.
If I understand, and following that reasoning, aren't the blue and red intersection (first image, post #14) quite far away from red and original black (open-loop) line crossing? I just was hoping to get no phase shift.

the shift increases gradually until by a bit above 2Hz the shift has reached 90°. The shift remains essentially constant at 90° until about 100kHz above which frequency the phase increases a bit more
I understand. As I just said, I was hoping for less shift working below 55 dB at 100 Hz.

Have you verified that your scope probes/channels are matched? If you connect both probes to the (same) input signal, is the trace then a single, straight line? If you have to use greatly different scope sensitivity settings to compare the input & output, then the matching of signals within the scope also becomes an issue to be verified as not a problem.
I'm using the same probes, matched equally well. I even tried 1x attenuation to take that out of the equation.
And yes, at the input the line is straight.
Sensitivity is obviously quite different by a factor of 400, because opamp gain is quite high.

Would it be better to just use two cascaded gain stages (at much lower gain each, of course, so as to get the same net gain), or try another opamp? I'm looking lots of datasheets from still in production opamps, and I don't see one that clearly outperforms in this regard, having low offset/drift. Any recommendation is apprecited.
 

TeeKay6

Joined Apr 20, 2019
573
Yes, but thats because of the internal compensation, and I assume that for low enough close-loop gains the phase shift will reach 0º at 100 Hz.



If I understand, and following that reasoning, aren't the blue and red intersection (first image, post #14) quite far away from red and original black (open-loop) line crossing? I just was hoping to get no phase shift.



I understand. As I just said, I was hoping for less shift working below 55 dB at 100 Hz.



I'm using the same probes, matched equally well. I even tried 1x attenuation to take that out of the equation.
And yes, at the input the line is straight.
Sensitivity is obviously quite different by a factor of 400, because opamp gain is quite high.

Would it be better to just use two cascaded gain stages (at much lower gain each, of course, so as to get the same net gain), or try another opamp? I'm looking lots of datasheets from still in production opamps, and I don't see one that clearly outperforms in this regard, having low offset/drift. Any recommendation is apprecited.
If you need to see less phase shift using the XY measurement scheme, then you can add a small phase shift (via an RC) delay to the signal source to use as the "reference". With the right amount of phase shifting, you can make the XY plot look better, using the "reference" vs the output of the opamp (rather than the original source vs output of opamp). Since I have no idea what you are trying to do or why, I cannot say whether this scheme would be of value to you.
 

Thread Starter

Elerion

Joined Sep 11, 2017
125
Since I have no idea what you are trying to do or why, I cannot say whether this scheme would be of value to you.
I want to measure the current through a device, which has to be in phase with the voltage generated in another part of the circuit (to get the current-voltage relation, like a curve tracer).
 

Audioguru again

Joined Oct 21, 2019
6,673
Use a dual opamp, one for current and the second opamp for voltage. Since they are in the same IC then their phase shifts are identical if you set both to have the same gain (then attenuate the one with the higher signal).
 
Top