Author Topic: Opamp exercices - inconsistent calculation results (solved)  (Read 7931 times)

0 Members and 1 Guest are viewing this topic.

Offline gildasdTopic starter

  • Frequent Contributor
  • **
  • Posts: 935
  • Country: be
  • Engineering watch officer - Apprentice Officer
    • Sci-fi Meanderings
Opamp exercices - inconsistent calculation results (solved)
« on: January 01, 2016, 08:26:51 pm »
I am revisiting old exercises because I want to sum and multiply in one step for a project...
I don't see the point of breadboarding if I don't have an expected result.
Some of theses questions were discussed a year ago, https://www.eevblog.com/forum/beginners/beginner-opamp-questions/ but no real methods were given.
Datasheets don't treat this circuit.

Course method,
The prof did it with mental calculation, but he did give us the method, that yields a disticnt result...


When I run with a simulator, the answer is totally different from the previous 2:


« Last Edit: January 04, 2016, 12:04:04 am by gildasd »
I'm electronically illiterate
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 11891
  • Country: us
Re: Opamp exercices - inconsistent calculation results.
« Reply #1 on: January 01, 2016, 08:35:22 pm »
The output voltage is +5 V.
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 11891
  • Country: us
Re: Opamp exercices - inconsistent calculation results.
« Reply #2 on: January 01, 2016, 08:39:37 pm »
Explanation:

V3 is 1 V. Therefore Va is 1 V.

If Va is 1 V, then I(R1) = -5 mA. And I(R2) is 1 mA.

Therefore I(R3) is -4 mA.

Therefore (Va - Vo) / R3 = (1 - Vo) / 1k = -4 mA, so Vo = 1 - (-4) = 5 V.

(Note: all resistor voltage differences and current flows measured from left to right.)
« Last Edit: January 01, 2016, 08:44:00 pm by IanB »
 

Offline dom0

  • Super Contributor
  • ***
  • Posts: 1483
  • Country: 00
Re: Opamp exercices - inconsistent calculation results.
« Reply #3 on: January 01, 2016, 08:40:22 pm »
The sources in your simulation might be just all the wrong polarity, I can never tell with this strange battery symbol.

The error in your calculation is that you forgot that the sign of the current in R3 is opposite the current of R2 and R1 (just add the currents you calculated: -5 mA + 1 mA - 4 mA = -8 mA, that's not zero!). If you correct that mistake you have 4 mA * 1 k? = 4 V + 1 V = 5 V like the professor correctly said.

#(LT)1128
,
 

Offline mstevens

  • Regular Contributor
  • *
  • Posts: 131
Re: Opamp exercices - inconsistent calculation results.
« Reply #4 on: January 01, 2016, 08:42:34 pm »
Look at your sign convention in the simulation. Your inconsistency is there. This is probably the most common problem in circuit analysis. You have to pick a convention and stick with it. As long as your sign convention (polarity) is consistent you should always get the same and right answer.

Succinctly: Your 2V and 1V batteries are wired in the wrong direction in the sim.
« Last Edit: January 01, 2016, 08:51:03 pm by mstevens »
 

Offline gildasdTopic starter

  • Frequent Contributor
  • **
  • Posts: 935
  • Country: be
  • Engineering watch officer - Apprentice Officer
    • Sci-fi Meanderings
Re: Opamp exercices - inconsistent calculation results.
« Reply #5 on: January 01, 2016, 08:53:00 pm »
The sources in your simulation might be just all the wrong polarity, I can never tell with this strange battery symbol.

The error in your calculation is that you forgot that the sign of the current in R3 is opposite the current of R2 and R1 (just add the currents you calculated: -5 mA + 1 mA - 4 mA = -8 mA, that's not zero!). If you correct that mistake you have 4 mA * 1 k? = 4 V + 1 V = 5 V like the professor correctly said.

#(LT)1128
Ok, from your consistent results, it seems he wrote down the equation to obtain I of R3 wrong (signs). With that corrected it all fits in.
Additionally, it now corresponds to the course method about summing Opamps (but to ground).
« Last Edit: January 01, 2016, 09:04:03 pm by gildasd »
I'm electronically illiterate
 

Offline gildasdTopic starter

  • Frequent Contributor
  • **
  • Posts: 935
  • Country: be
  • Engineering watch officer - Apprentice Officer
    • Sci-fi Meanderings
Re: Opamp exercices - inconsistent calculation results.
« Reply #6 on: January 01, 2016, 09:03:03 pm »
The sources in your simulation might be just all the wrong polarity, I can never tell with this strange battery symbol.

The error in your calculation is that you forgot that the sign of the current in R3 is opposite the current of R2 and R1 (just add the currents you calculated: -5 mA + 1 mA - 4 mA = -8 mA, that's not zero!). If you correct that mistake you have 4 mA * 1 k? = 4 V + 1 V = 5 V like the professor correctly said.

#(LT)1128
Checked that, did a simulation with a voltmeter on each source to be sure. So the simulator MUST be wrong here... Interesting.
I'm electronically illiterate
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 11891
  • Country: us
Re: Opamp exercices - inconsistent calculation results.
« Reply #7 on: January 01, 2016, 09:07:15 pm »
Checked that, did a simulation with a voltmeter on each source to be sure. So the simulator MUST be wrong here... Interesting.

I doubt it. It is very unlikely for something like that to occur.
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 11891
  • Country: us
Re: Opamp exercices - inconsistent calculation results.
« Reply #8 on: January 01, 2016, 09:12:24 pm »
If you look at the last line of your working, you have i(R3) = -0.004 (correct).

But in the next line you write i(R3) = (Vo - Va) / R3. This is where your error lies. You should have written i(R3) = (Va - Vo) / R3 instead.

This is because the current of -0.004 is flowing from Va to Vo. If i(R1) and i(R2) are flowing into the Va node, then i(R3) must be flowing out of the Va node to balance the currents.

If you fix this, your answer will work out correctly.
 

Offline gildasdTopic starter

  • Frequent Contributor
  • **
  • Posts: 935
  • Country: be
  • Engineering watch officer - Apprentice Officer
    • Sci-fi Meanderings
Re: Opamp exercices - inconsistent calculation results.
« Reply #9 on: January 01, 2016, 09:19:29 pm »
If you look at the last line of your working, you have i(R3) = -0.004 (correct).

But in the next line you write i(R3) = (Vo - Va) / R3. This is where your error lies. You should have written i(R3) = (Va - Vo) / R3 instead.

This is because the current of -0.004 is flowing from Va to Vo. If i(R1) and i(R2) are flowing into the Va node, then i(R3) must be flowing out of the Va node to balance the currents.

If you fix this, your answer will work out correctly.
Thanks a bunch Ian.
It's the way it was written on the blackboard... And what you say is what's written in his course.
There are quite a few typos in the course, so I was ambivalent about what was right.
Nobody said anything in class because this professor can look at a radar dish 5 miles away and say "38.5V on the 3rd rail" and be spot on...
So everybody assumed all the formulas were right...
I'm electronically illiterate
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 11891
  • Country: us
Re: Opamp exercices - inconsistent calculation results.
« Reply #10 on: January 01, 2016, 09:29:12 pm »
Regarding your circuit simulation, take a look at how you have set up the batteries for the voltages.

Firstly, note that the wide, thin plate is the positive end, and the short, thick plate is the negative end.

Secondly, note that batteries have positive voltages. If you want a negative potential in your circuit you have to reverse the battery.

So, Vdc2 has the right orientation, but you should set its voltage to +4 V.

Vdc0 has the wrong orientation. You should switch it around so that the positive end faces R1. (And leave it at +2 V.)

Similarly with Vdc1.

If you do this, then what does the simulator say?
 

Offline gildasdTopic starter

  • Frequent Contributor
  • **
  • Posts: 935
  • Country: be
  • Engineering watch officer - Apprentice Officer
    • Sci-fi Meanderings
Re: Opamp exercices - inconsistent calculation results.
« Reply #11 on: January 01, 2016, 09:35:44 pm »
Checked that, did a simulation with a voltmeter on each source to be sure. So the simulator MUST be wrong here... Interesting.

I doubt it. It is very unlikely for something like that to occur.
It seems this is a know bug/faffing about symbols.
Here is the file: http://www.docircuits.com/my-circuit/36912/exam-mn2-2015
I'm electronically illiterate
 

Offline gildasdTopic starter

  • Frequent Contributor
  • **
  • Posts: 935
  • Country: be
  • Engineering watch officer - Apprentice Officer
    • Sci-fi Meanderings
Re: Opamp exercices - inconsistent calculation results.
« Reply #12 on: January 01, 2016, 09:42:09 pm »
Regarding your circuit simulation, take a look at how you have set up the batteries for the voltages.

Firstly, note that the wide, thin plate is the positive end, and the short, thick plate is the negative end.

Secondly, note that batteries have positive voltages. If you want a negative potential in your circuit you have to reverse the battery.

So, Vdc2 has the right orientation, but you should set its voltage to +4 V.

Vdc0 has the wrong orientation. You should switch it around so that the positive end faces R1. (And leave it at +2 V.)

Similarly with Vdc1.

If you do this, then what does the simulator say?
Tried that and got +3V on the output... The other power supplies seem to have the same issue... Or there is a parameter that I'm not seeing.
I've did a quick check of the user issues and it seems it's a problem others have.

But I bet it runs an FPGA with no problems.  ::)
« Last Edit: January 01, 2016, 09:47:46 pm by gildasd »
I'm electronically illiterate
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 11891
  • Country: us
Re: Opamp exercices - inconsistent calculation results.
« Reply #13 on: January 01, 2016, 09:54:52 pm »
I still have trouble believing it's a bug. I can't try it myself however because I can't access the simulator without registering first. There doesn't seem to be a demo or trial mode.
 

Offline gildasdTopic starter

  • Frequent Contributor
  • **
  • Posts: 935
  • Country: be
  • Engineering watch officer - Apprentice Officer
    • Sci-fi Meanderings
Re: Opamp exercices - inconsistent calculation results.
« Reply #14 on: January 01, 2016, 10:00:13 pm »
I still have trouble believing it's a bug. I can't try it myself however because I can't access the simulator without registering first. There doesn't seem to be a demo or trial mode.
There is a free mode, but you need an email to set it up.
http://www.docircuits.com/pricing
I'm electronically illiterate
 

Offline Nerull

  • Frequent Contributor
  • **
  • Posts: 694
Re: Opamp exercices - inconsistent calculation results.
« Reply #15 on: January 01, 2016, 10:08:40 pm »




Works fine here. Post exactly what you built that got 3V.
« Last Edit: January 01, 2016, 10:12:50 pm by Nerull »
 

Offline gildasdTopic starter

  • Frequent Contributor
  • **
  • Posts: 935
  • Country: be
  • Engineering watch officer - Apprentice Officer
    • Sci-fi Meanderings
Re: Opamp exercices - inconsistent calculation results.
« Reply #16 on: January 01, 2016, 10:31:18 pm »
Works fine here. Post exactly what you built that got 3V.
WOW! What is that program, that's one hell of a learning tool!

Annnnd I get the same result. Put the sources the wrong way around...
« Last Edit: January 01, 2016, 10:39:54 pm by gildasd »
I'm electronically illiterate
 

Offline Nerull

  • Frequent Contributor
  • **
  • Posts: 694
Re: Opamp exercices - inconsistent calculation results.
« Reply #17 on: January 01, 2016, 10:39:31 pm »
The top one is EveryCircuit

http://everycircuit.com/
 

Offline gildasdTopic starter

  • Frequent Contributor
  • **
  • Posts: 935
  • Country: be
  • Engineering watch officer - Apprentice Officer
    • Sci-fi Meanderings
Re: Opamp exercices - inconsistent calculation results.
« Reply #18 on: January 01, 2016, 10:40:50 pm »
The top one is EveryCircuit

http://everycircuit.com/
That's very good to visualize, thanks.
I'm electronically illiterate
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 11891
  • Country: us
Re: Opamp exercices - inconsistent calculation results.
« Reply #19 on: January 01, 2016, 11:14:23 pm »
Annnnd I get the same result. Put the sources the wrong way around...

That's what I told you in Reply #10...
 

Offline gildasdTopic starter

  • Frequent Contributor
  • **
  • Posts: 935
  • Country: be
  • Engineering watch officer - Apprentice Officer
    • Sci-fi Meanderings
Re: Opamp exercices - inconsistent calculation results.
« Reply #20 on: January 01, 2016, 11:22:50 pm »
Annnnd I get the same result. Put the sources the wrong way around...

That's what I told you in Reply #10...
I see that now... Sorry.
But I am truly thankful for the help and patience, Thank you again.
I'm electronically illiterate
 

Offline gildasdTopic starter

  • Frequent Contributor
  • **
  • Posts: 935
  • Country: be
  • Engineering watch officer - Apprentice Officer
    • Sci-fi Meanderings
Re: Opamp exercices - inconsistent calculation results.
« Reply #21 on: January 03, 2016, 03:01:32 pm »
In the same vein as before, we have this OpAmp based monostable Multivibrator.
It comes with two pages of equations, that don't explain what happens when you change the value of a capacitor or a resistor.
Has anybody seen this circuit before and has the setup equations?

In real life, i'd breadboard it and use variable resistors and a oscilloscope to debug it... Not allowed in exam.

Changed the drawing to make it more relevant.
If we were to trigger this, what would we need to get, for example, a 2 second "blip"?
« Last Edit: January 03, 2016, 03:59:56 pm by gildasd »
I'm electronically illiterate
 

Offline gildasdTopic starter

  • Frequent Contributor
  • **
  • Posts: 935
  • Country: be
  • Engineering watch officer - Apprentice Officer
    • Sci-fi Meanderings
Re: Opamp exercices - inconsistent calculation results.
« Reply #22 on: January 03, 2016, 10:14:22 pm »
Think I solved it... Sorry for the French, only the graph at the bottom is of "real" interest.
I'm electronically illiterate
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf