Author Topic: Problems controlling an LM317  (Read 12540 times)

0 Members and 1 Guest are viewing this topic.

Offline PostaLTopic starter

  • Contributor
  • Posts: 31
  • Country: ro
Problems controlling an LM317
« on: January 29, 2013, 10:36:17 pm »
Hello,

I'm building my own power supply, obviously, inspired by Dave's uSupply. Schematic part relevant for this discussion is attached below.

The problem that I have is correctly controlling the LM317 at U2: if I pull the adjust pin to the ground, the output will go to 1.25 V. So far so good.

The problem comes when I connect the output of the opamp to the adjust pin. For some reason when the output of the op amp goes below 0.76V the output of the LM317 will stay at 2.06V, even if it goes to 0V (actually 0.01V, but that might be my cheap multimeter).

When The opamp goes to 9V (max) the LM317 output is 10.25V, as expected.

So, why doesn't the opamp sink the adjust pin correctly bellow 0.74V ? Am I missing something?

Thank you!
« Last Edit: January 29, 2013, 10:49:28 pm by PostaL »
 

alm

  • Guest
Re: Problems controlling an LM317
« Reply #1 on: January 30, 2013, 12:21:32 am »
The LM358 is not a rail-to-rail op-amp, it can't drive the output all the way to its negative rail. See the bottom left figure on page 9 of the TI datasheet. The current it can sink below ~0.6 V is very small. Use a op-amp that can drive its output to the negative rail or provide the op-amp with a negative voltage at least 0.7 V below power supply output ground to fix this.
 

Offline desirider

  • Newbie
  • Posts: 6
Re: Problems controlling an LM317
« Reply #2 on: January 30, 2013, 04:59:42 am »
Alm is spot on.

I run into this problem often and don't usually have a -ve supply available.  For a quick and dirty solution I simply use a AA battery to generate a level below circuit ground and run the op-amp on it.
 

Offline PostaLTopic starter

  • Contributor
  • Posts: 31
  • Country: ro
Re: Problems controlling an LM317
« Reply #3 on: January 30, 2013, 08:07:02 am »
Thank you guys so much! I've learned something new today :). I'll try to search for a rail-to-rail opamp and try this again.
 

Offline PA4TIM

  • Super Contributor
  • ***
  • Posts: 1161
  • Country: nl
  • instruments are like rabbits, they multiply fast
    • PA4TIMs shelter for orphan measurement stuff
Re: Problems controlling an LM317
« Reply #4 on: January 30, 2013, 08:39:23 am »
You can make two grounds by using a diode in serie with the negative from the bridge. ( kathode to bridge and a small cap over it) Then connect the opamp negative supply to the anode. And the rest of the circuit ground to the anode. Now the circuit ground is 0.6 to 1V above the opamp ground. That is the same as giving the opamp a negtive supply
( i have not tried it, not drawn it but it just comes to mind so correct me if I'm wrong because I am not good in making visuals in my head)
www.pa4tim.nl my collection measurement gear and experiments Also lots of info about network analyse
www.schneiderelectronicsrepair.nl  repair of test and calibration equipment
https://www.youtube.com/user/pa4tim my youtube channel
 

Offline PostaLTopic starter

  • Contributor
  • Posts: 31
  • Country: ro
Re: Problems controlling an LM317
« Reply #5 on: January 30, 2013, 08:44:13 am »
I'm new to electronics, so don't ask me  :-DD.

What do you mean by bridge. The only bridge I know about in electronics it's a rectifier bridge, and I have none in my design.
 

Offline _Steven_

  • Contributor
  • Posts: 15
Re: Problems controlling an LM317
« Reply #6 on: January 30, 2013, 11:14:26 am »
I'm using a FET-circuit to bringing up an output voltage to 0 Volts....I'm still not at the end of testing.
What PA4TIM means ..I understand...
I think you best go on the net and look at a lot of schemes of power supplies. I cant give you a corret answer now because I'm still testing.
I also use 2 extra diodes and a cap for acheiving the lower voltage than ground.


Ps in you scheme...don't forget the 2 protection diodes. In the datasheet of the LM317 you can find examples.
greetings
« Last Edit: January 30, 2013, 06:02:13 pm by _Steven_ »
 

Offline PostaLTopic starter

  • Contributor
  • Posts: 31
  • Country: ro
Re: Problems controlling an LM317
« Reply #7 on: January 30, 2013, 12:00:17 pm »
The LM358 is not a rail-to-rail op-amp, it can't drive the output all the way to its negative rail. See the bottom left figure on page 9 of the TI datasheet. The current it can sink below ~0.6 V is very small. Use a op-amp that can drive its output to the negative rail or provide the op-amp with a negative voltage at least 0.7 V below power supply output ground to fix this.

I'm really new to electronics, so you can imagine what headache I get from op-amps and datasheets :( ...

Based of what you said, and if I understood correctly, the op-amp that I need should sink more current at low voltages, and the rail-to-rail op-amp should generally be better at this.

I'm looking at the LM6132 datasheet's output voltage vs. sinking current (page 11, top), and as far as I can tell, it's not much better than LM358. Am I getting this wrong ?

And secondly, not to hold my project on hold, is there any general purpose, popular rail-to-rail op-amp that is capable of sinking my LM317 adjust pin correctly and handle a 14V input voltage ? Because finding a proper op-amp based on the datasheet is one thing, but where I live, the electronics shops are quite badly supplied, and if I don't ask for a relatively popular part, they will not have it, and as I said, I would like to move on with my project.
 

Offline Arrow

  • Contributor
  • Posts: 42
Re: Problems controlling an LM317
« Reply #8 on: January 30, 2013, 10:29:21 pm »

I'm really new to electronics, so you can imagine what headache I get from op-amps and datasheets :( ...

Take good notice of the minimum current. Datasheet tells me ~5mA. so you should change the 470 adjust resistor to 220-247ohm.
As I understood you are new to electronics, but you can ask someone with more experience to help you build a adsjustable negative supply from a positive supply. And that supply will take care (compensate)of the op amp offset, and you don't need to search for a rail to rail Op amp.
« Last Edit: January 30, 2013, 10:31:22 pm by Arrow »
 

Offline PostaLTopic starter

  • Contributor
  • Posts: 31
  • Country: ro
Re: Problems controlling an LM317
« Reply #9 on: January 30, 2013, 10:33:25 pm »
The more I think and hear the more I'm inclining towards the negative power supply. I believe I will even be able to get the LM317 to 0V instead of 1.25V. I will try to search for resources on how to achieve this. I'm a noob, but I'm eager to learn :D

Thank you!
 

alm

  • Guest
Re: Problems controlling an LM317
« Reply #10 on: January 30, 2013, 11:09:42 pm »
As long as the op-amp is able to sink enough current at -1.25 V relative to the negative output terminal, the LM317 should be able to regulate down to 0V. This is a common technique to use the LM317 below 1.25 V, and I think it's in the (National) datasheet as suggested application circuit.
 

Offline _Steven_

  • Contributor
  • Posts: 15
Re: Problems controlling an LM317
« Reply #11 on: February 01, 2013, 12:04:14 am »
I Use a fet circuit for acheiving that.

Maybe this can give you an idea:
http://www.circuitsonline.net/schakelingen/158/voedingen/lm317-labvoeding-bijgewerkte-versie.html

Or here:
note the difference for transformation wiring.
http://www.uploadarchief.net/files/download/co%20labvoeding%20v2_b.pdf

In the first case you need a transformation with an extra wire (i really don't know how you call these on in English....only in dutch :)

Succes. Ps i didn't tested these schemes but they are found at a really nice forum!
« Last Edit: February 01, 2013, 12:07:53 am by _Steven_ »
 

Offline PostaLTopic starter

  • Contributor
  • Posts: 31
  • Country: ro
Re: Problems controlling an LM317
« Reply #12 on: February 01, 2013, 12:16:44 am »
Thank you very much! I also see a lot of other stuff that looks interesting there that I should understand and incorporate in my design.
 

Offline free_electron

  • Super Contributor
  • ***
  • Posts: 8517
  • Country: us
    • SiliconValleyGarage
Re: Problems controlling an LM317
« Reply #13 on: February 01, 2013, 02:10:37 am »
aaargh.. why won't this crap schematic die and go away ? this thing keeps popping up over and over on the web and is just ... hair-raisingly bad design on so many points.

This is NOT the way to make a power supply. LM317's have their place, but not in an adjustable power supply as regulating element.

besides, you have another problem. In your circuit there is a risk that the opamp drives the ADJ pin above Vout... with a dead LM317 as a result.
You should not be actively driving the ADJ pin. Only be pulling it toward ground.

http://www.ti.com/lit/ds/symlink/lm317.pdf  page 7. read note E and look at the current arrow on the ADJ pin. Send current into that pin and you can kill the LM317....

page 12 of the same document shows how to do it right by adding an additional transistor to pull the adj pin down so there is no risk of driving current into the ADJ pin ( the base-emitter diode of the PNP blocks that )

and please put the backfeed diodes ( output pushed higher than input protection ) see ntes E on page 7 and read all the other notes there too.
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline _Steven_

  • Contributor
  • Posts: 15
Re: Problems controlling an LM317
« Reply #14 on: February 01, 2013, 03:11:14 am »
Do you mean the shemes i posted or the topic starters scheme? Advice is welcome..for sure!!! thank you!
 

Offline PostaLTopic starter

  • Contributor
  • Posts: 31
  • Country: ro
Re: Problems controlling an LM317
« Reply #15 on: February 01, 2013, 08:03:12 am »
Do you mean the shemes i posted or the topic starters scheme?

I'm 99% sure he talks about mine :D

LM317's have their place, but not in an adjustable power supply as regulating element.

Basically, this is a learning project for me, not necessary a product, per say. Not yet anyway :). What would you recommend as an adjustable linear regulator, other than LT3080 which costs a lot!

You should not be actively driving the ADJ pin. Only be pulling it toward ground

I had no idea about this. Very good to know! I might be wrong, but it might also solve my sinking problem.

and please put the backfeed diodes
I added those yesterday, as a matter of fact, plus another one on the output to protect the power supply from short :)

It's clear that I have no clue what I'm doing, but I sure do learn every day :D

Thank you all for your input so far !
 

Offline Arrow

  • Contributor
  • Posts: 42
Re: Problems controlling an LM317
« Reply #16 on: February 01, 2013, 12:04:36 pm »
You should not be actively driving the ADJ pin. Only be pulling it toward ground.
But if you use some fast schottky diode (0.1V) instead of those cheap diode in the datasheet, you have reduce the risk by 90%, right?
 National Semiconductor tells another story for the LM117, read page 9 protection diode http://www.ee.buffalo.edu/courses/elab/LM117.pdf
They also claim of internal protection. I use both protection diode everytime!!!


"The discharge current depends on the value of the capacitor, the output voltage of the regulator, and
the rate of decrease of VIN. In the LM117, this discharge path is through a large junction that is able to sustain 15A surge
with no problem. This is not true of other types of positive regulators. For output capacitors of 25 ?F or less, there is no
need to use diodes. "
 

Offline ptricks

  • Frequent Contributor
  • **
  • Posts: 671
  • Country: us
Re: Problems controlling an LM317
« Reply #17 on: February 02, 2013, 01:38:03 pm »
I always advise people starting out to avoid the integrated chips . The reason I do this is because parts like the LM317 are black boxes with pins that you connect stuff to without understanding of what is happening inside with the parts. You can build a much better variable supply using just resistors, capacitors and transistors or fets and gain some understanding of what is going on inside those black box chips .
http://schematicblog.blogspot.com/2011/06/power-supply-dc-variable.html
« Last Edit: February 02, 2013, 01:40:30 pm by ptricks »
 

Offline Arrow

  • Contributor
  • Posts: 42
Re: Problems controlling an LM317
« Reply #18 on: February 02, 2013, 02:53:41 pm »
I always advise people starting out to avoid the integrated chips . The reason I do this is because parts like the LM317 are black boxes with pins that you connect stuff to without understanding of what is happening inside with the parts.
That's why we have the datasheet, comes with schematics and all.
I completely agree with you that you will get some understanding, but about "a much better supply" by using everything from  a scratch, I don't know for sure. Dave used the LT3080 with line regulation < 0.001%/V LM317A has also LR of 0.001%/V. I don't know how I can achieve better LR than these. Furthermore I won't call it a black box because there are a lot more IC on the market with a lot more transistors like the 4040 but even so I'm not willing to build one of my own. So I'd don't see anything wrong with using the regulators unless  someone comes with some other motives that I have overlooked.



« Last Edit: February 02, 2013, 02:59:32 pm by Arrow »
 

Offline ptricks

  • Frequent Contributor
  • **
  • Posts: 671
  • Country: us
Re: Problems controlling an LM317
« Reply #19 on: February 03, 2013, 01:14:57 am »
That's why we have the datasheet, comes with schematics and all.
I completely agree with you that you will get some understanding, but about "a much better supply" by using everything from  a scratch, I don't know for sure.

I don't mean build every circuit from scratch but when starting out it really hurts the learning process if a beginner just knows what to connect to each pin and nothing about what goes on inside. Schematics are useful if you truly understand them and the majority of beginners I encounter do not understand them, they just know it has 3 pins to connect and when it fails they don't understand why .  There is something about building the circuit yourself, having it not work, having to figure out why or having to substitute parts that don't exactly match the values given and finding out how it all works together that is hard to replicate in a tutorial or class.  I tutor a lot of adults as a volunteer and it never fails that I will get someone who is baffled by things like switching a relay with a transistor, those students always want to jump right to a SSR because to them it solves all the problems,just connect a line from the micro, none of that external parts stuff even though doing so would require a heat sink and cost more.


It isn't uncommon to find beginners that can't blink an led without putting a chip into the loop and that hurts them later when they need to use what they could have learned from  a simple circuit when interfacing chips. 

One of my favorite things to do is give someone a bunch of transistors and resistors and caps, an incandescent bulb from a flashlight and a 9V battery. I tell them just a little bit about how transistors work then let them experiment with it, I let them burn out parts, burn their fingers from connecting things wrong and usually get a student that begins to understand the concept a lot better.
 

Offline free_electron

  • Super Contributor
  • ***
  • Posts: 8517
  • Country: us
    • SiliconValleyGarage
Re: Problems controlling an LM317
« Reply #20 on: February 03, 2013, 08:39:15 pm »
You should not be actively driving the ADJ pin. Only be pulling it toward ground.
But if you use some fast schottky diode (0.1V) instead of those cheap diode in the datasheet, you have reduce the risk by 90%, right?
 National Semiconductor tells another story for the LM117, read page 9 protection diode http://www.ee.buffalo.edu/courses/elab/LM117.pdf
They also claim of internal protection. I use both protection diode everytime!!!


"The discharge current depends on the value of the capacitor, the output voltage of the regulator, and
the rate of decrease of VIN. In the LM117, this discharge path is through a large junction that is able to sustain 15A surge
with no problem. This is not true of other types of positive regulators. For output capacitors of 25 ?F or less, there is no
need to use diodes. "

if you put a diode between ADJ and output then you can actively drive the ADJ pin. no problem.

the risk with active driving is that you succeed in injecting current into the ADJ pin ( once you pull ADJ more than 1.25 volts above Vout. ) you will turn on parasitics inside theLM317 and you can fry it.

there is a reason they put a diode there when they do the slow start using the capacitor on vadj ... that cap needs to discharge at powerdown. if it can't it can kill the lm317 at poer-off time

Code: [Select]

       _____
in ---|lm317|----+---+-- out
      |_____|    |  _|_
         |      R1  /_\  <- this guy protects ADJ at shutdown by discharging
         |       |   |      C1 into out at powerdown
          -------+---+
                 |   |
                r2  === C1
                 |  ---
                 |   |
                  -+-
                   |
                  _|_
                  gnd          ASCIICAD (c) free_electron's hand

fully protect lm317 with opamp control

Code: [Select]
           d1
     -----|<|-----
    |   _____     |
in -+--|lm317|----+--+---------+-------- out
       |_____|    |  |         |   d2
         |      R1 R3           --|<|--|gnd
         |       |  |
         +-------    -----------+--r4--|gnd
         |             ___      |
        E \|P         / - |-----+
          B|N--[r2]--<    |
        C /|P         \_+_|-- control
          |
         GND


d1 is the backfeed diode. try to yank OUT higher than In and it will conduct protecting the pass element in th lm317.
D2 is a polarity reversal protection. force ea reverse voltage on the output and it will protect the entire supply ( it will fry itself ...  this should be a diode that can handle some 'oompf' like a 10 ampere diode )

the PNP can nly pull ADJ to ground . it cannot send current into ADJ send the emitter -base is a diode.
now . there is still a mode of failure. if , for some reason, the opamp cranks the base more than 6 volts above the emitter of that transistor you will fry the transistor ( VBErmax) so, you can add an additional two diode in parallel to prevent that from happening.

Code: [Select]

           d1
     -----|<|-----
    |   _____     |
in -+--|lm317|----+--+---+---------+-------- out
       |_____|    | _|_  |         |   d2
         |      R1  /_\  R3         --|<|--|gnd
         |       |   |d3 |
         +-------+---+    --------------+--r4--|gnd
         |          _|_d4      ___      |
        E \|P       /_\       / - |-----+
          B|N--------+-[r2]--<    |
        C /|P                 \_+_|-- control
          |
         GND


d4 now prevents more than 0.6 volts in reverse across the transsitor, but it allows current injection again ! so we add D3 to limit the reverse voltage between ADJ and OUT not that the diodes are tapped between transsitor and R2 ... we don;t want to fry the opamp output.

this is the kind of misery you end up in when trying to use a component outside of what it was designed for.... you end up throwing so much external crap to prevent trouble.

Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline Arrow

  • Contributor
  • Posts: 42
Re: Problems controlling an LM317
« Reply #21 on: February 04, 2013, 12:15:45 am »
There is something about building the circuit yourself, having it not work, having to figure out why or having to substitute parts that don't exactly match the values given and finding out how it all works together that is hard to replicate in a tutorial or class.
I Agree!!!
 

Offline Arrow

  • Contributor
  • Posts: 42
Re: Problems controlling an LM317
« Reply #22 on: February 04, 2013, 12:34:50 am »

if you put a diode between ADJ and output then you can actively drive the ADJ pin. no problem.
So if you put the protection diode you don't need to use the transistor neither right???
I don't like that schematic of that diode transistor, because it influence the accuracy of the regulator badly.
Just think of the Vbe drift and temp, all will be reflected on the output.
If the output of the op amp is connected directly to the adj and the op amp raise its output voltage, this will also induce the regulator output to raise right? so why should current still run in the adj terminal if there is also two protection diode connected.
And the out/adj is still 1.25V
« Last Edit: February 04, 2013, 12:07:07 pm by Arrow »
 

Offline AlfBaz

  • Super Contributor
  • ***
  • Posts: 2184
  • Country: au
Re: Problems controlling an LM317
« Reply #23 on: February 04, 2013, 01:05:36 am »
Just think of the Vbe drift and temp, all will be reflected on the output.
Which is then seen in the neagtive feed back of the op amp which in turn adjust its output to compensate
 

Offline Arrow

  • Contributor
  • Posts: 42
Re: Problems controlling an LM317
« Reply #24 on: February 04, 2013, 12:27:49 pm »
I have to test it you know. Because it depends where you are in the transistor graphs by a specific Vbe. We are using a PNP transistor so in this schematic a  delta Vb should give me the same delta Ve. But it is not so in practical, the op amp will work hard to keep up for that compensation. What I am trying to explain is that if you change the Base voltage with 50mV you should also noticed a instant change in the Emitter voltage, (theory) but you will not. On the Vbe will always be a sort of ghost voltage, that's why in some circuits you see them putting a resistor between the BE. So instead that the op amp will give  a steady voltage, it will have to swing it's output over the adjust terminal which will influence the accuracy of the output voltage drastically.
« Last Edit: February 04, 2013, 01:11:38 pm by Arrow »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf