Author Topic: What is this weird sine wave at differentiator Opamp output?  (Read 2238 times)

0 Members and 1 Guest are viewing this topic.

Offline anviengTopic starter

  • Newbie
  • Posts: 2
  • Country: vn
What is this weird sine wave at differentiator Opamp output?
« on: November 03, 2017, 06:16:07 pm »
I'm testing a typical differentiator Opamp in LTSpice and saw a noisy sine wave at the start of simulation, though it eventually smoothed out after a few ms. Can anyone tell me what's the cause for the waveform to look like that?
 

Offline orolo

  • Frequent Contributor
  • **
  • Posts: 352
  • Country: es
Re: What is this weird sine wave at differentiator Opamp output?
« Reply #1 on: November 03, 2017, 09:04:07 pm »
A real op-amp has finite (although very high) gain, and non-zero phase shift at high frequencies. A differentiator is a high-pass filter: it does not attenuate by itself at high frequencies. So it can happen that a signal felt at the inverting input is amplified by the 795 with the right phase shift that, when passing through the RC (100k/10nF) feedback loop, is fed back with enough phase shift to become positive feedbacked at that specific frequency, without being very attenuated. If the gain at that frequency is high enough, the circuit will oscillate. If the gain is not high enough, it will decay gradually after an impulse. In your case, when the circuit starts, the positive feedback mode is excited, and then it decays after a while: the gain at that frequency is close to one but lower.

In more specific terms, a very simplified transfer function for an inverting op-amp is \$-\frac{A}{s}\$, where A is the transition angular frequency of your op amp (this is called the "integrator model"). Your feedback loop introduces another pole, \$\frac{1}{1 + sRC}\$. Both together give a closed loop gain \$\frac{-A(1+sRC)}{s^2RC + s + A}\$. So you have resonance, more or less (solve the quadratic equation), at \$f = \frac{1}{2\pi}\sqrt{\frac{A}{RC}}\$. Looking at the datasheet of the 795, A=6.2832*1.6MHz = 10000000, and your RC=0.001. Substituting, f=16kHz. You should expect trouble about that frequency. Counting peaks, in your case the parasitic seems to be in the range of 14-15kHz or so, more or less in the ballpark of the computed range.

An expert will correct me if I'm wrong, since I'm not talking from extended experience, but I think this is your trouble.
 
The following users thanked this post: anvieng

Offline orolo

  • Frequent Contributor
  • **
  • Posts: 352
  • Country: es
Re: What is this weird sine wave at differentiator Opamp output?
« Reply #2 on: November 04, 2017, 10:48:43 am »
To avoid the annoying math, you can also run an AC analysis of your op-amp circuit to see what's going on:



the bode plot at the output is:



This is a faster op-amp than yours (8MHz bandwidth), but the behaviour is the same: the differentiator works as intended up to some resonant frequency, and then turns into an integrator. The trouble is, mainly, at the resonance.

To avoid instability, you should add a resistor in series with the input, and a capacitor in parallel with the feedback resistor, like this:



You have to choose the time constant of this new RC with care: not too low, no too high (beyond the transition frequency of the op-amp). With the values chosen, we have smoothed the resonance without spoiling the differentiatior behavior at lower frequencies:



So now, at startup, the compensated differentiatior doesn't have a parasitic and works as expected:



Notice, however, that the derivative is slightly phase shifted with respect to exact 90 degrees (you could also see this in the Bode plot). Compensating for stability compromises the exact differentiator behaviour. You have to find the correct component values to satisfy all your requirements.
« Last Edit: November 04, 2017, 11:05:44 am by orolo »
 

Offline IanMacdonald

  • Frequent Contributor
  • **
  • Posts: 943
  • Country: gb
    • IWR Consultancy
Re: What is this weird sine wave at differentiator Opamp output?
« Reply #3 on: November 04, 2017, 11:08:24 am »
To put it even more simply, at high frequencies C3 is a virtual short whilst R4 has a high value. Therefore there is effectively no negative feedback. Few opamps can operate stably in open loop configuration.

To overcome this, the circuit has to be 'degraded' a little from the ideal case, to keep things within parameters. 
 
The following users thanked this post: orolo


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf