Author Topic: LM317 digital control  (Read 26116 times)

0 Members and 1 Guest are viewing this topic.

Offline MaobuffTopic starter

  • Contributor
  • Posts: 22
  • Country: ua
Re: LM317 digital control
« Reply #25 on: May 20, 2016, 06:32:32 pm »
Don't forget minimum load requirements (the circuit I posted covers that) , capacitors and protections. read very carefully the datasheet.
I don't think you need the op amp as a buffer because the adj pin is going to and internal op amp.
just because you got it working without minimum load does not mean it is stable, especially if this is your bench power supply you want to build it as stable as possible.
Yea but later I can use op amp as an amplifier to adjust output range of supply. Im planning to use MCP4821(DAC) which have output range of 0 to 2.048V, then i just amplify it to get a range of 0-10.75V (~5.25 gain). Which give me a output voltage 1.25-12V.
I put a 750Ohm dummy load in my test.

BTW can I use this circuit in my power supply for constant load?
« Last Edit: May 20, 2016, 06:35:17 pm by Maobuff »
 

Offline ZeTeX

  • Frequent Contributor
  • **
  • !
  • Posts: 610
  • Country: il
  • When in doubt, add more flux.
Re: LM317 digital control
« Reply #26 on: May 20, 2016, 08:41:23 pm »
Don't forget minimum load requirements (the circuit I posted covers that) , capacitors and protections. read very carefully the datasheet.
I don't think you need the op amp as a buffer because the adj pin is going to and internal op amp.
just because you got it working without minimum load does not mean it is stable, especially if this is your bench power supply you want to build it as stable as possible.
Yea but later I can use op amp as an amplifier to adjust output range of supply. Im planning to use MCP4821(DAC) which have output range of 0 to 2.048V, then i just amplify it to get a range of 0-10.75V (~5.25 gain). Which give me a output voltage 1.25-12V.
I put a 750Ohm dummy load in my test.

BTW can I use this circuit in my power supply for constant load?
Yes, you can use this circuit with slight modification to test a variable load.
C1 + R15 Is there for compensation, without them the circuit might oscillate.
https://www.eevblog.com/forum/projects/yes-another-dummy-load-%29/?action=dlattach;attach=59947;image
 

Offline MaobuffTopic starter

  • Contributor
  • Posts: 22
  • Country: ua
Re: LM317 digital control
« Reply #27 on: May 21, 2016, 08:47:43 am »
This is my finnal design. IC is current control, VC is voltage control, I is measuring current.
What about heat generating from Q1 and Q2. I think for Q1 it is 1.2Ohm * Icoil^2 which is around 0.012watts.And for Q2 its (Vmax-1V)*I=(12-1)*0.01=0.11watts. From datasheet i get junction to ambient which is 150K/W. So Q1 get 1.8K hotter that ambient and 16.5K for Q2. Is it true?
 

Offline MaobuffTopic starter

  • Contributor
  • Posts: 22
  • Country: ua
Re: LM317 digital control
« Reply #28 on: May 21, 2016, 12:16:07 pm »
And here is my controller board
 

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 15148
  • Country: de
Re: LM317 digital control
« Reply #29 on: May 22, 2016, 09:03:29 am »
The analog part has a few problems: the OP does not like a 100 nF cap at it's output. So some additions are needed here, to alow the OP to drive such a capacitive load.

Turning of the supply to the regulator in case of over-current is risky. A inductive load might give quite some kickback and thus damage the regulator. So there should be some over-voltage protection, at least a diode from the input to main filter cap.

The way the current is measured is also not that great: the resistive divider introduces quite some error and reduces the already small voltage at the shunt. So errors are rather large.  To prevent the overcurrent turn off part to activate directly when turning it on, there likely need some filtering caps / delay. With a relay you also need to have this part to be latching - otherwise the relay will immediately turn on again.

The µC might need a crystal to reliably work with the UART. With some tweaking it works without if the temperature range is not to large. The 2 DACs would need separate latching / CS signals to give different outputs.
 

Offline ZeTeX

  • Frequent Contributor
  • **
  • !
  • Posts: 610
  • Country: il
  • When in doubt, add more flux.
Re: LM317 digital control
« Reply #30 on: May 22, 2016, 12:35:52 pm »
I really recommend you to build the circuit in ltspice and test test your control loop, I bet it will oscillate a lot.
just wondering, how are you limiting the current? I don't know a lot about logic gates so as and interest I would like to understand what exactly are you pulling down to limit the current.
(I might be wrong but it seems like the relay you are switching on with Q1 does nothing?)

 

Offline MaobuffTopic starter

  • Contributor
  • Posts: 22
  • Country: ua
Re: LM317 digital control
« Reply #31 on: May 22, 2016, 01:49:49 pm »
just wondering, how are you limiting the current? I don't know a lot about logic gates so as and interest I would like to understand what exactly are you pulling down to limit the current.
(I might be wrong but it seems like the relay you are switching on with Q1 does nothing?)
R1-10 are current sense resistors, IC2A is diff amp that give voltage proportional to current (1V=1A), IC2B is comparator which compare voltage drop in those resistors and set one by DAC. If powered circuit consume more current that was set  output of IC2B is high, which feed in CLK pin of flipflop. When CLK changes from LOW to HIGH value from D is pushed in to Q. Than its turning on transistor and relay disconect reguator. To turn on back relay, i need reset flipflop(basically put LOW on to CLP). Swtch part of relay is K1 near LM317.
 

Offline MaobuffTopic starter

  • Contributor
  • Posts: 22
  • Country: ua
Re: LM317 digital control
« Reply #32 on: May 22, 2016, 02:00:58 pm »
The analog part has a few problems: the OP does not like a 100 nF cap at it's output. So some additions are needed here, to alow the OP to drive such a capacitive load.

Turning of the supply to the regulator in case of over-current is risky. A inductive load might give quite some kickback and thus damage the regulator. So there should be some over-voltage protection, at least a diode from the input to main filter cap.

The way the current is measured is also not that great: the resistive divider introduces quite some error and reduces the already small voltage at the shunt. So errors are rather large.  To prevent the overcurrent turn off part to activate directly when turning it on, there likely need some filtering caps / delay. With a relay you also need to have this part to be latching - otherwise the relay will immediately turn on again.

The µC might need a crystal to reliably work with the UART. With some tweaking it works without if the temperature range is not to large. The 2 DACs would need separate latching / CS signals to give different outputs.
Chip select pins are separate, one have IC name and other is VC. And yea its mine mistake to join latch of both dacs together. i know about current measuring error. I can minimize it by using 0.1% resistors. I will add crystal to my design. I will reduce or remove cap from adj pin of LM317, Thanks.
 

Offline ZeTeX

  • Frequent Contributor
  • **
  • !
  • Posts: 610
  • Country: il
  • When in doubt, add more flux.
Re: LM317 digital control
« Reply #33 on: May 22, 2016, 02:02:23 pm »
just wondering, how are you limiting the current? I don't know a lot about logic gates so as and interest I would like to understand what exactly are you pulling down to limit the current.
(I might be wrong but it seems like the relay you are switching on with Q1 does nothing?)
R1-10 are current sense resistors, IC2A is diff amp that give voltage proportional to current (1V=1A), IC2B is comparator which compare voltage drop in those resistors and set one by DAC. If powered circuit consume more current that was set  output of IC2B is high, which feed in CLK pin of flipflop. When CLK changes from LOW to HIGH value from D is pushed in to Q. Than its turning on transistor and relay disconect reguator. To turn on back relay, i need reset flipflop(basically put LOW on to CLP). Swtch part of relay is K1 near LM317.
So basically you just disconnect the power to the LM317? I dont think it is that good, the caps need to discharge and the regulator need to turn on \ off if you have something that gets current limited in a very fast pulses. I will test it in ltspice
 

Offline MaobuffTopic starter

  • Contributor
  • Posts: 22
  • Country: ua
Re: LM317 digital control
« Reply #34 on: May 22, 2016, 02:05:53 pm »
Turning of the supply to the regulator in case of over-current is risky. A inductive load might give quite some kickback and thus damage the regulator. So there should be some over-voltage protection, at least a diode from the input to main filter cap.
Can i move relay to output of supply?

So basically you just disconnect the power to the LM317? I dont think it is that good, the caps need to discharge and the regulator need to turn on \ off if you have something that gets current limited in a very fast pulses. I will test it in ltspice
Yes, that why im thinking of moving relay to output
 

Offline ZeTeX

  • Frequent Contributor
  • **
  • !
  • Posts: 610
  • Country: il
  • When in doubt, add more flux.
Re: LM317 digital control
« Reply #35 on: May 22, 2016, 02:22:20 pm »
Turning of the supply to the regulator in case of over-current is risky. A inductive load might give quite some kickback and thus damage the regulator. So there should be some over-voltage protection, at least a diode from the input to main filter cap.
Can i move relay to output of supply?

So basically you just disconnect the power to the LM317? I dont think it is that good, the caps need to discharge and the regulator need to turn on \ off if you have something that gets current limited in a very fast pulses. I will test it in ltspice
Yes, that why im thinking of moving relay to output
relay for current limiting is very slow, when I build a circuit using the LT317 I got the current limiting 300us to start limiting.
(the circuit needs to be redesigned, but you can get the idea).
« Last Edit: May 22, 2016, 02:30:41 pm by ZeTeX »
 

Offline MaobuffTopic starter

  • Contributor
  • Posts: 22
  • Country: ua
Re: LM317 digital control
« Reply #36 on: May 22, 2016, 03:24:32 pm »
relay for current limiting is very slow, when I build a circuit using the LT317 I got the current limiting 300us to start limiting.
(the circuit needs to be redesigned, but you can get the idea).
Using one LM317 for CC and CV is not a good solution, its lowing voltage to lower current, but what if i short wires? Its gonna drop voltage to minimum (1.25) but resistance is low enough to consume more current that I set with CC part of circuit. And relay speed is fine.
 

Offline ZeTeX

  • Frequent Contributor
  • **
  • !
  • Posts: 610
  • Country: il
  • When in doubt, add more flux.
Re: LM317 digital control
« Reply #37 on: May 22, 2016, 03:41:31 pm »
relay for current limiting is very slow, when I build a circuit using the LT317 I got the current limiting 300us to start limiting.
(the circuit needs to be redesigned, but you can get the idea).
Using one LM317 for CC and CV is not a good solution, its lowing voltage to lower current, but what if i short wires? Its gonna drop voltage to minimum (1.25) but resistance is low enough to consume more current that I set with CC part of circuit. And relay speed is fine.
no no no, its gonna drop the voltage to 0V because I'm using negative supply. Its a closed loop feedback, the op amp is going to do whatever it has to do to get 0V output.
relay is too slow for current limiting for sure.
 

Offline MaobuffTopic starter

  • Contributor
  • Posts: 22
  • Country: ua
Re: LM317 digital control
« Reply #38 on: May 22, 2016, 03:52:58 pm »
no no no, its gonna drop the voltage to 0V because I'm using negative supply. Its a closed loop feedback, the op amp is going to do whatever it has to do to get 0V output.
relay is too slow for current limiting for sure.
Why relay is slow? In my design if load consume more current its disconnect load from PSU.To connect it back i need to reset flipflop manually (or with help of MCU).
 

Offline ZeTeX

  • Frequent Contributor
  • **
  • !
  • Posts: 610
  • Country: il
  • When in doubt, add more flux.
Re: LM317 digital control
« Reply #39 on: May 22, 2016, 05:44:11 pm »
no no no, its gonna drop the voltage to 0V because I'm using negative supply. Its a closed loop feedback, the op amp is going to do whatever it has to do to get 0V output.
relay is too slow for current limiting for sure.
Why relay is slow? In my design if load consume more current its disconnect load from PSU.To connect it back i need to reset flipflop manually (or with help of MCU).
so lets say your circuit tell the relay to switch off or switch on.
Relay takes some time to switch off or on because the mechanical pin has to move a couple of mm in the air, it might sound like really fast, but really if its over 1ms its too much. not to mention that a relay is kinda loud and you will probably hear it every time your PSU will go into cc mode and you will want to destroy it.

Also you circuit will oscillate badly, because when lets say your load want to draw 3A while your CC set to 1.5A so the relay is gonna disconnect the load, so the cc circuit will see 0A doe gonna switch the relay on, so the current is going to shoot up to 3A and then over and over again, with NPN or MOSFET his happens much faster that it is easy to stabilize, with a relay.. not really.
« Last Edit: May 22, 2016, 05:48:23 pm by ZeTeX »
 

Offline MaobuffTopic starter

  • Contributor
  • Posts: 22
  • Country: ua
Re: LM317 digital control
« Reply #40 on: May 22, 2016, 06:13:45 pm »
no no no, its gonna drop the voltage to 0V because I'm using negative supply. Its a closed loop feedback, the op amp is going to do whatever it has to do to get 0V output.
relay is too slow for current limiting for sure.
Why relay is slow? In my design if load consume more current its disconnect load from PSU.To connect it back i need to reset flipflop manually (or with help of MCU).
so lets say your circuit tell the relay to switch off or switch on.
Relay takes some time to switch off or on because the mechanical pin has to move a couple of mm in the air, it might sound like really fast, but really if its over 1ms its too much. not to mention that a relay is kinda loud and you will probably hear it every time your PSU will go into cc mode and you will want to destroy it.

Also you circuit will oscillate badly, because when lets say your load want to draw 3A while your CC set to 1.5A so the relay is gonna disconnect the load, so the cc circuit will see 0A doe gonna switch the relay on, so the current is going to shoot up to 3A and then over and over again, with NPN or MOSFET his happens much faster that it is easy to stabilize, with a relay.. not really.
Sorry but you dont understand how flipflop works, if load draw more than I set its turn on relay and disconects output, and ONLY ONE WAY to connect it is to reset flipflop and turn relay off. Its acts like a RCD(Residual-current device).
 

Offline ZeTeX

  • Frequent Contributor
  • **
  • !
  • Posts: 610
  • Country: il
  • When in doubt, add more flux.
Re: LM317 digital control
« Reply #41 on: May 22, 2016, 06:29:29 pm »
no no no, its gonna drop the voltage to 0V because I'm using negative supply. Its a closed loop feedback, the op amp is going to do whatever it has to do to get 0V output.
relay is too slow for current limiting for sure.
Why relay is slow? In my design if load consume more current its disconnect load from PSU.To connect it back i need to reset flipflop manually (or with help of MCU).
so lets say your circuit tell the relay to switch off or switch on.
Relay takes some time to switch off or on because the mechanical pin has to move a couple of mm in the air, it might sound like really fast, but really if its over 1ms its too much. not to mention that a relay is kinda loud and you will probably hear it every time your PSU will go into cc mode and you will want to destroy it.

Also you circuit will oscillate badly, because when lets say your load want to draw 3A while your CC set to 1.5A so the relay is gonna disconnect the load, so the cc circuit will see 0A doe gonna switch the relay on, so the current is going to shoot up to 3A and then over and over again, with NPN or MOSFET his happens much faster that it is easy to stabilize, with a relay.. not really.
Sorry but you dont understand how flipflop works, if load draw more than I set its turn on relay and disconects output, and ONLY ONE WAY to connect it is to reset flipflop and turn relay off. Its acts like a RCD(Residual-current device).
That's great, but that does not change anything I said, so you are going to need to reset the relay, you want other loop \ micro controller to do that? that is just slower.
if you want your power supply to limit the current to any value then 0A you are going to need a feedback that maintenes this current, usually by an op amp controlling the the pass transistor, but if you have a relay that takes a couple of ms to switch you cc will be really, really slow.

So lets say that you want to maintain an CC of 1.5A, you relay will have to turn off and on very very very fast, or else you are going to have a very slow current limit, because until the relay switch on or off the current shoot up and the poor op amp cant do nothing because a slow relay is limting the speed

Best way is to simulate it or build your schematic and see the result. There is a reason no power supply ever in a world uses a relay to pull down or turn off the output. (its also much expensive then a MOSFET or NPN).


 

Offline MaobuffTopic starter

  • Contributor
  • Posts: 22
  • Country: ua
Re: LM317 digital control
« Reply #42 on: May 22, 2016, 06:39:53 pm »
So lets say that you want to maintain an CC of 1.5A, you relay will have to turn off and on very very very fast, or else you are going to have a very slow current limit, because until the relay switch on or off the current shoot up and the poor op amp cant do nothing because a slow relay is limting the speedr schematic and see the result. There is a reason no power supply ever in a world uses a relay to pull down or turn off the output. (its also much expensive then a MOSFET or NPN).
But i dont need a CC in my PSU, just overcurrent protection.

Best way is to simulate it or build your schematic and see the result. There is a reason no power supply ever in a world uses a relay to pull down or turn off the output. (its also much expensive then a MOSFET or NPN).
Relay make thinks little bit easy. And im currently using power supply with sama overcurrent protection.
 

Offline ZeTeX

  • Frequent Contributor
  • **
  • !
  • Posts: 610
  • Country: il
  • When in doubt, add more flux.
Re: LM317 digital control
« Reply #43 on: May 22, 2016, 06:50:16 pm »
So lets say that you want to maintain an CC of 1.5A, you relay will have to turn off and on very very very fast, or else you are going to have a very slow current limit, because until the relay switch on or off the current shoot up and the poor op amp cant do nothing because a slow relay is limting the speedr schematic and see the result. There is a reason no power supply ever in a world uses a relay to pull down or turn off the output. (its also much expensive then a MOSFET or NPN).
But i dont need a CC in my PSU, just overcurrent protection.

Best way is to simulate it or build your schematic and see the result. There is a reason no power supply ever in a world uses a relay to pull down or turn off the output. (its also much expensive then a MOSFET or NPN).
Relay make thinks little bit easy. And im currently using power supply with sama overcurrent protection.
if you only need overcurrent and not constant current then relay is fine, for a bench power supply I was pretty sure you are going to use constant current. anyway relay is fine then.
 

Offline Liv

  • Regular Contributor
  • *
  • Posts: 134
  • Country: by
Re: LM317 digital control
« Reply #44 on: May 22, 2016, 10:22:24 pm »
Using one LM317 for CC and CV is not a good solution

Using LM317 beyond its standard features is a bad idea. I recently made a PSU adjustable 0..±15 V and 0..+5 V based on LM317/337. The number of auxiliary parts was larger. In addition, it was necessary to add the supervisor scheme, since the power is turned off at the output there was a voltage surge. If you need a power supply with CC and CV modes, properly do it on discrete components. Here is a good example of a simple power supply with the processor control.
PSU PSL-3604 Pulse gen. PG-872 Freq. cnt. FC-510
 

Offline MaobuffTopic starter

  • Contributor
  • Posts: 22
  • Country: ua
Re: LM317 digital control
« Reply #45 on: May 23, 2016, 09:57:04 am »
Using LM317 beyond its standard features is a bad idea. I recently made a PSU adjustable 0..±15 V and 0..+5 V based on LM317/337. The number of auxiliary parts was larger. In addition, it was necessary to add the supervisor scheme, since the power is turned off at the output there was a voltage surge. If you need a power supply with CC and CV modes, properly do it on discrete components. Here is a good example of a simple power supply with the processor control.

Nice PSU there. Actually its ok to use lm317 as CC, there a circuit in datasheet. But its hard to control it digitally.
 

Offline ZeTeX

  • Frequent Contributor
  • **
  • !
  • Posts: 610
  • Country: il
  • When in doubt, add more flux.
Re: LM317 digital control
« Reply #46 on: May 23, 2016, 11:46:40 am »
Using LM317 beyond its standard features is a bad idea. I recently made a PSU adjustable 0..±15 V and 0..+5 V based on LM317/337. The number of auxiliary parts was larger. In addition, it was necessary to add the supervisor scheme, since the power is turned off at the output there was a voltage surge. If you need a power supply with CC and CV modes, properly do it on discrete components. Here is a good example of a simple power supply with the processor control.

Nice PSU there. Actually its ok to use lm317 as CC, there a circuit in datasheet. But its hard to control it digitally.
Using LM317 As constant current and other LM317 as CV is using it standard features, they give you a schematic with CC + CV in the datasheet.
 

Offline ZayneTech

  • Contributor
  • Posts: 20
  • Country: au
Re: LM317 digital control
« Reply #47 on: February 02, 2019, 10:02:52 pm »
If it ain't broke, don't fix it.
 

Offline RES

  • Regular Contributor
  • *
  • Posts: 109
  • Country: 00
Re: LM317 digital control
« Reply #48 on: February 04, 2019, 09:12:41 am »
Another idea.

Online Zero999

  • Super Contributor
  • ***
  • Posts: 20356
  • Country: gb
  • 0999
Re: LM317 digital control
« Reply #49 on: February 04, 2019, 12:02:33 pm »
Using LM317 beyond its standard features is a bad idea. I recently made a PSU adjustable 0..±15 V and 0..+5 V based on LM317/337. The number of auxiliary parts was larger. In addition, it was necessary to add the supervisor scheme, since the power is turned off at the output there was a voltage surge. If you need a power supply with CC and CV modes, properly do it on discrete components. Here is a good example of a simple power supply with the processor control.

Nice PSU there. Actually its ok to use lm317 as CC, there a circuit in datasheet. But its hard to control it digitally.
Using LM317 As constant current and other LM317 as CV is using it standard features, they give you a schematic with CC + CV in the datasheet.
Yes that works, but a big downside of using two LM317s in series is the huge drop-out voltage, as they both add together. The CC circuit will need the usual 3V of headroom plus 1.25V, giving 4.25V, plus the CV circuit requiring the usual 3V: a total of 7.25V!

http://www.circuitstoday.com/few-lm317-voltage-regulator-circuits
Check out this picture
The base resistors are missing.

It works better with MOSFETs.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf