Author Topic: Op amp beginner's questions  (Read 3391 times)

0 Members and 1 Guest are viewing this topic.

Offline nForceTopic starter

  • Frequent Contributor
  • **
  • Posts: 393
  • Country: ee
Op amp beginner's questions
« on: November 25, 2018, 05:08:38 pm »
1) Which configurations of op amps are more preferable? (Non-inverting or inverting)? In which cases?

2) How did this guy get Vout with the reactance of a capacitor (yellow)? (Picture of the integrator in the attachment)

Thanks.
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9963
  • Country: us
Re: Op amp beginner's questions
« Reply #1 on: November 25, 2018, 05:35:33 pm »
1) Which configurations of op amps are more preferable? (Non-inverting or inverting)? In which cases?
The big difference is whether the amplifier inverts.
http://pediaa.com/difference-between-inverting-and-noninverting-amplifier/
Quote
2) How did this guy get Vout with the reactance of a capacitor (yellow)? (Picture of the integrator in the attachment)

Suppose the Xc value was just a resistor and called Rf.  Then the standard gain equation would -Rf/R.  The only change is that the feedback is a capacitive reactance rather than a simple resistance.  This assumes we are interested in the circuit as an integrator but it can also be a low pass filter.

In the case of the integrator, the equation we care about is the one with the integration.  This is the fundamental building block of analog computers and this is a topic that just fascinates me.  I know, simple things...

The thing is, a second order differential equation like my''+dy'+sy = 0 shows up in so many areas of physics and electronics.  It is just fun to model it on an analog computer and watch it run.  Better yet, instead of = 0, substitute = A*cos(wt) and watch what happens when wt is less than the resonant frequency, equal to the resonant frequency (watch out!)  or greater than the resonant frequency.  FWIW:  m=mass, d=damping coefficient, s=spring constant  Look at equation 1 here and note the similarity:
http://www.math.ubc.ca/~feldman/m121/RLC.pdf

ETA: that little graph after equation 4 shows what happens to any second order differential equation when it is excited at its resonant frequency.

What a marvelous little circuit!
« Last Edit: November 25, 2018, 05:55:08 pm by rstofer »
 
The following users thanked this post: nForce

Offline Audioguru

  • Super Contributor
  • ***
  • Posts: 1507
  • Country: ca
Re: Op amp beginner's questions
« Reply #2 on: November 25, 2018, 05:46:37 pm »
If I do not need inverting then I always use a non-inverting opamp since its input impedance is very high or extremely high then the value and cost of an input coupling capacitor can be small. An inverting opamp circuit has a fairly low input impedance.

The integrator is a linear lowpass filter that cuts high frequencies.
 
The following users thanked this post: nForce

Offline Wimberleytech

  • Super Contributor
  • ***
  • Posts: 1134
  • Country: us
Re: Op amp beginner's questions
« Reply #3 on: November 26, 2018, 02:45:50 am »
A non-inverting configuration has more bandwidth for the same flat-band gain.
 
The following users thanked this post: nForce

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20357
  • Country: gb
  • 0999
Re: Op amp beginner's questions
« Reply #4 on: November 26, 2018, 09:36:30 am »
The circuit attached to the original post needs to have some DC negative feedback, otherwise the op-amp's output will probably saturate at one rail or another, due to the bias currents. There should be a high value resistor, in parallel with the capacitor to stabilise the circuit. If you're using a J-FET/CMOS input op-amp, you might be able to get away with it, as the leakage current through the capacitor could be sufficient, but it's still bad practise.
 
The following users thanked this post: nForce

Offline nForceTopic starter

  • Frequent Contributor
  • **
  • Posts: 393
  • Country: ee
Re: Op amp beginner's questions
« Reply #5 on: November 26, 2018, 10:17:39 am »
Quote
Suppose the Xc value was just a resistor and called Rf.  Then the standard gain equation would -Rf/R.  The only change is that the feedback is a capacitive reactance rather than a simple resistance.  This assumes we are interested in the circuit as an integrator but it can also be a low pass filter.

And because we get 1/(2*pi*f*RC), then we can say: this expression is equal to that of low pass filter, so it has to be low pass filter in the frequency domain?
 

Offline nsrmagazin

  • Regular Contributor
  • *
  • !
  • Posts: 156
  • Country: ru
Re: Op amp beginner's questions
« Reply #6 on: November 26, 2018, 01:46:07 pm »
Your picture is not in "English". That may make it harder to understand.

Operational amplifiers are called "operational" because they perform mathematical operations => summator, integrator, differenciator and etc.

There is no preference (someone decided once upon a time that the non-inverting will be used more). But changing the input from inverting to non-inverting can change the purpose of the circuit. You don't need to look at this so "idealistically". The capacitor will get charged until it reaches a certain voltage, with it the output voltage will rise and reach the capacitor maximum. Take a look at "P/PI/PID" regulators.
Hi all!
If you like the post, please press "thanks".
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9963
  • Country: us
Re: Op amp beginner's questions
« Reply #7 on: November 26, 2018, 04:01:33 pm »
Quote
Suppose the Xc value was just a resistor and called Rf.  Then the standard gain equation would -Rf/R.  The only change is that the feedback is a capacitive reactance rather than a simple resistance.  This assumes we are interested in the circuit as an integrator but it can also be a low pass filter.

And because we get 1/(2*pi*f*RC), then we can say: this expression is equal to that of low pass filter, so it has to be low pass filter in the frequency domain?

Yes but look at the circuit about 1/2 way down here:
https://www.electronics-tutorials.ws/filter/filter_5.html

There is a high value resistor in parallel with the capacitor as described above.
 

Offline nForceTopic starter

  • Frequent Contributor
  • **
  • Posts: 393
  • Country: ee
Re: Op amp beginner's questions
« Reply #8 on: November 26, 2018, 07:29:26 pm »
Regarding filters, I have an identical question as this guy: https://www.quora.com/Why-it-is-called-a-%E2%80%9Cfirst-order-low-pass-filter%E2%80%9D

But I don't understand the answer, can someone explain to me the concept as to a beginner?
 

Offline Wimberleytech

  • Super Contributor
  • ***
  • Posts: 1134
  • Country: us
Re: Op amp beginner's questions
« Reply #9 on: November 26, 2018, 07:41:52 pm »
His answer was pretty good.  Does this help?
First order LPF and a second order LPF
 
The following users thanked this post: nForce

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9963
  • Country: us
Re: Op amp beginner's questions
« Reply #10 on: November 26, 2018, 11:20:58 pm »
Or, one pole versus two poles and 20dB/decade versus 40dB/decade rolloff.

Look at the two transfer functions given above.  Note how the first has a linear denominator (s + ...) and the second has a quadratic denominator (s2 + ...).

Poles are determined by the denominator of the transfer function.  It the denominator is linear, it is a first order filter.  If the denominator is quadratic, it is a second order filter.  And so on...

We find the location of the poles by solving for the denominator going to 0.  Those roots can be real, imaginary or even 0.  Root Locus comes to mind and I really don't want to go there.

If you want to chase the math down a rathole, you need Calc I, Calc II, Differential Equations and Laplace Transforms.  And that's WHY I don't want to go there.  Yes, I took the classes, way back when.

You might have to throw in the Fourier Transform and the Inverse Fourier Transform  to convert between the time and frequency domains and back.
« Last Edit: November 26, 2018, 11:29:02 pm by rstofer »
 
The following users thanked this post: nForce, Wimberleytech

Offline Mattjd

  • Regular Contributor
  • *
  • Posts: 230
  • Country: us
Re: Op amp beginner's questions
« Reply #11 on: November 26, 2018, 11:41:35 pm »
if the region of convergence of the laplace transform contains the imaginary axis then you can just substitute in the definition of s with sigma = 0.

I.e to go from S to frequency set S = sigma+j*omega


Be careful with going backwards, as the converse is not always true.

i.e.


L{H(t)}|(s=j*w) = H(w) <=/=> H(w)|(j*w = s)

but

L{H(t)}|(s=j*w) = H(w) <=> Imaginary axis is an element of ROC{L{H(t)}}

 
« Last Edit: November 26, 2018, 11:44:41 pm by Mattjd »
 
The following users thanked this post: nForce

Offline nForceTopic starter

  • Frequent Contributor
  • **
  • Posts: 393
  • Country: ee
Re: Op amp beginner's questions
« Reply #12 on: November 27, 2018, 04:32:25 pm »
Quote
Or, one pole versus two poles and 20dB/decade versus 40dB/decade rolloff.

How do you know, that the first one has 20dB/decade rolloff? How can we calculate this?

From this, I can say that we can achieve a low-pass filter programmatically, why should we use then op-amp active filter?
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9963
  • Country: us
Re: Op amp beginner's questions
« Reply #13 on: November 27, 2018, 05:59:45 pm »
Quote
Or, one pole versus two poles and 20dB/decade versus 40dB/decade rolloff.

How do you know, that the first one has 20dB/decade rolloff? How can we calculate this?


There's a fair bit of math involved in proving that so here is a web page.  There are MANY others.  The roll-off is kind of a universal constant, like 'e' or 'pi' and it is derived from the definition of the Bel and deciBel (dB).

https://en.wikipedia.org/wiki/Roll-off

Here's a video re: Bode' Plots and is just the first of a series related to drawing the plots by hand.  Obviously, we aren't going to do it that way given  MATLAB or some other solver like Maxima or Octave.



Quote
From this, I can say that we can achieve a low-pass filter programmatically, why should we use then op-amp active filter?

But you really can't achieve the true analog nature of any continuous function with a program.  The best you can do is create a discrete time function which is, by definition, not continuous.  Sure, it's a good rendition if the CPU is fast enough and the ADC and DACs have enough bandwidth but they are still discrete time, not continuous, functions.  There a whole field of EE math involved with discrete time and it comes up frequently when building PID loops.  Here's a video (one of a series) on discrete time control systems:



And every time that DAC value changes, even by one bit, it generates harmonics.  Just like a square wave does.  They may not be significant but you can't avoid the math.  It happens...  There is a step change in voltage level in a short period of time.  Fourier Series comes up a lot about now!

One problem with the passive LPF is the loss of amplitude.  That is the big thought behind active filters - restore the output level with an op amp.  Nothing much changes in terms of breakpoint and roll-off but the output isn't attenuated.

https://www.electronics-tutorials.ws/filter/filter_5.html

Will every circuit you construct with spare parts exhibit the exact characteristics assumed by the math?  Probably not!  It isn't that the math is wrong, it's that the parts aren't, and probably can't be, modeled perfectly.

We know resistors have inductance, we know capacitors have resistance, we know inductors have resistance and so on.
« Last Edit: November 27, 2018, 06:05:05 pm by rstofer »
 
The following users thanked this post: nForce, bmdaly

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9963
  • Country: us
Re: Op amp beginner's questions
« Reply #14 on: November 27, 2018, 08:38:32 pm »
Remember that roll-off is in terms of dB per decade (usually).  Assume a corner frequency of 1 Hz and let's step away from the corner.  Between 10 Hz and 100 Hz is 1 decade but only 90 Hz spread and the attenuation is 20 dB.  Between 100 Hz and 1 kHz is one decade but 900 Hz spread and the attenuation is 20 dB.  Same between 1 kHz and 10 kHz, 9000 Hz spread, and so on.

The reason this looks like a straight line on the Bode' Plot is because the horizontal axis is logarithmic, not linear.  We use that scaling because we can use a straightedge to plot the roll-off.  And, of course, dB is logarithmic.  In the voltage case dB = 20 log10(Vo/Vi).  In the power case it is dB = 10 log10(Pout/Pin).

https://en.wikipedia.org/wiki/Decibel

BTW: 20 dB/decade is 6 dB/octave where an octave is just a doubling in frequency.  Sometimes you will see dB/octave in datasheets.
 
The following users thanked this post: nForce

Offline bson

  • Supporter
  • ****
  • Posts: 2497
  • Country: us
Re: Op amp beginner's questions
« Reply #15 on: November 28, 2018, 05:46:06 pm »
20dBV/decade attenuation is a reciprocal response.  1/10 = 0.1 = -20dB.  Anything of the form 1/f will exhibit it when f changes by 10x.
 
The following users thanked this post: nForce, rstofer

Offline nsrmagazin

  • Regular Contributor
  • *
  • !
  • Posts: 156
  • Country: ru
Re: Op amp beginner's questions
« Reply #16 on: December 03, 2018, 01:48:39 pm »
This is why Schools and Universities exist. You are not going to learn electronics from a forum.
Hi all!
If you like the post, please press "thanks".
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9963
  • Country: us
Re: Op amp beginner's questions
« Reply #17 on: December 03, 2018, 05:34:56 pm »
This is why Schools and Universities exist. You are not going to learn electronics from a forum.

To a large extent, that is true.  The theory and the math all tie together and, due to the sequential manner of study, it can't be learned in some random method.  It takes 4-5 years of increasingly more complex math.

OTOH, that's for engineering, not messing around on a breadboard.  We can easily demonstrate filters with a decent DMM (decent in terms of AC response) and a signal source.  My preference for Bode' Plots is the Digilent Analog Discovery 2 but when I was in school, we took individual voltage vs frequency measurements and did the plot by hand.  That's how it was done in the early '70s; we just didn't have the tools we have today.

We can demonstrate transistor circuits fairly easy and a good number of op amp designs really only take a dual rail power supply and some kind of display.  Again, I prefer the AD2 but a scope is workable.  Sometimes even a DMM is adequate.

One of the really nice things about the Internet era is the availability of tutorials on just about any subject.  CalcWorkshop is great (fee required), Khan Academy has an EE track as well as their famous math tutorials and there are a host of other sites (like mathbff or nancypi).  For solvers we have Symbolab and for graphing we have Desmos and there are some really nice offline tools like wxMaxima, Mathematica and even commercial products like MATLAB.

The modern student has it much easier.  All of these tools make learning a lot easier and faster so more time can be spent on theory and less time spent on doing the math.

But it still takes about 5 years to get through an engineering program.

On this topic:  why not build a LPF and measure the output over a couple of decades.  Make the corner frequency fairly low, like 1000 Hz and sweep, by hand, from 100 Hz to 100,000 Hz (3 decades) by hand and PROVE that the roll-off is 20 dB per decade.  Maybe take 10 measurements per decade.  Almost any DMM will handle the low frequency.  Even just 1 decade will prove the roll-off.  A scope is probably required to see the phase shift.
 

Offline Wimberleytech

  • Super Contributor
  • ***
  • Posts: 1134
  • Country: us
Re: Op amp beginner's questions
« Reply #18 on: December 03, 2018, 05:54:02 pm »

....but when I was in school, we took individual voltage vs frequency measurements and did the plot by hand.  That's how it was done in the early '70s; we just didn't have the tools we have today.


Indeed...I still have a big folder of semi-log paper of varying numbers of decades.  Beautiful stuff...a certain elegance in plotting those points with a template using a drafting pencil filled with B lead.  But, I am glad we have the tools you mentioned in this modern era.
 

Offline nsrmagazin

  • Regular Contributor
  • *
  • !
  • Posts: 156
  • Country: ru
Re: Op amp beginner's questions
« Reply #19 on: December 04, 2018, 06:53:56 am »
Like this you leave wholes in the knowledge. A lot of people think that they know something, but in truth they don't. Hope this is not tha case.
Hi all!
If you like the post, please press "thanks".
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf