LM317 constant current mode. Potentiometer?!? - Page 1
Forum section: electronics / beginners

author: Chaos_Klaus
author_rank: Contributor
timestamp: October 16, 2015, 12:43:30 am
content: 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!

author: Cliff Matthews
author_rank: Unknown
timestamp: October 16, 2015, 01:06:35 am
content: 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.

author: Chaos_Klaus
author_rank: Contributor
timestamp: October 16, 2015, 02:10:12 am
content: Hm. I am stupid.Obviously, I isinverselyproportional 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.

author: unitedatoms
author_rank: Frequent Contributor
timestamp: October 16, 2015, 02:19:42 am
content: With LM317 at 1A you can use low power pot in parallel to high power current sense resistor.

author: Chaos_Klaus
author_rank: Contributor
timestamp: October 16, 2015, 09:43:02 am
content: Hey unitedatoms,that is exactly the kind of solution that I was looking for. Thank you!Cheers!

author: unitedatoms
author_rank: Frequent Contributor
timestamp: October 16, 2015, 03:09:42 pm
content: Quote from: Chaos_Klaus on October 16, 2015, 09:43:02 amNo 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.

author: Gyro
author_rank: Super Contributor
timestamp: October 16, 2015, 06:54:07 pm
content: 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.

author: DimitriP
author_rank: Super Contributor
timestamp: October 16, 2015, 07:52:22 pm
content: All sorts of interesting circuits are included in the onsemi datasheet for the LM317Page 8 will be of most interest to you.http://www.onsemi.com/pub_link/Collateral/LM317-D.PDF

author: Gyro
author_rank: Super Contributor
timestamp: October 16, 2015, 08:22:26 pm
content: 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/

author: DimitriP
author_rank: Super Contributor
timestamp: October 16, 2015, 11:13:36 pm
content: Quote from: Gyro on October 16, 2015, 08:22:26 pmAs a bonus, the LM723 has much lower noise than the LM317.

author: Chaos_Klaus
author_rank: Contributor
timestamp: October 17, 2015, 12:42:56 am
content: Quote from: Gyro on October 16, 2015, 06:54:07 pmThe 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.Thatis 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.

author: Paul Moir
author_rank: Frequent Contributor
timestamp: October 17, 2015, 01:05:39 am
content: 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.htmlApparently some designs have gone overboard with it, which causes problems.

author: MarkF
author_rank: Super Contributor
timestamp: October 17, 2015, 05:11:25 am
content: The circuit at the top of page 9 in theLM117/LM317A/LM317 3-Terminal Adjustable Regulatorspec sheet seems to fill the bill.

author: DimitriP
author_rank: Super Contributor
timestamp: October 17, 2015, 05:20:42 am
content: Quote from: Paul Moir on October 17, 2015, 01:05:39 amIt 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 supplyhttp://chemelec.com/Projects/LM723-PS/LM723-PS.htmthat even uses the correct value capacitor at the right place !--edit: added link

author: mikerj
author_rank: Super Contributor
timestamp: October 17, 2015, 09:26:47 am
content: Quote from: Chaos_Klaus on October 17, 2015, 12:42:56 amNot 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.

author: Gyro
author_rank: Super Contributor
timestamp: October 17, 2015, 10:15:07 am
content: QuoteYou 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.htmlHope this helps.

author: Chaos_Klaus
author_rank: Contributor
timestamp: October 18, 2015, 11:10:19 am
content: 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.

author: Gyro
author_rank: Super Contributor
timestamp: October 18, 2015, 11:46:40 am
content: QuoteYes, 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.

author: sequoia
author_rank: Unknown
timestamp: October 18, 2015, 03:54:05 pm
content: Application document from TI regarding LMx17 regulators is really good read:http://www.ti.com/lit/an/snoa402b/snoa402b.pdfEspecially 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...

author: sync
author_rank: Frequent Contributor
timestamp: October 18, 2015, 04:35:32 pm
content: Quote from: sequoia on October 18, 2015, 03:54:05 pmThe potentiometer has to withstand 1.2A through the wiper. A 5W one is way to small. Look at 150W or higher.

author: Chaos_Klaus
author_rank: Contributor
timestamp: October 18, 2015, 09:43:37 pm
content: 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.

author: Cliff Matthews
author_rank: Unknown
timestamp: October 19, 2015, 12:59:30 am
content: Some things get costly. I got these 2 pots surplus but new they'd cost $50http://www.tedss.com/2022001291What 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..