MOSFET - OPAMP circuit

I was looking for a voltage controlled current source see here , and I stumbled upon this circuit with description here :

Now I am having difficulty figuring out how this works - I made a model of the circuit in SPICE and I am utterly confused.

When I measure the Gate voltage it shows up as 297 KV! - How on earth can it have that much gain. I do get the current through Load and sense resistor, as predicted. But when I use a general op amp model with reasonable supply voltages (5V and Gnd) to the opamp. I get output current in uA.

I am missing something here. What am I doing wrong?

I also found this with similar circuits.

I guess, what I am really asking is how things work when MOSFET is thrown in the op-amp feedback.

Edit:

I managed to get the expected output current with the new circuit -

• Try selecting an N-Channel MOSFET model for M1 in the LTSpice schematic. Feb 8, 2013 at 15:02
• M1 is a N Channel MOSFET already Feb 8, 2013 at 15:06
• what if you try building and measuring the circuit instead of simulation? :) Feb 8, 2013 at 15:30
• You get 297kV because you use an ideal opamp. If you use any practical opamp, the gate will saturate to (almost) positive supply voltage. Feb 8, 2013 at 15:49

There are a few things:

As Dave mentions, you are setting the current higher than the supply can provide, therefore the voltage at R1 will never reach 3.7V. So set the voltage lower or increase the set resistor.

A couple of other things about SPICE:

• You are using the basic ideal opamp model, so it will ignore supply voltage and drive as high as it can (e.g. 297kV if that's what is necessary for 3.7V at the inverting input. It could be infinite if it can't achieve 3.7V at any voltage, only limited by the FP range in SPICE) A better model is "Universal Opamp 2" (you can set various parameters such as gain, bandwidth, etc, with this one), or you can use one of the many LT opamps. These would do what would happen in real life, simply hit the supply rail.
• Right click on the MOSFET and select a real model from the list. Otherwise you are again using the basic model. This is what @Abdullah was referring to.

EDIT - here's an example circuit:

Simulation with the input swept from 0 to 5V:

• As per your recommendation and Dave's I changed the v1 to 15 V and used the "Universal opamp 2" with supplies of +/- 15V . The set and the load resistors are now 1 Ohms each. I tried control voltages of 2V and 5 V..in either case, a 2A current and a 5A current should make the drop across R1 (in LTSPICE) 2V and 5V respectively, which is less than 15/2 = 7.5V. And yet, the output saturates to 15V (rails) and I don't get the expected current. Feb 8, 2013 at 17:33
• Okay, hang on a minute, I'll post an example LTSpice circuit. Feb 8, 2013 at 17:34
• I got it to work (I think) , and edited my post. But I am not sure if it is a good idea to have 1 Ohm for both load and Rset. It seems like a lot of power is being wasted on Rset , which I will be using as a sense resistor. Feb 8, 2013 at 17:45
• I just checked without using a proper model for the MOSFET and it does not simulate correctly (it saturates) so that's probably your issue. If you want less power dissipated in the Rset resistor, reduce it and your set voltage as necessary (e.g. use 100mOhm and 0 - 500mV for 0 - 5A, or lower). Usually the sense resistor is a low as is reasonably possible, you certainly wouldn't want to use a 1Ohm resistor with 5A in real life. Feb 8, 2013 at 17:46
• By the way - if you hold Alt down and click on a component, you can plot it's power dissipation. Feb 8, 2013 at 17:52

The problem with your simulation is that you have limited the current through the load to 4.17A (5V / (1Ω + 0.2Ω)), but you're asking the current source to draw 18.5A (3.7V / 0.2Ω). Since it won't ever succeed at this, the simulator is driving the gate arbitrarily high in the attempt.

You simply need to pick self-consistent values for the components and sources in the simulation.

• thanks! I changed the V1 to 15, therefore limiting the current and changed the load resistor and R1 in LTSPICE to 1 Ohms each. So the current limit should be 15 V/2 = 7.5A . I am applying the control voltage of 2 V so the current drawn should be 2A (2V/1 Ohms) , which is less than 7.5A. The output is still blowing up. Feb 8, 2013 at 17:22

R1, R2, and C1 can be ignored for a first understanding of the circuit. They keep the op-amp stable by decreasing high-frequency gain, but with ideal components they would not be necessary.

The voltage at the inverting input is equal to the voltage drop over R3. Since the Q1 gate current is negligible, and R3 and the load are in series and thus must have equal currents, if we can control the voltage drop over R3, we control the current in the load.

If the current is too low, the voltage drop over R3 will be too low, and the inverting input will be less than the non-inverting input. The op-amp will raise its output voltage, increasing Q1's gate voltage, allowing more current to the load.

If the current is too high, the voltage drop over R3 will be too high, and the inverting input will be greater than the non-inverting input. The op-amp will decrease its output voltage, decreasing Q1's gate voltage, allowing less current to the load.

An om-amp with negative feedback attempts to make its inputs equal through the feedback path.

• Note to OP: To be clear, Phil is using the designators from the Protel circuit. In the LTSpice circuit, R1 can definitely not be ignored. It would be very helpful to keep the designators consistent between your drawings. Feb 8, 2013 at 17:01
• Thanks,yeah I realized that right away after I posted it. @Phil when you said "The voltage at the non-inverting input is equal to the voltage drop over R3." you meant inverting (-) input, right? because the non-inverting input (+) is the control voltage. Feb 8, 2013 at 17:04
• @EnderWiggins yes, that's probably what I meant to write, although since both inputs are equal as long as the op-amp is in its regular operating range, either statement is true. Feb 8, 2013 at 22:17