Author Topic: LM317 constant current mode. Potentiometer?!?  (Read 13133 times)

0 Members and 1 Guest are viewing this topic.

Offline Chaos_KlausTopic starter

  • Contributor
  • Posts: 48
  • Country: de
LM317 constant current mode. Potentiometer?!?
« on: October 16, 2015, 12:43:30 am »
Dear EEVblog forum,

I'm building a simple lab power supply that should work up to 15V 1A. I was going to use the vererable LM317 to regulate the current limit. Looking at the datasheet, I would need a 0.8Ohm resistor at the output to get 1A.

So far so good. But how do I go about adjusting that? I've found wirewound potentiometers that go as low as 4.7Ohm, but that's obviously not low enough and they are really expensive.

If I used a 0.8Ohm resistor with a pot in parallel, that would make for a non linear adjustment characteristic. How do I do it?

Thanks!
« Last Edit: October 16, 2015, 12:45:13 am by Chaos_Klaus »
 

Offline Cliff Matthews

  • Supporter
  • ****
  • Posts: 1910
  • Country: ca
    • General Repair and Support
Re: LM317 constant current mode. Potentiometer?!?
« Reply #1 on: October 16, 2015, 01:06:35 am »
Wire-wound pots that have wipers rated to pass 1 amp can get costly. Another venerable is the LM723 (25 cents) with an equally venerable 2N3055 (95-cents) pass transistor (you can never get enough amps!). This combo will prove hard to destroy at 1 amp. Above all have fun.
 

Offline Chaos_KlausTopic starter

  • Contributor
  • Posts: 48
  • Country: de
Re: LM317 constant current mode. Potentiometer?!?
« Reply #2 on: October 16, 2015, 02:10:12 am »
Hm. I am stupid.

Obviously, I is inversely proportional to R ... duhhh. ;)

So I could use a 1.25 Ohm resistor in series with a 100 Ohm wire-wound pot. But that still will make for a non linear characteristic ... and I'd have to spend 30 bucks on a potentometer. ;)

Looking into the LM723 option right now.
« Last Edit: October 16, 2015, 02:18:31 am by Chaos_Klaus »
 

Offline unitedatoms

  • Frequent Contributor
  • **
  • !
  • Posts: 324
  • Country: us
Re: LM317 constant current mode. Potentiometer?!?
« Reply #3 on: October 16, 2015, 02:19:42 am »
With LM317 at 1A you can use low power pot in parallel to high power current sense resistor.
Interested in all design related projects no matter how simple, or complicated, slow going or fast, failures or successes
 

Offline Chaos_KlausTopic starter

  • Contributor
  • Posts: 48
  • Country: de
Re: LM317 constant current mode. Potentiometer?!?
« Reply #4 on: October 16, 2015, 09:43:02 am »
Hey unitedatoms,

that is exactly the kind of solution that I was looking for. Thank you!

Cheers!
 

Offline unitedatoms

  • Frequent Contributor
  • **
  • !
  • Posts: 324
  • Country: us
Re: LM317 constant current mode. Potentiometer?!?
« Reply #5 on: October 16, 2015, 03:09:42 pm »
Hey unitedatoms,

that is exactly the kind of solution that I was looking for. Thank you!

Cheers!

No problem. I just googled quickly, because I knew that I adj is very low, and found instructables.com image. Can not find the relevant instructables article to give a credit to the author. So its just my googling skills.
Interested in all design related projects no matter how simple, or complicated, slow going or fast, failures or successes
 

Offline Gyro

  • Super Contributor
  • ***
  • Posts: 9410
  • Country: gb
Re: LM317 constant current mode. Potentiometer?!?
« Reply #6 on: October 16, 2015, 06:54:07 pm »
Sorry to throw a small spanner in the works but I think there's a problem with the circuit and value of the shunt resistor...

The internal reference voltage of the LM317 is 1.25V. This voltage needs to be dropped across the shunt resistor before the LM317 starts limiting. The shown value of 0R5 means that it won't current limit until about 2.5A (1R2 would give approx 1A). The other problem is that the 500R pot is tapping off a proportion of the voltage across the shunt resistor so as it is moved towards the 1k resistor it taps off a smaller proportion of the shunt voltage so that it increases, not decreases, the current limit value. The current limit can never be less than whatever gives 1.25V drop across the shunt resistor.

To get this circuit to work the shunt resistor needs to be sized to drop 1.25V at the _lowest_ required current, which will cause a large voltage drop at higher currents (when the pot is adjusted).

Two possible solutions I can think of:

1. Use an op-amp to sense the voltage across the shunt resistor and use it to drive the adj pin on the LM317, varying the gain in the op-amp circuit.

2 (Easier). Use shunt resistor which gives the lowest required current and use a rotary switch to connect other fixed resistors in parallel with it to increase the current. Cheaper than a low value rheostat but you have to accept that the current is adjusted in steps.
« Last Edit: October 16, 2015, 07:21:16 pm by Gyro »
Best Regards, Chris
 

Offline DimitriP

  • Super Contributor
  • ***
  • Posts: 1288
  • Country: us
  • "Best practices" are best not practiced.© Dimitri
Re: LM317 constant current mode. Potentiometer?!?
« Reply #7 on: October 16, 2015, 07:52:22 pm »
All sorts of interesting circuits are included in the onsemi datasheet for the LM317
Page 8 will be of most interest to you.

http://www.onsemi.com/pub_link/Collateral/LM317-D.PDF


   If three 100  Ohm resistors are connected in parallel, and in series with a 200 Ohm resistor, how many resistors do you have? 
 

Offline Gyro

  • Super Contributor
  • ***
  • Posts: 9410
  • Country: gb
Re: LM317 constant current mode. Potentiometer?!?
« Reply #8 on: October 16, 2015, 08:22:26 pm »
I think I would probably go with Cliff Matthews and use an LM723 instead (it's also venerable :)).

As I said in my previous post you _could_ implement switched current limit using a bunch of low values and an LM317 - I'd suggest 100mA, 200mA, 500mA, 1A, but you have quite a large voltage drop in the circuit (around 2V for the LM317 + 1.25V for the shunt resistor) which you could otherwise be using for output voltage.

With an LM723 you are doing the voltage regulation and current limiting in the same circuit, with lower losses. From a quick scan of the web, this design looks well though out....

https://hobbylad.wordpress.com/2013/09/14/part-1-bench-0-30v-0-1a2-psu-regulator-pcb/
« Last Edit: October 16, 2015, 08:24:15 pm by Gyro »
Best Regards, Chris
 

Offline DimitriP

  • Super Contributor
  • ***
  • Posts: 1288
  • Country: us
  • "Best practices" are best not practiced.© Dimitri
Re: LM317 constant current mode. Potentiometer?!?
« Reply #9 on: October 16, 2015, 11:13:36 pm »
I think I would probably go with Cliff Matthews and use an LM723 instead (it's also venerable :)).
....

As a bonus, the LM723 has much lower noise than the LM317.
   If three 100  Ohm resistors are connected in parallel, and in series with a 200 Ohm resistor, how many resistors do you have? 
 

Offline Chaos_KlausTopic starter

  • Contributor
  • Posts: 48
  • Country: de
Re: LM317 constant current mode. Potentiometer?!?
« Reply #10 on: October 17, 2015, 12:42:56 am »
The internal reference voltage of the LM317 is 1.25V. This voltage needs to be dropped across the shunt resistor before the LM317 starts limiting. The shown value of 0R5 means that it won't current limit until about 2.5A (1R2 would give approx 1A).

The way I see it, the 1.25V reference is between the output and the adjust pin. So in the circuit above those 1.25V are dropped across the 1kOhm resistor and the first part of the pot. That is the actual constant current source. This current then has to flow through the rest of the pot and that creates a voltage drop. When the pot is turned all the way "up". This voltage drop is 0.625V which gives 1.25A. It would be best to use an 0.6 Ohm resistor or even two 1.2Ohms resistors in parallel.

The nice thing about that circuit is that it gives an almost linear response for the pot.


I was thinking about a rotary switch aswell. But if I was to do measurements at different current levels, it's propably nice to have fine control over the current limit.

The LM723. Still getting to know that chip. ;)
 

Offline Paul Moir

  • Frequent Contributor
  • **
  • Posts: 926
  • Country: ca
Re: LM317 constant current mode. Potentiometer?!?
« Reply #11 on: October 17, 2015, 01:05:39 am »
An interesting comment I ran into a while ago regarding the LM723's compensation capacitor:

https://web.archive.org/web/20081227063334/http://www.midcoast.com.au/~paulb/faq_723.html

Apparently some designs have gone overboard with it, which causes problems.
 

Offline MarkF

  • Super Contributor
  • ***
  • Posts: 2523
  • Country: us
Re: LM317 constant current mode. Potentiometer?!?
« Reply #12 on: October 17, 2015, 05:11:25 am »
The circuit at the top of page 9 in the LM117/LM317A/LM317 3-Terminal Adjustable Regulator spec sheet seems to fill the bill.
 

Offline DimitriP

  • Super Contributor
  • ***
  • Posts: 1288
  • Country: us
  • "Best practices" are best not practiced.© Dimitri
Re: LM317 constant current mode. Potentiometer?!?
« Reply #13 on: October 17, 2015, 05:20:42 am »
An interesting comment I ran into a while ago regarding the LM723's compensation capacitor:

https://web.archive.org/web/20081227063334/http://www.midcoast.com.au/~paulb/faq_723.html

Apparently some designs have gone overboard with it, which causes problems.

It explains why in some circles the 723 may have aquired it's undeserving  "bad reputation".
I while ago I stumbled on this 3-30V 0-3A supply  http://chemelec.com/Projects/LM723-PS/LM723-PS.htm  that even uses the correct value capacitor at the right place ! :)


--edit: added link
   If three 100  Ohm resistors are connected in parallel, and in series with a 200 Ohm resistor, how many resistors do you have? 
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3233
  • Country: gb
Re: LM317 constant current mode. Potentiometer?!?
« Reply #14 on: October 17, 2015, 09:26:47 am »
The internal reference voltage of the LM317 is 1.25V. This voltage needs to be dropped across the shunt resistor before the LM317 starts limiting. The shown value of 0R5 means that it won't current limit until about 2.5A (1R2 would give approx 1A).

The way I see it, the 1.25V reference is between the output and the adjust pin. So in the circuit above those 1.25V are dropped across the 1kOhm resistor and the first part of the pot. That is the actual constant current source. This current then has to flow through the rest of the pot and that creates a voltage drop. When the pot is turned all the way "up". This voltage drop is 0.625V which gives 1.25A. It would be best to use an 0.6 Ohm resistor or even two 1.2Ohms resistors in parallel.

Not quite.  The bulk of the current will be through the 0.5R resistor, the 1k resistor and 500R pot simply take a variable fraction of the voltage drop across the 0.5R resistor.  The circuit is inherently flawed since the minimum current required to enter constant current mode (1.25/0.5 = 2.5 Amps)  is higher than the LM317T's internal current limit.

A simple but rough and ready fix would be to put a couple of rectifier diodes in series with the 0.5R resistor (e.g. 1N5401).  This will provide an additional ~1.2v drop, so the current limit would be adjustable almost down to zero.  However, this won't provide any kind of precision current limiting since the Vf of the diodes is both current and temperature dependant, but purely as a protection function when experimenting with circuits it should work well enough.

A 1.25v reference powered from a negative supply would give better performance at the cost of extra complexity.
« Last Edit: October 17, 2015, 10:03:13 am by mikerj »
 

Offline Gyro

  • Super Contributor
  • ***
  • Posts: 9410
  • Country: gb
Re: LM317 constant current mode. Potentiometer?!?
« Reply #15 on: October 17, 2015, 10:15:07 am »
Quote
The way I see it, the 1.25V reference is between the output and the adjust pin. So in the circuit above those 1.25V are dropped across the 1kOhm resistor and the first part of the pot. That is the actual constant current source. This current then has to flow through the rest of the pot and that creates a voltage drop. When the pot is turned all the way "up". This voltage drop is 0.625V which gives 1.25A. It would be best to use an 0.6 Ohm resistor or even two 1.2Ohms resistors in parallel.

The nice thing about that circuit is that it gives an almost linear response for the pot.

You have a bit of a misunderstanding of how the LM317 reference operates - it does not _generate_ a 1.25V reference between ADJ and Output, it _clamps_ the voltage to 1.25V.

Think of it as a simple zener diode (actually it's a bandgap), it needs a current through it and it _clamps_ at the 1.25V reference voltage. In a normal voltage regulator circuit this current is provided by the resistor to ground. In a 2-terminal current source, the only place this voltage can come from is the voltage across the current shunt resistor - when this voltage hits 1.25V the LM317 starts to limit. There is no other source for this voltage available.

I think the origin of the circuit shown is for feeding an LED chain and being able to 'Fine-Tune' the current. It was never intended as a '0 to whatever' current control. I found what may have been one of the origins of the circuit on the Elliott Sound Products (a very useful site by the way) page. See Figure 10 and associated text...

http://sound.westhost.com/articles/vi-regulators.html

Hope this helps.  :)

 
« Last Edit: October 17, 2015, 10:17:22 am by Gyro »
Best Regards, Chris
 

Offline Chaos_KlausTopic starter

  • Contributor
  • Posts: 48
  • Country: de
Re: LM317 constant current mode. Potentiometer?!?
« Reply #16 on: October 18, 2015, 11:10:19 am »
Wow, that helps tremendously! What a great website. Eventually I was going to build audio circuits anyway so this is a valuable resource to me. Thanks you.

You were right. I misunderstood how the current limiting works. Not really sure if I do now. I don't really understand the term "clamping". Does that mean it will try to assume the reference voltage but the actual voltage has to come from somewhere else? And if it can't get that voltage, it won't hit the reference? In that case, the voltage between the output pin and the adjust pin would be lower than 1.25V until the current limit is reached. Only then would the regulator start regulating at all.

I'm still a bit in the dark about this. Sorry. ;)
 

Offline Gyro

  • Super Contributor
  • ***
  • Posts: 9410
  • Country: gb
Re: LM317 constant current mode. Potentiometer?!?
« Reply #17 on: October 18, 2015, 11:46:40 am »
Quote
I don't really understand the term "clamping". Does that mean it will try to assume the reference voltage but the actual voltage has to come from somewhere else? And if it can't get that voltage, it won't hit the reference? In that case, the voltage between the output pin and the adjust pin would be lower than 1.25V until the current limit is reached. Only then would the regulator start regulating at all.

Yes, perhaps "clamping" is not the best term, something like 'reference turn-on voltage' might be better, but you've managed to 'decode' the rest of it correctly - the regulator won't start doing any regulating until the voltage between the Adj and output pins reaches 1.25V (it just passes the input to the output, minus the dropout voltage of the regulator, around 2V drop depending on load current). Yes, you've got it, the actual current to the Adj pin must come from something external, either the shunt resistor in the current source case or a resistive divider to ground in the case of a standard voltage regulator. If you simply connected the Adj pin to ground then the regulator would output 1.25V.

Don't give up on the switched output current if you're still trying to keep things very simple (ie not trying the 723 yet) then it will still probably be sufficient in most cases - just limiting the current to protect your circuit. You could add extra positions to go down below 100mA, eg 50mA 20mA 10mA (1:2:5 ratio tends to work best), low enough for LEDs for example. Note that the LM317 needs to pass at least 5mA typ. to power its internal circuit, but you can just add a resistor from the output to ground if necessary.

Glad it was of some help.  :)
« Last Edit: October 18, 2015, 11:48:47 am by Gyro »
Best Regards, Chris
 

Offline sequoia

  • Supporter
  • ****
  • Posts: 154
  • Country: us
Re: LM317 constant current mode. Potentiometer?!?
« Reply #18 on: October 18, 2015, 03:54:05 pm »
Application document from TI regarding LMx17 regulators is really good read:
http://www.ti.com/lit/an/snoa402b/snoa402b.pdf

Especially starting page 5, the notes regarding "lab power supply".

But when it comes to the simple current regulation (constant current), it seems LM317 should work fine as adjustable current limiter for about 12mA to about 1.2A, using the circuit shown in "Figure 8" in that application note document from TI.  When using 1 ohm resistor (1% etc) and 100 ohm potentiometer in series as the "R1"...

2W or higher resistors should work fine?  Since it resistor wattage should be above 1.2A * 1.25V = 1.5W in this case (?)

5W 1% metal oxide film resistors are rather cheap, but good quality potentiometers that are 2W (or higher) are somewhat pricy, but looks like there is cheap 5W 100 ohm potentiometers available in Amazon (etc) for couple bucks each, those might work just fine...



 

Offline sync

  • Frequent Contributor
  • **
  • Posts: 799
  • Country: de
Re: LM317 constant current mode. Potentiometer?!?
« Reply #19 on: October 18, 2015, 04:35:32 pm »
5W 1% metal oxide film resistors are rather cheap, but good quality potentiometers that are 2W (or higher) are somewhat pricy, but looks like there is cheap 5W 100 ohm potentiometers available in Amazon (etc) for couple bucks each, those might work just fine...
The potentiometer has to withstand 1.2A through the wiper. A 5W one is way to small. Look at 150W or higher.
 

Offline Chaos_KlausTopic starter

  • Contributor
  • Posts: 48
  • Country: de
Re: LM317 constant current mode. Potentiometer?!?
« Reply #20 on: October 18, 2015, 09:43:37 pm »
And a linear pot will give you absolutely no control what so ever. The first 10Ohms will already get you down to about 100mA.

I think I'll go with the switchable resistors for sake of simplicity.
 

Offline Cliff Matthews

  • Supporter
  • ****
  • Posts: 1910
  • Country: ca
    • General Repair and Support
Re: LM317 constant current mode. Potentiometer?!?
« Reply #21 on: October 19, 2015, 12:59:30 am »
Some things get costly. I got these 2 pots surplus but new they'd cost $50 http://www.tedss.com/2022001291 What puzzles me about the 0.50 amp rating is that I x R would be 50 watts, but the total element is stated to be 25watts..
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf