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

0 Members and 1 Guest are viewing this topic.

Offline Drake122Topic starter

  • Contributor
  • Posts: 17
  • Country: hu
Yet another circuit I need your help with!
« on: March 07, 2018, 09:44:45 pm »
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: 5869
  • Country: de
Re: Yet another circuit I need your help with!
« Reply #1 on: March 07, 2018, 10:01:41 pm »
Seems your simulation SW is crap.
At just a glance, the circuit should work fine.
 

Offline Drake122Topic starter

  • Contributor
  • Posts: 17
  • Country: hu
Re: Yet another circuit I need your help with!
« Reply #2 on: March 07, 2018, 10:17:15 pm »
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?
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9889
  • Country: us
Re: Yet another circuit I need your help with!
« Reply #3 on: March 07, 2018, 10:46:13 pm »
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 07, 2018, 11:08:29 pm by rstofer »
 

Offline Wimberleytech

  • Super Contributor
  • ***
  • Posts: 1133
  • Country: us
Re: Yet another circuit I need your help with!
« Reply #4 on: March 07, 2018, 10:51:46 pm »
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

  • Super Contributor
  • ***
  • Posts: 1133
  • Country: us
Re: Yet another circuit I need your help with!
« Reply #5 on: March 07, 2018, 10:55:28 pm »
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: 1507
  • Country: ca
Re: Yet another circuit I need your help with!
« Reply #6 on: March 07, 2018, 11:29:04 pm »
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: 694
Re: Yet another circuit I need your help with!
« Reply #7 on: March 08, 2018, 12: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: 1507
  • Country: ca
Re: Yet another circuit I need your help with!
« Reply #8 on: March 08, 2018, 12: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: 694
Re: Yet another circuit I need your help with!
« Reply #9 on: March 08, 2018, 12: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, 01:09:39 am by Nerull »
 
The following users thanked this post: Inverted18650

Offline Inverted18650

  • Frequent Contributor
  • **
  • Posts: 875
  • Country: us
    • Test Gear Addicts
Re: Yet another circuit I need your help with!
« Reply #10 on: March 08, 2018, 01:12:48 am »
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.

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19491
  • Country: gb
  • 0999
Re: Yet another circuit I need your help with!
« Reply #11 on: March 08, 2018, 07:15:38 pm »
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 Drake122Topic starter

  • Contributor
  • Posts: 17
  • Country: hu
Re: Yet another circuit I need your help with!
« Reply #12 on: March 08, 2018, 09:01:14 pm »
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

  • Super Contributor
  • ***
  • Posts: 1133
  • Country: us
Re: Yet another circuit I need your help with!
« Reply #13 on: March 08, 2018, 09:36:11 pm »
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

« Last Edit: March 08, 2018, 09:51:44 pm by Wimberleytech »
 

Offline Nerull

  • Frequent Contributor
  • **
  • Posts: 694
Re: Yet another circuit I need your help with!
« Reply #14 on: March 08, 2018, 10:00:37 pm »
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: 875
  • Country: us
    • Test Gear Addicts
Re: Yet another circuit I need your help with!
« Reply #15 on: March 08, 2018, 11:09:13 pm »
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 08, 2018, 11:14:28 pm by Inverted18650 »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf