Your circuit is apparently working fine, you just don't realize it.
With the drain left floating, the MOSFET cannot pull any current, and therefor the integrator keeps providing a lower and lower gate drive, trying to draw current.
With the drain grounded and the reference at 0 volts, the integrator goes just low enough to start pulling a tiny amount of current and satisfies the loop.
What you now need to do is get a set of power resistors, such as 10 ohm / 25W, 20 ohm / 25 watt, etc. and use them as loads. From the voltage across your load resistors you can determine the current through them.
However, before you do that, you need desperately to provide a heatsink for your MOSFET. Its' peak power dissipation at a current of 2A will be nearly 30 watts, worst case (for very low load resistances).
You also need to make sure that your shunt resistor is of high enough power. If you're following the app note religiously and using a .2 ohm resistor, it needs to be a 1-watt or better unit, since at 2 amps it will dissipate (2 x 2 x .2) = .8 watts.
You would also do well to reconsider your power wiring. The contacts on a solderless breadboard may not handle 2 amps well.
Finally, you need to make damn sure you can't provide a reference voltage greater than 2 volts.
And finally finally, I suggest you do a good deal of testing with resistors, in order to convince yourself that the circuit really is working. I suspect that you may find it doesn't work nearly as well when you give it a highly inductive load like a coil. It may work, and it may not, since the effects of the inductance will tend to counteract the effects of the loop integrating capacitor, and the result may be instability.
Otherwise, congratulations.
Your basic concept is OK, but you need to think about some details. You are essentially using push-pull emitter followers to get a lot of current gain but otherwise not so great characteristics, then a opamp and closed loop feedback around the whole mess to fix the problems.
Again, that's not necessarily a bad concept for a assignment like this. However:
- You only need a gain of 100. There is no point making things more difficult by exceeding that by 10x. I'd go a bit above the minimum to make sure the specs are met, but otherwise going way beyond specs is a waste. Lots of gain has drawbacks too.
- Yes the feedback will fix a lot of sins of the basic emitter follower power amp. But, the opamp is a real-world device, so it won't correct for everything perfectly. Look for simple ways to make the basic power amp more linear. For example, note the instantaneous jump the opamp output voltage must make when transitioning between driving high and driving low. Think about how you might be able to lessen the two diode drop jump.
- Your output current capability is basically the opamp output current times the gain of the transistors. You need to look those up and then compare to the maximum your load requires.
If what you have can't supply enough current, then you need more current gain between the opamp and the output. Think about how you can use two transistors on each side to get more current gain, but not make the voltage gap at crossover even worse than it already is.
Best Answer
Don't bother using MOSFETs. Instead, use FET-based devices such as the CD4066.
Furthermore, if you only need 2 gain settings, you only need 1 switch. As an example
simulate this circuit – Schematic created using CircuitLab
will give a gain of 10 or 100. (Note that your example, if it worked, would give gains of 11 or 101). Also note that, whenever possible, put your switch elements to ground rather than floating, since that way the gate voltages will not vary with signal.