Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Integrating op amps

Status
Not open for further replies.
Thanks MrAl,

I was trying to recall how to do it, but couldn't.

I don't have the time to dig out the maths books that I used as a student and revise it.
 
wow.. its gonna take a while to sink that in :) but thanks a lot guys.. really really appreciate it.. ill go through it and try to fix my problem :)
 
You're welcome.

I followed through MrAl's maths and the approximate answer that I obtained was:-

Vo = 3.183{ε^-10t - cos(6283 t)}

It is approx as I ignored the sin term since ωτ is >> 1.

Note that 2 * 1.59 = 3.18
 
Last edited:
hmm.. thats strange.. i guess the exponential term can also be ignored if we only want just the steady state response?

but then theres no offset in the output signal.. :confused: but simulation shows a clear negative offset which's value is equal to the signal's amplitude..

so the equation should be

Code:
 Vo = -3.183{cos(6283t) + 1}                                  (ignoring the initial transient)

and looking at the integrating process.. the solution you got is correct for a cos wave where,

Vin =0 when t =0

but for a sin wave where

Vin = 2 when t = 0

you get an offset..
its this that i cant understand.. i thought maybe its something wrong with my calculations but now that you've gotten it i guess its not..

please look into it if you have time :)
 
I used Vi = A sin ωt (because you wrote yesterday "lets say a voltage of 2sin(2000*pi*t) is applied to the above circuit.."

Therefore, the initial conditions are:-

Vi = 0 at t = 0

(I assumed that C is uncharged at t = 0 therefore Vo = 0 at t = 0)

Thus

Vo = {R A/r} * {sin ωt - ωτ cos ωt + ωτ ε ^ -t/τ}/{(ωτ) ^ 2 + 1}

Thus at t = 0, Vo = 0 as expected. Note that τ = RC

since sin ωt - ωτ cos ωt + ωτ ε ^ -t/τ = 0 at t = 0

For the steady state, let t -> ∞ thus ε ^ -t/τ -> 0

so you are left with the sin & cos terms.

So I don't know where your +1 comes from.

Nor do I know why your simulation shows an off set
 
Last edited:
Now you understand my problem :)

actually the dc offset can be explained logically.. since the integrator is supposed to integrate that means the area is added up. And in the case of a sine wave with an initial value of 0 the area is added and subtracted throughout the curve in the positive and negative sections and therefore the area never becomes negative..

offset..jpg
heres the image explaining this.. the output signal is on the negative side because the output is inverted..

so logically there must be an offset..

so the problem is it not showing up in the calculations :)
 
Hi there,


There is no offset in the output even when you start the sine wave at some phase angle except at the very beginning of the wave train. If you look closer at your simulation you should see that the offset eventually goes away according to the exponential term, so it may take one cycle, two cycles, or 1000 cycles to go away, but it will go away.
One way to get a constant offset is to substitute sin(wt)+B for sin(wt) where B is the input offset and then solve all the equations over again. That's equivalent to an AC signal riding on a DC signal (the offset voltage).


If you read the last part of my previous post where i posted the equations, you would see that i included a remark at the end for a way to account for any offset. You simply replace sin(wt) with sin(wt)+B, where B is the input offset. That's a constant offset though.

If you want to solve for a sine input with a phase shift, perhaps you can try sin(wt+a) where a is the radian angle. The equations will account for this angle then.
 
Last edited:
No, I don't understand your problem.

The maths shows that the steady state is of the form -K cos ωt

so it is centred around zero. (The integral of sin is - cos.)

The exponential part is positive, so there should be a positive off set until the ε ^ -t/τ term approaches zero and then the waveform should be centred around zero as I said above.

Have you checked your simulation?

Is there an off set set it it?.
 
Last edited:
noo.. there is no input offset in it.. how can it be the integration if theres no offset? thats not mathematically correct.. cause for an integrator on a sin wave with initial voltage of zero the integrated value cant be negative? but your solution swings between plus and negative :)

im just trying to understand whats wrong :) perhaps your calculations are ryt.. but how?
 
Hello again,

There can be offset or not on the input, it depends if you want to add that to the math.
For these kinds of problems the math is dead on, and the way you verify it is by using more math that approaches the problem from a different perspective such as Laplace transforms. You can do it both ways, and should come out with the same results or at least a different form of the same result.
You can also prove the math by looking at your simulation and perhaps plotting your math results, then comparing. Since you appear to be doing that but
you dont seem to get that the sine starts at zero in those previous equations, maybe you should look again.
 
Last edited:
sigh.. im really really sorry if im a pain in the ass.. i probably am..
just trying to understand this :(

and to clarify once again im not considering any input voltage in this.. input offset is zero..

can one of you try to get the same equation using the equation given in this link.. which is the time domain analysis i did first..
Op Amp Integrator (im sorry i dont have a scanner to upload my workings)

and in that analysis you get the offset when you evaluate the limits.. [t 0] because cos(0) = 1

i understand that math should be correct.. but then y is the time domain analysis different?
 
Hello again normad,


Ok, sorry about that, i didnt understand your question. Now that i do, i understand fully what you are talking about and i think we can finally resolve this discrepancy.

What happened was when ljcox did the original op amp analysis, he apparently did not get the polarity right. The output is negative with respect to the input so the equation has to be written with the inversion caused by the op amp in mind. This leads to a totally different equation really, so we would have to go back to the beginning and start over again.
I guess it is partly my fault too because i did not check his previous work first, but followed after that.

We have to start like this:
Vi/r=-Vo/R-dVo*C

and if you compare with previous results, you'll see that the Vo terms all have to be negative to account for the inversion by the op amp. The effect is that the input gets inverted, so we end up with this:

Vo=(w*cos(w*t)*C*R^2-sin(w*t)*R)/(r*w^2*C^2*R^2+r)+K*e^(-t/(R*C))

where
K=-(w*C*R^2)/(r*w^2*C^2*R^2+r)


and now if you compare that to the simulation you are doing you should find it to be EXACTLY the same.

Again im sorry about the misunderstanding, and im sure ljcox will want to go back over his work and see what had happened.

I'll leave it to you to solve for the above equation following the same guidelines as we did before, just starting out with the Vo terms negative.
If you cant get it for some reason just yell and we'll go over it again, no problem. I think it is interesting to do the phase shift and offset too but of course we dont have to.
 
Last edited:
Yes, My apologies.

I assumed the wrong direction for the currents I1 & I2 in my analysis.

Obviously, Vo has to be negative when Vi is positive so the voltage at the - input of the Op Amp is 0.

So I did a calculation using Excel and the attachement is the result.

It shows the first few cycles of the cos & exp terms.

My version of MrAl's maths is:-

Vo = (R/r) * {-sin(ωt) + ωτ[cos(ωt) - ε ^ -t/τ]}/[(ωτ)^2 + 1]

where τ = RC So it is the negative of the previous.

Again, the sin term can be ignored since ωτ is >> 1.

However, there is no offset.

The cos term is shifted downwards by the expontial.

Thus, at t = 0, Vo = 0 and the curve goes down from there since the exp term is still close to 1 (large time constant) thus the curve is approx cos - 1.
 

Attachments

  • cos-exp..gif
    cos-exp..gif
    9.6 KB · Views: 182
Last edited:
Hi there Len,

I guess we are all getting on the same page now...and i should have actually thanked you for starting the analysis in the first place, which got me interested in looking into this too.
 
Hi there Len,

I guess we are all getting on the same page now...and i should have actually thanked you for starting the analysis in the first place, which got me interested in looking into this too.

No problem & thanks to you for saving me from having to dust off my maths books to recall how to do the intrgration.

normad wanted to see the Laplace solution so I've attached it.

Contrary to my earlier post, it is not necessary to reverse the I1 & I2 currents. It is easiler to use Kirchoff's current law, ie. I1 + I2 + I3 = 0 and then the correct sign falls out.
 

Attachments

  • Laplace solution .gif
    Laplace solution .gif
    31.4 KB · Views: 176
  • Laplace solution .gif
    Laplace solution .gif
    38.3 KB · Views: 178
Hi Len,


Yes you can do it that way too, which is also good to know i believe.
I hope this all makes sense to the OP now :)
 
i see!! :) thanks a lot guys.. it makes much more sense now..! so the offset is due to the transient which eventually dies away.. sorry i took long to reply.. have been a bit busy.. really appreciate all your help.. thanks a bunch!! :)
 
i see!! :) thanks a lot guys.. it makes much more sense now..! so the offset is due to the transient which eventually dies away.. sorry i took long to reply.. have been a bit busy.. really appreciate all your help.. thanks a bunch!! :)

You're welcome.

The exponential part of the equation can be viewed as an offset, but the reason I prefer to not use offset in this case is because it has a particular meaning when referring to Op Amps.

If you look at an Op Amp spec, you'll see that the offset is specified.

My recollection is that the offset is the voltage (or current) necessary at the input to the Op Amp to make the output voltage zero (assuming dual supply voltages)

An ideal Op Amp has no offset, but in practice, it is impossible to make them without some offset.
 
Hi again,

Thanks for bringing that up Len, as i was a little confused too when he said 'offset'. I assumed he wanted an analysis that included the input offset at first, which BTW, isnt a bad idea anyway.

It's interesting how op amps have changed since i was working in the industry years ago...now we can find op amps with 1uv offset, 10uv max. I may actually have the chance to work with one of these very soon.

Another way of looking at the input offset is to imagine a small battery in series with one of the input terminals of a perfect op amp. The battery (many times around 0.005v) can be connected either with the plus side toward the op amp input or the minus side
toward the op amp, depending on what that particular physical package is producing. The spec sheet usually say plus or minus, so it's always a good idea to check the design with either polarity.
 
Last edited:
Thanks Al,
The small battery idea is a good way to look at it.

Yes, I was confused by his use of "offset" also.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top