On Wednesday, April 20, 2011, Olin Lathrop wrot= e: > V G wrote: >> I made a constant current source (for battery drain testing, >> charging, pretty much any application). But there's so many >> variables that I don't know how to calculate for it. So many of the >> components influence the current through Q1 (power BJT) that I don't >> know how to select the values and which one to vary to get the >> widest current selection range. > > Yes, this is the problem of "solving" a circuit with a simulator instead = of > a brain. =A0Until you understand the circuit, all you can do is poke at i= t in > the hope of randomly stumbling accross something that works. > > In this case, the feedback is messed up. =A0Let the opamp drive the base = of > the darlington directly. =A0The current sense voltage from R2 then goes i= nto > the negative input, with the desired voltage on R2 fed into the positive > input. =A0If you can trust your V3 voltage source, then this can be a div= ider > from V3. =A0You may need a small cap (a few 10s of pF) from the opamp out= put > to the negative input to keep it stable, and a resistor between R2 and th= e > negative opamp input to give this cap something to work against. =A010K O= hms > should be fine. =A0You don't need fast response since the battery > characteristics will only change slowly. > > Also, you forgot the bypass cap accross the opamp power leads. Thanks. This makes sense to me. But I forgot that I want some way to control the current with the computer as well. In either case, the circuit will be monitored by a microcontroller which will report to the computer for logging, so I might as well just have the microcontroller control the base of the Darlington. --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .