You can also think about your problem like this:
- Let's say you want to have a maximum of 0.1V at the sense resistor at the full current.
For a sake of example, let's say that you are designing the constant current load for a maximum of 2.5A load.
- At the maximum current of 2.5A and 0.1V across the sense resistor, the sense resistor needs to be R = U / I = 0.1V / 2.5A = 0.04 ohms.
- At the maximum current the power dissipated in the resistor is P = U * I = 0.1V * 2.5A = 0.25W, so you should select a 1W or 3W resistor.
Let's say you will use the constant current load to the a 5V or 12V power supply or car battery.
- At 5V the MOSFET will need to dissipate (5V - 0.1V) * 2.5A = 12.25W.
- At 12V the MOSFET will need to dissipate (12V - 0.1V) * 2.5A = 29.75W.
In order to the MOSFET pass the 2.5A current it is quite safe to assume that the Vgs has to be something like 4V more that the source voltage. In this particular example, the op amp is required to be able to drive its output ie. the MOSFET gate voltage to be at least 4V + 0.1V = 4.1V in order the MOSFET to pass the 2.5A current. If the Vgs needs to be more that 4.5V at 2.5A it is quite probable that you need to choose another MOSFET. You need to check the MOSFET datasheet for actual numbers.
In order to make the MOSFET close completely in practical terms, the Vgs must be below the threshold voltage Vth. Let's assume the Vth is 2V for the MOSFET.
What we have now found out is as follows:
- The sense voltage across the sense resistor will be 0.1V at the maximum current.
- The sense voltage across the sense resistor will be 0.01V at 250mA.
- The sense voltage across the sense resistor will be 0.001V at 25mA.
- The op amp driving the MOSFET gate needs to be able to drive its output up to 4.1V when the maximum 2.5A current is required.
- The op amp driving the MSOFET gate needs to be able to drive its output below 2V in order to close the MOSFET completely.
From the following facts we can say that we need an op amp that needs to be able to operate on input signals very close to the negative rail, its input offset voltage needs to be less than 1mV, and provide output signals that are quite close to the positive rail, and the minimum output voltage needs to be 2V of the negative power supply rail or less when the op amp is operated from 5V power supply.
When you take a look at the datasheet of the NE5532 you may find out that some of the requirements are not satisfied**. So, you may want to check some other op amps that are targeted for a single supply operation, have low offset voltage and which have RRIO specification. You may also tweak the sense resistor value somewhat higher if the op amp's input voltage range cannot go close enough to the negative rail and you want to be able to adjust the current in milliampere range. If you want to have multiple ranges, you may want to consider something like this:
http://electronicdesign.com/displays/resistive-dummy-load-draws-constant-current-12-50-v Notice also how the op amp is compensated as it is driving a MOSFET gate.
To answer your original question: The probable cause is that the op amp cannot maintain the feedback loop so that the voltage across the sense resistor is constant. Either the op amp cannot drive the MOSFET gate high enough or the input of the op amp cannot measure the very small voltage close to the negative rail across the sense resistor. Or both.
** From the NE5532 datasheet one can see that at +/- 15V power supply the Common-mode input-voltage range is typically +/- 13V. That means that the input signal needs to be 2V less than the positive operating voltage and 2V more than the negative operating voltage. In the +5V single supply case this means that NE5532's input signals needs to be in range (0V + 2V) ... (5V - 2V) ie. between 2V ... 3V. In a similar fashion one can see from the datasheet that the Maximum peak-to-peak output-voltage swing is 26V which means that the output will swing 2V less the positive operating voltage and output will stay 2V above the negative operating voltage. In a 5V single supply case that the NE5532's output will be able to swing typically only in range 2V ... 3V.