Author Topic: Non ideality in output square wave of a differentiator circuit  (Read 2649 times)

0 Members and 1 Guest are viewing this topic.

Offline bonzerTopic starter

  • Regular Contributor
  • *
  • Posts: 117
  • Country: it
Non ideality in output square wave of a differentiator circuit
« on: February 13, 2019, 02:12:01 pm »
Hello everyone! Please help me to understand why does that square wave at the output of differentiator circuit using operational amplifier have that spike at those points of rising edge? The input is a triangular wave with frequency of 30Hz.
It's not a simple differentiator, it had a compensation so it derives till like 3kHz than it crosses the output open loop gain of the operational and starts to go down.
My opinion is that at those points triangular waves have high frequency components that get cut by the differentiator and therefore can't complete the waveform at the output. What's your thoughts?
« Last Edit: February 13, 2019, 02:42:26 pm by bonzer »
 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 6420
  • Country: de
Re: Non ideality in output square wave of a derivative circuit
« Reply #1 on: February 13, 2019, 02:18:48 pm »
Change your title from "derivator" to "differentiator", then probably more people will react.
 
The following users thanked this post: bonzer

Offline emece67

  • Frequent Contributor
  • **
  • !
  • Posts: 614
  • Country: 00
Re: Non ideality in output square wave of a differentiator circuit
« Reply #2 on: February 13, 2019, 02:46:03 pm »
.
« Last Edit: August 19, 2022, 02:15:21 pm by emece67 »
 
The following users thanked this post: bonzer

Offline bonzerTopic starter

  • Regular Contributor
  • *
  • Posts: 117
  • Country: it
Re: Non ideality in output square wave of a differentiator circuit
« Reply #3 on: February 13, 2019, 03:08:07 pm »
Thanks a lot! I think it's exactly my case!
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9963
  • Country: us
Re: Non ideality in output square wave of a differentiator circuit
« Reply #4 on: February 13, 2019, 04:51:41 pm »
I'm on thin ice here...

The triangle wave is continuous but its first derivative is not (square wave having a jump discontinuity).  Therefore,the triangle wave is not continuously differentialable.  So the derivative blows up at the peak (top and bottom) of the triangle wave.

Note how the author wants to ignore the peak in this link:

https://www.chegg.com/homework-help/questions-and-answers/derivative-triangle-wave-square-wave-illustration-shows-triangle-amplitude-periodt-line-se-q19516514

I'm not sure I would put what your seeing down as the Gibbs Phenomenon because you only see it on one corner of the square wave.  The GP affects both ends of both edges.

When the square wave changes level, dv/dt approaches infinity.  Given infinite harmonic content, dv/dt would approach quite closely.  But even with modest harmonic content, the derivative will still be quite high.
« Last Edit: February 13, 2019, 05:08:49 pm by rstofer »
 
The following users thanked this post: bonzer

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9963
  • Country: us
Re: Non ideality in output square wave of a differentiator circuit
« Reply #5 on: February 13, 2019, 04:58:51 pm »
My opinion is that at those points triangular waves have high frequency components that get cut by the differentiator and therefore can't complete the waveform at the output. What's your thoughts?

My point (above) exactly.  There is a lot of harmonic content in making that corner and the differentiator is doing its very best to produce a derivative.

These issues with differentiators is the reason that in analog computing we keep integrating everything until we get rid of derivatives altogether (where such is possible).
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 12537
  • Country: us
Re: Non ideality in output square wave of a differentiator circuit
« Reply #6 on: February 13, 2019, 05:07:17 pm »
Hello everyone! Please help me to understand why does that square wave at the output of differentiator circuit using operational amplifier have that spike at those points of rising edge? The input is a triangular wave with frequency of 30Hz.

Some people above have given you the mathematical explanation, but the practical explanation is that a perfect square wave is a mathematical abstraction that is not realizable in practice. It is functionally impossible to produce a perfect square wave with any circuit--you can only get a sufficiently good approximation. If you zoom in on the corners you will always see some kind of imperfection, either rounding or overshoot.
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9963
  • Country: us
Re: Non ideality in output square wave of a differentiator circuit
« Reply #7 on: February 13, 2019, 05:14:40 pm »
But...

I have been working through Calculus with my grandson over the last couple of years and we have run into this definition on several occasions.  I was so happy with the "continuously differentialable" bit that I was going to send him a link to the thread.  He'll be so proud!

But first I have to wait and see if I get blown out of the water.  If that happens, I'll just quietly return to my corner and take a nap.  Old people need naps...

Yes, the corner will never be perfect but the derivative didn't go to infinity either.  All this proves is that dv/dt isn't infinite in a realizable circuit.
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 12537
  • Country: us
Re: Non ideality in output square wave of a differentiator circuit
« Reply #8 on: February 13, 2019, 05:26:56 pm »
We can say that "continuously differentiable" is the same as saying "the derivative is continuous". A square wave is not a continuous function since at the steps the value of the function is undefined (there are no actual vertical lines in the mathematical plot, there are just gaps between the upper horizontals and the lower horizontals).

One way to put this on a theoretical footing mathematically is to apply the epsilon-delta theorem of continuous functions to the square wave.

Another way to consider this is to recognize that a true square wave has infinite frequency content. Since no real circuit can handle infinite frequencies it means no real circuit can produce a perfect square wave.
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 12537
  • Country: us
Re: Non ideality in output square wave of a differentiator circuit
« Reply #9 on: February 13, 2019, 05:29:12 pm »
With reference to post above:

https://youtu.be/kfF40MiS7zA
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9963
  • Country: us
Re: Non ideality in output square wave of a differentiator circuit
« Reply #10 on: February 13, 2019, 05:49:50 pm »
https://www.3blue1brown.com/ is one of my favorite sites.  I have spent may hours hanging out around there as well as at Khan Academy and CalcWorkshop (fee).
 

Offline emece67

  • Frequent Contributor
  • **
  • !
  • Posts: 614
  • Country: 00
Re: Non ideality in output square wave of a differentiator circuit
« Reply #11 on: February 13, 2019, 06:22:51 pm »
.
« Last Edit: August 19, 2022, 02:15:31 pm by emece67 »
 
The following users thanked this post: bonzer

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9963
  • Country: us
Re: Non ideality in output square wave of a differentiator circuit
« Reply #12 on: February 13, 2019, 06:24:47 pm »
Another way to consider this is to recognize that a true square wave has infinite frequency content. Since no real circuit can handle infinite frequencies it means no real circuit can produce a perfect square wave.

Practcally, I think the circuit will be limited by the slew rate of the UA741 which is about 0.5V/us.  I would sure want to know more about the component values because I have problems when the simulation output is in terms of nanovolts.

« Last Edit: February 13, 2019, 08:29:35 pm by rstofer »
 

Offline Audioguru

  • Super Contributor
  • ***
  • Posts: 1507
  • Country: ca
Re: Non ideality in output square wave of a differentiator circuit
« Reply #13 on: February 13, 2019, 07:11:08 pm »
The 741 opamp is 52 years old. Bury it and let it RIP.
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9963
  • Country: us
Re: Non ideality in output square wave of a differentiator circuit
« Reply #14 on: February 13, 2019, 07:22:46 pm »
The 741 opamp is 52 years old. Bury it and let it RIP.

Except that both of my Comdyna 6 Analog Computers are loaded with 741s and replacements are expensive.  I'm somewhat reluctant to substitute but at some point that may just be the way it works out.
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 12537
  • Country: us
Re: Non ideality in output square wave of a differentiator circuit
« Reply #15 on: February 13, 2019, 09:01:29 pm »
Except that both of my Comdyna 6 Analog Computers are loaded with 741s and replacements are expensive.  I'm somewhat reluctant to substitute but at some point that may just be the way it works out.

On an analog computer we would do both amplitude and frequency scaling for any given problem. So if the desired frequencies in the system being modeled exceed the limiting slew rate of the amplifiers, one could just change the frequency scale to bring things into range.

There may be other performance limits of the 741, but if the analog computer was designed around those amplifiers, then substituting them for more modern amplifiers with higher performance may just introduce new compatibility problems with the rest of the system? I would be cautious.
 

Offline bonzerTopic starter

  • Regular Contributor
  • *
  • Posts: 117
  • Country: it
Re: Non ideality in output square wave of a differentiator circuit
« Reply #16 on: February 13, 2019, 09:15:33 pm »
Thanks a lot for you answers. I also wanted to notice that these are the results of a simulation circuit.
I'm still a bit confused, I'd like to point out the problem in an accurate way because it's for an university work (but it's a brief comment so feel free to add here whatever comes to your mind).
I attached differentiator's bode diagram of the gain.
So what we have from what you said is that:
  • Gibbs phenomenon is a math abstraction so is not exactly rappresented by the circuit as it is real and has attenuation therefore high frequency harmonics get attenuated and not truncated. What we see is then an approximation of the Gibbs fenomenon, not at both ends of the edges because of the real behaivor of the circuit (phase shift and so on, as said by emence67) 
  • The problem of non differentiable points of the triangular wave doesn't convince me enough, why wouldn't it just saturate at those points then? Anyway it might be, I'm not sure
  • Phase non linearity - could be the biggest contribution to those overshoots as we don't have here a linear phase system

In confirmation to the last point, I've just found an example of a butterworth filter vs bessel filter (bessel has linear phase) having a square wave at the output on this link. The case looks similar but I don't know how much it is related.

https://www.allaboutcircuits.com/technical-articles/how-to-low-pass-filter-a-square-wave/
« Last Edit: February 13, 2019, 09:39:56 pm by bonzer »
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9963
  • Country: us
Re: Non ideality in output square wave of a differentiator circuit
« Reply #17 on: February 13, 2019, 10:05:09 pm »
If you stop and think about a C-R differentiator where the signal goes in the C and comes out the junction between the R and C, you will see the same spike when the triangle or square wave changes shape.

https://www.electronics-tutorials.ws/rc/rc-differentiator.html

Look at the waveforms about 1/2 way down the page.  The bottom waveform is a typical differentiator used to generate a clock pulse from a square wave.  It would be cleaned up with a Schmitt Trigger perhaps but the idea is to find the edges of the square wave where dv/dt heads off toward infinity and the output waveform has the characteristic differentiator spike.

This is exactly what you have except your circuit is more elegant.  But a differentiator is a differentiator and the derivative at the point of inflection or jump discontinuity is undefined.

In my view, Gibbs Phenomenon is a completely different animal and will always affect all 4 corners whereas the differentiator only looks at the 2 edges and the direction of the pulse is in the same direction as the edge transition.

Actually, GP is just a math problem.  Add another harmonic and it will be reduced.  Add a dozen more and it will be reduced further.  Include an infinite number of terms and it will disappear.  As you build up a square wave from a sine wave and its harmonics, it is the corners that are the last to fill in.

http://recordingology.com/in-the-studio/distortion/square-wave-calculations/


MANY years ago, logic systems weren't always synchronous and it was quite common to use the edge of some signal to create a pulse to clock some part of the circuit.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf