Author Topic: LM324 Power Supply with variable voltage and current  (Read 71800 times)

0 Members and 2 Guests are viewing this topic.

Offline imo

  • Super Contributor
  • ***
  • Posts: 2771
  • Country: li
Re: LM324 Power Supply with variable voltage and current
« Reply #125 on: May 05, 2019, 08:56:04 am »
Have you checked with Fast CC and Slow CC engaged?? With larger currents?
 

Offline mike_mike

  • Frequent Contributor
  • **
  • Posts: 700
  • Country: ro
Re: LM324 Power Supply with variable voltage and current
« Reply #126 on: May 05, 2019, 09:11:46 am »
The output using the PSU shorter, with 0R resistance in the D of the mosfet and 820R resistance across D-S of the mosfet. The PSU output voltage was 26.1V, and the current was set to max (3A).
1. With 1nF, 10K: 701.jpg
2. With 100nF, 100R: 702, 703.jpg

Please have a look at the screenshots and tell me what you think.

I am almost sure that there is some oscillation, on the "lower" part of the waveform.
« Last Edit: May 05, 2019, 09:29:40 am by mike_mike »
 

Offline imo

  • Super Contributor
  • ***
  • Posts: 2771
  • Country: li
Re: LM324 Power Supply with variable voltage and current
« Reply #127 on: May 05, 2019, 10:26:03 am »
It looks like the Slow CC oscillates.
Try to replace the 100nF ser 100k CC compensation with for example 1nF ser 10k, etc.
 

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 9200
  • Country: de
Re: LM324 Power Supply with variable voltage and current
« Reply #128 on: May 05, 2019, 10:29:06 am »
A first step against the oscillations is some capacitance (e.g. 10-100 µF electrolytic)  at the output of the supply.

The low phase would be with the CC mode active.

PS. for the CC regulation the 0.1 nF cap at the pot can be a problem.
« Last Edit: May 05, 2019, 10:32:00 am by Kleinstein »
 
The following users thanked this post: mike_mike

Offline mike_mike

  • Frequent Contributor
  • **
  • Posts: 700
  • Country: ro
Re: LM324 Power Supply with variable voltage and current
« Reply #129 on: May 05, 2019, 10:44:38 am »
@Kleinstein I already have 10uF/63V electrolytic and 1uF/63V non-polarised at the output.
@imo The results are the following, and the test condition are same as above (26V, 3A), and 1nF in series with 10k.

Please have a look at the screenshots and tell me what you think.
« Last Edit: May 05, 2019, 10:46:15 am by mike_mike »
 

Offline imo

  • Super Contributor
  • ***
  • Posts: 2771
  • Country: li
Re: LM324 Power Supply with variable voltage and current
« Reply #130 on: May 05, 2019, 10:48:07 am »
What do you think?  ;)
 

Offline mike_mike

  • Frequent Contributor
  • **
  • Posts: 700
  • Country: ro
Re: LM324 Power Supply with variable voltage and current
« Reply #131 on: May 05, 2019, 10:49:58 am »
I think that is good, but I don't know if it needs any other modifications.

Please correct me if I am wrong.
 

Offline imo

  • Super Contributor
  • ***
  • Posts: 2771
  • Country: li
Re: LM324 Power Supply with variable voltage and current
« Reply #132 on: May 05, 2019, 10:57:18 am »
As has been said few times here an approach could be to find the CC and CV compensation where it just starts to oscillate and then double or triple the compensation capacitors..
 

Offline mike_mike

  • Frequent Contributor
  • **
  • Posts: 700
  • Country: ro
Re: LM324 Power Supply with variable voltage and current
« Reply #133 on: May 05, 2019, 11:03:03 am »
There is something I do not understand...
I reduced 100nF in series with 100k to 1nF and 10k and it stopped oscillating... Now I have to increase it, for example to 47nF and 10k and see if it oscillate ? And then to reduce the capacitor to half of the capacitance ?
 

Offline imo

  • Super Contributor
  • ***
  • Posts: 2771
  • Country: li
Re: LM324 Power Supply with variable voltage and current
« Reply #134 on: May 05, 2019, 11:10:00 am »
The 100k resistors in the compensations are craps, imho.
Start with 10k+capacitor_X.
The X could be 330pF to 2n2 usually, but it depends on other parameters too..

For example while tweaking the CC put there 10k plus

100pF oscillates
150pF oscillates
220pF oscillates
270pF does not oscillate
330pF does not oscillate
470pF does not oscillate.

Doublecheck at various Slow CC settings.

Take 10k+820pF or 1nF for the final CC circuit.

The same for CV.
« Last Edit: May 05, 2019, 11:44:16 am by imo »
 
The following users thanked this post: mike_mike

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 9200
  • Country: de
Re: LM324 Power Supply with variable voltage and current
« Reply #135 on: May 05, 2019, 12:00:08 pm »
The rule of thumb adjustment of the compensation is to reduce the capacitance so far that it starts to oscillate and than double from that limit. For the series resistor there are also crude rules for the adjustment, based on the frequency of the oscillation. These rules are the application of the Ziegler Nichols method known from regular control theory. The current regulator is a simple PI type. For faster reaction one might have to use PID.
Different from normal control theory one here looks for stability even with a variable system due to possible changes in the load, especially possibly added extra load capacitance, that can make things difficult.

In the shown circuit the CC regulation uses the CV part as an inner loop. So one should adjust the CV mode first. Changes to the CV mode loop would also effect the CC mode, but not the other way around. A reasonable fast CV mode is kind of needed to make the CC mode work well.
« Last Edit: May 05, 2019, 12:02:27 pm by Kleinstein »
 
The following users thanked this post: mike_mike

Offline mike_mike

  • Frequent Contributor
  • **
  • Posts: 700
  • Country: ro
Re: LM324 Power Supply with variable voltage and current
« Reply #136 on: May 05, 2019, 12:02:51 pm »
I checked with 1nF and 10k for both CV and slow CC.
I found that the power supply oscillates.
I tried the following:

CV 10k+1nF
CC 10k+1nF
it oscillates

CV 4k7+1nF
CC 10k+1nF
it oscillates

CV 10k+22nF
CC 10k+1nF
it oscillates

CV 10k+100nF
CC 10k+1nF
it oscillates

CV 100R+100nF
CC 10k+1nF
it does not oscillate

The tests were made using the psu shorter at max output current from the supply, with the load resistor = 0R.
« Last Edit: May 05, 2019, 12:20:13 pm by mike_mike »
 

Offline mike_mike

  • Frequent Contributor
  • **
  • Posts: 700
  • Country: ro
Re: LM324 Power Supply with variable voltage and current
« Reply #137 on: May 05, 2019, 03:11:06 pm »
I tried to make a simulation in LTSpice, but it seems that there are some errors that I cannot solve...
I am attaching the simulation file.
 

Offline imo

  • Super Contributor
  • ***
  • Posts: 2771
  • Country: li
Re: LM324 Power Supply with variable voltage and current
« Reply #138 on: May 05, 2019, 03:30:35 pm »
Works.. Modded..
 
The following users thanked this post: mike_mike

Offline imo

  • Super Contributor
  • ***
  • Posts: 2771
  • Country: li
Re: LM324 Power Supply with variable voltage and current
« Reply #139 on: May 05, 2019, 03:39:40 pm »
Try to add 1k into the Q1's emitter.
Works with 1nF ser 10k with both CV and CC compensation.
Sim only..
 
The following users thanked this post: mike_mike

Offline imo

  • Super Contributor
  • ***
  • Posts: 2771
  • Country: li
Re: LM324 Power Supply with variable voltage and current
« Reply #140 on: May 05, 2019, 03:48:27 pm »
C2 and C4 are critical too. With larger values, like 10nF, it oscillates.
So stay with <1nF there.

I think the 2n2+10k in CV is minimum, also try with larger output capacitors (ie >47uF 0.1ohm ESR) what happens.
« Last Edit: May 05, 2019, 03:56:26 pm by imo »
 
The following users thanked this post: mike_mike

Offline mike_mike

  • Frequent Contributor
  • **
  • Posts: 700
  • Country: ro
Re: LM324 Power Supply with variable voltage and current
« Reply #141 on: May 05, 2019, 04:21:42 pm »
I checked again, and I found something "strange" the waveform on the oscilloscope looks good, but the led (red) does not lit.
I used 10k and 1nF for both CV and CC.
Initially the led was flashing rapidly, now it does not lit. And when I connect the load, the voltage drops from 26V to about 0.7V.
If I remove the 1k emitter resistor and replace it with a wire, then it works normally, but it oscillates.
I also tried with 10k + 10nF in CV but it also oscillates.

Later Edit: I tested with 10uF in parallel with 33uF on the output, and with 10k + 1nF for both CV and CC, and I got the attached screenshots, with the PSU shorter, with 0R load resistor.
1. Output at about 12V: 0725.jpg
2. Output at about 26V: 0726.jpg
« Last Edit: May 05, 2019, 04:48:16 pm by mike_mike »
 

Offline imo

  • Super Contributor
  • ***
  • Posts: 2771
  • Country: li
Re: LM324 Power Supply with variable voltage and current
« Reply #142 on: May 05, 2019, 05:00:01 pm »
Your CC LED indication is full of errors.
Look at my mod below.
Basically it works now.

PS: LTspice is a great tool. Try to get your circuits working before you mess with hardware..

PS: Do not copy circuits from WEB blindly. Always try to analyze what it does and whether the parts or their values are OK or not...
« Last Edit: May 05, 2019, 05:12:43 pm by imo »
 
The following users thanked this post: mike_mike

Offline mike_mike

  • Frequent Contributor
  • **
  • Posts: 700
  • Country: ro
Re: LM324 Power Supply with variable voltage and current
« Reply #143 on: May 05, 2019, 05:25:16 pm »
I made the modifications, but if I use R4 (1k) in the Emitter of 2N5551, then the output voltage drops from 12V to 0.7V when I connect the load... I checked the circuit and it seems to be ok, i just connected that 1k resistor there and it does not work correctly anymore...

The schematic for the led is now good, I made the specified modifications and I checked and it corresponds with the schematic that I drew in Eagle.
 

Offline imo

  • Super Contributor
  • ***
  • Posts: 2771
  • Country: li
Re: LM324 Power Supply with variable voltage and current
« Reply #144 on: May 05, 2019, 05:50:50 pm »
Try to increase the R2 to 4k7-10k and use R4=1k.

I would even increase the R4 to 3k3 (the same as the one in collector) thus decrease the loop gain (helps with stability).
« Last Edit: May 05, 2019, 06:05:54 pm by imo »
 

Offline mike_mike

  • Frequent Contributor
  • **
  • Posts: 700
  • Country: ro
Re: LM324 Power Supply with variable voltage and current
« Reply #145 on: May 05, 2019, 06:56:40 pm »
I will do that and I will come back with the results.
 

Offline mike_mike

  • Frequent Contributor
  • **
  • Posts: 700
  • Country: ro
Re: LM324 Power Supply with variable voltage and current
« Reply #146 on: May 06, 2019, 07:02:14 pm »
I replaced R2 by 10k and I replaced R4 by 3k3.
I checked with 1.6A load at 12V and 26V and it works.
I will check with the oscilloscope and with the PSU shorter tomorrow.
 

Offline mike_mike

  • Frequent Contributor
  • **
  • Posts: 700
  • Country: ro
Re: LM324 Power Supply with variable voltage and current
« Reply #147 on: May 07, 2019, 06:38:14 am »
In the last simulation, there was used 470pF for both C2 and C4 (the capacitors on the potentiometers). Initially in the schematic those capacitors had a value of 0.1n each.
You also said that increasing C2 and C4 could make the PSU to oscillate.
It is ok to use 470p for C2 and C4 ? Or it should be better with 100pF ?
 

Offline imo

  • Super Contributor
  • ***
  • Posts: 2771
  • Country: li
Re: LM324 Power Supply with variable voltage and current
« Reply #148 on: May 07, 2019, 07:03:22 am »
Try simulate with your latest schematics. I do not know what changes you did.
My simulation with all the changes (R4=3k3, R2=10k, 1n+10k in comp CC an CV) starts to oscillate with C4 and C2 around 8n.
So 470pF-1n would be safe.
« Last Edit: May 07, 2019, 07:06:08 am by imo »
 

Offline mike_mike

  • Frequent Contributor
  • **
  • Posts: 700
  • Country: ro
Re: LM324 Power Supply with variable voltage and current
« Reply #149 on: May 07, 2019, 11:10:19 am »
I tested with the following components: CV 4n7 and 10k, CC 1n and 10k, R4=3k3, R2=10k. The simulation in LTSpice was good.
The results are:
1. The fast CC (measured on the 0.22R resistor):
a. with output voltage at 24.6V: 0730.jpg
b. with output voltage at 12.5V: 0735.jpg
c. with output voltage at 3.1V: 0740.jpg

2. The output with PSU shorter and 0R load resistance:
a. with output voltage at 24.6V and max current: 0734.jpg
b. with output voltage at 24.6V and middle current: 0732.jpg
c. with output voltage at 24.6V and almost min current: 0733.jpg

d. with output voltage at 12.5V and max current: 0737.jpg

e. with output voltage at 3.1V and max current: 0742.jpg

I think that at 1.c there is some oscillation.
Please have a look at the screenshots and tell me what you think.

Later Edit: I think I found a problem... I will try to solve it.
« Last Edit: May 07, 2019, 11:36:09 am by mike_mike »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf