Author Topic: Yet another circuit I need your help with!  (Read 637 times)

0 Members and 1 Guest are viewing this topic.

Offline Drake122

  • Contributor
  • Posts: 17
  • Country: hu
Yet another circuit I need your help with!
« on: March 08, 2018, 08:44:45 am »
Hey guys!

I found this current sensing circuit as part of GreatScott's DIY overcurrent protection project. It amplifies the voltage drop across a small resistance. I tried to simulate it in EveryCircuit, but I still don't get what happens. The voltage on the inverting and non-inverting output stay 11.4 volts even if I change that 1k load resistance to almost 0 to send a high current. The circuit does indeed the works, on the output I get mA instead of uA. So my question is, what gets amplified, I don't see any increase on the non-inverting side, but maybe its just the software's limitation and it does increase the voltage by a really small ammount and that gets amplified.
 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 1441
  • Country: de
Re: Yet another circuit I need your help with!
« Reply #1 on: March 08, 2018, 09:01:41 am »
Seems your simulation SW is crap.
At just a glance, the circuit should work fine.
 

Offline Drake122

  • Contributor
  • Posts: 17
  • Country: hu
Re: Yet another circuit I need your help with!
« Reply #2 on: March 08, 2018, 09:17:15 am »
Its called EveryCircuit. And it does work. But since I can't see it on the sim, what is happening? Am I right in assuming that the voltage drop on the sense resistor is added to the non-inverting input?
 

Online rstofer

  • Super Contributor
  • ***
  • Posts: 4700
  • Country: us
Re: Yet another circuit I need your help with!
« Reply #3 on: March 08, 2018, 09:46:13 am »
If you short out the 10 mOhm resistor, it is as though there is no current flow.  What does your simulation give for this condition?  With the 10 mOhm in the circuit, it is as though you are getting maximum current flow.  Then what does the output look like.  In the simulation, measure every node voltage under both conditions.

Otherwise, it's back to Kirchhoff's Current Law and some node equations.
« Last Edit: March 08, 2018, 10:08:29 am by rstofer »
 

Offline Wimberleytech

  • Frequent Contributor
  • **
  • Posts: 356
  • Country: us
Re: Yet another circuit I need your help with!
« Reply #4 on: March 08, 2018, 09:51:46 am »
Quote
author=Drake122 link=topic=105523.msg1446515#msg1446515 date=1520459085]

I found this current sensing circuit as part of GreatScott's DIY overcurrent protection project. It amplifies the voltage drop across a small resistance. I tried to simulate it in EveryCircuit, but I still don't get what happens. The voltage on the inverting and non-inverting output stay 11.4 volts even if I change that 1k load resistance to almost 0 to send a high current. The circuit does indeed the works, on the output I get mA instead of uA. So my question is, what gets amplified, I don't see any increase on the non-inverting side, but maybe its just the software's limitation and it does increase the voltage by a really small ammount and that gets amplified.

The amplifier amplifies the voltage across the 10m ohm resistor.  The voltage on the inverting and nin-inverting input SHOULD stay at about 11.4 volts.
V = 12*20k/21k
The opamp gain forces the inverting input to equal the non-inverting input.

 

Offline Wimberleytech

  • Frequent Contributor
  • **
  • Posts: 356
  • Country: us
Re: Yet another circuit I need your help with!
« Reply #5 on: March 08, 2018, 09:55:28 am »
Its called EveryCircuit. And it does work. But since I can't see it on the sim, what is happening? Am I right in assuming that the voltage drop on the sense resistor is added to the non-inverting input?

It would be cool if we all used LTSPice.  If you told me to do this a year ago, I would have rebelled, but I am now in love with LTSPice and rarely use my other simulator--even though it is a great SPICE and offers easier manipulation of models and such.

I have simulated your circuit with LTSPice and achieved predictable results!
 

Offline Audioguru

  • Super Contributor
  • ***
  • Posts: 1268
  • Country: ca
Re: Yet another circuit I need your help with!
« Reply #6 on: March 08, 2018, 10:29:04 am »
Your negative image is a nuisance to modify.
The opamp is not powered (it needs a plus and minus supply).
The opamp has a low gain of only 21 times.
Look here:
 

Offline Nerull

  • Frequent Contributor
  • **
  • Posts: 508
Re: Yet another circuit I need your help with!
« Reply #7 on: March 08, 2018, 11:28:59 am »
The opamp does not need a separate power source in the simulation, it has its own built in.

OP is trying to replicate this circuit, since he didn't bother posting it: https://cdn.instructables.com/FWD/SW5D/J5MQQ58B/FWDSW5DJ5MQQ58B.LARGE.jpg
 

Offline Audioguru

  • Super Contributor
  • ***
  • Posts: 1268
  • Country: ca
Re: Yet another circuit I need your help with!
« Reply #8 on: March 08, 2018, 11:38:26 am »
I see that the original circuit has the opamp as a differential amplifier.

The Instructable (some are written by kids who are only 10 years old) is wrong because it has an LM358 with one of its inputs above its Common Mode Voltage Range.
That is why every schematic should show its supply voltage.
 

Offline Nerull

  • Frequent Contributor
  • **
  • Posts: 508
Re: Yet another circuit I need your help with!
« Reply #9 on: March 08, 2018, 11:48:20 am »
The circuit produces the exact same results in LTSpice and EveryCircuit, the simulation is not the issue except that EveryCircuit displays few significant digits in its values. The circuit amplifies the voltage difference across the 10mOhm shunt, and that voltage difference is quite small - smaller than EveryCircuit can display. It is calculating the proper voltage difference, it just isn't showing it to you. Insert the voltmeter component to show small voltages.

Also realize that the inputs of a opamp, properly connected as an amplifier, will be essentially equal. Notice that there is a resistor connecting the output and the negative input, so that the voltage at that input is not only due to the voltage drop across the shunt resistor, but also due to the output of the opamp itself. That is the feedback circuit which sets the gain of the amplifier. The opamp will attempt to adjust its output until there is no difference between the output terminals. The larger the voltage drop across the shunt, the more voltage the opamp will need to output to keep its terminals equal.

In this particular circuit, the terminals will have equal voltage if the opamp outputs 20 times the shunt voltage, whatever that may be. So, within the limits of its specs and power supply, the opamp always multiplies the shunt voltage drop by 20.

« Last Edit: March 08, 2018, 12:09:39 pm by Nerull »
 
The following users thanked this post: Inverted18650

Offline Inverted18650

  • Frequent Contributor
  • **
  • Posts: 292
  • Country: us
Re: Yet another circuit I need your help with!
« Reply #10 on: March 08, 2018, 12:12:48 pm »
Drake, I also have EveryCircuit on my iPhone so I can help you with the simulation if needed. You can also change the default opamp settings. The default is 100kV/V and you can tailor it for your selected part number.
 

Online Hero999

  • Super Contributor
  • ***
  • Posts: 10853
  • Country: gb
Re: Yet another circuit I need your help with!
« Reply #11 on: March 09, 2018, 06:15:38 am »
Hey guys!

I found this current sensing circuit as part of GreatScott's DIY overcurrent protection project. It amplifies the voltage drop across a small resistance. I tried to simulate it in EveryCircuit, but I still don't get what happens. The voltage on the inverting and non-inverting output stay 11.4 volts even if I change that 1k load resistance to almost 0 to send a high current. The circuit does indeed the works, on the output I get mA instead of uA. So my question is, what gets amplified, I don't see any increase on the non-inverting side, but maybe its just the software's limitation and it does increase the voltage by a really small ammount and that gets amplified.
Your circuit is working as expected.

As mentioned above, both of the op-amp's inputs will be at the same voltage, due to negative feedback.If you subtracted the -input from the +input, then you'll find it's a very low voltage, dependant on the open loop gain of the op-amp. For example, if the output voltage is 0.2V and the op-amp has an open loop gain of 500 000, there will be only 0.4┬ÁV between the +input and -input, which will be too small to measure with an ordinary multimeter.

Another interesting circuit to build is the inverting amplifier. If you measure V2, you'll find it's very close to zero. Obviously, you'll need to power this circuit from a bipolar power supply, e.g. +12V, 0V and -12V.

https://www.electronics-tutorials.ws/opamp/opamp_2.html
 

Offline Drake122

  • Contributor
  • Posts: 17
  • Country: hu
Re: Yet another circuit I need your help with!
« Reply #12 on: March 09, 2018, 08:01:14 am »
Yet an other question came up, targeted @Inverted18650, you said you use EveryCircuit as well, but you guys can chip in as well.
So, I guess I don't know how MOSFETs work, cause I don't get why this simple circuit doesn't work as I expected. Applied +5V to the gate, why isn't it fully opened? Also, what are those values? the width, length, kp, vto, lambda, none of them are on any datasheet for mosfets. 
 

Offline Wimberleytech

  • Frequent Contributor
  • **
  • Posts: 356
  • Country: us
Re: Yet another circuit I need your help with!
« Reply #13 on: March 09, 2018, 08:36:11 am »
Yet an other question came up, targeted @Inverted18650, you said you use EveryCircuit as well, but you guys can chip in as well.
So, I guess I don't know how MOSFETs work, cause I don't get why this simple circuit doesn't work as I expected. Applied +5V to the gate, why isn't it fully opened? Also, what are those values? the width, length, kp, vto, lambda, none of them are on any datasheet for mosfets.

It appears to be working properly as an enhancement mode N-channel MOSFET.  You have turned it on by driving the G-S voltage to 5 volts.

The simple model for an NCH MOSFET operating in saturation is as follows:

Ids = (kp/2)(W/L)(Vgs - Vto)2 (1 + lambda*Vds)

Vto is the threshold voltage and will be given in a datasheet.
Channel width and length will not be given in a datasheet, nor will the channel-length-modulation parameter, lambda

https://i.imgur.com/zs647qq.png
« Last Edit: March 09, 2018, 08:51:44 am by Wimberleytech »
 

Offline Nerull

  • Frequent Contributor
  • **
  • Posts: 508
Re: Yet another circuit I need your help with!
« Reply #14 on: March 09, 2018, 09:00:37 am »
Those are parameters you'd have to calculate or measure directly. The generic spice model of a mosfet isn't all that useful, typically manufacturers will provide full spice models of each specific mosfet which are much more accurate but to use those you'd need to dump EveryCircuit and move to something else. The default parameters are very much not suited to a power mosfet with low RDS.

http://everycircuit.com/circuit/5927322113015808/

Cranking your channel width up is one way to get it to act more like a switch, but if you really want to play with mosfets it might be time to learn LTSpice.
 
The following users thanked this post: Inverted18650

Offline Inverted18650

  • Frequent Contributor
  • **
  • Posts: 292
  • Country: us
Re: Yet another circuit I need your help with!
« Reply #15 on: March 09, 2018, 10:09:13 am »
Those are parameters you'd have to calculate or measure directly. The generic spice model of a mosfet isn't all that useful, typically manufacturers will provide full spice models of each specific mosfet which are much more accurate but to use those you'd need to dump EveryCircuit and move to something else. The default parameters are very much not suited to a power mosfet with low RDS.

http://everycircuit.com/circuit/5927322113015808/

Cranking your channel width up is one way to get it to act more like a switch, but if you really want to play with mosfets it might be time to learn LTSpice.

Nailed it. I do not have the required physics level knowledge of the fets to fully understand how to adjust all the settings in EC. I only change the width, as stated above, to make it switch on and off with a measured on resistance.
« Last Edit: March 09, 2018, 10:14:28 am by Inverted18650 »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf