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.
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.)
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.
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.)
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)
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.
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 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.
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.
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)
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.
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
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!