Author Topic: LM317 Based Digitally Controlled Power Supply  (Read 3624 times)

0 Members and 1 Guest are viewing this topic.

Offline EthannCrafttTopic starter

  • Newbie
  • Posts: 2
  • Country: us
LM317 Based Digitally Controlled Power Supply
« on: April 20, 2024, 02:57:43 am »
Hello. I'm looking to construct a digitally controlled power supply. I have a circuit drawn up with a PWM voltage control circuit of my own design, and the current control design that Dave drew on his PSU series hooked up to the input of the second LM317.

After being plugged into a circuit simulator, it seems to have really weird behavior even though both circuits work great on their own. Any help??? Schematic below.

(The +5v inputs are where the PWM will be inputted. An RC filter will be added in the final design. The 1ohm resistor to the far right will also be removed.)
 

Offline TerrySt

  • Regular Contributor
  • *
  • Posts: 73
  • Country: us
Re: LM317 Based Digitally Controlled Power Supply
« Reply #1 on: April 21, 2024, 12:57:30 am »
The voltage regulator using the pwm to the lm317 won’t work as drawn.  You have eliminated the feedback for the lm317 by connecting the opamp output directly to the reference pin of the lm317.   You can sum in a voltage to the ref pin or use the pwm voltage to raise the ground but you still need the output of the lm317 to affect the ref voltage.  But the way you have it, the connection from the output of the lm317 to ref is basically eliminated. 
 
The following users thanked this post: EthannCraftt

Offline TerrySt

  • Regular Contributor
  • *
  • Posts: 73
  • Country: us
Re: LM317 Based Digitally Controlled Power Supply
« Reply #2 on: April 21, 2024, 01:06:34 am »
Sorry.  I spoke too soon. I was going by memory and it obviously isn’t too sharp.   That should work, although the resistor from the output to the ref pin isn’t doing anything other than raising the dissipation of the opamp. 
 
The following users thanked this post: EthannCraftt

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19684
  • Country: gb
  • 0999
Re: LM317 Based Digitally Controlled Power Supply
« Reply #3 on: April 21, 2024, 10:37:33 am »
Sorry.  I spoke too soon. I was going by memory and it obviously isn’t too sharp.   That should work, although the resistor from the output to the ref pin isn’t doing anything other than raising the dissipation of the opamp. 
The 220R resistor provides a minimum load for the LM317. It won't work without it. A lower value resistor might even be required, because the minimum load current for the LM317 is 10mA.

Hello. I'm looking to construct a digitally controlled power supply. I have a circuit drawn up with a PWM voltage control circuit of my own design, and the current control design that Dave drew on his PSU series hooked up to the input of the second LM317.

After being plugged into a circuit simulator, it seems to have really weird behavior even though both circuits work great on their own. Any help??? Schematic below.

(The +5v inputs are where the PWM will be inputted. An RC filter will be added in the final design. The 1ohm resistor to the far right will also be removed.)

What a strange circuit.

What does the Darlington pair and all of the op-amps do before the LM317? It appears to be a current limiter, but the LM317 already has built-in current limiting.

All this circuit will do is output 30V.

Why not skip the LM317 and just use a Darlington pair? All it does in that circuit is increase the drop-out voltage.
 
The following users thanked this post: TerrySt, EthannCraftt

Offline TerrySt

  • Regular Contributor
  • *
  • Posts: 73
  • Country: us
Re: LM317 Based Digitally Controlled Power Supply
« Reply #4 on: April 21, 2024, 01:40:50 pm »
Yes, I see that the 220R is a good way to ensure a minimum load current for the 317.

The first stage is a programmable current limit using a pwm controlled voltage in place of the +5V input to the opamp.  Either circuit (the voltage control or the current control) should work on its own, but combining them might be tricky.  The current control won't take effect until the voltage control goes into drop out, which might make for some erratic behavior.  Whenever I've tried something similar, I've run into issues making it work predictably under all conditions.
I would try to sum the current control into the the opamp for the voltage control by eliminating the darlingtons and integrating the current error.  That might make things behave a little more predictably.
 
The following users thanked this post: EthannCraftt

Online themadhippy

  • Super Contributor
  • ***
  • Posts: 2793
  • Country: gb
Re: LM317 Based Digitally Controlled Power Supply
« Reply #5 on: April 21, 2024, 02:27:44 pm »
I tinkered with similar ideas and gave up and used a high side current sensor (ina168),adjust its output range to match your pwm signal range and compare the 2 .
 
The following users thanked this post: EthannCraftt

Offline TerrySt

  • Regular Contributor
  • *
  • Posts: 73
  • Country: us
Re: LM317 Based Digitally Controlled Power Supply
« Reply #6 on: April 21, 2024, 05:08:05 pm »
Something like this is what I would do.  It compares the current sense (high side sense) to a reference voltage that could come from a PWM and integrates the difference to over-ride the voltage set when the current goes above the set point.
Of course the devil is in the details.  One downside of this architecture is a small delay as the integrator slews from zero.  This will let the current overshoot for a short time. 
The biggest issue is the choice of opamps.  As drawn, it assumes a 'perfect' opamp that doesn't exist.  You need rail to rail inputs for the high side current sense.  And single supply, 30V tolerant.  I don't know that you can find that. 
There are ways to deal with the rail to rail input issue, but it requires a bit more design work.

« Last Edit: April 21, 2024, 05:11:21 pm by TerrySt »
 
The following users thanked this post: EthannCraftt

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19684
  • Country: gb
  • 0999
Re: LM317 Based Digitally Controlled Power Supply
« Reply #7 on: April 21, 2024, 09:52:29 pm »
Something like this is what I would do.  It compares the current sense (high side sense) to a reference voltage that could come from a PWM and integrates the difference to over-ride the voltage set when the current goes above the set point.
Of course the devil is in the details.  One downside of this architecture is a small delay as the integrator slews from zero.  This will let the current overshoot for a short time. 
The biggest issue is the choice of opamps.  As drawn, it assumes a 'perfect' opamp that doesn't exist.  You need rail to rail inputs for the high side current sense.  And single supply, 30V tolerant.  I don't know that you can find that. 
There are ways to deal with the rail to rail input issue, but it requires a bit more design work.
Another strange circuit.

How does it work?

Have to simulated it under different loads, currents and voltages?
 
The following users thanked this post: EthannCraftt

Offline TerrySt

  • Regular Contributor
  • *
  • Posts: 73
  • Country: us
Re: LM317 Based Digitally Controlled Power Supply
« Reply #8 on: April 21, 2024, 10:34:52 pm »
Not really unusual.  I've seen it, or variations of it many times.  Just summing in the voltage and current control loops.  You could also ground the bottom of the 2k resistor (R9) and use a diode to sum in the current control.
I just did a quick simulation of it with a constant load as I ramped the voltage up enough to switch from voltage mode to current mode and then back down.  It works as expected, with a short period of overcurrent before the current loop kicks in.  That will always be there, but can be minimized with tuning.   If you shorten the integration time, it will respond faster, but eventually loop stability will be an issue.  Unless your requirements are ultra-strict, it will probably work.
It wouldn't make much sense to do a lot of simulations until you cleaned up the design (scaling the voltage and current loop gains) and used 'real' op amps instead of 'perfect' op amps.  I just wanted to show the general architecture.
Also, as drawn, the current set point is 'backwards'.  Low voltage sets the highest current and vice-versa.  You could handle that in the software that controls the PWM or add an inversion.

Here is a sim with a constant load of 100 Ohms as the voltage is ramped up using the voltage control from zero (but of course 1.25V is as low as the 317 goes) to 30V.  The current limit kicks in at about 19.2V (192mA).  I used the ADA4097-2 op amp for the high side current sense which is just the first one I came across that works rail to rail with a single supply at 30V.  The other two op amps are still 'ideal'.  You would probably need to add some caps in the feedback of the op amps to get everything stable once you pick the real op amps.
 
The following users thanked this post: EthannCraftt

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19684
  • Country: gb
  • 0999
Re: LM317 Based Digitally Controlled Power Supply
« Reply #9 on: April 22, 2024, 07:38:05 am »
How does the LM317's output go down to 0V, without the adjust pin being pulled down to -1.25V?

Are you sure the op-amp models you've used model the power supply rails properly?

Please post the .asc file. You can use LT's version of the LM317, the RH117 which is similar enough.
 
The following users thanked this post: EthannCraftt

Offline MrAl

  • Super Contributor
  • ***
  • Posts: 1521
Re: LM317 Based Digitally Controlled Power Supply
« Reply #10 on: April 22, 2024, 09:37:38 am »
Hello. I'm looking to construct a digitally controlled power supply. I have a circuit drawn up with a PWM voltage control circuit of my own design, and the current control design that Dave drew on his PSU series hooked up to the input of the second LM317.

After being plugged into a circuit simulator, it seems to have really weird behavior even though both circuits work great on their own. Any help??? Schematic below.

(The +5v inputs are where the PWM will be inputted. An RC filter will be added in the final design. The 1ohm resistor to the far right will also be removed.)

Hello,

A couple points to be made here.

[1]
That 220 Ohm resistor is not considered to be low enough anymore, 120 Ohms is the preferred value now.  That's to load the LM317 with at least 10ma.

[2]
When you drive the ADJ terminal directly with a voltage source, you essentially give up the voltage regulation offered from the LM317.  The external voltage source appears in series with the 1.25 volt reference source internal to the LM317.  That means that your external voltage source is now a large part of the reference source, which means it must be well regulated if the output is to be well regulated.  Another side issue is that the LM317 now becomes just a driver, similar to an amplifier with a gain of 1 with an added reference of around 1.25v, and with the external voltage source Vs the reference becomes Vs+1.25v, and that is 'amplified' by the gain of 1 amplifier and then the output of that amplifier drives the output load.
That's probably not a problem, but the external source has to be regulated itself, which for your circuit could be a problem.  More about that later.

[3]
The input circuit, ideally, should really be a buck switching regulator that automatically adjusts to the minimum requirements of the input of the LM317.  If the so-called drop out voltage was 2.5 volts for example, then the output of the buck should be 2.5 volts plus whatever the output voltage has to be.  This isn't too hard to do, but the buck circuit front end is more important because that lowers power dissipation by a very large amount.  It means the circuit can go from instead of 30 watts of dissipation for a given load, down to 3 watts of dissipation for that same load.  That's a lot and that is why switching regulators make good front ends for linear regulators.
So this means drop the linear front end and go with a buck front end.  If you can't do that, then you're going to be stuck with pure linear operation which sometimes will dissipate a large amount of power and require a very large heat sink.

Now a little more about the external voltage source.
Because you will be using PWM, you might have to incorporate some feedback so that you can get the PWM to output the right source voltage so you can get decent accuracy on the output voltage setting.  This means sensing the output or the filtered PWM signal and adjusting the pulse width accordingly.  This is because the LM317 can no longer regulate the output voltage like it does when only resistors connect to the ADJ terminal.  That means you have to do all the regulation with a separate feedback system.  This brings in the question of if an LM317 is really needed at all if you have to incorporate your own feedback system anyway and why put up with the unusually large voltage drop of the LM317 that comes with it.  With a power transistor and some feedback you can get the voltage drop down to at least 1v or even less.



« Last Edit: April 22, 2024, 09:41:57 am by MrAl »
 
The following users thanked this post: EthannCraftt

Offline Terry Bites

  • Super Contributor
  • ***
  • Posts: 2471
  • Country: gb
  • Recovering Electrical Engineer
 
The following users thanked this post: EthannCraftt

Offline TerrySt

  • Regular Contributor
  • *
  • Posts: 73
  • Country: us
Re: LM317 Based Digitally Controlled Power Supply
« Reply #12 on: April 22, 2024, 01:28:06 pm »
How does the LM317's output go down to 0V, without the adjust pin being pulled down to -1.25V?

Are you sure the op-amp models you've used model the power supply rails properly?

Please post the .asc file. You can use LT's version of the LM317, the RH117 which is similar enough.
(Attachment Link)

As I mentioned, the LM317 won't go below 1.25V without a negative reference.
The model for the ADA4097-2 is the one that is in the LTSpice op amp directory by default.  It is a 50V single supply capable with over the top input capability, so should work here.  The data sheet even shows it sensing 50V inputs with a 5V supply.
But if I use it in all three locations in my asc file it never completes (I even let it run overnight and it didn't finish).  That is usually a sign of some non-monotonic behavior in the model,  So the asc I'm attaching only uses it in the current sense location, and just uses 'ideal' op amps in the other two locations.
You will probably need to change the LM317 model since I build a custom part from a model I grabbed on the internet.  Make sure the model you use works though.  I The first one I grabbed didn't.  It only had a 0.625 V reference and didn't give close to the correct output.

 
The following users thanked this post: EthannCraftt

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19684
  • Country: gb
  • 0999
Re: LM317 Based Digitally Controlled Power Supply
« Reply #13 on: April 22, 2024, 06:24:30 pm »
My simulation results differ from yours and the only thing I change was the LM317 to the RH117, which shouldn't make any difference.

EDIT:
I notice the schematic is different to the other one. I'm glad you realised a diode is necessary to implement CC as well as CV control.
« Last Edit: April 22, 2024, 06:54:29 pm by Zero999 »
 
The following users thanked this post: EthannCraftt

Offline TerrySt

  • Regular Contributor
  • *
  • Posts: 73
  • Country: us
Re: LM317 Based Digitally Controlled Power Supply
« Reply #14 on: April 22, 2024, 06:59:27 pm »
The diode isn’t required.  I put it in there to make it easier to understand.  When not in current regulation, the op amp output is at zero volts, so eliminating the diode and connecting the 2k resistor to the op amp output works just as well.   I mentioned that above. 
The results are different because I changed some resistors to make the current scaling different.  It is now about 1 amp full scale. 
 
The following users thanked this post: EthannCraftt

Offline TerrySt

  • Regular Contributor
  • *
  • Posts: 73
  • Country: us
Re: LM317 Based Digitally Controlled Power Supply
« Reply #15 on: April 22, 2024, 07:19:03 pm »
Hello. I'm looking to construct a digitally controlled power supply. I have a circuit drawn up with a PWM voltage control circuit of my own design, and the current control design that Dave drew on his PSU series hooked up to the input of the second LM317.

After being plugged into a circuit simulator, it seems to have really weird behavior even though both circuits work great on their own. Any help??? Schematic below.

(The +5v inputs are where the PWM will be inputted. An RC filter will be added in the final design. The 1ohm resistor to the far right will also be removed.)

Hello,

A couple points to be made here.

[1]
That 220 Ohm resistor is not considered to be low enough anymore, 120 Ohms is the preferred value now.  That's to load the LM317 with at least 10ma.

[2]
When you drive the ADJ terminal directly with a voltage source, you essentially give up the voltage regulation offered from the LM317.  The external voltage source appears in series with the 1.25 volt reference source internal to the LM317.  That means that your external voltage source is now a large part of the reference source, which means it must be well regulated if the output is to be well regulated.  Another side issue is that the LM317 now becomes just a driver, similar to an amplifier with a gain of 1 with an added reference of around 1.25v, and with the external voltage source Vs the reference becomes Vs+1.25v, and that is 'amplified' by the gain of 1 amplifier and then the output of that amplifier drives the output load.
That's probably not a problem, but the external source has to be regulated itself, which for your circuit could be a problem.  More about that later.

[3]
The input circuit, ideally, should really be a buck switching regulator that automatically adjusts to the minimum requirements of the input of the LM317.  If the so-called drop out voltage was 2.5 volts for example, then the output of the buck should be 2.5 volts plus whatever the output voltage has to be.  This isn't too hard to do, but the buck circuit front end is more important because that lowers power dissipation by a very large amount.  It means the circuit can go from instead of 30 watts of dissipation for a given load, down to 3 watts of dissipation for that same load.  That's a lot and that is why switching regulators make good front ends for linear regulators.
So this means drop the linear front end and go with a buck front end.  If you can't do that, then you're going to be stuck with pure linear operation which sometimes will dissipate a large amount of power and require a very large heat sink.

Now a little more about the external voltage source.
Because you will be using PWM, you might have to incorporate some feedback so that you can get the PWM to output the right source voltage so you can get decent accuracy on the output voltage setting.  This means sensing the output or the filtered PWM signal and adjusting the pulse width accordingly.  This is because the LM317 can no longer regulate the output voltage like it does when only resistors connect to the ADJ terminal.  That means you have to do all the regulation with a separate feedback system.  This brings in the question of if an LM317 is really needed at all if you have to incorporate your own feedback system anyway and why put up with the unusually large voltage drop of the LM317 that comes with it.  With a power transistor and some feedback you can get the voltage drop down to at least 1v or even less.

Presumably, the PWM will come from a micro processor or similar running off a 5V supply.  So the stability of the PWM control and the reference voltage to the 317 should be pretty much as stable as whatever supply is feeding the micro.
And you still get the benefit of the line and load regulation of the 317.  Not lab quality, but not bad.  You will definitely want to calibrate the relationship between PWM and output volts, or like you suggest, measure the output and trim the pwm.  That will be slow though, so probably only good for a fine trim.
 
The following users thanked this post: EthannCraftt

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19684
  • Country: gb
  • 0999
Re: LM317 Based Digitally Controlled Power Supply
« Reply #16 on: April 22, 2024, 08:57:12 pm »
The diode isn’t required.  I put it in there to make it easier to understand.  When not in current regulation, the op amp output is at zero volts, so eliminating the diode and connecting the 2k resistor to the op amp output works just as well.   I mentioned that above. 
The results are different because I changed some resistors to make the current scaling different.  It is now about 1 amp full scale.
Oh, I see now. The op-amp's negative rail is 0V, so it just connects the 2k to 0V. That will work fine.

Another thing to note about these ideas is in addition to the 1.25V minimum LM317 voltage, there's also the saturation voltage of the op-amp.
 
The following users thanked this post: EthannCraftt

Offline TerrySt

  • Regular Contributor
  • *
  • Posts: 73
  • Country: us
Re: LM317 Based Digitally Controlled Power Supply
« Reply #17 on: April 22, 2024, 09:24:24 pm »
The diode isn’t required.  I put it in there to make it easier to understand.  When not in current regulation, the op amp output is at zero volts, so eliminating the diode and connecting the 2k resistor to the op amp output works just as well.   I mentioned that above. 
The results are different because I changed some resistors to make the current scaling different.  It is now about 1 amp full scale.
Oh, I see now. The op-amp's negative rail is 0V, so it just connects the 2k to 0V. That will work fine.

Another thing to note about these ideas is in addition to the 1.25V minimum LM317 voltage, there's also the saturation voltage of the op-amp.

Yep.  These are rail to rail op amps, but that is a term that is loosely defined.   In this case, it looks like it should get you within 20mV or so of the rails.
adding the diode, does get you that 20mV closer to zero if that's important.
 
The following users thanked this post: EthannCraftt

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19684
  • Country: gb
  • 0999
Re: LM317 Based Digitally Controlled Power Supply
« Reply #18 on: April 23, 2024, 06:47:34 pm »
I'd just ditch the LM317 and replace it with an emitter follower. I chose the BD437 because it has a high enough hFE to be driven by the LM358, even with a collector current of 1A.

It's designed so neither op-amp gets driven into saturation, which can take awhile to recover from. D2, R8 & R9 form another feedback loop when it's in current mode. This limits the voltage over-shoot, during recovery.

The peak current due to the speed limitation of the current op-amp is limited by D3 and D4 which clamp the base voltage to around 1.4V above the output.
« Last Edit: April 23, 2024, 06:49:07 pm by Zero999 »
 
The following users thanked this post: EthannCraftt

Offline MrAl

  • Super Contributor
  • ***
  • Posts: 1521
Re: LM317 Based Digitally Controlled Power Supply
« Reply #19 on: April 24, 2024, 01:23:38 pm »
Hello. I'm looking to construct a digitally controlled power supply. I have a circuit drawn up with a PWM voltage control circuit of my own design, and the current control design that Dave drew on his PSU series hooked up to the input of the second LM317.

After being plugged into a circuit simulator, it seems to have really weird behavior even though both circuits work great on their own. Any help??? Schematic below.

(The +5v inputs are where the PWM will be inputted. An RC filter will be added in the final design. The 1ohm resistor to the far right will also be removed.)

Hello,

A couple points to be made here.

[1]
That 220 Ohm resistor is not considered to be low enough anymore, 120 Ohms is the preferred value now.  That's to load the LM317 with at least 10ma.

[2]
When you drive the ADJ terminal directly with a voltage source, you essentially give up the voltage regulation offered from the LM317.  The external voltage source appears in series with the 1.25 volt reference source internal to the LM317.  That means that your external voltage source is now a large part of the reference source, which means it must be well regulated if the output is to be well regulated.  Another side issue is that the LM317 now becomes just a driver, similar to an amplifier with a gain of 1 with an added reference of around 1.25v, and with the external voltage source Vs the reference becomes Vs+1.25v, and that is 'amplified' by the gain of 1 amplifier and then the output of that amplifier drives the output load.
That's probably not a problem, but the external source has to be regulated itself, which for your circuit could be a problem.  More about that later.

[3]
The input circuit, ideally, should really be a buck switching regulator that automatically adjusts to the minimum requirements of the input of the LM317.  If the so-called drop out voltage was 2.5 volts for example, then the output of the buck should be 2.5 volts plus whatever the output voltage has to be.  This isn't too hard to do, but the buck circuit front end is more important because that lowers power dissipation by a very large amount.  It means the circuit can go from instead of 30 watts of dissipation for a given load, down to 3 watts of dissipation for that same load.  That's a lot and that is why switching regulators make good front ends for linear regulators.
So this means drop the linear front end and go with a buck front end.  If you can't do that, then you're going to be stuck with pure linear operation which sometimes will dissipate a large amount of power and require a very large heat sink.

Now a little more about the external voltage source.
Because you will be using PWM, you might have to incorporate some feedback so that you can get the PWM to output the right source voltage so you can get decent accuracy on the output voltage setting.  This means sensing the output or the filtered PWM signal and adjusting the pulse width accordingly.  This is because the LM317 can no longer regulate the output voltage like it does when only resistors connect to the ADJ terminal.  That means you have to do all the regulation with a separate feedback system.  This brings in the question of if an LM317 is really needed at all if you have to incorporate your own feedback system anyway and why put up with the unusually large voltage drop of the LM317 that comes with it.  With a power transistor and some feedback you can get the voltage drop down to at least 1v or even less.

Presumably, the PWM will come from a micro processor or similar running off a 5V supply.  So the stability of the PWM control and the reference voltage to the 317 should be pretty much as stable as whatever supply is feeding the micro.
And you still get the benefit of the line and load regulation of the 317.  Not lab quality, but not bad.  You will definitely want to calibrate the relationship between PWM and output volts, or like you suggest, measure the output and trim the pwm.  That will be slow though, so probably only good for a fine trim.


Hi there,

Actually I was referring to the accuracy of the set point of the voltage that would be controlling the LM317.  If the user wanted to output say 5 volts then they would have to apply about 3.75 volts to the ADJ pin.  If it was just 3.70 volts then the output would be 4.95 volts.  If the design could get that right though (3.75v) I don't think there would be any worry, but that could easily require feedback which brings in the issue of control stability into the picture.  If the designer wants to use feedback then it's going to be their responsibility to get it stable.  That means the uC will have to sample the output and make adjustments, and that means there will be a delay.

As far as regulating once the right voltage is actually applied, that may be ok but I have not looked into that in detail.
 
The following users thanked this post: TerrySt, EthannCraftt

Offline TerrySt

  • Regular Contributor
  • *
  • Posts: 73
  • Country: us
Re: LM317 Based Digitally Controlled Power Supply
« Reply #20 on: April 25, 2024, 01:19:58 am »
I'd just ditch the LM317 and replace it with an emitter follower. I chose the BD437 because it has a high enough hFE to be driven by the LM358, even with a collector current of 1A.

It's designed so neither op-amp gets driven into saturation, which can take awhile to recover from. D2, R8 & R9 form another feedback loop when it's in current mode. This limits the voltage over-shoot, during recovery.

The peak current due to the speed limitation of the current op-amp is limited by D3 and D4 which clamp the base voltage to around 1.4V above the output.
(Attachment Link)

That looks like a good approach.  Many ways to go about this for sure.  I like the way the voltage control sums with the current control.

I added models for 'real' op amps to my version and tweaked the component values to make it work with a range of output (load) capacitance (up to at least 10,000uF).
I'm posting the latest.  It could still use some fine tuning, but since the OP hasn't been back, probably no reason to carry this further.

Terry
 
The following users thanked this post: EthannCraftt

Offline TerrySt

  • Regular Contributor
  • *
  • Posts: 73
  • Country: us
Re: LM317 Based Digitally Controlled Power Supply
« Reply #21 on: April 25, 2024, 01:26:33 am »

Hi there,

Actually I was referring to the accuracy of the set point of the voltage that would be controlling the LM317.  If the user wanted to output say 5 volts then they would have to apply about 3.75 volts to the ADJ pin.  If it was just 3.70 volts then the output would be 4.95 volts.  If the design could get that right though (3.75v) I don't think there would be any worry, but that could easily require feedback which brings in the issue of control stability into the picture.  If the designer wants to use feedback then it's going to be their responsibility to get it stable.  That means the uC will have to sample the output and make adjustments, and that means there will be a delay.

As far as regulating once the right voltage is actually applied, that may be ok but I have not looked into that in detail.

Yep.  I hope the OP realizes the issue and has a plan to deal with it.

Terry
 
The following users thanked this post: EthannCraftt

Offline aliarifat794

  • Regular Contributor
  • *
  • !
  • Posts: 138
  • Country: bd
Re: LM317 Based Digitally Controlled Power Supply
« Reply #22 on: April 25, 2024, 04:22:09 pm »
Here is also an adjustable power supply design featuring LM317 and LM337. You can see it for further improvement. It uses two voltage regulators, an LM317 for positive voltage and an LM337 for negative voltage.
https://www.pcbway.com/project/shareproject/LM317_AND_LM337_ADJUSTABLE_POWER_SUPPLY_CIRCUIT_BOARD_904eaf4a.html
 
The following users thanked this post: EthannCraftt

Offline EthannCrafttTopic starter

  • Newbie
  • Posts: 2
  • Country: us
Re: LM317 Based Digitally Controlled Power Supply
« Reply #23 on: April 26, 2024, 02:25:23 am »
Thanks all for replying!! I got caught up in my high voltage work and was a little busy with that.

I'm not necessarily opposed to replacing the lm317 with discrete components, I just thought it would be a fun design challenge and a nice way to use the ones I had on hand ;D

I did plan on adding a feedback on the output to the microcontroller (and one across the 1ohm resistor from the current limiter circuit), I just didn't know how to integrate that into a digital schematic.

The main problem that I've noticed based on the replies was the fact that inputing a voltage puts the internal voltage refrence in series, and to be frank I doubt the accuracy of my own voltage input. How would I go about voltage regulation with PWM another way that doesn't have this issue? I couldn't figure it out with my tinkering in simulation software. Can it even be done while maintaining use of the LM317?

Again, I would be perfectly okay with changing out the voltage regulator with discrete circuitry, so long as it's accurate(ish). Thanks!
 

Offline MrAl

  • Super Contributor
  • ***
  • Posts: 1521
Re: LM317 Based Digitally Controlled Power Supply
« Reply #24 on: April 26, 2024, 01:41:03 pm »
Thanks all for replying!! I got caught up in my high voltage work and was a little busy with that.

I'm not necessarily opposed to replacing the lm317 with discrete components, I just thought it would be a fun design challenge and a nice way to use the ones I had on hand ;D

I did plan on adding a feedback on the output to the microcontroller (and one across the 1ohm resistor from the current limiter circuit), I just didn't know how to integrate that into a digital schematic.

The main problem that I've noticed based on the replies was the fact that inputing a voltage puts the internal voltage refrence in series, and to be frank I doubt the accuracy of my own voltage input. How would I go about voltage regulation with PWM another way that doesn't have this issue? I couldn't figure it out with my tinkering in simulation software. Can it even be done while maintaining use of the LM317?

Again, I would be perfectly okay with changing out the voltage regulator with discrete circuitry, so long as it's accurate(ish). Thanks!

Well it does make an interesting linear series pass power element as compared to a regular power transistor.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf