sharpie7 / circuitjs1

Electronic Circuit Simulator in the Browser
GNU General Public License v2.0
2.29k stars 633 forks source link

741 broken #598

Closed infinity-computers-dot-net closed 2 years ago

infinity-computers-dot-net commented 3 years ago

image

....what is there to say?

pfalstad commented 3 years ago

I'm not seeing that. When I try it I get 960mV. When I switch the op-amp model to LM324 v1 I get that, is that what you're using? But LM324 v2 gives me 17.931mV. So now you see why there's a v2. Maybe I should hide the broken v1 model.

infinity-computers-dot-net commented 3 years ago

Well, this is interesting.

Now when I try it - on a fresh canvas - it only happens with the LM324.

But before, it happened on both types. Definitely. Without a shadow of a doubt. I specifically checked.

So most likely, there is a bug in the "changing of the model" code, rather than in the 741 code.

Btw, I don't see a v2 LM324.

pfalstad commented 3 years ago

Are you using lushprojects.com? Use http://www.falstad.com/circuit/ , lushprojects is a little behind.

pfalstad commented 3 years ago

I can't reproduce the "changing of the model" issue. Maybe you can get it to happen again? What were you doing just before that? If it happens again, see if it persists if you reset or if you export/import.

infinity-computers-dot-net commented 3 years ago

I was trying to design an op-amp-based current sensor (and finding it didn't work properly when I set the lower bound of the op-amp to 1.5v).

I shall try that other site and see how I get on. Thank you.

infinity-computers-dot-net commented 3 years ago

I have managed to (sort of) reproduce the problem on the other site.

Notice that the voltage on the negative exceeds the voltage on the positive, and yet the output is high.

pfalstad commented 3 years ago

Thanks! I tried using the 741 model I found on wikipedia and got the same result: https://tinyurl.com/yjqcnbju

I would not be surprised if this is how a real 741 behaves. The input voltage range is only supposed to be -Vs+2V to +Vs-2V.

The LM324 has problems too. I would just use the ideal op-amp.

nulldg commented 3 years ago

Maybe I should hide the broken v1 model.

I think this is a good idea.