LM317 and op-amp Constant Current Source

This is the place for any magazine-related discussions that don't fit in any of the column discussion boards below.
Dimbulb
Posts: 324
Joined: Sun Oct 13, 2002 1:01 am

LM317 and op-amp Constant Current Source

Post by Dimbulb »

Hello,<p>Most of you are familiar with using the LM317 as a constant current source like the data sheet application suggests.<p>I wondered if anyone has tryed to counter the temperature coefficient with some kind of compensation circuit ?<p>Or possibly you might be willing to share some tips about how to make the LM317 into a good Constant Current Source ?<p>I will try to share some CC notes with this discussion and as I try to clarify some aspects in my own recollection.<p>[ May 15, 2003: Message edited by: dimbulb ]</p>
analogee
Posts: 42
Joined: Sun Dec 22, 2002 1:01 am
Location: Aurora, OR
Contact:

Re: LM317 and op-amp Constant Current Source

Post by analogee »

You're thinking of the LM334? It's current is directly proportional to Kelvin temperature, but it can be compensated with a diode and an extra resistor. The circuit is in the datasheet.<p>see figure 3 in this LM334 datasheet<p>The LM317 is pretty insensitive to temperature. A curve in its datasheet indicates a typical temperature drift of about 20 mV over a 150 deg. C range, or about 1.6%. The typical number for "Temperature Stability" over the temperature range is listed as 1% in the Electrical Characteristics chart. As long as you don't try to do very small currents * (like in the low mA range, where the adjust pin current change might start to be significant), you should be happy with the LM317's stability unless you're designing a VERY precision circuit.<p>* Actually, I don't think you should try to use the LM317 for constant currents of less than 10 mA anyway. Need to pull a minimum of 10 mA out of it to make sure it works right.<p>Regards,
Todd
Wir m�ssen wissen.
Wir werden wissen.
Chris Foley
Posts: 146
Joined: Mon Jan 13, 2003 1:01 am
Location: Chicago IL
Contact:

Re: LM317 and op-amp Constant Current Source

Post by Chris Foley »

Use a low temperature coefficient power resistor with a power rating much higher than the job requirement for the current limiting/sensing. A typical power resistor has much more temperature drift than the LM317, especially if you run it hot. A second important mod is to use a big heat sink to limit the temperature rise of the IC. These two will get you just about as far as you can go with the LM317 current source for low drift.<p>I think what you're asking for is a special power resistor that has a temperature drift that heads in the opposite direction of the IC, thus cancelling out?
L. Daniel Rosa
Posts: 400
Joined: Tue Dec 25, 2001 1:01 am
Location: Bellingham, WA
Contact:

Re: LM317 and op-amp Constant Current Source

Post by L. Daniel Rosa »

If you need 50mA or less, there's and all discrete circuit (six parts) that may give acceptable results. PM your address to me if you want a couple PCBs for it.
Chris Foley
Posts: 146
Joined: Mon Jan 13, 2003 1:01 am
Location: Chicago IL
Contact:

Re: LM317 and op-amp Constant Current Source

Post by Chris Foley »

No need to struggle -- just decide ahead of time what kind of precision and drift characteristics you need ahead of time. I'm assuming you need something like 0.1% accuracy, with low drift. For almost all standard current source/sink circuits of that type, you're relying on the feedback provided from a current-sensing low-ohm resistor. Get a wirewound resistor, 1% or better tolerance (these are typically wound with lower temperature coefficient resistance wire). Make the resistor as many times the expected power dissipation as your wallet and space can tolerate. Deciding on the resistor is a tradeoff. Higher feedback voltage means more resistor heating, but higher voltage also swamps out circuit drift problems. If you use an op amp circuit, look in the specs for offset drift with temperature. Single supply op amps exist with very reasonable drift specs. Those are the two main causes for error in the current source/sink circuits that shoot for somewhere around 0.1% accuracy. Try looking at National Semiconductor appnote AN31, p. 13. It's easy to modify this circuit to take advantage of a single supply. Be sure to use a precision reference (such as the LM385BZ-1.2) with a trimmer pot to give you a low drift reference -- if you just use a voltage divider from the power supply, your circuit won't have better accuracy than your power. Also, use a better trimmer pot -- the cheapies have poor contact resistance, meaning that your reference input voltage can hop around for no reason.<p>The Best Op Amp Appnote For Beginners -- AN31.pdf<p>I've never seen a precision switcher current source that doesn't have a lot of noise. Anyone out there seen one? Happy hunting.<p>[ May 10, 2003: Message edited by: Chris Foley ]</p>
rshayes
Posts: 1286
Joined: Tue Mar 04, 2003 1:01 am
Contact:

Re: LM317 and op-amp Constant Current Source

Post by rshayes »

The current monitor circuit on page 26 is not a current source. The circuit samples the current flowing through R1, which is connected between a load and the supply voltage. The load current results in a small voltage signal which is referenced to the power supply voltage. This circuit amplifies that signal and changes its reference point to ground instead of the input voltage.<p>This is a trick circuit. The LM107 is one of the few op amps that I know of that can operate with the input leads at the power supply voltage. Most op amps require that the input leads be more negative than 2 or 3 volts below the positive supply. This is also true for the negative supply. A few op amps can operate with both input leads at the negative supply voltage. Most op amps require that the input voltage be at least 2 or 3 volts more positive than the negative supply lead.<p>This is a very old ap note. The September 2002 date is the date of the last revision. The original ap note was probably written in the early 1970's. I don't know if the LM107 is still being produced.
rshayes
Posts: 1286
Joined: Tue Mar 04, 2003 1:01 am
Contact:

Re: LM317 and op-amp Constant Current Source

Post by rshayes »

That is a very general question. The worst case is probably a bipolar ground referenced control signal controlling a load with one end grounded where high accuracy is required. This could easily require several op amps with a number of trim adjustments and precision resistors.<p>If the load can be raised off of ground, a sampling resistor, such as your .1 ohm resistor, can be placed in the ground lead. This would go to the inverting input of the op amp, with the control signal going to the non-inverting input. The load would be connected between the op amp output and the ungrounded end of the sampling resistor. If more current is needed, emitter followers can be added to the output of the op amp. This can be either unipolar or bipolar.<p>If the load is fed by an isolated power source, then the sampling resistor can be placed in the return lead to the power supply with the load grounded.<p>If the load can be floated on a positive power supply, the op amp can be used to control a transistor (or FET) with the load in the collector circuit and the sampling resistor between the emitter and ground. The voltage across the sampling resistor is forced to equal the control voltage by the op amp.<p>If the load has to be grounded, a current mirror can be used to reflect the constant current back to the load.<p>In extreme cases, an isolation amplifier can be used to read the voltage across the sampling resistor and transfer it to ground where it can be compared to a control signal. An isolation amplifier is a special form of amplifier where the input section is internally powered in such a way that it can be placed at any reasonable potential (within a kilovolt or two) with respect to the output section. Often power can be supplied at a third potential.<p>In even more extreme cases, the current can be sampled and its value transmitted over a fiber optic link to a control circuit. This could be done up to hundreds of kilovolts.<p>Some early street lighting systems used a string of arc lamps connected in series with a special moving core transformer used as a constant current source.<p>For low values of current, a current limiting diode can be used. These are field effect transistors with the gate connected to the source and selected for specific values of Idss. They need about 4 or 5 volts to get into the current limiting region but can withstand about 100 volts before breaking down.<p>Illuminated photodiodes operated with reverse bias can also be used as current sources.<p>Do you have a specific application in mind?
Chris Foley
Posts: 146
Joined: Mon Jan 13, 2003 1:01 am
Location: Chicago IL
Contact:

Re: LM317 and op-amp Constant Current Source

Post by Chris Foley »

Do you mean 100mA +/- 0.05mA? This might be doable with an LM358. (By the way, you might use the other end of the dual to drive an LED which indicates voltage getting too high for constant current).<p>Try working through the appnote example in AN31, using an LM358 and a single supply. Use a well-regulated single power supply of about 6 to 9 VDC (higher voltage = higher power dissipation = more heat = more drift). Have the op-amp output drive the base of a TO-220 NPN power transistor directly instead of using a FET. You need to feed the N.I. input of the op-amp a good solid reference voltage. Try the LM385BZ-1.2. Once you set up the reference voltage, cut it with a 10K pot to get a 1.0VDC reference. Then use a 10 ohm current sensing resistor from the emitter of the NPN to com to get 1V @ 100mA. Sense this with the inverting input. You will have some inaccuracy due to the base drive current (about 1mA, assuming a current gain of 100), but that should be pretty much constant (assuming you keep the temperature under control), and I'm assuming you're going to tweak the pot to get exactly 100mA anyway.<p>Look at a project like this as something with an ERROR BUDGET. Then look at your circuit, and realistically examine all the sources of error, trying to fit them into the budget. You're looking at .05% accuracy. Make sure you use a precision voltage reference. Use a 10 watt 1% power resistor if you have to get something off the shelf (the mil-type chassis-mount ones can keep the temp drift from the R down even more). Given these things, I think your main error sources are going to be the change in current gain with transistor temperature (minimize this by overdoing the heat sink) and the drift with temperature and time of the LM358. Make the IC socketed on the perfboard (use the higher-priced collet pin sockets if you can), and replace the LM358 if you find you're not too happy with the offset drift over time and temp. For best precision, mount the resistor and the transistor on a heat sink whose cooling fins are external to the box (back mount). Keep it cool and you will have less problems with thermal drift. Good luck.<p>[ May 13, 2003: Message edited by: Chris Foley ]</p>
rshayes
Posts: 1286
Joined: Tue Mar 04, 2003 1:01 am
Contact:

Re: LM317 and op-amp Constant Current Source

Post by rshayes »

It sounds like you are using a reference diode, which is essentially a zener and a junction diode selected for zero temperature coefficient. These usually operate around 6.2 volts and 7.5 milliamps plus or minus 50 microamps. Some were operated at lower currents, but the principle is the same.<p>These diodes were often used in a bridge circuit which balanced when the diode current was at the correct value. No external reference was required. Usually only one op amp was needed, but it had to be a precision one. Each circuit also had to be tweaked to match the individual reference diode, since there was some variation in the voltage.<p>Have you looked at the voltage references available commercially, such as the AD586 and AD587 from Analog Devices (www.analog.com). These appear to have about the stability you need and they are already laser trimmed to fairly tight tolerances.
Chris Foley
Posts: 146
Joined: Mon Jan 13, 2003 1:01 am
Location: Chicago IL
Contact:

Re: LM317 and op-amp Constant Current Source

Post by Chris Foley »

The LM385BZ-1.2 is a 1.2V bandgap reference IC in a TO-92 package. It's common, fairly inexpensive, easy to use, and behaves well if you treat it right.<p>National Semiconductor LM185.pdf<p>[ May 13, 2003: Message edited by: Chris Foley ]</p>
Ron H
Posts: 360
Joined: Tue Dec 18, 2001 1:01 am
Location: Boise, ID
Contact:

Re: LM317 and op-amp Constant Current Source

Post by Ron H »

Chris, why did you recommend eliminating the FET? The FET eliminates the base current error which occurs if you use the bipolar transistor alone. In fact, a MOSFET can replace the bipolar transistor and JFET combination.
Dimbulb
Posts: 324
Joined: Sun Oct 13, 2002 1:01 am

Re: LM317 and op-amp Constant Current Source

Post by Dimbulb »

The National Semi precision current source I found is located on page 12 of 17 page pdf.
This is what I thought Chris was refering to.<p>It is 1970 uses LM101,2N3069 FET and 2N2219.
What I read was that the LM101 provides a large loop gain that assures that the circuit acts as a current source.<p>http://www.national.com/an/AN/AN-32.pdf
Chris Foley
Posts: 146
Joined: Mon Jan 13, 2003 1:01 am
Location: Chicago IL
Contact:

Re: LM317 and op-amp Constant Current Source

Post by Chris Foley »

I've created a little confusion here by not being very specific in referring to the circuit. The "high compliance current sink" is shown in the National LM358 appnote, page 15, upper left hand corner.<p>http://cache.national.com/ds/LM/LM158.pdf<p>The LM385 is covered in this data sheet:<p>http://cache.national.com/ds/LM/LM185-1.2.pdf<p>Assuming the base current is 1% of the total current going through the 10 ohm Re, I believe that all you have to do is to keep the base current stable to within less than 2 or 3%, which you would probably be able to do if you keep the transistor cool. You would calibrate the device after it had been running for about 10 minutes, and that value should be a pretty stable reference -- at least, the drift would probably be acceptably within the error budget. Or, if you've got a volt or two to play with (remember, we did say 6 to 9 volts here), you might want to use a TO-220 NPN power darlington such as the TIP102. That will make the base current negligible, and the circuit should still be stable for that current range.<p>The downside of adding a FET or MOSFET would be the probable decrease in reliability, that's all. FETs have a tendency to smoke when let out into the "real world", due to static and such. Having a current source usually means you have two banana jacks exposed to the outside world, taking on all comers. I think I'd feel more comfortable about the FET if I knew it would be shielded from ESD.<p>By the way, 1206DX did ask for a current source. The circuit specified is a current sink. Depending on the application, that might not be a problem at all -- you just use a floating or independent power supply, and the red banana jack sources, the black sinks, and it's good to go. If that's not good, you might want to look at something else.<p>[ May 13, 2003: Message edited by: Chris Foley ]</p>
Dimbulb
Posts: 324
Joined: Sun Oct 13, 2002 1:01 am

Re: LM317 and op-amp Constant Current Source

Post by Dimbulb »

[Please correct me or additional info so that this summary is accurate.]<p>Summary:<p>The LM317 in a current mode will not work in series as a pre-regulator<p>The LM358 op-amp uses Rsense loop with an NPN BJT or mostfet on the output the load being part of a loop.
R1 or Rsense a small ohm high watt could be made from a few inches of heavy nichrome wire.<p>From what I gather about the FET conversation; the fets are more ESD prone and could cause difficulties and irregularities in the finite 20 uA adjustment and developing ESD requiring more critical copper layout so most hobbiest would have better success by simply using a few low cost metal BJT (tip102 and tip 31 cascaded or tip 112 darlington were mentioned these might counter some TC errors) whereas FETs of this type are harder to find and expensive. Power mosfets however are easy to find and was suggested that they could improveme warmup time. Larger BJT transistors for higher amperage such as 100mA while smaller NPN such as 2N2222A, 2N3553 cascaded may suffice as a smaller current source.<p>[ May 15, 2003: Message edited by: 1206DX ]</p>
Chris Foley
Posts: 146
Joined: Mon Jan 13, 2003 1:01 am
Location: Chicago IL
Contact:

Re: LM317 and op-amp Constant Current Source

Post by Chris Foley »

Almost. You want to use a 10 ohm resistor (10 ohms * 100 mA = 1.0 VDC). That will make it so both inputs of the LM358 are out of the grass (a 1.0 mV input signal is below what the LM358 can handle, and also is dwarfed by the offset). Apart from that, I think you're there. How about just putting something together, and see what happens? The water's fine, and the most expensive component is the reference, which won't self-destruct if you use a series resistor and series diode, no matter what happens. Happy hunting.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 67 guests