(chiming)
- Today we are going to talk about
op-amp integrator circuits.
So we've gone over op-amps in different ways before
but now we're gonna show how you can use them to
actually be an integrator.
And where you'd use that, I don't know, but it's important.
So we'll go over it.
So first thing I just wanna
go over integration really quick.
So with integration, the idea is,
if it's been a couple years
since you've done any calculation,
is to find the area under the curve.
So it's something that if you have a constant input,
like that, as you are going this direction,
the area under the curve increases.
So if this is your input
then your output will increase like that
as you are constantly increasing the area under your curve.
So with circuits, the idea of area under the curve is
that any positive voltage will cause the output to
have a bigger positive voltage.
And then if you go into a negative voltage
it will actually drop your voltage.
So now on this example, if we were to go like that,
then immediately, let's make that
at least somewhat even,
immediately, we're gonna start going down like that
because now all of this area is a negative area.
So that is going to be measuring the negative area
under the voltage or under the line
and so you're going to be going down like that.
Now this is not at all supposed to be a replacement
for years and years of calculus and stuff like that
but just the general idea as a reminder is
that this integration circuit
that we're going to be going over
is going to be measuring the area under the curve
and giving us an output that is indicative of that.
And as one more example
before we get into the circuit itself,
if you remember that you take
the integral of sine, it's cosine.
The integral of cosine, it's sine, stuff like that.
You can see if you have the sine here
and it probably is easier to show it
if I went the other way.
Let's say we start with cosine, that starts up here
and then let's see how well I can do this.
Oh my goodness, that's terrible.
The idea is though, if you have cosine,
it starts up here.
As you're moving across, you are increasing the area
under this as you're going along
but it's getting smaller amounts of area.
So as your sine wave comes up, it's getting bigger
and bigger, but it's also not increasing as much.
But then as soon as you hit zero, the inflection point
for your sine wave, which is again the integral of cosine,
it starts to go down again
because again, you're losing the area under that curve.
And then once you start decreasing here,
you get that inflection in the curve.
But once you cross here,
that's where your sine wave comes back up
and you're losing that space.
But again, the idea is here that we are integrating a signal
and we are taking all the positive voltage
and measuring it and finding that area under the curve.
But then if the voltage becomes negative
our output actually starts decreasing again.
Okay, now with that very, very terrible
integral calculus overview,
let's go to the circuit itself.
Okay, so now we have our integrator circuit
and it looks much like your typical inverting feedback,
non-inverting amplifier circuit.
There we go.
You have your input resistor,
but instead of this feedback resistor,
you get a feedback capacitor.
And so this feedback capacitor,
obviously, is not going to act like a normal resistor
because a capacitor at DC acts as a block
and won't pass any voltage.
Whereas at AC, it acts as a closed
and it'll let any signal pass without any problem.
And then in between, that's where you get to
have a little bit of fun with the math.
But the idea here is that as your voltage is changing
and you've got your virtual ground here,
where your two inputs are tied together,
remember no current going into these inputs
and the output of your op-amp
will drive this to zero at all times
or excuse me, not drive it to zero at all times.
It will make sure
that these two inputs are the same voltage.
And in this case
with our non-inverting input connect to ground,
it will be forcing this input to zero.
So what you're doing is,
if you have any change of input here,
your output is trying to change
this node right here to be zero volts.
And as always
any current going here has to be matched here.
Okay.
Reminder that capacitor, it's dependent
on the change in the voltage
that the change in the voltage over it is
how you'll know how much current is going through it.
C dv dt, remember?
Change in voltage over change in time times the capacitance.
That's how we get the relationship
between the currents that go through here.
So let's go over this a little bit mathematically.
I don't wanna get into it too much.
I do just want to make sure
that we go over it fundamentally and understand.
And then I've got this all set up
and we'll actually show this in action
with a variety of wave forms.
And I think it's pretty cool.
For me, it helps a lot to see it practically done.
See, oh, this is literally what's happening there.
So we'll get to that.
But first, let's go over how we come up
with this equation, where we find out V out.
Like all of our other op-amp circuits that we've gone over,
we know that this current is the same as this current.
So we can find this current right here
and we'll just call it i.
I called those Rf and Cf
because of the resistor feedback and the capacitor feedback
but it's the only resistor and the only capacitor.
So maybe I should have left them out to keep it simpler.
I don't know.
But in this case, we know that i here is
simply Vin minus zero,
because that's tied to ground virtually, over Rf.
So let's just say
Vin
over Rf
and then we know that that current is
going to be the same thing,
except we're not gonna gonna use Ohm's law
because Ohm's law doesn't work with capacitors.
We are going to use the fact that we know
that current through capacitor is
C times the change in voltage over the change in time.
And so we will have Cf times dv
and we wanna say dv out and this-
Dang it, I have to change that.
Change in, because it is a change in this voltage.
So that's gonna be zero minus Vout.
That is very important.
Over the change in time, dt.
And so this is our initial equation
that we have to work with,
relating these two currents together.
So let's look at that for a moment.
That makes sense.
Current going through there
is the same as the voltage change over there, times Cf.
Good to go.
So now how does this become this?
How do we get that Vout out of there and all by itself?
That's where we have to integrate it
on both sides to eliminate that.
And that's where we get the integrator circuit.
So let's do some math here really quick.
Integrate that on both sides.
So let's just say from zero to whatever time we have
Vin over Rf
equals integral of zero to t,
Cf d,
we'll just drop that zero,
negative V and I'm just gonna put Vo instead of Vout
to make it shorter, dt.
Okay, if you remember anything from integral calculus,
you can take all of your constants
out of the integral
and that will make things quite a bit simpler.
And since we're wanting to get that Vout on its own,
let's move the negative and the Cf over to the other side.
So we will divide both sides by our capacitance
and by that negative one.
So we will get negative one
over Cf Rf,
pulling that outta the integral to make it simpler.
Zero to t,
Vin equals
the integral zero to t of
dv zero
over dt.
Okay, just integrated both sides.
Moved the constants over there,
so we didn't have to worry about 'em.
And then we just know that the integral of a derivative is
basically your original thing plus a constant.
Now in this case, we're just gonna assume
that the the original voltage is zero.
So that is quite literally just
V zero.
Makes things very, very simple.
Okay?
Now sometimes people can see those integral signs
and it scares 'em.
We didn't do anything special here.
All we did was we took this derivative
with a change of that voltage
and we wanted to get get rid of it
so that we could have our output,
everything in regards to that output V zero,
and all we did was integrate over on this side.
Now, this is helpful for you to know what's going on
and explains things mathematically,
but again, it's much more important
that you get an intuitive idea of what's going on.
And that is simply that the output is simply the inverse,
remember that negative sign,
the inverse of one over your feedback resistance
times your feedback capacitance
times the change in your input voltage
or excuse me, not the change in your input voltage.
Here I'm trying to be clear and I mess it up.
Times the integral of your input voltage.
All this is saying is
that your output is simply the area under the input.
So anytime it's above zero or below zero,
it's gonna go add one way or the other.
Times one over the feedback resistance
times the feedback capacitance.
That actually sounds maybe
even still a little bit confusing.
But if you keep that in mind, and we'll try
and go over it one more time after we go over this,
it should make a lot of sense.
And then you just look at this
and you can plug in the numbers.
If you have your Vin,
you can plug in those numbers, integrate it,
you Rf Cf.
Simple, simple addition, multiplication.
Very, very straightforward.
But I do wanna make sure that you understand that.
Let's jump into the example
of the different things and what this is looking like here.
And then we will get back, review the concept one more time
and then finish this whole thing up.
Now this is actually a little bit more complicated
because we had to hook it up to the oscilloscope
and the function generator and the power supply.
And we actually did need a negative voltage on here.
We're gonna go over the setup here really quick.
The input here, our power supply
to the op-amp itself
is at negative 10 volts.
Our power supply to the op-amp is now positive 10 volts
and I tied to the ground rails to the middle at zero volts.
So it was a little bit more complicated,
but other than that, this is quite straightforward.
We tied our non-inverting input here to ground
at that zero volts.
Our input here is tied to both the oscilloscope
and the waveform generator.
So we can both see the in and the output here.
And it's going through this about 5,000 ohm resistor.
And then then it goes to the inverting input,
which is then connected to the output via this capacitor.
And then I have another oscilloscope input
that I will just probe directly into the output
so that we can see how that's going.
So this is what it looks like on the breadboard
and it looks, well, basically,
it's exactly what was on the sheet of paper as well,
so should be good to go.
But let's now look at the power supply
and the input and output.
Okay, so our input's just going to be one kilohertz
five volts peak to peak.
It's going to be going,
currently it's a sine output
but I'll switch that actually to a square wave
and we'll go through the different ones.
But this is actually five volts peak to peak.
So it's plus 2.5 volts minus 2.5 volts.
We'll see how the input is measured on the oscilloscope
and then we'll see what the output looks like
and we will start messing with things.
All right, here, We have the yellow line as the input
which is that square wave that I was talking about.
And we have the blue line as the output.
You can see very easily
that as the voltage drops and becomes negative
since the signal is inverted, you get an increase.
And then as soon as the voltage is high,
again, because it's multiplied by a negative one over Rf Cf,
that it immediately starts to drop down again.
So that is exactly what we'd expect
on the output with the square wave.
Now the interesting thing is let's switch it
and let's have a ramp input.
So that is, again,
the yellow is the input and it's a ramp input,
with the blue as the output.
You can see that the inflection points
on the sine wave output are equal,
not necessarily to the the top
and the bottom of the ramp sign
but it's where it crosses the zero.
So it crosses the zero there
and it starts to become more negative.
And since it's inverted, that's exactly where
it starts to become more positive right there.
So that's pretty cool.
And then if you have a sine wave,
it does the same way or it does the same thing.
You can see that these are two basically sine waves
but out of phase from each other.
And that's where you get that sine to cosine
and cosine to sine changes when you integrate a circuit.
So that's about it.
I think those are some pretty cool examples
but I would like to point out a few things
that you may have already noticed.
The blue is moving.
It kind of goes all over the place.
It floats up, it floats down, and that's because, oh
it just did it for me right there.
That was quite nice.
It does that because you have those input bias voltages
that we've discussed in previous videos.
And so the op-amp isn't perfect
and this circuit assumes an ideal and perfect op-amp.
In real life, if you want an integrator circuit
that works properly,
you need to have some way to reset it
for when it goes crazy like this.
And you can do that with feedback resistors
and other little mechanisms.
But that is something you definitely need to worry about
in a real life application.
Another thing that you need to worry about is
that there are bandwidth limitations on this.
So we're currently at 1000 hertz
but as we increase that, you can see
that the output actually is getting smaller and smaller
and it's looking more like just a flat line.
You still get a ripple,
but the peak to peak on the output is significantly less.
And then as we go the other direction.
And let me get this farther down.
I'll have to
change my view quite a bit.
You can see that the output just looks horrible
and that's me not changing anything,
except for the frequency input.
And so you can tell that this is very independent
and that's not just an op-amp thing,
that's also your feedback resistor
and your feedback capacitor relationship.
So those two things will affect
what your circuit looks like,
and you'll have to tweak it.
Okay, so we just went over
and we saw practically what it looks like.
So again, I just want to go over briefly again
conceptually what's going on here.
Your output is simply going to be the inverse
of the integral of your input.
That's it.
Any input that's above zero, you're gonna start,
since it's inverted, start getting a more negative number.
Any input that is below zero volts,
it's gonna start getting to be a bigger number.
And you got to make sure
that you remember that inverse relationship
or you're gonna be quite confused.
So ideally, if you have a zero input on your input,
your output should be zero.
But because there is that bias,
it'll start to float a little bit
and that's something you need to deal with in real life.
But again, in a perfect situation,
if the input is zero volts, your output should also be zero
or stay the same if you've already had a previous
above or below zero voltage on the input.
Okay, that's pretty cool.
I admit, integrator was difficult for me
when I was learning about it.
It was just a strange relationship,
I didn't really understand.
But it's a fun circuit
and it's a lot of fun for me to see it in real life
and see how it works.
So I really hope this was both interesting to you
and also made it a lot more understandable
and intuitive to you on how this circuit works
and what's going on.
If it did, please give us a like,
subscribe to the channel, all that good stuff.
If it didn't, if you have any questions,
please leave it below in the comments
and we'd love to get back to you
and figure out what we can do to help clarify things.
Have a great one, and we'll see you in the next one.
(engaging)