Author Topic: Need Op-Amp integrator math help  (Read 4834 times)

0 Members and 1 Guest are viewing this topic.

Offline skysurf76Topic starter

  • Regular Contributor
  • *
  • Posts: 65
Need Op-Amp integrator math help
« on: April 25, 2013, 12:56:08 am »
Been working on this for a couple hours and just keep going around in circles.

The problem: With an input square wave of 1kHz at 10v peak to peak (+-5) with no DC offset, find the peak to peak output voltage of the integrator.

I'm including a scan of my work with all the pertinent information.  The numbers just don't make sense no matter what I try.  The setup I did on the scan seems to make sense to me, but clearly the answer shouldn't be negative.  I don't know how to go about figuring out what the peak values will settle at.
 

Offline GK

  • Super Contributor
  • ***
  • Posts: 2607
  • Country: au
Re: Need Op-Amp integrator math help
« Reply #1 on: April 25, 2013, 01:08:16 am »
Vc = (Ic/c)t

Ic = Vin/Ri
Bzzzzt. No longer care, over this forum shit.........ZZzzzzzzzzzzzzzzz
 

Offline skysurf76Topic starter

  • Regular Contributor
  • *
  • Posts: 65
Re: Need Op-Amp integrator math help
« Reply #2 on: April 25, 2013, 01:13:18 am »
Vc = (Ic/c)t

Ic = Vin/Ri

Ok I think I see what you're saying.  I was focusing only on the integral at the top of my scan.  Thats what was given in the lab manual and I assumed it should be sufficient to solve the problem.  I'll try approaching it using what you suggested.
 

Offline Rufus

  • Super Contributor
  • ***
  • Posts: 2095
Re: Need Op-Amp integrator math help
« Reply #3 on: April 25, 2013, 01:52:22 am »
I think it will be helpful to remember

Q = CV = IT.

 

Offline skysurf76Topic starter

  • Regular Contributor
  • *
  • Posts: 65
Re: Need Op-Amp integrator math help
« Reply #4 on: April 25, 2013, 02:24:21 am »
I'm going to have to just skip this problem for the time being.  I simply cannot get my head around it.  I actually built the circuit in the problem and got the results I'm attaching.  I've tried thinking through it but it just doesn't make sense.  This is a major brain bender.

The following is the output of the op-amp integrator I assembled as in the scan in the first post of this thread.  16V plus and minus rails on the op-amp, 15k ohm input resistor, and a 560nf cap. 1kHz +-5V square wave with no DC offset at the input.  20 volts peak with a +16V rail on the op-amp?  Laws of physics are being broken here.
 :o



« Last Edit: April 25, 2013, 02:27:03 am by skysurf76 »
 

Offline GK

  • Super Contributor
  • ***
  • Posts: 2607
  • Country: au
Re: Need Op-Amp integrator math help
« Reply #5 on: April 25, 2013, 02:44:58 am »
I think you need to double check your grounding. Also, either select a much lower value cap or lower the input frequency. Another thing; don't expect a basic integrator circuit like this to practically generate a triangle wave from a square wave input. The rise and fall times will never be perfectly identical and the op-amp output will just trend to one of the supply rails, generally before you have a chance to blink. However you can input a low frequency square (or rectangular) waveform and observe the integrator alternately slew from saturation against one rail to the other.

 
     
Bzzzzt. No longer care, over this forum shit.........ZZzzzzzzzzzzzzzzz
 

Offline c4757p

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: Need Op-Amp integrator math help
« Reply #6 on: April 25, 2013, 02:50:18 am »
Is that the output with a square wave input? Looks like you've made a differentiator instead of an integrator. Have you swapped R and C?
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline skysurf76Topic starter

  • Regular Contributor
  • *
  • Posts: 65
Re: Need Op-Amp integrator math help
« Reply #7 on: April 25, 2013, 03:12:58 am »
Is that the output with a square wave input? Looks like you've made a differentiator instead of an integrator. Have you swapped R and C?

Yep, I went back and checked my circuit and I had a ground in an input.  |O

Attached is what I get now...

What I don't understand is why the average output settles up at 15.2V.  It also looks like my answer of .167V from the integral in my very first post is reasonable now, although the sign is still wrong.
 

Offline c4757p

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: Need Op-Amp integrator math help
« Reply #8 on: April 25, 2013, 03:18:49 am »
What I don't understand is why the average output settles up at 15.2V.

You have pretty much no control of this. The integral builds up over time without ever being reset, so any offset caused during circuit startup will be kept. Try adding a very high value resistor across the capacitor to roll off the frequency response a bit on the low end.
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline GK

  • Super Contributor
  • ***
  • Posts: 2607
  • Country: au
Re: Need Op-Amp integrator math help
« Reply #9 on: April 25, 2013, 03:19:14 am »
What I don't understand is why the average output settles up at 15.2V.  It also looks like my answer of .167V from the integral in my very first post is reasonable now, although the sign is still wrong.


I told you in my previous reply.
Bzzzzt. No longer care, over this forum shit.........ZZzzzzzzzzzzzzzzz
 

Offline Rufus

  • Super Contributor
  • ***
  • Posts: 2095
Re: Need Op-Amp integrator math help
« Reply #10 on: April 25, 2013, 03:22:28 am »
I'm going to have to just skip this problem for the time being.  I simply cannot get my head around it.

It is far from complicated but perhaps you don't understand the op-amp operation. The op-amp has -ve feedback through the capacitor and will do whatever it can to keep the voltage between + and - inputs essentially zero.

If the + input is 0v so will be the - input which makes the current in Ri Vi/Ri.  The op-amp input is high impedance so the current in Ri can only flow into C.

Q = CV = IT

You know the current, you know the time (half cycle of the input) you know the capacitance.

It isn't a real world circuit. Small offsets and bias currents will quickly send the op-amp output towards one rail or the other. If for example the op-amp has 1uA of bias current on the -ve input CV = IT still applies, and the op-amp output will ramp at 2v/s.
 

Offline skysurf76Topic starter

  • Regular Contributor
  • *
  • Posts: 65
Re: Need Op-Amp integrator math help
« Reply #11 on: April 25, 2013, 03:30:17 am »
What I don't understand is why the average output settles up at 15.2V.  It also looks like my answer of .167V from the integral in my very first post is reasonable now, although the sign is still wrong.


I told you in my previous reply.

I'm sorry GK, I see it now.  I read your post but missed the last sentence.  I've been going at it for about 10 hours and my eyes are starting to glaze over.  I apologize.

That actually makes perfect sense to me.  When you turn it on depending on the offset error of the op amp the strongest rail will push the output up to the limit of the rail because over time that rail is just putting more and more charge onto the capacitor.

So even though the input is going back and forth between +5 and -5 unless the op amp is perfectly balanced (which it won't be of course) the stronger rail will put just a little more charge into the cap than is drained when the input swings the other way and this error gradually builds till it hits that rail.

And THEN once it does hit the limit of that rail I should be able to use the integral in my first post to find peaks.

 

Offline skysurf76Topic starter

  • Regular Contributor
  • *
  • Posts: 65
Re: Need Op-Amp integrator math help
« Reply #12 on: April 25, 2013, 04:08:44 am »
Thank you so much Rufus, GK, and c4757p.  I really appreciate you guys taking time out of your day to help.  I apologize for seeming kind of hair brained when I post on these forums asking for help.  Usually I've been grinding out homework for hours by the time I post, and I make simple stupid mistakes and don't read things thoroughly.  I need to work on that.

Anyway, this is my second time asking for help on these forums, and as usual I'm not disappointed.  Ironically at the very end once I understood what was going on I finally realized the mistake I made in my original post.  If you look at my little graph I made at the top right of the scan you'll see I didn't draw the output as inverting the input.  Thats why the signs were wrong.  I worked out the full correct solution and I'm attaching it to this post.

The ironic thing is that in this thread I have learned that the theoretical outcome I got with math isn't even realistically possible.
 

Offline GK

  • Super Contributor
  • ***
  • Posts: 2607
  • Country: au
Re: Need Op-Amp integrator math help
« Reply #13 on: April 25, 2013, 05:12:21 am »
The ironic thing is that in this thread I have learned that the theoretical outcome I got with math isn't even realistically possible.



 ;D I still remember having the exact same problem years ago. My Prentice Hall text book, in a "system application" section in the "basic op-amp circuits" chapter, showed a simplified function generator schematic in which a triangle wave was produced simply by an integrator driven by a square wave generator. I built in on breadboard and just couldn't get it to work as the op-amp output just kept slamming against the negative rail. The same text book also showed complementary bipolar audio amplifier power output stages "ideally" biased by a diode for each Vbe, with no emitter degeneration. I assembled one of those too. BOOM!  ::) Two classic text book examples of presenting concepts with excessive simplification.

As for generating triangle wave by integrating a squarewave source, it can be done, but a negative feedback servo loop is required. See:

https://www.eevblog.com/forum/projects/home-brew-analog-computer-system/?action=dlattach;attach=35299

and

https://www.eevblog.com/forum/projects/home-brew-analog-computer-system/msg170229/#msg170229
« Last Edit: April 25, 2013, 08:39:52 am by GK »
Bzzzzt. No longer care, over this forum shit.........ZZzzzzzzzzzzzzzzz
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf