1
\$\begingroup\$

I'm trying to implement the following circuit in a project:

voltage controlled current source http://www.ecircuitcenter.com/Circuits/curr_src1/image002.gif

VCC coming in is 18v. The op-amp is supplied with 3.3v. There is a waveform voltage input from 0-2 v that can oscillate at up to 100hz, or not at all. I need to convert this into 0-2 mA, so I used 1K RSENSE. I obviously need constant current with a variable RL. I only know enough about electronics to be dangerous, but this seems like a fairly straightforward circuit, and I got it working on a simulator, so I tried prototyping it. When I hooked up my ammeter, it gave a range of 0.17-0.19 mA for an input of 0-2 v. I used an an LMC6482 and a 2N3904. When it didn't work, I switched the BJT with a MOSFET (2N7000G) and got the same result. I'm assuming that there are some parameters for the transistor that is causing the unexpected behavior. Am I on the right track?

Why is the circuit currently acting the way it is? What should I do to get working as described? Thanks

UPDATE:

I scoped all inputs and outputs and there were no oscillations. In fact, touching my scope to the anode of the load resistor gave me the perfect waveform I was looking for. I then touched it to the anode of my multimeter and the same signal was there, yet my multimeter oscillated between 0.15-0.19 mA... does this mean my multimeter is shot? It was connected in series right before the load resistance.

\$\endgroup\$
  • \$\begingroup\$ What supply rail(s) are you using for the op-amp (it's 15.5V operating max)? Do you have decoupling caps right at the supply to ground? Have you looked at the output of the op-amp on a scope to see if it's oscillating? In general this type of circuit works pretty well, so it's likely you have something hooked up incorrectly, or a layout/decoupling issue. \$\endgroup\$ – John D Jul 17 '14 at 15:03
  • \$\begingroup\$ op-amp is getting 3.3v from the regulator on my arduino. I did add a .1 uF decoupling cap from supply to ground on the op amp. My cap wasn't wide enough to attach it directly over the op amp, but it's still a short path to gnd. I've verified the oscillating voltage on the input of the op amp, even though it doesn't have to oscillate, so I'm using a constant signal for testing at the moment. \$\endgroup\$ – scubadude22 Jul 17 '14 at 15:11
  • \$\begingroup\$ OK- My point about oscillation was to check that the output of the op-amp isn't oscillating with a constant signal input. (I.e. check that it's not unstable due to layout.) Are you applying 2V constant voltage into the non-inverting terminal? When you do that what do you measure at the inverting terminal and the output of the amplifier? \$\endgroup\$ – John D Jul 17 '14 at 15:15
  • \$\begingroup\$ I will check that tonight, but last night I remember the output being like 1.6v for 1v at the non-inverting input. \$\endgroup\$ – scubadude22 Jul 17 '14 at 15:20
  • \$\begingroup\$ If that's the case the op-amp is not closing the loop, and something's unstable or wired incorrectly. Is your transistor backwards? Check the pinouts of everything. \$\endgroup\$ – John D Jul 17 '14 at 15:23
3
\$\begingroup\$

The opamp is rail-to-rail and it can run from 3.3 V, so that's OK.

One thing to check is that Rl is small enough. At 1 mA, the emitter of of Q1 will be at 1 V. That means the collector should be 1.5 V minimum, preferably 2 V, for good regulation. That leaves 16 V for the load. This can't be more than 16 kΩ, else there isn't enough available voltage to allow the 1 mA to flow.

I suspect the opamp is oscillating. Check the output of the opamp with a scope. If it is oscillating, the average current could be considerably off from the setpoint.

A little capacitance immediately between the opamp output and its negative input will provide "compensation". There are lots of ways of looking at this. One way is that this slows the opamp down so that the rest of the system looks instantaneous to the opamp, thereby not causing lag and instability.

C1 provides the immediate high frequency negative feedback to slow down the opamp. R2 provides a fixed and known impedance for it to work against. The 100 pF shown is probably more than needed, so is a good place to start to eliminate instability as the issue. Once everything is working, you can experiment with how small of a C1 you can get away with. I'd at least double it then in the final circuit since you can't test over the full range of operating and environmental conditions.

The same thing applies wither Q1 is a NPN transistor (as shown above) or a N channel FET.

\$\endgroup\$
  • \$\begingroup\$ That's nice, I might add a bit of resistance in the base lead. (~100 ohm) For the FET I'm not sure there is enough voltage head room (3.3V) to turn on the FET and eat the R1 voltage drop. I wonder why @scubadude22 doesn't power the opamp from the +18V? \$\endgroup\$ – George Herold Jul 17 '14 at 17:02
  • \$\begingroup\$ @George: There is no need for a resistor in series with the base. Feedback will keep the current to just what it needs to be, and there is no chance of damage with R1 there. I agree about powering the opamp from 18 V, except this particular amp can only take 15 V. If he uses a FET, then it nees to have low gate threshold voltage. Unless the extra accuracy is really required, I'd stick with a BJT since it will all work fine with 3.3 V opamp supply. \$\endgroup\$ – Olin Lathrop Jul 17 '14 at 17:12
  • \$\begingroup\$ I'll try this tonight. I would like accuracy within 1 uA. The FET I tried using has a gate threshold voltage of 0.8-3v. Is that low enough? If I wanted a minimum current of 100 uA, would that mean the gate threshold voltage needs to be 100mV? \$\endgroup\$ – scubadude22 Jul 17 '14 at 17:31
  • \$\begingroup\$ @scub: 1 uA out of 2 mA (1 part in 2000) is quite a serious constraint, and totally unrealistic with the parts you mention. Think about it. The resistor needs to be better than 0.05% (500 PPM), and the opamp have better than 1 mV input offset, which it doesn't. You also can't use a BJT due to the base current adding way too much error for your requirement. Get realistic or be prepared to buy some expensive and special parts, and probably put them into a temperature controlled box. \$\endgroup\$ – Olin Lathrop Jul 17 '14 at 17:33
  • \$\begingroup\$ Hi @OlinLathrop, I must have used this circuit, or some cousin, at least a dozen times. Mostly for driving a constant current through B-field coils. Now lots of times it works without the base resistor. But sometimes it doesn't and the circuit oscillates. The base resistor seems to fix it. (I'm not sure why... with a Darlington as the pass element I would say it always needs the base resistor.) These days I just put it in. My hand-wavy understanding is that the resistor gives the opamp a bit more voltage to chew on, besides just Vbe. \$\endgroup\$ – George Herold Jul 17 '14 at 19:22
0
\$\begingroup\$

This should 100% work fine the way you've drawn it, don't change a thing.

Do, however, check carefully the wiring on the op-amp and other parts. There is something wired wrong. Maybe V- (pin 4) is not connected to ground or V+ (pin 8) is not actually receiving the 3.3V. Or the non-inverting input is floating around.

I would expect different symptoms if something was damaged (output railed).

\$\endgroup\$
  • \$\begingroup\$ Hi Spehro, Could you say something about why you think this circuit won't oscillate? Is it the rather large 1 k sense resistor? Thanks \$\endgroup\$ – George Herold Jul 17 '14 at 19:31
  • \$\begingroup\$ @GeorgeHerold Yes, oscillation could be an issue if the Op-amp output was heavily loaded (especially capacitively), but with that circuit the ~100R output impedance of the op-amp is hardly a factor practically. I've used this configuration in lots of instrumentation designs and it is really stable with sensible ~MHz GBW op-amps (maybe if you used a 1GHz amplifier you could get it to sing). \$\endgroup\$ – Spehro Pefhany Jul 17 '14 at 19:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.