EEVblog Electronics Community Forum

Electronics => Beginners => Topic started by: mike_mike on March 08, 2019, 04:17:50 pm

Title: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 08, 2019, 04:17:50 pm
Hello,
I have a few questions about the attached schematic of power supply.
1. Is the schematic functional ? If not, what are the mistakes in the schematic ?
2. Is the layout correct ? If not, how it can be improved ? The DRC does not return any error, but I am wondering about ground connection and other stuff like this...
3. Is the minimum output current really 0A ?
4. I will use R3=680R, R4=2K2, R7=12K, R11=120K, because I did not found the specified values at the local electronics shop. On the VT4 footprint I will solder the wires that go to the power transistors that will be on another PCB.
Here you can find the schematic image: https://imgur.com/REbW3Af

Thank you in advance.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: Kleinstein on March 08, 2019, 05:49:18 pm
The regulation circuit does not look good. Chances are it could oscillate and react rather slow.  The transistors VT2+VT3 add quite some nonlinear gain to the loop. With VT3 the output stage is more like current controlling and thus usually needs an accurate frequency compensation to get acceptable performance.

The way the current limit is done is also not good - the LM324 output level is not well defined when in saturation - so voltage regulation it would not be really temperature stable. Worst case, with the output voltage set to zero and a positive offset of OP1A the current limitation may not work as the voltage would only go down to the offset value.

So before thinking about the layout, one should get a working circuit. A simulation could be a good idea to get a check, as a lab supply is not such a simple circuit. Stability can be quite tricky with possible highly capacitive loads.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 08, 2019, 06:48:21 pm
Thank you for the reply.
Could you please recommend me a schematic wich is stable and have variable current (0-5A) and voltage (0-25 or 30V) and which can accept input voltage up to 45Vdc ?
I know that I can find on the internet lots of schematic, but I simply do not know wich of them are good...
Title: Re: LM324 Power Supply with variable voltage and current
Post by: Kleinstein on March 08, 2019, 07:02:19 pm
With up to 30 V and 5 A out, a simple linear regulator would produce up to some 180 W of heat worst case. At that power level it would really help, if there is some transformer tap switching or similar.

For 30 V DC out the right transformer would be more like 28 or 30 V.  Is there already a transformer in mind or at hand ?

For more than about 25 V, my personal favorite would be the floating regulator with a small 2 nd transformer / winding to supply the regulator and display. Here using a transformer with center tap could allow for a relatively simple tap "switching" in the electron way (more like a class H amplifier). For a 30 V output this would be something like 2x15 V AC.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 08, 2019, 10:18:54 pm
Yes, I have: 24V/160VA and 30V/250VA transformers which I could use for power supply.
I found the attached schematic. It is a good schematic ? I would like to build the 0-30V version.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: anbudroid on March 09, 2019, 06:57:44 am
can we input 12v SMPS as its input and also may I swap IRLZ44N instead of 2N3055. what happened if I do this
Title: Re: LM324 Power Supply with variable voltage and current
Post by: not1xor1 on March 09, 2019, 08:14:10 am
Yes, I have: 24V/160VA and 30V/250VA transformers which I could use for power supply.
I found the attached schematic. It is a good schematic ? I would like to build the 0-30V version.

at those power levels (approximately corresponding to usable 100W and 150W max out DC power) you would need a preregulator or multitap switching unless you want to further increase CO2 levels  :o

In past I posted an alternative schematic (https://www.eevblog.com/forum/projects/13-8v-20a-power-supply-looking-to-add-adjustable-current-limit/msg2156326/#msg2156326) (yet untested for lack of space-time, I've to get closer to the event horizon   :) ).

Here is another proof of concept (inspired by this circuit suggestion from 0999 (https://www.eevblog.com/forum/beginners/0-30v-0-3a-psu-audiogurus-version/msg2240139/#msg2240139)) . The drawbacks is that current reference needs to be buffered by an opamp and to get proper current regulation (i.e. with little dependence on output voltage) you would need 4 0.1% or better tolerance resistors).

(https://www.eevblog.com/forum/beginners/lm324-power-supply-with-variable-voltage-and-current/?action=dlattach;attach=671838;image)
Title: Re: LM324 Power Supply with variable voltage and current
Post by: Kleinstein on March 09, 2019, 10:04:06 am
Yes, I have: 24V/160VA and 30V/250VA transformers which I could use for power supply.
I found the attached schematic. It is a good schematic ? I would like to build the 0-30V version.

The circuit looks reasonable and might work. So it could be a good start for a simulation. It is a little similar to the common kit circuit that in principle might work but not with so much voltage. The circuit here adds an output stage with a voltage gain of 2. 

There are still a few slightly odd points, that might be done better / check in the simulation:
 The current through R22 is also flowing through the shunt. It should probably better go to the other side of the shunt.
 No need for R23: R12+R22 do the Job as well.
 The current regulation could be rather slow to react: the LM324 is not really fast and may take quite some time to get down from some 20 V back to zero. So an additional fast acting crude current limit would be a good idea.  It could also be a good idea to limit the voltage how high OP3 (current regulation) can go - no need to go beyond some 10 V.
 C3 is rather small compared to C4.
 The current regulation may not work in the initial phase before the negative supply comes up. 
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 13, 2019, 08:46:28 am
It is possible that the power transistors (2N3055 in the schematic at reply #4, but I used TIP35C in my project) to be destroyed if I make a short circuit on the output of the power supply ?
I am talking about the schematic at reply #4 and I am talking about the situation when I use a properly large heatsink for the power transistors...
Title: Re: LM324 Power Supply with variable voltage and current
Post by: Kleinstein on March 13, 2019, 03:54:54 pm
With a suddenen short from a high voltage there is a slight chance to damage the output transistor(s).  As the current limit takes some time to react  (the OP has to slew down from around 22 V to slightly below 0 and this can take some 50 µs for the LM324 alone), there can be quite some peak current. The compensation can add to this delay.

The circuit from post #4 has a high current gain and could thus go quite high (possibly 100 A) if the filter cap is low ESR.

Ideally one would have another fast acting current limit in one way of the other.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 13, 2019, 04:18:36 pm
What should I do to solve this problem ?
Sorry for bothering you and others with such problems but I searched the internet from top to bottom and I did not found a good power supply schematic. This year I built about 5 power supply each with different schematic and all of them had problems...
Title: Re: LM324 Power Supply with variable voltage and current
Post by: Kleinstein on March 13, 2019, 05:11:38 pm
To add a fast current limit one could add a current limit to T2: add a small resistor at the emitter and than take a small PNP transistor to take away the base current to T2. To use a smaller emitter resistor one might be able to use the middle of R4 for the base.
An alternative way could be a NPN transistor turning on with more than 0.6 V over the shunt and pulling down the base of T1.


A diode in parallel to R21 could speed up time for reaction with gross over-current. It could also help to have a slightly faster OP for IC1/3 and maybe IC1/4 - so maybe a TLE2022 for those 2.  The other 2 OPs could be still a LM358.

I would in addition do a simulation to check if the output stage is stable under all loads. If not, it might help to more the right side of R12 to the left side of R15 or similar - thus take the inner loop feedback from before the emitter resistor. This way the inner loop would have the emitter resistor as part of it's load and would be thus less sensitive to a highly capacitive load.

It would probably also help to have a protection to only enable the output if the negative supply is at at least - 3 V or so. Other wise there might be a peak during turn on.

Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 13, 2019, 05:30:36 pm
Can you please draw a schematic for the fast protection using a PNP transistor ?
1. I am attaching a schematic, but I think that it is not good ...
2. Is the second attached schematic better ? Does it solves the problems of the first schematic ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on March 13, 2019, 08:59:23 pm
I would make the Fast CC (current limit) this way (an example) - see below.
When the CV goes into CC (ie when shorting the output) there is usually 10-50us delay the information from the shunt resistor propagates to the pass transistors. During that time the pass transistors create a current pulse, 10-50us long (its duration depends on the opapms types used and on their compensation), pushing the high current into the load. The "fast current limit" limits it. Set the fast current limit to say 4.5A when the max "slow" limit is for example 4A.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 14, 2019, 05:57:50 am
@imo Please have a look at the attached schematic and tell me what you think. It is better to connect the collector of BC547 in the B of BD244 ? I think that there needs to be a resistor to limit the current through BC547. I used 0.18R resistor (rated at 5w) to limit the current at about 0.6V/0.18ohm=3.33A, while the maximum output current set from the potentiometer will be 3A.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 14, 2019, 09:18:51 am
I uploaded a new schematic.
Please have a look and tell me if the schematic is ok.

Thank you.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on March 14, 2019, 09:36:14 am
I uploaded a new schematic.
Please have a look and tell me if the schematic is ok.

Thank you.
If there is an overload, the protection transistor will drive T2 more and the whole output stage will latch up. I can't see a simple way of using the voltage drop across the sharing resistors for current limiting with that sort of output stage. It will work with a Darlington output stage, and where the drive current is limited to some safe low amount.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on March 14, 2019, 09:53:06 am
I would make it this way.

The FastCC transistor has to be with 1A max collector current one, as its Ice pulse could be several hundreds of mAmps (it depends on several factors).

The FastCC transistor fully opens itself when the voltage at those 0.16ohm resistor(s) (R13/14/15) will be around 0.7V, thus the Fast CC limit will be aprox 3x4.4Amp.

I would use higher 3055 emitter resistors, for example 0.33ohm, the Fast CC limit will be 3x2.2Amp=6.6Amp then, and so on.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on March 14, 2019, 11:27:20 am
And a simulation of Mike_Mike's FCC:

Code: [Select]
R1      Q1_3055_Ie    Q1+Q2+Q3
Ohm      Ampere       Ampere

0.1      4.73         14.19
0.16     4.54         13.62
0.22     3.94         11.82
0.33     3.14          9.42
0.47     2.50          7.50
0.56     2.20          6.60
0.68     1.90          5.70
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 14, 2019, 11:42:58 am
Thank you @imo.
If I want to use 4 or more 2N3055 or TIP35C transistors, the schematic will be the same (the schematic at FAST CC 2.PNG), only the number of the power transistors will increase ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on March 14, 2019, 11:48:31 am
Yes, with N pass transistors the total current will be N*3055_I(R1).

Mind the BD244 may limit the total current (it drives those N*3055 with N*3055_Ibase, which is for example 990mA in the above simulation for 3*3055).
It could be you have to drive the BD244 with larger Ib current then.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 14, 2019, 11:52:29 am
Can I use a higher Ic transistor instead of BC639-16, if I can't find BC639-16 at the local shop ? For example can I use BD135 or BD139 ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on March 14, 2019, 11:53:15 am
Yes, BD139 would be ok. (best BD139-16)
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 14, 2019, 12:02:22 pm
Does R10 needs to be connected between the C of BC337 and B of BD244 or it can be zero ohms, as it is in the attached schematic ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on March 14, 2019, 12:14:30 pm
The 1k R10 in my simulation is there to simulate the input current.
Do not use my R10 in your schematics.

Btw, the fast current limit currents depend on the BD244 drive current a bit too, for example here is the simulation with BD244 Ibase=25mA (R10=100ohm) and Ic=1.5A in the pulse.

You have to measure it and adjust at the end of the day. Simulation only here..


Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 14, 2019, 12:26:38 pm
Is there any way to measure that current using a standard multimeter or an oscilloscope with standard 1x/10x probe ?
Is there the possibility to estimate that current ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on March 14, 2019, 12:29:25 pm
And finally how the Fast CC limit depends on the BD244 base current (ib=5mA..80mA) for constant emitter resistor R1=0.33ohm.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 14, 2019, 12:40:36 pm
It will be safe for the transistor the maximum value from the above graphic about 3.4A  ?
I think that this depends on the SOA of the transistor...
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on March 14, 2019, 12:59:34 pm
For 2N3055 the max Ice=15A. It depends on the Vce as well, of course. According to the datasheet at Ice=15A and Vce=40V and a short 50us pulse the transistor is within the spec.

Still the question is how to set the BD244 emitter resistor value in my schematics (R8=10ohm). It limits the Ic current of the BD139 during the pulse, it creates a significant voltage drop on it during the pulse as well. Under normal operation the voltage drop on it will be 0..3V I guess.


Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 14, 2019, 01:05:05 pm
If I will use TIP35C, it should also work as TIP35C has Ic=25A while 2N3055 has Ic=15A ?
I can also use TIP3055 (Ic=15A)...
I currently have TIP35C and TIP3055 and I want to use one of them. I am interested especially if I can use TIP3055.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on March 14, 2019, 01:22:00 pm
Well, the fast cc limit currents in my schematics depends on the I_base of the BD244, R8 value, 3055 emitter resistors, and real transistor's parameters.. I do not know how your transient will be long (50us??) - the width of it depends on the number of opamps in the control loop, their speed, their compensation, etc.
It needs to be elaborated..
Best would be to download the LTspice and simulate with your schematics, parts and conditions. And then to measure and compare.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on March 14, 2019, 02:05:00 pm
1.Is there any way to measure that current using a standard multimeter or an oscilloscope with standard 1x/10x probe ?
2.Is there the possibility to estimate that current ?

1. the worst case scenario would be to set the output voltage to your max, for example 20V, set the slow current limit to your min (for example 100mA).
Hook the oscilloscope probe at the shunt resistor and short the output. You have to see a voltage pulse on the shunt resistor.
See below a simulation with a PSU as above (2xLT1022 - current sense and voltage sense, BD139+2n3055, 0.33ohm in 3055's emitter, Fast CC as above, R_Shunt 0.22ohm, output capacitor 100uF (100mOhm ESR).
The 20V output shorted (slow current limit 100mA) at 300ms.
The R15 is the 3055's 0.33ohm emitter resistor.

2. sure, see above.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 14, 2019, 02:48:59 pm
I will check using the scope and I will come back with the results.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 14, 2019, 04:09:02 pm
I have attached the results from the oscilloscope.
I hope that I measured correctly, on the Rx1, Rx2 and Rx3.
I used TIP3055 instead of 2N3055 (currently I have a PCB with TIP3055 and I only attached the BD139 and resistors, 0.33 ohms in E of TIP3055, LM324, 20.3V output voltage, 0.1A output current, output capacitor 100uF). I put the scope alligator to the GND and the probe to the other side of Rx. R13,R14,R15 = 0.33 ohms.
Here are the screenshots:

https://ibb.co/ZMq3Dq5
https://ibb.co/TYR7bkN
https://ibb.co/cc4hR0S
https://ibb.co/3hTNkWz
https://ibb.co/TmwHy6s
https://ibb.co/kJyfnxy
https://ibb.co/ySRB7rB
https://ibb.co/nLvB6mz
https://ibb.co/By6ZDz4
https://ibb.co/Ngh9sxC
https://ibb.co/pWvkxTr
https://ibb.co/Bz09dv4
https://ibb.co/ChHj97b
https://ibb.co/0hWgChJ
https://ibb.co/f9f4kgM
https://ibb.co/42yqRCd
https://ibb.co/0cS5KYn
https://ibb.co/S59SQqP
https://ibb.co/F6HhDbw
https://ibb.co/hW5CRMW
https://ibb.co/wQnGNyc
https://ibb.co/PCWgLyr
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on March 14, 2019, 05:12:13 pm
Which schematics do you refer to?
Is the Shunt 3x0.68ohm in parallel?
I can see 3.2V max peak there (typically 1.2V) - that will be 14Amperes (typically 5.3A). Right?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 14, 2019, 05:22:19 pm
1. The schematic is the one attached, with the difference that I used 4xTIP3055 with 0.33 ohm Emitter resistor instead of 2N3055 with 0.22 ohm Emitter resistor. I also added a 100uF capacitor on the output. I also added the fast current limit from the attached image.
2. Yes, the shunt is 3x0.68 ohm in parallel rated at 5W each.
3. Yes.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on March 14, 2019, 05:51:35 pm
That is 1.3-3.5A per transistor in the pulses based on the oscilloscope pictures (1.2-3V pulse on the Shunt's 0.226 ohm). That seems good, imho.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 14, 2019, 06:05:05 pm
There is one thing that I did not observe correctly: I put the alligator clip of the probe on the GND, but the other end of the probe I put on the Anode of D5 (BY500). Is the measurement still correct in this case ? The distance between the Anode of D5 and the resistor pin is about 10mm...
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on March 14, 2019, 06:13:56 pm
Your probe's gnd wire (ending at the alligator clip) is around 10cm, therefore those 10mm play no role..
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 17, 2019, 12:15:28 pm
Hello @imo, I made a short simulation of the circuit in LTSpice. I found that the Ic and Ie of BD139 is higher than the datasheet values, which are 1.5A. Please have a look at the attached images because I don't know if the simulation is 100% correct.
Should be a good idea to replace BD139 by a higher Ic transistor ? For example, I have in my workshop a BD243C...
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on March 17, 2019, 12:32:26 pm
There are 2 potential issues with the Fast CC in my schematics:
1. the pulse is indeed higher current, but rather short pulse. Of course it has to be within spec.
2. the 10ohm resistor limits the current, but it also creates a drop with larger drive current for the Nx3055.

So it would be a better design to control the base of the BD244 pnp instead.
That cannot be done by the BD139 directly, however.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on March 17, 2019, 12:40:16 pm
R8 could be changed to something low like 1Ω. Some clamping diodes in series between the rail and the Base of Q5 will limit the allowed voltage across R8.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 17, 2019, 12:47:56 pm
There are 2 potential issues with the Fast CC in my schematics:
1. the pulse is indeed higher current, but rather short pulse. Of course it has to be within spec.
2. the 10ohm resistor limits the current, but it also creates a drop with larger drive current for the Nx3055.

So it would be a better design to control the base of the BD244 pnp instead.
That cannot be done by the BD139 directly, however.
Is there any simple solution to this problem ? Might the problem be solved by replacing BD139 or by increasing the 10R resistor value ?

Later edit: replacing 10 ohms resistor by 47 ohms resistor gives me the attached results...
and replacing the 10 ohms by 39 ohms resistor...

That cannot be done by the BD139 directly, however.
Does it require a transistor connected to the base of BD244 ?

2. the 10ohm resistor limits the current, but it also creates a drop with larger drive current for the Nx3055.
Can the voltage drop across the 10 ohm resistor be compensated by a transformer with higher secondary voltage ? I have a 30V/200VA output transformer...
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on March 17, 2019, 01:26:08 pm
This is something which may work fine.

In the simulation the FCC limits the current of a single 3055 to aprox 1.2A in the pulse.

In the simulation you may decrease the "1ohm Load" resistor to 0.01ohm with the same results.

In the simulation the collector current of the BD244 is about 3.5A for about 250ns (charging the capacitancies inside the 3055), that should be ok with that transistor.

The Q8 on the left hand side in my schematics is the T1 in your green schematics (together with 3x1k resistors around it).
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 17, 2019, 01:42:06 pm
 I will try it and I will come back later with the results.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on March 17, 2019, 01:53:28 pm
And the sim res.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on March 17, 2019, 04:15:04 pm
And a simulation with all relevant parts (based on the "green" schematics). It seems it works  :).
Shorting the output.
Vout=15V, I_Load=100mA, I_Limit=1A, FCC=5A.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 17, 2019, 07:02:25 pm
I uploaded on the site the screenshots from the oscilloscope.
Please have a look and tell me what you think.
I used BC556B and BC337-40. Only those transistors I have in my workshop at this moment.
V out = 25.5V, I out = 0.1A
https://ibb.co/1K0XCKh
https://ibb.co/QnT1v5M
https://ibb.co/MCT0sfG
https://ibb.co/58Ys04y
https://ibb.co/7GMKTnJ
https://ibb.co/2tyB5zL
https://ibb.co/Pjn2s1j
https://ibb.co/xCZf0fM
https://ibb.co/QvnGBxH
https://ibb.co/tLG0t3z
https://ibb.co/jbWDHVP
https://ibb.co/nrqz4s1
https://ibb.co/Wn2h5T7
https://ibb.co/PZKHSsB
https://ibb.co/DfvmsqL
https://ibb.co/GxwD9QS
https://ibb.co/p48HRFp
https://ibb.co/TgPYRqp
https://ibb.co/gRGMTsY
https://ibb.co/4M9g39h
https://ibb.co/HzFdwsW
https://ibb.co/199QQSp
https://ibb.co/cJ8F91X
https://ibb.co/dfDHrS8
https://ibb.co/vs0SXHG
https://ibb.co/D8h0b1x
https://ibb.co/bJCyWgj
https://ibb.co/TMGknVh

Later Edit: but something is not working, because if I set the output voltage to 25.5V and if I connect a 24V/60W light bulb, the voltage drops to 19.4V. The slow current limit is set to maximum and the LED does not lit.
I checked the circuit and it seems to be ok.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on March 17, 2019, 09:46:44 pm
You have to debug it step by step.
It has no sense to mess with 60W loads until it works with 1W load.

It looks like it is unstable. You may try to increase the feedback capacitors values.
PS: in the simulation it oscillates with 470pF feedback caps.

Also good decoupling and wiring style is important - with large currents the voltage drops on the thin/long wires may create instabilities.

We do not know what are the screenshots about. What did you measure? How?

First do measure how the input voltage changes under the load. Voltage drop, ripple, etc. The powering of the pass transistors and opamps must be stable.
Then do check how the voltage setting works.
Then do check how the slow current setting works.
Doublecheck and note all voltages at various nodes in the schematics during the tests, especially their changes. The


Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 17, 2019, 09:56:15 pm
We do not know what are the screenshots about. What did you measure? How?
I measured with the probe on the Rx resistor (3x0.68R in parallel). I took the screenshots in the moment when I made a short circuit on the output of the power supply. I measured the voltage drop on the Rx resistors when a short circuit occurred on the output of the power supply.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on March 17, 2019, 10:09:02 pm
The Fast CC response is the last thing I would test. First - see above - your PSU must work stable in a "static" operation under different voltage and current settings and loads. After that you may start with dynamic tests.

Shorting the output - doing that in simulation is easy. IN real HW it is difficult. When you do it manually or with any mechanical switch you are producing a long burst (several ms) of random spaced pulses (the contacts bounce).
Title: Re: LM324 Power Supply with variable voltage and current
Post by: floobydust on March 17, 2019, 10:29:21 pm
Um, I think the design not quite polished but close.

Where are the capacitors for filtering the op-amp's Vcc, such as across Z3 and Z2? Like 0.1uF and >100uF pairs. These are important   :palm:
The LM324 shares an internal bias circuit common to all four amplifiers, so noise on Vcc can affect all sections and make an oscillator or other problems etc.

mike_mike the scope trace pictures are hard to know where the probe was, or what was going on. What is the raw DC input voltage and op-amp rail voltages? I would first get CV mode working but building something like this is always a lot of fun learning.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on March 17, 2019, 11:13:57 pm
The 2nd schematic in Reply #12 shows suitable Base/Emitter bleeder resistors for output stage transistors.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 18, 2019, 11:32:31 am
What is the raw DC input voltage and op-amp rail voltages? I would first get CV mode working but building something like this is always a lot of fun learning.
Input DC voltage = 29.0V with load at the output 32.4V without load at the output
Op-amp rail voltages = 28.6V with load at the output and 29.4V without load at the output
Without load, the output voltage varies from the potentiometer from 0V to 25.5V.
The output current varies from the potentiometer from 0A to about 3.3A if I first go with the potentiometer to 0A and then I go with the potentiometer to 3.3A, while the ammeter is connected to the output.
If I set the current limit to maximum, and then if I connect the ammeter it shows about 2.40A, and the led does not lit.

What else should I measure to determine were is the problem ?


Later Edit: I found that if I connect the load and after connecting the load I plug the power supply to the 230V, then the output voltage does not drop. This happens only sometimes. But if I connect the load after I plug the power supply to the 230V, then the output voltage drops from 25.5V to about 19-20V.

When the output voltage drops to 19-20V, the voltage on BC337 from the original schematic collector is about 28V.

An alternative way could be a NPN transistor turning on with more than 0.6 V over the shunt and pulling down the base of T1.

Should the attached schematic work ?
I also made a simulation... but I am not sure if the simulation is correct.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 18, 2019, 02:36:42 pm
I am attaching a new simulation. I see on the red line some oscillation... is that normal ?
Please have a look and tell me if it is correct ...
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 18, 2019, 04:18:10 pm
I also made a simulation using diodes instead of transistor.
Could somebody please have a look and tell me if it is ok ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: Kleinstein on March 18, 2019, 04:59:11 pm
The Sizlaki type power stage is a little prone to oscillation.  It sometimes helps to have a resistors at the emitter of the PNP or the first NPN to reduce the inner loop gain. The choice of transistors can also be important. It is not that critical if the fast current limit oscillates, as this is only used as a kind of emergency stop and during transients.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 18, 2019, 05:13:42 pm
I tried with both BC547C and 2N2222A. The results are attached.
1. Wich of them is the best choice ?
2. Also, please have a look at the schematic in simulator and tell me if it is correct ?
3. The schematic and the simulation from reply #55 are correct ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: Kleinstein on March 18, 2019, 05:37:40 pm
There is very little difference between 2N2222 and BC547, it's mainly the case. The more important question would be the speed of the PNP and power transistors. I would likely help if the PNP is not too fast and the TIP3055 not too slow. If needed one could artificially slow down the PNP with a small cap from collector to base.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: floobydust on March 18, 2019, 05:55:35 pm
I find the same thing in simulations, the pass-transistor section is prone to oscillation in 2.7.1
It is not strictly a problem with Sziklai, but is due to use of negative feedback there.

I think Ver. 2.7.4-v2 schematic (Reply #12) (https://www.eevblog.com/forum/beginners/lm324-power-supply-with-variable-voltage-and-current/msg2266263/#msg2266263) is better for stability than 2.7.1; after it things got fixed.
Add R4, R35, and change R22, R12 *Added 10uF output capacitor Ckl; all important changes for stability.
If you make these changes, the 2.7.1 design seems to be good aside from the spike on power-up/power-down.

I noticed the schematic is from a 725 page thread on lab power supplies at the Hungarian electronics forum Hobbi Elektronika. (https://www.hobbielektronika.hu/forum/topic_1560_from.html) :o
mike_mike can make sure you have the latest version, so we don't all waste time redoing the design revisions.

edit: added output cap revision.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 18, 2019, 08:15:15 pm
Hello @floobydust.
I modified the initial schematic to the schematic 2.7.4-v2. I tested it a little bit and it seems to work.
I used 4u7 capacitor (Ckl) instead of 10uF, like it said in the schematic (only now I saw your edit).
I am waiting for further instructions and advices.

Later edit: And the E resistors for TIP3055 remained 0.47R/5W during those tests. I can modify this, but first I need to know what kind of fast CC will be used and if those 0.47R resistor will have influence on the fast CC.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: floobydust on March 18, 2019, 09:58:12 pm
What is most important to you in this PSU?
Low cost, simple, reliable, tough, precision... You can't have it all without adding parts... and the discussion never ends.

This Hungarian design is I think a collaboration of three designers. It is close to being really good. I would keep testing it. A few mistakes in the 2.7.4-v2 still.

For reliability, I would add a current-limiting resistor to the PNP driver transistor T2. T2 gets hit hard when output short-circuits happen. BD139 is too small. 15-22R (1W to 2W) at its collector limits transient current to <1A pk. I have not looked at fast (protective) current-limiting, I would not use it to cover up slow CC operation. The op-amp is supposed to go into CC mode after some time anyhow. Does the CC LED still not work?

It would be better if the op-amps had power from voltage regulator IC's like 78L24 and 79L05, instead of the zeners. Add some op-amp Vcc decoupling capacitors.

Translated 2.7.4-v2 to explain the hands on the schematic:
Update A;  something about voltage drops on that wiring/trace run.
Update B;  cal trimpot P3 to set max. current limit.
Update C;  Adding hi/lo switch for ammeter range.
Update D;  Adding T6, R11/2, R33, R34 to prevent output spikes when you switch power on or off.
Update E,H; For stability to stop pass-transistors and op-amps from oscillating.
Update F; For big heatsink wiring.
Update G: adding R36 for protection if pot wiper goes open-circuit; but wrong it should connect to GND like P2. Added R37 to give semi-log response to the CC potentiometer.

It looks like modern 2N3055 are fake or not as strong as the old ones, so the design eventually went to mosfets.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on March 19, 2019, 02:23:21 am
This is a simplified version of a bench supply design I'm building.
It's topology is similar except for mainly  that the output stage is current sourcing, no local feedback.
The presence of D5 greatly improves the response time of the CC loop to sudden overloads.
The actual design I'm using has added complications to further improve the CC response.
It may not work as well with a slow op-amp.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 19, 2019, 06:20:52 am
What is most important to you in this PSU?
Low cost, simple, reliable, tough, precision... You can't have it all without adding parts... and the discussion never ends.

Does the CC LED still not work?
I am satisfied with the supply as it this now if I will not find problems, but I want to add a fast current limit to protect the power transistors, if this is needed.

After removing the fast CC and making the modifications (version 2.7.4-v2), the led is working, but it lights up at the minimum current only if I have a load at the output of the power supply. The loads that I used were a 24V/60W light bulb and a 2.95A at 19.75V light bulb. The output current varies from 0 to 3.25A.

For reliability, I would add a current-limiting resistor to the PNP driver transistor T2. T2 gets hit hard when output short-circuits happen. BD139 is too small. 15-22R (1W to 2W) at its collector limits transient current to <1A pk. I have not looked at fast (protective) current-limiting, I would not use it to cover up slow CC operation. The op-amp is supposed to go into CC mode after some time anyhow.
I think I don't understood how to connect the 15-22R resistor, does it needs to be connected between the C of BD244 and the B of TIP3055 ?
The decoupling capacitor should be connected between the +Vcc (+24V) and -Vcc (-5V) of the LM324 ?
I can use L7824 and L7905, I don't have the part number with "L". But I want to stick with zeners, since the 78 accept input voltages in 33-40V range and the input voltage in my case drops below 33V when I have a load at the output.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on March 19, 2019, 11:13:43 am
Quote
I think I don't understood how to connect the 15-22R resistor, does it needs to be connected between the C of BD244 and the B of TIP3055 ?
I would put it into BD244 emitter, it limits the current and lowers the BD244 gain as well. Mind 10ohm creates a voltage drop on it with large currents.

Quote
The decoupling capacitor should be connected between the +Vcc (+24V) and -Vcc (-5V) of the LM324 ?
It should be wired as close to the LM324 package as possible, between +Vcc and -Vcc pins (pin 4 and 11, afaik). The value: 100nF/35V ceramic in parallel with an elyt 10u/35V.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 19, 2019, 12:04:15 pm
I added the 10 ohm resistor into BD244 emitter, and the 2 capacitors as close to LM324 as I could (I found in my box only 10uF/63V - electrolytic and 100nF/50V - ceramic). I made a quick test and the power supply seems to work. The voltage drop with 2.95A load was about 0.05V. The current limit also works and the led lights up when I reduce the output current.
The fast CC is still needed ? If yes, which schematic should I use ? Note that the complicated one (with 2 transistors) did not worked for me...
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on March 19, 2019, 12:37:38 pm
You may try the classic FCC version (my first version with a single npn transistor):

https://www.eevblog.com/forum/beginners/lm324-power-supply-with-variable-voltage-and-current/msg2268063/#msg2268063 (https://www.eevblog.com/forum/beginners/lm324-power-supply-with-variable-voltage-and-current/msg2268063/#msg2268063)

While the BD244 with 10ohm in emitter now limits the current, the single transistor version may work best, as it is placed closest to the 3055s.

Your FCC current limit has to be set a bit higher than the "slow CC" maximum limit is set, otherwise the CC will not work.
For example FCC=7A for SLOW_CC_MAX=4A.

PS: in case you ask how to set the FCC - trial and error method :)

Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 19, 2019, 01:15:21 pm
I made a simulation using BD139, but I see that there does not appear all the "lines" on the graphic like it appeared when I made the first tests. Are there any mistakes ?
Also, the collector current of BD139 is about 1.1A... is that good ? In case if the current goes over 1.5A, can I use a higher collector current transistor ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on March 19, 2019, 02:33:16 pm
What do you mean by "all lines in your first test".
Do you mean stepping through various 3055 emitter resistors?
Your total FCC limit is 10.6A with your above simulation.
It is a simulation only - the reality may vary by +/- 2A easily.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 19, 2019, 02:42:49 pm
I meant the lines from the attached screenshot.
Also, can I use a higher collector current transistor to replace BD139 ? Sorry for asking again, but I think that I did not understood correctly...
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on March 19, 2019, 02:46:52 pm
You have to learn LTspice directives.
See below. Try to replicate.
BD139 is ok.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on March 19, 2019, 08:54:51 pm
Here is a "PSU SHORTER" - you may test your Fast CC and SLOW CC in hardware.

The nMOSFET is (80V/60A 10mOhm) and the npn are randomly chosen from the LTspice lib. 555 is the 555 (not the cmos one) :)

The short is 1ms long, approx 20Hz repetition rate.

Blue: the current through the nmosfet, a short 50A pulse from the discharge of the output's 100uF capacitor and then 3A Slow CC

Green: the PSU_Shunt current where the first peak is the 6A Fast CC and then 3A slow CC, the idle is 160mA (16V/100ohm).
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 20, 2019, 06:26:34 am
Probably I will built the circuit with 555... but this takes a little time to built the circuit.


edit: It is possible to drive the mosfet using an Arduino UNO board ? I worked with Arduino a few times and I think I know how to write the code.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: not1xor1 on March 20, 2019, 07:11:36 am
Quote
I think I don't understood how to connect the 15-22R resistor, does it needs to be connected between the C of BD244 and the B of TIP3055 ?
I would put it into BD244 emitter, it limits the current and lowers the BD244 gain as well. Mind 10ohm creates a voltage drop on it with large currents.

Quote
The decoupling capacitor should be connected between the +Vcc (+24V) and -Vcc (-5V) of the LM324 ?
It should be wired as close to the LM324 package as possible, between +Vcc and -Vcc pins (pin 4 and 11, afaik). The value: 100nF/35V ceramic in parallel with an elyt 10u/35V.

 :o
The capacitance of ceramic capacitors is  inversely proportional to the applied voltage (https://www.maximintegrated.com/en/app-notes/index.mvp/id/5527) so 50V or more is better than just a bit above the supply voltage.
 |O OK... I had stopped at 100nF and had not realized you suggested electrolytic in parallel... in any case melius abundare quam deficiere  ;D
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 20, 2019, 01:52:13 pm
I managed to build the schematic with 555 suggested by @imo at reply #71. The mosfet I used is W20NB50 and it is the most powerful that I could find.
I set the output voltage at 25.5V, and the output current at 3.2A.
The results are:
1. The Gate of the mosfet DS0483.jpg
2. With the probe on the 0.68R resistors (the crocodile clip at ground and the probe on the other end of 0.68R resistors) and the max output current set at about 3.2A: DS0477.jpg to DS0480.jpg
3. With the crocodile clip at source (S) of the mosfet and the other end of the probe at Drain (D) of the mosfet: DS0481.jpg

I tested without R23 (100 ohm) because it was low power and did not resist to the high current. Some smoke appeared from this resistor. It is good if I tested without the 100R resistor ?
While testing, the led was flashing and some hum could be heard from the power supply.

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

Later Edit: I managed to find a 100R /3W resistor and I tested with this resistor in the 555 schematic. I know that there needs to be a more powerful resistor, but this is all I have.
4. With the probe on the 0.68R resistors (the crocodile clip at ground and the probe on the other end of 0.68R resistors) and the max output current set at about 3.2A: DS0485.jpg to DS0489.jpg
5. With the crocodile clip at source (S) of the mosfet and the other end of the probe at Drain (D) of the mosfet: DS0490.jpg to DS0491.jpg

Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on March 20, 2019, 02:38:37 pm
Well done!!    :-+
Finally we see something working in HW, not only in LTspice  :clap:

The 100ohm is there to create the "idle load current". It could be something different, it is up to you.

The pictures DS0478, DS0480 are almost "identical" with what I see in simulation, including the small negative glitch at the end of the pulse.

It starts with the "idle load current", then it goes into the FastCC peak, usually 20-50us long, then it goes to SlowCC for the rest of the 1ms shorting, then back to the "idle load current".

From by the o'scope measured voltages and the known resistor's values you can calculate the currents in idle, FastCC and the SlowCC.

100nF ceramic and the applied voltage - MMs 50V rating is 2x the 24V so it is ok, I think the most affected are the multilayers ceramics (up to 80% capacity loss at full DC rating bias).

The buzzing sound - it is the 20Hz repetition rate of the pulses. The ratio is 1ms:50ms so the stuff should not get hot, imho.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on March 20, 2019, 03:17:33 pm
You may use the "PSU SHORTER" for measuring the PSU stability as well..

Simply put a second load resistor into the MOSFET's drain (collector), for example 15ohm, set Vout=15V for example, let the first load resistor 100ohm there and the PSU SHORTER will then switch between 150mA and 1.15A.

You may search at the various points in the wiring for ringing or oscillation while changing the Vout, SlowCC and load currents (by changing the mosfet's drain resistor).

You may also increase the 4k7 at 555 to something bigger to make the pulse wider for this measurement.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 20, 2019, 04:30:40 pm
I made the following tests:
1. Vout=10.12V, Iout=3.25A (max current, the led does not light), R23=100R, Rdrain=1R
DS0510-DS0511.jpg

2. Vout=10.12V, Iout=3.25A (max current, the led does not light), R23=100R, Rdrain=10R
DS0512.jpg

3. Vout=25.5V, Iout=3.25A (max current, the led does not light), R23=100R, Rdrain = 10R
DS0513-DS0514.jpg

4. Vout=25.5V, Iout=half of 3.25A (the pot at half, the led lights up), R23=100R, Rdrain=10R
DS0515.jpg

The oscilloscope probe was put on the output of the power supply, with the crocodile clip at GND and the other end of the probe at +. I used a 8k2 resistor instead of 4k7 for the 555 "PSU SHORTER".

Please have a look and tell me what you think...
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on March 20, 2019, 04:59:11 pm
The pulse for the stability measurement is still too short, imho, thus you do not see all the ringing at rising ad falling edges.
Try to go with even higher resistor, say 100-220k, you may decrease the 330n capacitor to stay at 20Hz. It will never be 1:1 but that is ok.

For example 220k/220k/100n will be 22Hz 1:2 ratio - that is ok.

PS: your "Iout=" shall be "SlowCC=" in your above post.

Your Iout = Vout/R23 + Vout/Rdrain

when Iout is smaller than SlowCC, otherwise your Iout=SlowCC.

BTW - your max SlowCC (provided your measurements where with full pot) based on DS0480 is aprox 3.09A (see above table).
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 20, 2019, 05:24:38 pm
I used the combination 220k/220k/100n, but I found the attached waveform at the G of the mosfet. Is that normal ? Or it should be a perfect square wave ? I checked the probe and it is correctly compensated...
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on March 20, 2019, 05:29:11 pm
What is your "PSU Shorter" power source?
It seems it cannot source enough current.

The 220ohm resistors are there to drive even high gate capacitance mosfets. The currents are high.
You may go with higher resistor's values, provided your mosfet has got lower gate capacitance ("gate capacitance" is somehow simplified name for it, though).
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 20, 2019, 05:30:15 pm
It is a 2A, LM723 variable power supply from 3.5V to 30V.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on March 20, 2019, 05:38:49 pm
I've done some edits in my above posts - read it plz.

Do you have a 100uF capacitor connected to the 555 Vcc and GND?
PS: the 0.3ohm resistors with 100uF caps are their internal ESR, so do not wire any resistors there.


Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 20, 2019, 05:43:32 pm
Yes, I have a 100uF capacitor, but at the beginning of the tests I though that the capacitor from the power supply output will be sufficient and I did not used the 100uF capacitor...

I'll modify the values of the 220R resistors and I will come back with the results.

Edit: I modified the values of 220R resistors to 1k but the waveform at the G of mosfet is almost the same with the one from reply #79. I used only the 100uF capacitor without any resistor in series.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on March 20, 2019, 05:56:48 pm
With 220ohm resistors and 5nF input capacitance of your mosfet the gate pulses shall be nice square.


PS: do you have AC or DC coupling of your o'scope probes???

It must be DC.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 20, 2019, 06:07:02 pm
I have AC coupling on all tests ...
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on March 20, 2019, 06:11:38 pm
Set it to DC.
With short pulses AC was not critical, but with longer pulses it makes the sawtooth.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 20, 2019, 06:18:21 pm
You can find attached the screenshot with the coupling set to DC.
If I begin the tests and I connect the oscilloscope probe to the output of the supply, the coupling should be set to DC ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on March 20, 2019, 06:27:35 pm
Set probe to 1:10 and DC, sure.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 20, 2019, 06:52:40 pm
I am attaching the results:
1. Rdrain=10R, R23=100R, Vout=25.5V, SlowCC=3.25A
DS0520.jpg

2. Rdrain=10R, R23=100R, Vout=25.5V, SlowCC=1.625A (the current pot at half) - led flashes
DS0521.jpg

3. Rdrain=10R, R23=100R, Vout=12.12VV, SlowCC=3.25A
DS0522.jpg

4. Rdrain=10R, R23=100R, Vout=12.12V, SlowCC=1.10A - led flashes
DS0524.jpg

DC coupling, probe x10, oscilloscope set on x10 probe, measured with the alligator clip at gnd and the other end of the probe at + of the output of the power supply.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on March 20, 2019, 07:14:17 pm
Quote
2. Rdrain=10R, R23=100R, Vout=25.5V, SlowCC=1.625A (the current pot at half) - led flashes
DS0521.jpg
While the SlowCC triggers, the Vout decreases by 11V only. Is this measurement ok?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 20, 2019, 07:18:49 pm
Yes, if I make a test and directly connect the 10R resistor to the output of the power supply, while the output voltage is 25.5V and output current is at half (about 1.4A), the voltage drops to 14.1V.
There is the 10R resistor in the Drain of the mosfet which determines the power supply to enter in the CC mode.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on March 20, 2019, 07:34:23 pm
Quote
..if I make a test and directly connect the 10R resistor to the output of the power supply, while the output voltage is 25.5V and SlowCC is at half (about 1.6A), the voltage drops to 14.1V.
There is the 10R resistor in the Drain of the mosfet which determines the power supply to enter in the CC mode.

Your SlowCC max is 3.1A (based on the "shorting" measurement).
Half is 1.55A.
When triggered SlowCC the 1.55A flows into 10||100ohm.
Vout=1.55A * 9.091ohm = 14.091V

Looks ok.

Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on March 20, 2019, 07:49:57 pm
Try to increase the value of the resistor from 555 into the npn base from 220ohm to 1k, plz.
With the 220 it is too much base current..
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 20, 2019, 08:06:08 pm
I increased the base resistor to 1k, and I made a few quick tests.
The results are shown below:
1. Rdrain=10R, R23=100R, Vout=25.5V, SlowCC=3.25A
DS0526.jpg

2.  Rdrain=10R, R23=100R, Vout=12.18V, SlowCC=3.25A
DS0527-DS0528.jpg

DC coupling, probe x10, oscilloscope set on x10 probe, measured with the alligator clip at gnd and the other end of the probe at + of the output of the power supply.

Later Edit: I could not find the response of the power supply on 10mS/div, instead I found the response (the overshoot) of the power supply on 250 and 500nS/div. If I use the oscilloscope on 10mS/div, then nothing appears when I connect the power supply to the "PSU SHORTER".

Please have a look at the results and tell me what you think.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on March 21, 2019, 05:53:33 am
Quote
If I use the oscilloscope on 10mS/div, then nothing appears when I connect the power supply to the "PSU SHORTER".
You have to play with the trigger level, it should work, imho. You may ask GW_Instek experts here how to set up your o'scope for this task.

In the pictures there is a 20% overshoot and ringing.

When you change the capacitors values (slowly, say in 100pF increments) in the opamp's feedbacks the overshoot and the ringing should go lower, and vice versa. With lower capacities there is chance of oscillation, though.

The goal is to find such compensation level where the transitions are optimal (in above examples minimal overshoot and ringing) and the PSU is STABLE AT ALL Vout, Iout and SLowCC settings.

PS: You may start with Vset opamp compensation in above example, as the SlowCC is not in action.

Below is a simulation of the Vset opamp compensation from 100pF to 2000pF step 50pF. It is a simulation only, it will differ in reality.
Also mind with lower compensation caps values the PSU will most probably oscillate.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on March 21, 2019, 07:59:28 am
There might not be enough minimum load.
39K is too high for R9.
Edit; and R8 can be a lower resistance. Clamping diodes across R9 will limit the drive current.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 21, 2019, 01:27:35 pm
I increased the value of C2 (the Vset opamp) by 100pF and I got the following results:
1. Rdrain=1R, R23=100R, Vout=2.57V, SlowCC=3.25A
DS0558
2. Rdrain=10R, R23=100R, Vout=12.57V, SlowCC=3.25A
DS0559-DS0560
3. Rdrain=10R, R23=100R, Vout=25.5V, SlowCC=3.25A
DS0561-DS0564

Then, I increased the C2 value to 2nF (2x1nF in parallel):
4. Rdrain=10R, R23=100R, Vout=25.4V, SlowCC=3.25A
DS0565-0566

I see that the overshoot does not go under 4V, if the output voltage is 25.5V...
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 21, 2019, 08:26:01 pm
1. If the capacitors remain at the original value (C2=C5=1nF), and the overshoot and ringing will exist at the values from the screenshots, is there the possibility to appear problems at the power supply ?
I am afraid to reduce the value of those capacitors (C2 and C5) because the possibility to oscillate will increase...

2. Please have a look at the screenshots from reply #97 and tell me what you think.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on March 21, 2019, 08:56:19 pm
Define "problems at the PSU"..

You have got basically two options:
1. to accept the values given in the schematics.
2. to make measurements and find the optimal or safe values.

Measurements - you have not decreased the capacitance values, so you do not know where the PSU starts to oscillate.
Therefore nobody can tell you what is the right capacitance value.

Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 21, 2019, 09:06:33 pm
Define "problems"..
Sorry, I was not sufficiently clear when I said problems...
Problems =
1. the power supply may be damaged by the ringing or overshoot.
2. the load may be damaged by the ringing or overshoot.

Later Edit: I would go for accepting the 1nF values for C2 and C5, if there are no oscillations.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on March 21, 2019, 09:23:48 pm
What if your PSU starts to oscillate at 970pF?  >:D
Title: Re: LM324 Power Supply with variable voltage and current
Post by: Kleinstein on March 21, 2019, 09:24:56 pm
The power supply usually does not get damaged from ringing or overshoot. There might be theoretical a damage from oscillation, as some small transistors or caps may see more power than normal. However normally the supply should survive.

Too much overshoot (in the voltage) might damage a sensitive load.

For the CC to CV transition the usual way is to make the recovery relatively slow. There are ways to implement at least a partial anti windup to reduce the voltage overshoot.

Too much overshoot in the CV to CC transition could in theory damage the supply and maybe a circuit that relies on the limited current. This a reason for the extra fast current limit. However some extra current for a short time is quite often desired. The output transistors can also stand quite some current for a short time.

For the adjustment it is not just the capacitors but also often a series resistor to the compensation cap for the CV mode. I somewhat got lost in what circuit was actually measured.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 22, 2019, 06:13:26 am
What if your PSU starts to oscillate at 970pF?  >:D
This is the reason I did not wanted to reduce the value below 1nF...  :-[
Title: Re: LM324 Power Supply with variable voltage and current
Post by: Kleinstein on March 22, 2019, 07:27:08 am
To check that the supply is sufficiently in the safe range one should also do test with smaller caps than one would later use. So to make sure 1 nF is OK one should have it not oscillating with 500 pF as well.

In the old days the method was to reduce the compensation cap so far that the circuit starts to oscillates and than increase it by something like a factor of 2 to 5.

The overshoot also depends on the size of the output capacitor - more capacitance usually gives less overshoot.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 22, 2019, 12:25:52 pm
I made a few more tests using 470pF for C2 and 470pF for C5.
Oscilloscope: DC coupling, probe x10, scope setting x10.
The measurement point for the oscilloscope was on the output of the power supply.
R23 was always 100R/3W.
1. Rdrain=10R, Vout=25.5V, SlowCC=3.25A
DS0567-DS0571.jpg

2. Rdrain=1R, Vout=25.5V, SlowCC=3.25A
DS0572.BMP

3. Rdrain=10R, Vout=25.5V, SlowCC=1.63A
DS0573-0574.jpg

4. Rdrain=10R, Vout=12.1V, SlowCC=3.25A
DS0575-0578.jpg

5. Rdrain=1R, Vout=12.1V, SlowCC=3.25A
DS0579-0580.jpg

6. Rdrain=10R, Vout=12.1V, SlowCC=1.59A
DS0581-0588.jpg

7. Rdrain=1R, Vout=2.49V, SlowCC=3.25A
DS0589-0594.jpg

8. Rdrain=1R, Vout=2.49V, SlowCC=1.66A
DS0594-0598.jpg
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 22, 2019, 12:28:28 pm
continuation from the reply #105...

Please have a look at the screenshots from reply #105 and #106 and tell me what you think.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on March 22, 2019, 12:38:51 pm
You know how an oscillation looks like.
So the goal is to find the moment it starts to oscillate.
Mind the oscillation may start at certain Vout, Iout, SlowCC settings, so with the new caps values you have to run the PSU shorter while turning the Vout and the SLowCC pots up and down slowly (with 1ohm or 10ohm in the mosfet's drain).
Do not make a lot of screenshots, rather do decrease the caps values even more, do manipulate settings and do watch your o'scope.
Make one screenshot with nice oscillation.
A nice exercise for the upcoming weekend :)


PS: it could be your PSU will never oscillate..  :)
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 22, 2019, 01:28:07 pm
I tested using the following resistors (connected in the Drain of the power mosfet):
10R - from 0V to 25.5V in steps of 5V, and at each step I varied the current from 0 to 3.25A.
1R  - from 0V to about 3.3V, and the current from 0 to 3.25A.
5.7R (1R+4.7R) from 3.3V to 14.8V, in steps and the current from 0 to 3.25A.

I found the ringing and the overshoot at all tests as was in the previous screenshots, but at 0.01V output and 0A, I found the following waveform, and I do not know what is it...

Edit: I also modified R23 (100R) to 1.8k, because at 100R, it almost burned. I used 470pF for C2 and C5.
@Kleinstein I used the schematic from post #12 , v2.7.4 v2, with capacitors at the power rails of 324 and with single BD139 fast CC.

Please have a look and tell me what you think.

Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on March 22, 2019, 04:32:00 pm
DS0603 - the transients there come from PSU_Shorter switching the loads (peaks are 45ms apart).
From the pictures I cannot say whether the noise is just a noise or it oscillates somehow.
Try with lower cap's values.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 22, 2019, 05:56:36 pm
I changed the C2 and C5 values to 100pF, and I found the oscillation.
The oscillation happens when the output is set to 5.1V, when the current limitation occurs and the voltage goes down to about 4.2V. The current limitation is set by the current potentiometer.
100pF:
DS0616-0617.jpg
I also checked in the same conditions with 470pF, and I got the following screenshot:
DS0620.jpg

Please have a look at the results and tell me what you think.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on March 22, 2019, 06:11:12 pm
 :-+
Exactly as my simulation above. Nice oscillation, indeed. :)

I would try with 220pF and/or 330pF and if there will be none oscillation (again you have to sweep through all possible settings) then use the rule Kleinstein has suggested above.

.. In the old days the method was to reduce the compensation cap so far that the circuit starts to oscillates and than increase it by something like a factor of 2 to 5.

Title: Re: LM324 Power Supply with variable voltage and current
Post by: floobydust on March 22, 2019, 06:15:12 pm
DS0603 - the transients there come from PSU_Shorter switching the loads (peaks are 45ms apart).
From the pictures I cannot say whether the noise is just a noise or it oscillates somehow.
Try with lower cap's values.

OP might be observing effects of mains ripple on the -5V rail. It is a problem with the cheap chinese 0-30V PSU design, mainly when CC mode is activated and the current draw from the -5V rail is higher. I would scope the -5V rail, comparing to when the PSU is in CV and CC mode.

Based on Paul's Blog as he debugs that PSU design: http://www.paulvdiyblogs.net/2015/05/tuning-030v-dc-with-03a-psu-diy-kit.html (http://www.paulvdiyblogs.net/2015/05/tuning-030v-dc-with-03a-psu-diy-kit.html)
It's why I suggested using a 79L05 or LM337 instead of the zener.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 22, 2019, 06:43:35 pm
I tried with 330pF, and I found the following problems (I used as load only the 10R resistor):
1. Vout=15V, SlocCC=3.25A, Rdrain=10R
DS0621.jpg
but if I go to 100nS, it does not show that oscillation:
DS0622.jpg

2. Vout=4.8V, SlocCC=3.25A, Rdrain=10R
DS0623.jpg
but if I go to 50nS, it does not show that oscillation:
DS0624.jpg

I don't know if they are oscillations or other things ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on March 22, 2019, 06:58:34 pm
Those oscillation freqs are >100MHz - I doubt it comes from your PSU. Try to set your oscope's input filter to 20Mhz if applicable.
What is your GWInstek type?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 22, 2019, 07:04:39 pm
It's a GDS-1052-U...

Late edit: I used the BW limit option from the oscilloscope, and I got the following results:
1. Vout=14.9V, SlocCC=3.25A, Rdrain=10R
DS0625-DS0632.jpg

The waveform from 0625 is modifying over time and it transform in the waveform from 0629. Please have a look at the screenshots and tell me what you think ...
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on March 22, 2019, 07:43:38 pm
With 20MHz BW limit you can hardly see a square 1Vpp 125MHz pulses, afaik. That would be something with your o'scope settings. Try to set the trigger better..
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 22, 2019, 08:17:46 pm
1. I tried with the trigger in different positions, and the results are in the following screenshots:
Sometime like this DS0642 and sometime like this 0643.jpg

2. I continued the tests using different Vout, different Iout and different resistors in the Drain of the mosfet. The most "strange" waveforms are attached:
a. Vout=1.3V, led flashes, because I reduced the output current
DS0636jpg

b. Vout=2.3V, led flashes, because I reduced the output current
DS0639.jpg

Please have a look at the screenshots and tell me what you think.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on March 22, 2019, 08:37:32 pm
The first one is the issue with the oscope, the last two are ok, I can see that in the simulation as well.

I would say, based on your measurements, it does oscillate with 100pF, does not oscillate with 330pF and 470pF, thus applying the 2-5x rule, the 470pF is optimal and the 1nF is safe..
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 05, 2019, 05:32:47 am
Hello,
I just finished the attached schematic, and I am trying to check if the power supply is oscillating. I have also used the fast CC as suggested by imo.
I used 1N4007 instead of HER508, and I used 3v3 zener diode instead of 13V zeneer diode. The resistor Imin, was modified from 300R to 10R and the Umax resistor was modified to 12K. The transformer is rated at 24Vac and 160VA. The bridge rectifier is 35A/1000V, the filter capacitor is 2x6800uF/80V.
I am using the attached power supply shorter, with a 4.7R/5W resistor. The power supply output voltage is set at 10V.
This is the signal at pin 3 of LM555: DS0000.jpg
This is the output of the power supply: DS0001.jpg

Are there any oscillations at the output of the power supply ? Basically, I don't know what I am seeing at the output. Is that a "slow" response of the power supply ?
Please have a look at the screenshots and tell me what you think.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 05, 2019, 07:28:01 am
I think the 100n ser 100ohm compensation is causing the response is "slow".
Try with 470p-1n ser 10k.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: Kleinstein on May 05, 2019, 07:53:55 am
The frequency of the test circuit is too high to see the important part of the curve, when the voltage really approaches the set value.

Especially with a DSO there is no need for so fast tests.

The low speed is due to the really slow compensation.

In the initial phase when the voltage recovers, it looks like there could be some ringing (hard to see on the picture - we just need the rising part once). Normally such a circuit (current controlling power stage) would need some capacitance (e.g. 10-100 µF) at the output to be stable.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 05, 2019, 08:03:10 am
I tested again, with 470pF and 10K: DS0000.jpg.
If I will leave the circuit as it was originally (100nF and 100R) what problems could appear ? Could it oscillate, or the 100nF+100R will prevent the oscillation ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 05, 2019, 08:04:01 am
  :o now I see your psu-shorter pulses freqs is 28kHz!!
I think my initial design was around 22Hz (the mosfet is 1ms "ON")..

Something is wrong with your "PSU shorter"..
You cannot get 28kHz with your above schematics. Double-check the values of the 220k/4k7/330nF parts.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 05, 2019, 08:39:02 am
I corrected the values 220k/4k7/330nF.
The output of 555: DS0699.jpg
The output of power supply, using 100R in series with 100nF: DS0698, DS0697.

Please have a look at the screenshots and tell me what you think.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 05, 2019, 08:56:04 am
Have you checked with Fast CC and Slow CC engaged?? With larger currents?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike 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.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo 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.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: Kleinstein 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.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike 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.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 05, 2019, 10:48:07 am
What do you think?  ;)
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike 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.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo 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..
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike 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 ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo 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.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: Kleinstein 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.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike 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.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike 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.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 05, 2019, 03:30:35 pm
Works.. Modded..
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo 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..
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo 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.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike 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
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo 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...
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike 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.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo 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).
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 05, 2019, 06:56:40 pm
I will do that and I will come back with the results.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike 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.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike 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 ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo 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.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike 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.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: Kleinstein on May 07, 2019, 11:42:05 am
The voltage recovery part looks reasonably good. There is still some overshoot, but not very much (some 700 mV). For the simple more PI like regulator it is hard to avoid some overshoot. The voltage regulation still looks rather slow.

The fast current limit is active for quite some time. This is in part due to the compensation and the circuit principle: a lower set voltage also reduces the gain of the current regulation. Due to the relatively slow voltage regulation the current loop can't be fast either. So in some cases the fast current regulation has quite some work to do and is active for a relatively long time.
It could be acceptable for a simple supply, especially if you are aware of this limitation.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 07, 2019, 12:00:26 pm
I am uploading updated screenshots ( I found a problem, the the 39K resistor was 2k2 and I replaced it by 39k):
Same test conditions as here:
I tested with the following components: CV 4n7 and 10k, CC 1n and 10k, R4=3k3, R2=10k. The simulation in LTSpice was good.
Output votlage: 25.6V, I max= 3.06A
Fast CC: 0746-0747.jpg
On the output with PSU Shorter and R load at PSU Shorter = 0 R:
a. I max 0748.jpg
b. I med 0750.jpg
c. I almost min 0751.jpg

Are there any oscillations ? I am not sure if there are any oscillation at the first 2 screenshots because I see that the bottom lines are a little bit thick than other lines.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 07, 2019, 12:13:50 pm
Why AC triigger?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 07, 2019, 12:17:48 pm
I don't know if I need to use AC or DC trigger...

I am searching for some explanations on the internet about the AC and DC trigger.

For the first screenshots, it is correct to use AC coupling because I am seeing a repetitive signal on the 0.22R resistor, while on the last screenshots it is correct to use DC coupling because there is a DC signal coming from the power supply.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 07, 2019, 12:40:30 pm
I do not see an issue on those last pictures.
The 2k2 vs 39k issue was not critical.

PS: a good point to measure is at the 0.22ohm slow CC shunt.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 07, 2019, 03:14:59 pm
You said "last pictures"... I don't know if you was talking about reply #151 or about reply #151 and reply #149 ?
This also looks good ? It is with Vout=3.1V, with the probe on the 0.22R resistor, and with the output current at maximum.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 07, 2019, 04:02:20 pm
I do not see issues on the last 21 pictures :)
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 07, 2019, 05:18:13 pm
I made some tests with 10R and 2R load at the PSU shorter.
1. On the output of the power supply
a. Vout=24.5V, Iout=3.06A, load=10R: 0752.jpg
Iout=half: 0753.jpg
Iout=almost min: 0754.jpg
1. On the 0.22R resistor (shunt)
b. Vout=24.5V, Iout=3.06A load=10R: 0763.jpg
Iout=half: 0762.jpg
Iout=almost min:0761.jpg

2. On the output of the power supply
a. Vout=16.29V, Iout=3.06A, load=10R: 0755.jpg
Iout=half: 0756.jpg
Iout=almost min: 0757.jpg
2. b. On the 0.22R resistor (shunt)
Vout=24.5V, Iout=3.06A load=10R: 0758.jpg
Iout=half: 0759.jpg
Iout=almost min:0760.jpg

3. On the output of the power supply
a. Vout=5.08V, Iout=3.06A, load=2R: 0765.jpg
Iout=half: 0766.jpg
Iout=almost min: 0767.jpg
3. b. On the 0.22R resistor (shunt)
Vout=24.5V, Iout=3.06A load=10R: 0769.jpg
Iout=half: 0770.jpg
Iout=almost min:0768.jpg

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

Title: Re: LM324 Power Supply with variable voltage and current
Post by: Kleinstein on May 07, 2019, 05:55:32 pm
The drop after applying the load and the overshoot when the load is removed is rather large. So one may have to increase the loop gain / speed up the voltage regulator.

The tringle type "ringing" after coming from lower voltage is kind of "normal" it happens with the output stage of for some time and the regulator running into some windup. This can be rather difficult to fix in the topology.

However there is a limit on how far this can be done in the simple PI like regulator. For much faster regulation the next step would be an RC (series) element in parallel to R12 as an additional D element. This would be some 2-3 K and an capacitor still to be optimized from simulation (some 1-10 nF as a guess).
One may also  want some additional back to back Diodes over the OPs inputs (if no already inside the OP).
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 07, 2019, 06:17:59 pm
In the screenshots were the voltage drop is big, there also the slow CC has been activated by the load, because the output current was reduced using the current potentiometer.
For example in the second and 3rd screenshots, there the slow CC has been activated...

If the power supply will remain as it is, what would be the consequences ? The same as the previous power supply discussed in this thread ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: floobydust on May 07, 2019, 08:57:14 pm
mike_mike, what's the schematic look like now.

Sluggish CC response can also be due to the op-amp(s) saturating and I have not seen LM324/LM358 data on how it behaves with large-signal differential input. I have seen clamp diodes between op-amp +,- inputs to limit that to +/-0.7V or +/-0.3V with Schottkys.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 07, 2019, 09:08:55 pm
mike_mike, what's the schematic look like now.
This is the schematic that I have built on pcb. I have not included the current limiting led notification in the schematic, but on pcb there exists. The led notification schematic is the same with the one on reply #142.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: floobydust on May 07, 2019, 11:05:17 pm
mike_mike you're doing good work. This could beat the chinese 0-30V 2mA-3A power supply kit, which would be a relief to us all.
I haven't contributed and don't want to upset things, so take all this lightly. You could polish this design, or keep experimenting.

C2 and C4 give a variable time delay depending on the potentiometer's position. I find you can get instability at low (V or I) potentiometer settings, made worse by the Sziklai having higher gain at low currents (beta droops at higher currents). Q7 needs to be flipped C-E?

I would consider changing the architecture, so the CC op-amp cannot affect voltage-setpoint accuracy.
U3's output voltage (high) will not be consistent. In CV mode, U3's output will sit saturated high and will move around with temperature and mood, so the voltage setpoint will be a bit drifty.
Also, CC mode includes a second delay of the CV op-amp. So CC mode transitions go through two stages- which is overall slower.
The 0-30V 2mA-3A power supply kit, the CC op-amp instead pulls down U4 (+) input.
Other PSU designs the two op-amps instead drive Q1 through a diode/transistor OR gate, where either (V or I) op-amp can fast control Q1. CC still has priority over CV of course.
I'd have to play with the LTSpice .asc and see if I can contribute anything.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 07, 2019, 11:46:40 pm
Diode ORing with independent CC and CV compensation would be a worthwhile improvement.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 08, 2019, 06:49:08 am
Q7 needs to be flipped C-E?
Q7 is flipped C-E in the practical built. This problem is only in the simulation. I used the transistor schematic from the previous power supply discussed in this thread.

I am attaching the simulation file...

I have found another problem...

Later Edit: The problem was solved. The screenshots show the fast CC (with the probe on the 0.22 shunt resistor) and with 0R load resistor:
Vout=24.2V
Imax:771
Imed:772
I almost min:773
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 08, 2019, 07:39:27 am
Do add some serial esr (ie 0.5 ohm) to the output capacitors in the simulation .asc file.
The first peak is 7.7A FastCC, then there are two plateaus - it should be single one, imho.

Provided your shorter pulse is 1ms the first plateau ends with the pulse end, and then the second one continues for another 0.5ms/1ms/2ms based on I_limit setting.
So it comes from an RC around the CC opamp..
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 08, 2019, 07:49:30 am
I added 0.5R series resistance to the capacitors.

Later edit: I will replace the old fast CC.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 08, 2019, 07:57:40 am
So it comes from an RC around the CC opamp..
I am attaching the screenshot with the new fast cc circuit (same schematic as in simulation).

Should I increase the value of the CC op amp capacitor ? (C5 and R7)
Or the problem is coming from C4 ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 08, 2019, 08:02:50 am
You may also change the pulse such it mimics the psu_shorter

PULSE(0 1 0.1 10n 10n 1m 20m)
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 08, 2019, 08:09:27 am
I used the pulse configuration as you said.
The results are attached.
The second plateau is also present in the simulation.
I tried with 470p and 2.2n for C5 and with 100p for C4, but there also is present the second plateau.

Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 08, 2019, 08:33:12 am
The second plateau comes from R7C5 time constant. The bigger C5 the longer the ramp at the TRIM_V wiper (input to CV opamp). It also affects the rising edge of the Vout.

Btw, how do you set the output voltage?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 08, 2019, 08:46:49 am
1. In the practical montage I set the output voltage to about 24V, and in the simulation, I set it to about the same output voltage as the practical montage.

I set it to about 24V, because at higher output voltages, for example at 27V, when I connect the load (aprox. 3Amps) then the output voltages falls with about 1-2V. I think that this is because the input voltage is also falling. The transformer that I used has a 24V secondary and 160VA power.

2. The second plateau is a problem that it needs to be solved, or it could be as it is ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 08, 2019, 08:48:20 am
But how do you set the Vout? With which resistor or trimmers? What values for Vout=24V?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 08, 2019, 09:01:31 am
I set the Vout using the pot U6 from simulation. The curent (at this moment) value for this pot is 9.57k between the wiper and the gnd. The max value for this pot is 10.57k.
The other pot (the one for current) it is set to max (3.06A).
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 08, 2019, 09:12:55 am
I would not go with this design. I think there are better designs - ie those with separated CC an CV.
For example the one with separate CC and CV pulling a current source (or the base of the Q1 in your schematics) via diodes.
Both work fine with Vouts much larger that Vcc of the opamps, and use the low-side shunt.

The Howland combo gives you much more precise CC setting, but it uses high-side shunt, therefore Vouts much larger than Vcc of the opamps is difficult to get (or not possible easily).

Title: Re: LM324 Power Supply with variable voltage and current
Post by: Kleinstein on May 08, 2019, 09:19:18 am
The 2 nd plateau in the current is just the current needed to charge the output caps. This is kind of normal and not a problem.

The slightly odd looking triangle like ringing can be reduced with an RC series combination of some 5 K and 5 nF (or similar values)  in parallel to R12. It than may be possible to reduce C1 a little too. This speeds up the voltage regulation, by going from a PI regulator to the PID type loop.

The ringing could also happen during normal load transients (larger resistor in series to switch). So just slowing down the current regulation (with C5) is not a full solution to the overshoot problem.

The capacitor C4 is a kind of compromise, it may be needed to avoid trouble for the voltage regulation, but it is more of a problem to the current regulation. Here some of the less normal properties of the OP come into play - the models may not be accurate here.

Having the CV loop as an inner loop for the CC regulation is not the main problem here. The trouble is more with using the poorly defined upper output limit of the lm324 as the reference level and  coupling the CC control part to the reference before the pot.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 08, 2019, 09:57:13 am
For example a mod of the schematics (not tested in HW):
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 08, 2019, 10:04:19 am
Can I use the power supply as it is in the last simulation made by me ?
Will be there any problems ?

I am asking this because I like this design, because it does not have a lot of components and it is a simple design...
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 08, 2019, 10:18:49 am
Look at my MOD above. It is the same number of parts, added compensation into the output divider.
With C8=6.2nF there is almost no overshoot.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 08, 2019, 10:27:16 am
I think that I will not make any other modifications.
I it too much for me to modify each project...
I am sorry.
I should have been aware that it is not a good design, from the beginning of the project.

I just wanted to ask if the power supply will work as it is in my last simulation. I do not expect state of the art performance... just to power some loads, max 3A.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: Kleinstein on May 08, 2019, 11:28:03 am
That last suggestion from IMO is more like the standard version. It avoids relying on the saturation performance of the LM324. The added R4 and C8 could also be used with the other circuit. It gets even better with R4 = 5 K.

Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 08, 2019, 01:07:50 pm
@imo @Kleinstein
I finally managed to make the modifications. But it does not work. The output voltage is always 33V.

Please recommend me a schematic that is working. It is not necessary to be designed by you, I need only to be tested and to work.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 08, 2019, 01:49:10 pm
Here is the LTspice sim source and a picture showing it works.
Look at it carefully before you start to solder, do simulations, and ask when any questions.
Updated.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 08, 2019, 03:57:34 pm
Still nothing.
I checked about 4-5 times.
I also have the led circuit connected...
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 08, 2019, 04:07:11 pm
In a real circuit, Q1 might not be able to turn off enough.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 08, 2019, 04:10:27 pm
Yes, Q1 is saturated, it has BE voltage =0.603V
Title: Re: LM324 Power Supply with variable voltage and current
Post by: floobydust on May 08, 2019, 05:39:24 pm
No- use a transistor instead because it can completely turn off Q1 in OP's schematic. As a bonus, you can put an LED in series with base drive to indicate CC mode. Oh, and flip CC op-amp +, - inputs because things are inverted now.
I did get CV mode to work well but have to work on CC mode more to post anything usable.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 08, 2019, 06:43:27 pm
A BE of 0.6V doesn't mean that a transistor is saturated.  Because there is an Emitter resistor, the Base voltage sets the Collector current  which needs to go below about 0.12mA for  Q2 to be off.
The Base of Q1 needs to be able to be pulled below 1V. The CV opamp's output needs to be able to pull below 0.4V.
I don't use a simulator.
The actual reason for the output staying high needs to be found first. What voltage is being reported for the CV opamp's output?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 08, 2019, 07:35:46 pm
The output of the CV op amp is always 0.86V, with respect to the ground. At any voltage pot position.

I have found this power supply, on a Russian forum: https://vrtp.ru/index.php?showtopic=16392
It is a better design that the current one in this topic ?


I have also found that on the Russian forum are multiple versions of the power supply. Does anybody knows that forum and could tell us which is the latest version of the power supply ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 08, 2019, 10:19:19 pm
The output of the CV op amp is always 0.86V, with respect to the ground. At any voltage pot position.

I have found this power supply, on a Russian forum: https://vrtp.ru/index.php?showtopic=16392 (https://vrtp.ru/index.php?showtopic=16392)
It is a better design that the current one in this topic ?


I have also found that on the Russian forum are multiple versions of the power supply. Does anybody knows that forum and could tell us which is the latest version of the power supply ?
0.86V minimum at the CV op-amp's output is realistic and is not low enough to completely turn off Q1. This will cause the regulator to always output some current and the output to stay high voltage with low loads.
These recent modifications suggested by imo are making the design  become very similar to a bench supply design I  recently completed.
The problem with Q1 is solved by adding another resistor from Emitter to control  rail which is 8V in my design.
Q1's function is as a level shifter. Some designs that use a level shifter can be trouble because of the unnecessary gain it can add if not done properly.
The other circuit you linked has a level shifter.

My current design can be simplified. The TL431 reference and preload circuit are not essential. https://www.eevblog.com/forum/projects/linear-lab-power-supply/msg2388873/#msg2388873 (https://www.eevblog.com/forum/projects/linear-lab-power-supply/msg2388873/#msg2388873)
Title: Re: LM324 Power Supply with variable voltage and current
Post by: floobydust on May 09, 2019, 03:20:52 am
I have found this power supply, on a Russian forum: https://vrtp.ru/index.php?showtopic=16392 (https://vrtp.ru/index.php?showtopic=16392)

It looks like an older 2016 thread that had problems, people complaining it oscillates or drifts or CC is sloppy etc. They really like PNP Darlington TIP146. (https://www.onsemi.com/pub/Collateral/TIP140-D.PDF) I find the circuit weird and nothing I would build. The server was maxxed out but I got these pics for other people's opinions.

If you want a schematic that guaranteed works, then just copy a commercial bench PSU circuit.

I've never seen well-polished 0-30V 0-3A kind of PSU designs on the Internet, so I just quietly design  my own. A community approach seems to not work, in chinese or Polish forums someone ends up getting something working and making a PCB.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 09, 2019, 05:12:02 am
If you want a schematic that guaranteed works, then just copy a commercial bench PSU circuit.

Can you show me such a schematic ?
Are there on the forum schematics for commercial bench PSU, that 100% works correctly and which uses components that can be found easily ?

I found this power supply: http://www.electronics-lab.com/project/0-30v-laboratory-power-supply/ (http://www.electronics-lab.com/project/0-30v-laboratory-power-supply/)
Does it have a better version ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: Kleinstein on May 09, 2019, 05:49:49 am
The last link shows essentially the circuit from the cheap Chinese kits, with a different Layout. At least the Layout looks a little better. However with a TL081 one will not get reliably get 30 V and the 1 transistor is a somewhat on the weak side. So better only 2 A.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: floobydust on May 09, 2019, 06:15:10 am
I found the original 0-30V 2mA-2A PSU circuit, Practical Electronics Nov. 1978.
We haven't beat a 40+ year old circuit and I'm sure no one would copy it  :palm:  Now I have to apologize to everyone in china for lambasting them on this little kit...

Project on pg. 41 but big 12MB pdf:   https://americanradiohistory.com/Archive-Practical-Electronics/70s/Practical-Electronics-1978-10.pdf (https://americanradiohistory.com/Archive-Practical-Electronics/70s/Practical-Electronics-1978-10.pdf)
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 09, 2019, 07:10:14 am
@floobydust
Can I build the schematic attached ?
It is a good schematic to build ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 09, 2019, 07:12:22 am
Progress was being made in a useful direction.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 09, 2019, 07:31:38 am
I read the article, and I have a few questions:
1. Why all resistors are 1/2W ? Why can't be used 1/4W resistors ?
2. I can't see where are specified the properties for the 2.2k pot ?

3. What is the meaning of 3 good quality 10k log ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 09, 2019, 08:35:17 am
My MOD schematics works fine in simulation with the PSU_Shorter Vout=1V-30.6V based on CV pot's position.
Based on the activity the voltages at opamp's outputs are from 0.68V to 10.5V, and the Q1's base voltage is from 0.8 to 1.6V, the Q1's collector current is 21uA-300uA.

If I were you, I would start with LTspice. You have done a lot of great work by building various types of PSUs, the next step could be the refining of the "design phase" - here the LTspice is the right tool to use.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 09, 2019, 11:01:34 am
My MOD schematics works fine in simulation with the PSU_Shorter Vout=1V-30.6V based on CV pot's position.

Do you suspect that there is a mistake in the practical built ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 09, 2019, 11:16:23 am
The possible solution in Reply #189 didn't work?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 09, 2019, 11:33:08 am
I added R7 into schematic (2k2) and now the power supply is working.

Later Edit: updated the simulation, R15=39k as in the practical montage.
LE2: updated again the schematic.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 09, 2019, 12:12:39 pm
 :-+
Now, what is the right value for the R7?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 09, 2019, 12:28:02 pm
According to simulation, when the R7 value is higher than 4k7, there appears some overshoot in the output voltage, for example at 6k8.
I think that the correct value is between 1k and 3k3.

And there needs to be a minimum current that flown through that resistor ...
There also is a minimum current through the transistor.
Also, R7 and R25 forms a voltage divider.

I do not know for sure what is the right value for R7 ...
Can somebody give some help ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: Kleinstein on May 09, 2019, 02:43:38 pm
R7 mainly adds some voltage to the emitter, so the OPs can turn off the transistor even with the diodes.

The value should not be that critical. Something from some 1 K to 33 K should be OK. I personally would prefer 22 K (because I have too many of those   :-DD) and with a higher resistor the regulator could be a little faster turning on after being hard off (e.g. recovery from overshoot).

With the base to emitter resistor at the PNP not too large (e.g. < 2 K) one should get away without R7.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 09, 2019, 03:18:26 pm
Should I continue with some testing with the oscilloscope, using the PSU Shorter ?

Later Edit: can I replace R6 by 2k7 to lower the maximum output voltage ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 09, 2019, 03:45:38 pm
I have some screenshots.
Vout=24.3V, Iout=3.05A, PSU Shorter with 0R load:
1. On the output of the power supply:
0803-0805
2. On the 0.22R shunt resistor:   -   I think that something is not good here.
0806-0808

I am also attaching the schematic, that I used during tests.

Later Edit: and the simulation looks like the screenshots from the oscilloscope... (last image)

Deleting C4, eliminates that oscillation ... It is safe to eliminate C4 ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 09, 2019, 06:33:07 pm
The CC loop doesn't like a lot of Proportional response. There should only be a capacitor in the op-amp's feedback.
The CC Pot circuitry looks odd. Use the other design as a guide.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 09, 2019, 07:08:26 pm
The CC loop doesn't like a lot of Proportional response. There should only be a capacitor in the op-amp's feedback.
The CC Pot circuitry looks odd. Use the other design as a guide.
Can you please explain more detailed ?

@imo What should I do to correct this problem ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 09, 2019, 07:15:03 pm
Also, the performance of the CV and CC loops is affected by the gain of the output path. That is the amount of change of output current for a given change of voltage at the Base of the level shifter transistor, Q1 in your design.
The design I used has a gain of 10.    A 100mV  change at the Base of the level shifter causes 1A change of output current.
My design doesn't need a fast limiting transistor. The diode between the op-amp's inverting input and ground does fast limiting. I don't know if it will work well with an LM324.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: floobydust on May 09, 2019, 07:58:31 pm
Remember the LM324 is not a speed demon at 0.4V/usec slew rate. If the op-amp's output has to move 4V, that takes 10usec.
Adding R7 can decrease the amount the op-amp (output) has to slew, and make things look faster.

You're always going to have overshoot, undershoot and tweaking in SPICE is interesting but only a guideline and as good as your models. Modeling with nice pure 35VDC can fall apart when you go to a transformer and bridge rectifier. The 100/120Hz mains-ripple modulates the control loops and this can cause further instability. I'm saying SPICE is a guide, and can lead a person in the wrong direction.

C4 adds teeny tiny lag to the current-sense, so I would delete it. In the real world R_Shunt is wirewound and has inductance.
R5 I don't use, as R25 limits current there. The Russian design has no R7 or R25 and puts a 5.6V zener diode in place of R25.
Can you include your potentiometer models and the ST one. I am using On-Semi LM324 model 9/2018.

Code: [Select]
* BEGIN SPICE MODEL LM324
* ON SEMICONDUCTOR NEXT GEN MODEL 9/27/2018
* MODEL FEATURES INCLUDE OUTPUT SWING, OUTPUT CURRENT
* THROUGH THE SUPPLY RAILS, CLASS B OUTPUT STAGE, OUTPUT
* SWING, OPEN LOOP GAIN AND PHASE WITH RL AND CL EFFECTS,
* POWER SUPPLY REJECTION WITH FREQUENCY EFFECTS, COMMON
* MODE REJECTION WITH FREQUENCY EFFECTS, INPUT VOLTAGE
; NOISE WITH 1/F, INPUT CURRENT NOISE, INPUT BIAS AND
* OFFSET CURRENT, INPUT COMMON MODE VOLTAGE RANGE, VOS
* WITH TEMPERATURE EFFECTS, AND QUIESCENT CURRENT WITH
* TEMPERATURE EFFECTS.
* MODEL TOTAL SUPPLY VOLTAGE RANGE IS 3 TO 36 V.
* MODEL TEMP RANGE IS -55 TO +125 DEG C.
* NOTE THAT MODEL IS FUNCTIONAL OVER THIS TEMP RANGE
* BUT NOT ALL PARAMETERS TRACK THOSE OF THE REAL PART.
* NOTE THAT LIKE THE REAL PART THERE IS NO AB BIAS
* IN THE OUTPUT STAGE WHICH UNDER SOME CIRCUMSTANCES
* CAUSES HIGH OUTPUT IMPEDANCE AND OR CROSSOVER DELAY
* WHICH CAN EFFECT THE PERFORMANCE IN SOME CIRCUITS.
* THE COMBINATION OF OUTPUT CURRENT SINK AND NO AB
* BIAS WHEN USED WITH A LARGE CLOAD CAN CAUSE SOME
* INTERESTING SMALL SIGNAL STEP OVERSHOOTS THAT ARE
* LARGER THAN NORMAL AND RAMP LINEARLY RATHER THAN
* BEING SHAPED LIKE A CLASSIC OVERSHOOT. THIS HAPPENS
* IDENTICALLY WITH THE REAL PART AND THE MODEL.
*
* PINOUT ORDER +IN -IN +V -V OUT
* PINOUT ORDER  1   2   3  4  5
.SUBCKT LM324 1 2 3 4 5
R44 4 6 4E4
I1 4 7 0.5E-6
Q1 4 8 9 QPI
Q2 4 2 10 QPA
Q3 9 9 11 QPI
Q4 10 10 11 QPI
Q5 12 13 4 QNQ
Q6 13 13 4 QNQ
Q7 4 12 14 QPQ
Q8 3 14 6 QNQ
Q9 15 6 4 QNQ
Q10 3 15 16 QNQ
Q11 3 16 17 QNQ
R67 17 16 4E4
R68 5 17 18
Q12 4 15 5 QPQ
Q13 15 17 5 QNQ
I2 18 3 120E-9
I3 19 3 60E-9
I4 20 3 1E-6
Q14 11 18 3 QPQ
Q15 14 19 3 QPQ
Q16 5 7 4 QNQ
Q17 15 20 3 QPQ
C15 21 22 4.8E-12
R69 12 21 3
R70 12 15 3E9
E2 23 8 3 0 -10E-6
V51 23 1 1.56E-3
I6 3 4 5E-6
R71 4 3 4.5E5
Q18 12 9 11 QPQ
Q19 13 10 11 QPQ
C17 12 13 8E-12
C18 6 15 1E-12
C21 3 24 100E-15
R78 11 24 3E5
C22 1 2 0.23E-12
C23 2 0 0.79E-12
C24 1 0 0.79E-12
E3 22 0 15 0 2
C25 5 0 50E-15
Q20 25 25 0 QNQ
G1 3 4 VT 0 3E-4
I7 0 25 1E-3
V53 25 26 0.25
R79 0 26 1E6
E4 VT 0 27 26 1
R80 0 VT 1E6
V54 27 0 0.55
R81 0 27 1E6
.MODEL QPQ PNP IKF=3E-3 RC=300 KF=4.8E-17 BR=1
.MODEL QPA PNP IKF=3E-3 RC=380 IS=1.01E-16 VAF=245 RE=5 RB=1700 BF=300 KF=4.8E-17 BR=1
.MODEL QPI PNP IKF=3E-3 RC=380 IS=1.01E-16 VAF=290 RE=5 RB=1700 BF=306 KF=4.8E-17 BR=1
.MODEL QNQ NPN IKF=5E-3 RC=25  KF=4.8E-17 BR=1
.ENDS
* END SPICE MODEL LM324
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 10, 2019, 03:56:08 am
I will try without C4 to see what happens.
Regarding the R5 and R25, i don't know for sure if I need to delete them or not, because I was told here to use them in the circuit ... And I do not know what should I do

The results without C4 are:
Vout=24V, Iout=3.06A, PSU Shorter without load
1. On the Rshunt (0.22R)
0809-0811
2. On the output of the power supply
0812-0814

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

I think I will never make it work correctly ...  :( Because I have on the first 3 screenshots some negative voltage...
Title: Re: LM324 Power Supply with variable voltage and current
Post by: floobydust on May 10, 2019, 05:17:18 am
Let me know if this is right, I'm seeing:

Overshoot is to 6A for 10usec and levels off at 3A, the CC setpoint. Around 8A is the fast CC protection level?
-ve spike 500mV at the current-sense resistor waveforms 0809-0811 right when the "PSU Shorter" activates.  I'm guessing C4 was looking after this? I would think it's wiring issue, or where you connect scope ground.

The voltage output takes 250usec to recover in waveforms 0812-0814, then 200usec more to level off.
That is 20v/250usec = 0.08v/usec slew rate?
That would be quite slow, if I'm reading your scope traces correctly.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 10, 2019, 05:21:40 am
R5 isn't needed. The negative pulse is likely due to the probe ground in the wrong place or a ground loop.
The 10Ω resistor needs to go, it would be causing an increase in dropout voltage.
The fast limiting transistor might work well enough on the low side with the shunt changed to 0.1Ω
Did you change the CC pot circuitry?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 10, 2019, 05:33:02 am
Let me know if this is right, I'm seeing:
Around 8A is the fast CC protection level?
Yes.

R5 isn't needed. The negative pulse is likely due to the probe ground in the wrong place or a ground loop.
The 10Ω resistor needs to go, it would be causing an increase in dropout voltage.
The fast limiting transistor might work well enough on the low side with the shunt changed to 0.1Ω
Did you change the CC pot circuitry?
I will remove R5 and the 10R resistor. In the current montage were not removed.
I did not understood correctly how should I modify the CC pot circuitry. Should I remove the 10k resistor and leave only the capacitor in the feedback look of the CC op amp ? What other else should I modify ?

I made a simulation. It also have some oscillation (overshoot ?) on the voltage on the shunt resistor...
Title: Re: LM324 Power Supply with variable voltage and current
Post by: floobydust on May 10, 2019, 05:41:21 am
... The 10Ω resistor needs to go, it would be causing an increase in dropout voltage.

Um, which 10R resistor? R14 (at BD139) you need. Something to limit base-drive to the 2N3055's or for the fast CC. Without something, the BD139 shorts.
R11 10R for the minimum CC setpoint, should not matter.

Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 10, 2019, 05:50:51 am
Just copy the CC Pot wiring in the linked circuit. https://www.eevblog.com/forum/projects/linear-lab-power-supply/msg2388873/#msg2388873 (https://www.eevblog.com/forum/projects/linear-lab-power-supply/msg2388873/#msg2388873)
The values aren't critical and can be refined later.
That regulator circuit happens to already do what you are trying to achieve.
The 10Ω(R14) at the Emitter of the PNP driver can be removed only after the fast limiting is moved to the low side.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 10, 2019, 05:56:20 am
Yes, you can try removing R3 leaving C5 although the CC loop looks stable now but this could be due to your output path having a much lower gain than mine.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 10, 2019, 06:51:45 am
Ok, I will copy the CC pot wiring from your schematic, and I will come back later with the results.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: Kleinstein on May 10, 2019, 08:15:40 am
R14 is needed to limit the current for the fast current limit. One could reduce it to something like 1 Ohms if 2 diodes in series are in parallel to R16.  At some 3 A at the output the current through R14 should reach some 100 mA. So some 1 V more drop with 10 Ohms, but not much with 1-2 Ohms.

To reduce possible overshoot (e.g. after a short phase of current limiting, possible only the fast limit active), one could consider moving the left side of C1 to the other side of the D2. This limits the windup of the voltage regulator with little effort.
It depends one the speed of the OPs, and should be OK with the slow LM324/358.

A LED (or zener with 3-5 V) in series to R1 could help against possible spikes on turn on / turn off, as it would prevent the output to turn on until the OPs have at least some 5 V to work with.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 10, 2019, 10:13:30 am
To reduce possible overshoot (e.g. after a short phase of current limiting, possible only the fast limit active), one could consider moving the left side of C1 to the other side of the D2. This limits the windup of the voltage regulator with little effort.
I have just applied that mod to my design and it works well without causing any problems that I can find.
It works especially well in the situation where the regulator goes from CV to CC and back to CV without the output voltage dropping by much.
The RC across the top feedback divider resistor does little to reduce overshoot in this situation.

Extra: I have totally removed the RC from the feedback divider. The load transient response has increased from 3µs to 10µs which is still more than fast enough.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 10, 2019, 10:44:19 am
I copied your schematic for CC, but is does not work in simulation. The max current is about a few kA.

Are there any mistakes in the simulation ?
Please have a look at the simulation.

@floobydust I was talking about the 10R resistor in series with the CC potentiometer (the 5k pot).
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 10, 2019, 10:45:50 am
can you post the revised schematic?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 10, 2019, 10:49:05 am
Please find attached the last simulated schematic.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 10, 2019, 11:04:28 am
That all looks correct. You mentioned that the Pot is 5K? which would be fine.
Maybe the simulator doesn't like the Schottky diode.
What actually doesn't happen?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 10, 2019, 11:07:39 am
The output current is too high. It will burn the transistors if a short circuit happens at the output of the power supply.
Please find attached the result in LTSpice.

The pot is 5k.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 10, 2019, 11:14:22 am
What voltages are on the inputs of the CC op-amp with no load?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 10, 2019, 11:17:36 am
In the practical montage or in the simulation ?
I don't want to built it in the practical montage, until it works in the simulation, because the transistors can burn in case of a short circuit on the output.
So I want to make the simulation to work correctly first... if you can help me.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 10, 2019, 11:25:58 am
Yes, the current limit should be equal  to the voltage set on the non-inverting input divided by the shunt resistance.
For example, if the voltage set on the non-inverting input is set to 0.22V, the current limit should be 1A.
The inverting input should alway be zero volts.
You should apply load gradually to a real regulator the first time. I use a 300W wire-wound rheostat.

Extra: that calculation isn't exact but very close.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 10, 2019, 11:39:38 am
Has R7 been changed to 22K?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 10, 2019, 11:42:45 am
Yes, R7 was changed to 22k.

This is the current through the load with the pot at min and with R8=100k.
But with the pot at max, the current is a few kAamps.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 10, 2019, 11:52:30 am
You need to analyze the problem in steps.
Does the voltage regulation loop still work?
Set 0.22V on the non-inverting input of the CC op-amp.
Put a resistor across the output that would cause a 2A load at the set output voltage.
Does the output of the CC op-amp drop to 0.8V?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 10, 2019, 12:02:53 pm
If I set the load resistor to 12R and the output voltage to about 26V, then the output looks like this:

I don't know how to set 0.22V on the non-inverting input of the CC op amp.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 10, 2019, 12:22:18 pm
I cant make much sense of that yet. What voltage is the CC Pot's wiper set to? What is the on time of the pulser?
Why was R7 changed to 22K? Have you tried changing it back to 2.2K?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 10, 2019, 12:40:32 pm
V5

D4 - I would use 10-15V 0.5W zener
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 10, 2019, 12:46:42 pm
I tested again the circuit, using the last schematic from @imo, but the current is also very big...
Please have a look at the attached image.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 10, 2019, 12:50:44 pm
I think the CC Pot is set too low and the fast limiting isn't working also.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 10, 2019, 12:51:34 pm
I do not see kA there..
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 10, 2019, 12:54:39 pm
You see kA because you watch the current via the 0.01ohm load.
The kAmperes come from the discharge of the output capacitors into 0.01ohm (because the 1uF there has not got an ESR).
That current does not flow via R_Shunt, however.

In the V5 I added the xavier60's antiwindup D7, and tuned the stuff around the CC pot such you get 3A SlowCC in max pot position.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 10, 2019, 01:06:30 pm
Careful with the CV anti-windup, it only works properly with the correct combination of PN and Schottky diodes.
I'm now using Kleinstein's idea from Reply #218.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 10, 2019, 01:28:55 pm
I did not found D6 and D7 at the local electronics shop.
Are they really necessary ? Can I use 1N5817 ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 10, 2019, 01:43:59 pm
D6 isn't necessary if you are keeping the fast limiting transistor.
D5 can be a 1N4148 and no need for D7, all if Kleinstein's idea from Reply #218 is used which is working fine for me.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 10, 2019, 01:50:34 pm
all if Kleinstein's idea from Reply #218 is used which is working fine for me.
Are you talking about the idea with the led or zener in series with the R1 ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 10, 2019, 01:57:59 pm
all if Kleinstein's idea from Reply #218 is used which is working fine for me.
Are you talking about the idea with the led or zener in series with the R1 ?
I should have said it is the CV anti-windup idea for reducing voltage overshoots.
I'll add an updated circuit to the other thread.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 10, 2019, 02:05:13 pm
Ok, are you saying that are there alternatives instead of using the BAT43 ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 10, 2019, 02:16:44 pm
There is no need for any Schottky diodes if the new CV anti-windup idea is used and you keep the fast limiting transistor.https://www.eevblog.com/forum/projects/linear-lab-power-supply/msg2388873/#msg2388873 (https://www.eevblog.com/forum/projects/linear-lab-power-supply/msg2388873/#msg2388873)
I'm still  curious to know if the fast limiting can work on the low side. It will use less parts.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 10, 2019, 02:20:36 pm
I modified the schematic.
Please have a look and tell me if the schematic is good.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 10, 2019, 02:22:17 pm
Yes, that looks right.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 10, 2019, 02:25:14 pm
Ok, I will built it and I will try to test the power supply with the oscilloscope.

Later Edit: What output voltage and output current do I need to set when testing ?

But first, I will test it in the simulator.
First test attached. You can see on the image the settings for the pot, load and output voltage. Please have a look at the screenshot and tell me if the result is good.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 10, 2019, 03:56:50 pm
I would add a buffer in the CC wiper.
V7.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 10, 2019, 04:14:23 pm
I added the LED circuit...
Please have a look at the schematic and tell me if it is good.

I also added an updated circuit.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 10, 2019, 04:22:52 pm
CC LED test in V8.

PS: V8.1 is not good.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 10, 2019, 04:46:23 pm
Something started to work bad, because the simulation blocks without giving any error messages at Transient analysis 50% done.
What should I do ?

Later Edit: a few minutes ago it was working. Now it sais Defcon1, I will google it, but I have no idea how to fix it.

Sometimes it works, and sometimes not.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 10, 2019, 05:00:35 pm
Post your .asc file.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 10, 2019, 05:04:34 pm
Please find attached the .asc file.

Later Edit: I forgot to add the feedback capacitor on U5.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 10, 2019, 06:22:15 pm
Here is the V9.
It has problems with 10k input resistors in CC_LED opamp comparator. Why?
100k resistors there work.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 10, 2019, 06:55:29 pm
Added a Soft Start :)
V10
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 10, 2019, 07:31:13 pm
It is safe now to built the practical circuit and test it with the oscilloscope ?

Later Edit: C15 needs to be non polarized ? The local electronics shop does not have in the stock such big values for non polarized capacitors. This is why I am asking.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 10, 2019, 09:27:52 pm
C15 4u7/50V is polarized. Could be 1u-10u (based on its value the start of Vout will be delayed).
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 10, 2019, 09:49:14 pm
Why is the softstart needed?
A better use of the transistor would be as an Under Voltage Lock Out between R25 and ground.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 10, 2019, 10:03:36 pm
Some tests in LT Spice. You can find the pots settings in the image.

I replaced D4 by BZX384B3V6, because I did not found the model for the original diode.

Are the results good ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 10, 2019, 11:09:06 pm
All looks fine to me. The small amount of voltage overshoot after a shallow drop is because the output current  can't be turned off instantly.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 10, 2019, 11:26:54 pm
What is D4 for? It could cause under voltage stability problems. It is better if the op-amps stay in control  for as long as possible as the unregulated voltage drops.
Kleinstein's idea from reply #218 might help if there is a problem.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 11, 2019, 05:29:44 am
What is D4 for?
D4 is for lowering the input voltage for 7812, if the voltage goes above 35V.
I will delete D4, if it can cause problems.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 11, 2019, 05:32:09 am
Keeping the 7812 safe is important also. What input voltage do you expect?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 11, 2019, 05:46:59 am
I used an LM317. It is working near its maximum rated voltage so I have a 10V zenner crowbar protecting the 8V rail and a 100mA polyswitch at the output of the LM317.
When I tested one of my ST branded LM317's, it didn't break over until 70V anyway.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 11, 2019, 05:53:24 am
D4 is there in order to drop the 7812 input voltage (as his input is around 35V), afaik.

@MM: you may show the I(R_Shunt) with the peak upwards such you right click on the "I(R_Shunt)" label (trace window), and edit it to "-I(R_Shunt)".

@MM: the slow CC_limit is

I_cc = V_wiper_cc / (R_Shunt * R3/R5) = V_wiper_cc / 2.2

For example 6.908V gives you 3.14A slow CC limit.

The output

Vout = (R12 + R13) / R13 * V_wiper_cv = 2.833 * V_wiper_cv

For example 5.67V gives you 16.06V Vout.

When you want to see the correct voltages in the schematics after the simulation use ".tran 0.2", the "startup" there causes the simulation starts at 0V and it shows some weird uVs then.

Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 11, 2019, 05:56:59 am
What input voltage do you expect?
I wanted to use a 24Vac transformer, which has a measured output voltage of about 26-27Vac.
I also have some 30Vac transformers which I can use if necessary.

Using the .tran 0.2 gives me something like the attached screenshot. Probably, I am missing something.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 11, 2019, 06:32:17 am
 :D
You miss the soft start..
Either disable the sstart or use longer tran.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 11, 2019, 06:34:01 am
I will use longer tran.

It is better to use the 30Vac transformer and an LM317 ?
If I will use the 30Vac transformer, then the output voltage will go higher than with the 24Vac transformer...
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 11, 2019, 06:42:42 am
You may use higher voltage zener for a larger drop.
The max current through the zener I see is 12mA (except a 250mA 30ns peak which is probably coming from ideal simulation).

The "soft start" is experimental. Some ripples or fluctuation on the input voltage rail may trigger the soft start such it lowers Vout. Thus it still needs some tuning.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 11, 2019, 07:07:11 am
Ok, then I will not use the soft start circuit.
I think that it is not really necessary...
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 11, 2019, 07:46:29 am
Are there any other modifications needed or I can build and test the practical montage ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: Kleinstein on May 11, 2019, 07:57:53 am
In stead of the soft (delayed) start circuit with the capacitor, reacting on rising voltage, I would prefer the zener / LED in series to D1. It should disable the output if the voltage from the 7812 is too low (e.g. below some 5-8 V, the exact limit depends on the zener and R7). This would work and turn on and turn off.

If really worries about peak current to the zener in series to the 7812, one could also have some series resistance in addition to the zener to limit peak currents and ripple currents.

The buffer for the current limit setting is no really needed - it does not hurt, but just a wire is lower noise (though it does not matter). One could use the 4 th OP for something like temperature supervision (turn off if the heat sink gets too hot, or enable a fan).

For the actual build one should watch out where the shund voltage is sensed - make sure there is no other drop included.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 11, 2019, 08:03:27 am
The LM7812 maximum input voltage rating typically is 35V. The LM317 has a typical maximum input to output voltage difference rating of typically 40V.
An LM317 set for 12V would then have a maximum input voltage of 52V so long as the output is never shorted to ground.
There is also the option of getting the high voltage version, the LM317HVT like I did and got sent blacktopped fakes anyway.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 11, 2019, 08:04:32 am
In stead of the soft (delayed) start circuit with the capacitor, reacting on rising voltage, I would prefer the zener / LED in series to D1.
You do mean R1, don't you?

That would work with a zener (ie 5.1V) in the Q1's emitter (and say 3k3 in the collector), it seems.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 11, 2019, 08:41:14 am
If a simple solution can't be made to work, this is certain to.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 11, 2019, 08:48:27 am
I would go with the zener and LED version 2 (updated above), as the compare will be "sharper", imho.
An Led and 3.9-5.6V zener.
Below with Blue (top) or Red LEDs.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 11, 2019, 09:03:18 am
I modified into my simulation.

Later Edit: added updated file.

Later Edit 2: updated file.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 11, 2019, 09:19:19 am
You may remove the soft start when the Vcc undervoltage lock is used.

The CC set voltage buffer - in a different thread we messed with a PSU design it showed to me this kind of CC sensing requires an low impedance source for the compare divider. It could be the whole "CC precision" is not great here, therefore it may work without the buffer. You have to try and measure.

Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 11, 2019, 09:22:30 am
Updated file.

You have to try and measure.

Do I have to try in the practical circuit ? Or in the simulation ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 11, 2019, 09:39:48 am
Try to make a few simulations with different Rloads, Vout and Icc settings.
Also try to add some output capacitance (with ESRs) to see what happens with larger capacitive loads (up to 2000uF for example).
You may make the 1ms load switch pulse longer in the simulation such you see the whole event with smaller loads and larger caps, like

PULSE(0 1 0.01 10n 10n 10m 50m)

PS: also do use the 7812 instead of V6 there, of course.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: Kleinstein on May 11, 2019, 10:13:20 am
This circuit should not need the buffer for the CC set value. It would only effect the linearity of the setting a little, but pots are not that linear anyway.

For most of the simulations V6 instead of the 7812 should be OK.

I would still consider 1 diodes parallel to R30 to allow for a reduced R29 and thus drop.

For further testing in the simulation (e.g. load tests, like 1 A  - 1 mA - 1 A) one can use the spice current source as a load. This is easier than the switch and resistor and does not include the resistor as a helping load.

The current "source"  can also be used in an AC mode simulation to look at stability: the output voltage than gives the output impedance (in ohms, as the source is 1 A for 0 dB). This way one can see the possibly critical loads (capacitance) without separate runs.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 11, 2019, 10:20:54 am
Here are the results with resistor load, and the .asc file.

Please have a look at the screenshots and tell me what you think...
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 11, 2019, 12:16:44 pm
New tests, with the CC buffer removed.
I am also attaching the .asc file.

Please have a look at the attached screenshots and tell me if the results are good.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: Kleinstein on May 11, 2019, 01:02:42 pm
The simulation results so far look good. However they are only the CC to CV and CV to CC transitions.

One should at least simulate a few more normal load transients in the CV mode. Something like a 10 mA - 1 A - 10 mA cycle. Once with just the load and once with an extra capacitor like 1000 µF with some 5 mOhms ESR.  The extra cap case would be about the worst case load. One should have the CC limit at some 1.5 A and maybe some 1.1 A for a test.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 11, 2019, 01:09:38 pm
I am curious to see what voltage the Base voltage of Q1 needs to go up to for a 3A load.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 11, 2019, 01:16:40 pm
@xavier60 Please find attached the voltage (green color) for the base of Q1. Color blue = output current.

@Kleinstein I will come back with the results...
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 11, 2019, 01:29:05 pm
@Kleinstein
The results:
1. Resistive load 24,25
2. Capacitive load 26,27

Please have a look at the results and tell me if they are good.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 11, 2019, 01:41:17 pm
@xavier60 Please find attached the voltage (green color) for the base of Q1. Color blue = output current.

@Kleinstein I will come back with the results...
That shows that the output stage should have plenty of gain.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 11, 2019, 02:38:06 pm
What else should I test next ?
Are the last 4 screenshots good or not ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: Kleinstein on May 11, 2019, 03:13:17 pm
@Kleinstein
The results:
1. Resistive load 24,25
2. Capacitive load 26,27

Please have a look at the results and tell me if they are good.

The resistive load looks Ok, as far as one can see it. The scale is rather poor, as the interesting part is some +-500 mV around the set voltage. No need to show multiple periods.

For the capacitive loading there was a misunderstanding: the capacitor should be fixed connected to the regulator for the test, and only the current switched (ideally with a current source element, but the resistor and switch version is also acceptable, though not such a strict test).
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 11, 2019, 03:29:57 pm
For the capacitive loading there was a misunderstanding: the capacitor should be fixed connected to the regulator for the test, and only the current switched (ideally with a current source element, but the resistor and switch version is also acceptable, though not such a strict test).
Like this ? 28.png

Later Edit: this is with resistive load: 29.png
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 11, 2019, 04:48:18 pm
Zoom in at the rising edge (blue) 28.png - it looks like ringing there..

PS: when you remove R4 and C4 you will get nice ringing with aprox 457us period. It comes from R2C1 in CV comp. Needs to be fine-tuned somehow (or to find values as a good balance between resistive and capacitive loads).
In the meantime increasing C4 to 4n7 helps.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: Kleinstein on May 11, 2019, 05:45:51 pm
The case with a 1000 µF low ESR cap is a really difficult one - close to the worst case. So in this case some ringing is not a problem if it is not too much. One might still tweak the circuit a little, but there is no need to avoid ringing all together.

The load response without the extra capacitor looks good.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 11, 2019, 05:59:46 pm
This is without R4 C4 input CV divider comp.
28.png setting.

Sure a difficult load. Curious how to fine-tune that response.
It is sensitive to R2C1.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 11, 2019, 06:16:03 pm
 :phew:
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 11, 2019, 06:48:15 pm
Some minimum load should reduce the bouncing.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: Kleinstein on May 11, 2019, 07:00:25 pm
For tuning I would look at the output impedance, with a current source (sink) in AC mode.

Those triangle like oscillations are a special case that includes some wind-up / nonlinear effects.

Some limitation of the wind-up can help. A good stability in the linear range case is a good starting point though. For the wind-up effects I see only the transient mode simulations.

A minimum load can help, but the effect is limited if a large cap is present.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 11, 2019, 07:56:03 pm
I understood that there is a problem regarding the ringing of the power supply when powering loads.
The ringing depends on R4, C4 and it is sensitive to R2, C1.
What would be the next step in solving this problem ?
Making experiments in LTSpice using different values for R2 and C1 should solve the problem ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 11, 2019, 08:04:44 pm
Output impedance:
Updated
Title: Re: LM324 Power Supply with variable voltage and current
Post by: Kleinstein on May 11, 2019, 08:16:24 pm
One can do a few more experiment with different C1 R2 values. I would prefer output impedance in the AC mode here, as it includes all possible capacitors at the load in one simulation.  This simulation can also be used to find good values for C7/C10.

Most of the time, if the impedance is good, the transient simulations also look good.  Specific to the transients going all the way to saturation it may help to have back to back diodes across the inputs of U4. It's worth a try at least in the simulation to see if it helps.

Some ringing in case of a very difficult load (large cap with very low ESR) is normal - it is already a good sign if the regulator does not permanently oscillate under that condition. Limiting the circuit to rather slow TIP3055 and LM324 OPs means one should not expect high end performance.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 11, 2019, 08:39:02 pm
C1 from 330p-10n.
All caps with some esr except the comp ones.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 11, 2019, 10:10:31 pm
Output impedance with C1=10n and R2=10-100k
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 11, 2019, 10:12:07 pm
And the 28.png (1000uF 5mOhm) test with C1=4n7 and R2=100k

It oscillates with small capacitive loads, however.

It seems we need a switchable R2, 10k for small cap loads, 100k for large one :)
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 12, 2019, 02:14:57 am
The needed compensation should be about the same as what my bench supply project is happy with.
The photos show load transient tests with a pulsed 2A constant current load.
The 2nd photo shows some ringing at about 8Khz with a 470µF super low ESR polymer capacitor connected directly across the output at the regulator's PCB.
It also causes  multiple bouncing after unloading.
Common type low ESR electos don't cause ringing.
The ringing and bouncing don't occur when I connect the polymer capacitor via 20cm of 24AWG twisted pair.
I believe that this behavior is expected from current sourcing designs including Harrison topology and is not a practical problem.

https://www.eevblog.com/forum/projects/linear-lab-power-supply/msg2388873/#msg2388873 (https://www.eevblog.com/forum/projects/linear-lab-power-supply/msg2388873/#msg2388873)
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 12, 2019, 07:52:10 am
V12
Title: Re: LM324 Power Supply with variable voltage and current
Post by: Kleinstein on May 12, 2019, 08:31:54 am
Output impedance with C1=10n and R2=10-100k

I think there is something wrong with the way the output impedance is simulated. Some 100 Ohms over a large range would be really bad.  I did a simulation of an older version - to get a rough idea what C4 R4 values to use. It did look much more reasonable. So I think it's more a problem with the simulation, not the circuit.

@xavier60: some ringing with a super low ESR cap at the output is hard to avoid and probably to be accepted.
This is because the typical impedance curve of the output will look like very much like an inductor, especially in the 100 Hz to 10 kHz range. One essentially needed the impedance to go down to lower frequencies - so essentially no good way to avoid this. One can and should  (R4 and C4 are good for this) deviate from the simple  Z ~ f curve in the 100 kHz range. This at least avoids ringing with more common 10-100  µF range low ESR caps.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 12, 2019, 08:41:45 am
@Kleinstein, This possibly relates to what you said. When I increase the size of the compensation capacitor from 150pF, the ringing with the 470µF super low ESR  capacitor becomes much larger.
I am completely satisfied with the performance of my bench supply project.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 12, 2019, 08:46:56 am
@Kleinstein: would be nice to see your simulation of the output impedance (incl. the .asc). Thanks.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 12, 2019, 09:18:17 am
Is there any possibility to use an alternative for the switch across the R2 (91k) ? 

@xavier60, Can TLC072 be replaced by another op amp, in your power supply project ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 12, 2019, 09:39:56 am
I recently tried an LM358 in place of the TLC072. There was very little difference in performance. Mainly the diode fast limiting was slower at 10µs instead of 2µs which isn't important anyway.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 12, 2019, 10:05:40 am
@xavier60 Where does CC and CV led's need to be connected ? To the output of the CC and CV op amps ? (in your power supply design)
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 12, 2019, 10:25:08 am
@xavier60 Where does CC and CV led's need to be connected ? To the output of the CC and CV op amps ? (in your power supply design)
Yes, they connect to the respective op-amp outputs. The way my design is configured, the LED current is about 200µA which gives suitable brightness with high efficiency LEDs which are commonly found on eBay now.
With your current design using 12V control rail and the operating point of op-amps, the LED current will be something higher using 10K resistors.

Also: If for some reason the regulator's output voltage is forced higher than its setting, the CV LED will glow extra bright.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 12, 2019, 10:55:36 am
@xavier60
Can you please answer a few questions about your PSU ?
1. Can R32 and R33 be omitted ?
2. What type of diodes are D2, D3 and D10 ? 1N4148 ?
3. C9 is polarized ?
4. Where should be connected the shutdown K of the diode ?
5. What are the values for R23 and R24 ?
6. This PSU has been tested ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 12, 2019, 11:52:04 am
@xavier60
Can you please answer a few questions about your PSU ?
1. Can R32 and R33 be omitted ?
2. What type of diodes are D2, D3 and D10 ? 1N4148 ?
3. C9 is polarized ?
4. Where should be connected the shutdown K of the diode ?
5. It is good to build this PSU ?
R32 is a 100mA polyswitch and isn't important if there is no concern about the regulator breaking down.
R33 is a 100mA polyswitch which protects the preload circuit from reverse polarity. The whole preload circuit can be replace by a resistor.
Diodes  D2, D3 and D10 can be 1N4148.
C9 can be a polarized electrolytic capacitor. I like to use leaded monolithic ceramic capacitors.
Shorting the shutdown K of the diode to ground turns off the regulator's output.
My design and the one imo is developing are very similar. You should stay with that design with some changes.
The under voltage lockout idea with D9 should work well. It might not need D6 and R16. The gain of Q1 is easy to change by changing the value of R25 if necessary.
My design does not have a reliable under voltage lockout to suit other op-amp types. 
The CC buffer can go and there is no need for the op-amp for the CC LED, just copy what I have done.
Ill stop at this point. Draw up a new circuit, then we will sort out more details.

R23 and R24 are 10K 10 turn pots.

Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 12, 2019, 12:02:39 pm
I would like to built your PSU circuit  :) ... if it is tested and working good.
Are the testing results any good ?
I need something that does not need so much testing ... something that is already tested and it is working good  :)

Later Edit: what can go wrong if the under voltage lockup is missing ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: Kleinstein on May 12, 2019, 12:06:05 pm
@Kleinstein: would be nice to see your simulation of the output impedance (incl. the .asc). Thanks.

Here is a simulation file for the Z_out simulation. Its based on an older Version and with slightly changed OPs / transistors to use models that I had on the PC. The response that version looks reasonably, though still with a relatively slow regulation.
The curve is the result, with the Zout still in dB (rel 1 Ohm), so 0 dB is 1 Ohms and -60 dB is 1 mOhms
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 12, 2019, 12:45:12 pm
@Kleinstein: thanks, I wanted to see how you did the .ac analysis. I did it exactly the same way, but with the recent version of the PSU schematics, which is way different than yours. Thus the results are pretty different too..
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 12, 2019, 12:53:54 pm
I would like to built your PSU circuit  :) ... if it is tested and working good.
Are the testing results any good ?
I need something that does not need so much testing ... something that is already tested and it is working good  :)

Later Edit: what can go wrong if the under voltage lockup is missing ?
If the ULVO doesn't work properly, the output voltage can go higher than the set voltage after the mains is switched off.
My design will work well if built the same as the schematic. I understand that some of the parts you already have are different.
Testing can't be avoided.
You should not want to completely abandon another member's work after they have made so much effort.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 12, 2019, 01:10:59 pm
You should not want to completely abandon another member's work after they have made so much effort.
I will not abandon it.
I just wait with impatience for @imo and @Kleinstein to find the final version, of the design.

Does anybody has the final version ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 12, 2019, 01:45:32 pm
The version 12 could be taken as a solution worth of implementing in HW.
You should implement it into the real HW with care.
1. you do not need the switch nor the 91k resistor, unless you plan to feed systems with large input capacitors with <0.01ohm esr
2. as others wrote you may not need the CC's pot buffer
3. you may also get rid of the CC_LED opamp, as an LED could be wired directly to to CC opamp's output (via a 10k resistor for example against Vcc)
4. on real HW you may want to optimize the compensation capacitor's values as described earlier
5. my favorite hint - wire a large resistor (ie 1Meg) from the pot's wiper to the gnd, in case your pot is a cheap plastic crap
6. there is not such thing like final design, all designs include at least one issue, and in the moment as a design is implemented in the HW it becomes obsolete :)

Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 12, 2019, 01:54:55 pm
3. you may also get rid of the CC_LED opamp, as an LED could be wired directly to to CC opamp's output (via a 10k resistor for example against gnd)
The LED should be wired from the op amp's output to gnd, in series with a 10k resitor ?
 
Later Edit: if I will remove the CC pot buffer and the led notification op amp (CC led op amp), then what should I do with them ? LM324 has 4 op amps and I use only 2 of them in this design ...

I removed the CC pot buffer and CC led op amp.
I added the 1Meg resistors.

Please have a look at the schematic and tell me if it is good.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: Kleinstein on May 12, 2019, 03:02:34 pm
The last version is not that much different from the Version from Xavier. It is the same type of circuit with more minor differences

The circuit is about ready to build in real hardware, e.g. on a perf.-board or similar.
The LM324 has 4 OPs, so one could keep the OP for the mode LED. The 4 th OP could control a fan or over-temperature off.
Alternative there are dual OPs like LM358.
If really build for a high current, I would consider a better (lower drift, e.g. TLE2021) OP for the CC mode. This could permit a smaller shunt resistor and less trouble with self heating of the shunt. With the LM324 class OP one would have quite some drift at low currents or heat problems with the shunt at high currents.

The possible 2 diodes in parallel to R30, I already mentioned earlier would be the main addition I would consider.
For a first test, I would start with only one power transistor and thus less maximum current. I would add the other only after a first test.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 12, 2019, 03:13:09 pm
3. you may also get rid of the CC_LED opamp, as an LED could be wired directly to to CC opamp's output (via a 10k resistor for example against gnd)
The LED should be wired from the op amp's output to gnd, in series with a 10k resitor ?
I fixed above, it should be wired from CC opamp's output to Vcc via 10k resistor. The LED current will be from 10uA to 440uA, I think enough for the indication.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 12, 2019, 03:17:11 pm
Later Edit: if I will remove the CC pot buffer and the led notification op amp (CC led op amp), then what should I do with them ? LM324 has 4 op amps and I use only 2 of them in this design ...
I would cut the LM324 package in half and use the spare opapm's for a second PSU..  :-DD
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 12, 2019, 03:19:35 pm
1. I am attaching the modified simulation file. Please have a look and tell me if it is correct.
2. It LM358 a alternative for LM324 in this design ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 12, 2019, 03:32:12 pm
The CC LED in V13 is ok.
Also do change the version number in the schematics plz.

Quote
2. It LM358 a alternative for LM324 in this design ?
Replace the LM324 with the LM358 in your simulation and you will see.

Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 12, 2019, 03:37:35 pm
I fixed the version number.
The CC led should be red, or it can also be another color, for example amber or blue (I know that those led's have different dropout voltage)...

Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 12, 2019, 03:46:19 pm
CC LED could be any modern high lumi LED any color.
The D8 - look at my simulations of the undervoltage lock with Blue and Red leds and take the one which does suite you better.

Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 12, 2019, 10:56:02 pm
The UVLO should work without D8 and R16.
When the control rail gets down to 5V, the Emitter of Q1 will also be 5V. At this point it is not possible for Q1 to be turned on because only 5V is available to the whole control circuit.
R1 can be higher like 10K.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 13, 2019, 02:28:12 am
This illustrates the diode clamp idea that limits drive current while allowing a lower value for R29.

Edit: corrected D9
 
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 13, 2019, 11:37:57 am
I managed to built the circuit. The built schematic is attached (.asc file).
I did not used the buffer, as you said that it could be removed.
I made some tests, with a red led (normal red led, not low current, because I did not found any low current led at the local shop), and with the 10k resistor it does not light up sufficiently.
I used 2x6800uF because I had them from an old project. If necessary I could use another capacitors.

The schematic is functional, I just tested it with a load at 25.5V and at about 19V and it seems to work.
Also the red led lights up when a short circuit is produced on the output. I also tested the variable current limit and it works.

I will test it with the PSU Shorter, but first I need to know what resistors and capacitor do I need to use for LM555 in order to generate the pulse as it needs to be ? Initially it was 220k/4k7/330nF.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 13, 2019, 01:47:47 pm
I tested the power supply using the PSU Shorter and 0 ohms load resistor. The schematic is the one from reply #331.
I see some ringing on the output of the power supply, at low output voltages.
1. V out = 1.08V, Iout=3.01A
0810.jpg
2. V out = 1.08V, Iout= 1.5A
0811,0812
3. V out = 4.17V, Iout=3.01A
0814,0815
4. V out = 10.84V, Iout=3.01A
0816,0817
5. V out = 10.84V, Iout=1.5A
0820
6. V out = 25.6V, Iout=3.01A
0822.jpg

Please have a look at the attached screenshots and tell me what you think.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 13, 2019, 02:04:36 pm
The ringing could just be wire inductance resonating with the MOSFET's output capacitance.
See if the ringing is larger at the MOSFET.
I can't open ASC files here. I don't know what the schematic is.
Load transient tests will give us an idea about how well it's compensated.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 13, 2019, 02:04:50 pm
C4=4n7 to 6n2 may lower the small overshoot/ringing at the rising edge of the Vout.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 13, 2019, 02:24:36 pm
With C4=4n7
Vout=1.08V, I=3.01A
0824-0826
Vout=1.08V, I=1.5A
0827-0830
Vout=4.64V, I=3.01A
0831-0833
Closer to the mosfet
0834-0836

Please have a look at the attached screenshots and tell me what you think.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 13, 2019, 03:18:06 pm
..and with C5=4n7 (CC comp) ringing should disappear (sim).
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 13, 2019, 04:00:15 pm
I tried with C5=4n7 and C4=4n7, but the ringing did not disappeared.
1. V out=4.64V, I=3.01A
0837-0838
2. V out=1.21V, I=3.01A
0839-0840

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

Title: Re: LM324 Power Supply with variable voltage and current
Post by: Kleinstein on May 13, 2019, 04:20:13 pm
It looks like there is still some ringing when going from CC to CV mode. I am not sure if this is the phase where the CC mode is still not all the way off, or more the phase where the current through the output stage is already very low. Both cases are a little difficult for the regulator.

One possible point to try would be a slightly slower current regulation (C6 larger). Another point to play with is R32 (possibly a little smaller).

There are a few effects than can make the real circuit to behave a little different than the simulation. Such things are the ESR of some caps, parasitic inductance of the shunt resistor and wiring inductance. Also transistors may be a little different from the models.

Looking at the output of the two regulating OP may give an hint to which loop is oscillating - at least it could show if both loops are active together.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 13, 2019, 04:25:05 pm
What is your load (exactly)?

Look at the shunt next time - there you can observe the ringing better..
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 13, 2019, 04:36:16 pm
The output of the Op Amps looks like:
V out=1.21V, I=3.01A
1. CV op amp output 842-845
2. CC op amp output 846-850.jpg

Photos with the load:
https://imgur.com/a/PIfz20x

Later Edit: on the shunt 852-855 (Vout=1.21V, Iout=3.01A).
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 13, 2019, 05:05:54 pm
The CV loop should be tested separately with various static and pulsed loads without allowing the current limiting to act.
I don't know what the present design details are.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 13, 2019, 05:24:00 pm
You are pretty fast with making pcbs :)
The proper pcb layout is also important with this kind of HW, maybe it should be discussed later on.

Add a ceramic 10n-100n at the output (parallel to the 47u). I would suggest the 1uF is a 50V ceramic.
Not sure the 1uF foil there is optimal.

I do not see ringing with 1.2V/3A in sim.

The R32 from 50-100ohm does not matter, below 50ohm it reduces output current.

The load - I've been asking whether the load in V14 is similar to your LOAD (the 1uF cap and Rload1=0, Rload2=100ohm).
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 13, 2019, 05:30:47 pm
The main current path area appears  large and I don't think there is a bypass capacitor on the power input.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 13, 2019, 05:32:12 pm
The CV loop should be tested separately with various static and pulsed loads without allowing the current limiting to act.
I don't know what the present design details are.

@MM: set the CC to 3A limit and make tests with lower output currents than the CC limit, for example 1-2A,  look at the shunt and Vout.

Also could you set your o'scope picture such the "gnd" is somehow aligned with the grid?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 13, 2019, 07:47:51 pm
New tests with Imax set to 3A and output voltage set to 1.21V. As load I used an 1R resistor and no capacitor.
1. With C6 and a parallel 100nF to the 47uF:
a. on the output 0857-0859
b. on the shunt 0860-0864

2. Without C6 and a parallel 100nF to the 47uF:
a. on the output 0866-0868, 0874-0875
b. on the shunt 0869-0872, 0876

Please also find attached the schematic for the PSU Shorter.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 13, 2019, 08:21:40 pm
I think the ringing above comes from some parasitics (5-6us period).
Considering 1.2V/1.2A setting it looks to me "normal".
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 13, 2019, 08:52:33 pm
Good, I will continue the tests tomorrow.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 13, 2019, 09:48:04 pm
Without seeing the schematic, I don't know which suggestions have been ignored, Has R4 or C4 been removed?
There could be just too much gain in the CV loop.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 14, 2019, 05:19:31 am
Please find attached the latest schematic.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 14, 2019, 05:43:46 am
Try disconnecting R4 and check what effect it has on the ringing during a load transient test.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: floobydust on May 14, 2019, 05:57:16 am
I suspect there's too much gain, on both CV and CC.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 14, 2019, 06:42:18 am
Fyi - V15 stability plot with Vout=20V, 1k load, Icc set full.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: Kleinstein on May 14, 2019, 08:58:58 am
The loop gain plot looks good, though maybe a little high gain / unitiy gain transition at the upper edge of the good range.
So maybe a little smaller R30 to reduce the gain.

The R4, C4 part is kind of needed to get good stability even with nasty low ESR load.  It adds to the gain and thus the compensation for the rest would need to be slower than without it.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 14, 2019, 09:47:05 am
The loop gain plot looks good, though maybe a little high gain / unitiy gain transition at the upper edge of the good range.
So maybe a little smaller R30 to reduce the gain.

The R4, C4 part is kind of needed to get good stability even with nasty low ESR load.  It adds to the gain and thus the compensation for the rest would need to be slower than without it.
I still want to see the result of a load transient test just without the R4,C4 RC. My project is quite happy without this RC.
What I did notice was increasing the equivalent of C1 in my project worsened the stability with the 470uF super low ESR capacitaor across the output. The C1 in my project is 150pF.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 14, 2019, 10:42:31 am
In simulation the whole stuff depends on the ESR of the output/load capacitors.
For example with the 47uF output capacitor with 0.5ohm ESR (in parallel 100n 0.05ohm) with R30=3k3 and C1=C5=100pF and none R4C4 you get a good result with 0.7Vpp overshoot ringing at 21Vout, ringing is rather small (transient test V15, none CLOAD).
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 14, 2019, 11:01:43 am
Does anybody have a schematic that can be practically tested ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 14, 2019, 11:41:18 am
A few pages back I showed the result of a 2A load transient test which I regard as good.
Mine has a 47uF 500mΩ output capacitor also. The CV op-amp is compensated with a 10K and 150pF.
These values should be suitable for this thread's design also except maybe for some differences.
The different voltage divider that will add a bit more gain compared to mine.
The gm of the output path  is unknown. Mine is 10.

https://www.eevblog.com/forum/beginners/lm324-power-supply-with-variable-voltage-and-current/msg2405490/#msg2405490 (https://www.eevblog.com/forum/beginners/lm324-power-supply-with-variable-voltage-and-current/msg2405490/#msg2405490)
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 14, 2019, 12:23:45 pm
This is the recovery from a short circuit with the supply set to 5V and 2A.

BTW: The ramp up is due to the 2.0 Amps charging the output capacitor and not because of settling in the compensation components.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 14, 2019, 12:55:14 pm
@MM: development of a perfect PSU is a hard work. Your design is almost identical with Xavier's.

I think you may use your PSU as-is.

You may also fine tune the C1, C5, C4 (or get rid of C4).

Fine-tuning (and the picture on your o'scope) depends on the actual parts used, wiring, decoupling, grounding, pcb layout, etc.

At this stage we can hardly write more about it, as the fine-tuning cannot be done from the other side of the planet.



Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 14, 2019, 04:31:33 pm
I made some tests, with different C1, C5 and C4 values, and I used R30 = 4k7 (as it was in the V15 schematic).
I tried to reduce C1 and C5 values in order to make the power supply to oscillate.

1. Vout=1.21V ,SlowCC=3A ,Rload=0R (only resistive load) , C1=470p ,C5=470p ,C4=removed
0879-0883
2. Vout=26V ,SlowCC=3A ,Rload=0R (only resistive load), C1=470p ,C5=470p ,C4=removed
0884-0886
3. Vout= 26V ,SlowCC= 3A,Rload=0R (only resistive load), C1=100p ,C5=100p ,C4=removed
0887-0888
4. Vout=1.21V ,SlowCC=3A ,Rload=0R (only resistive load), C1=100p ,C5=100p ,C4=removed
0889-0891
5. Vout=1.21V ,SlowCC=3A ,Rload=0R (only resistive load), C1=100p ,C5=100p ,C4=4.7n
0892-0895
6. Vout=25.9V ,SlowCC=3A ,Rload=0R (only resistive load), C1=100p ,C5=100p ,C4=4.7n
0896-0900
7. Vout=1.48V ,SlowCC=3A ,Rload=1R (only resistive load), C1=100p ,C5=100p ,C4=4.7n
0901-0903

Please have a look at the attached screenshots and tell me what you think.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 14, 2019, 06:47:04 pm
Is there any reason because the power supply did not oscillate when I reduced C1 and C5 capacitance ?
When I run the simulation with C1 and C5 = 100pF, then the simulation does not stop, it continues to run to infinite ...
Please also have a look at the previous reply and tell me what you think about the screenshots. Thank you.

Later Edit: I managed to simulate with 100pF for C1 and C5. It looks like the power supply oscillates. But in the practical montage I did not found any oscillation ... Should I reduce the capacitance for C1 and C5 ?
The used schematic is the one from V15.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: Kleinstein on May 14, 2019, 07:35:13 pm
The simulation is only as good as the models are, and these are not perfect. Also parasitic effects like wire inductance and parasitic capacitance are not includes. The LM324 / LM358 has quite some cross over distortion (the rate drops a lot near current zero crossing as the output stage is class B with quite some gap) - not sure this is included in the models.

The simulation can do quite a lot, but only if the circuit is really like the plan.

One thing I would change from the pictures shown is to twist the wires to the power stage and also the wires to the raw voltage.  If not already there one may want to add some local decoupling on the board for the raw voltage.

For the beginning I would look at only the voltage loop, to use a larger load resistor (like 10 Ohms), so that the current limit does not engage. The point of very low output current is one of the more difficult ones, the turn off phase is essentially without a load. One may have to add some minimum load (e.g. some 5-10 mA).
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 14, 2019, 08:13:40 pm
I checked with a 10R max load at PSU Shorter and a minimum 820R load at PSU Shorter.
C4=4n7, R30=4k7.
1. Vout=1.98V , SlowCC= 3A, Rload=10R, C1=C5=100pF  -  it looks like with 100pF it oscillates.
0905, 0906
2. Vout=1.98V , SlowCC= 3A, Rload=10R, C1=C5=470pF
0907, 0908
3. Vout=1.98V , SlowCC= 3A, Rload=10R, C1=C5=1nF
0909, 0911

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

Please also find attached the schematic for the PSU Shorter.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 14, 2019, 08:52:27 pm
You should not be wasting time doing tests with C4 in circuit for now or ever.
C5 affects the CC loop only. The CC loop will be stable with a large range of values and only needs to be changed to set the settling time of the CC loop. Leave its value large and just check to see how long it takes for the CC loop to take control from the fast limiting.
 
Have a think about how to measure the gain or gm of the output path. Mine is 10
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 14, 2019, 09:16:25 pm
From the test(DS0885.jpg) in Reply #360, the CV looks stable with C1=470p  ,C4=removed.
It's unstable with C1=100p, C4=removed. So looks like it might be happy with 150p or a bit larger.
It doesn't make sense to do further test with C4 in circuit with such a low value for R4, or at all.

PS: C4 was not the actual problem, rather the large amount of gain R4 added to the loop.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 15, 2019, 05:05:11 am
I disconnected R4 and C4 from the circuit.
I added C5=2n2 and C1=150pF. I hope I selected correctly those capacitors...
Please find attached the results:
1. Vout=1.98V ,SlowCC=3A ,Rload=10R
0914-0916
2. Vout=1.98V ,SlowCC=3A ,Rload=0R
0917-0918
3. Vout=26V ,SlowCC=3A ,Rload=0R
0919-0921
4. Vout=26V ,SlowCC=3A ,Rload=10R
0923-0927
5. Vout=2.08V, slowCC=3A, Rload=10R
0929-0932

Please have a look at the attached screenshots and tell me what you think.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 15, 2019, 06:36:53 am
Although there are some things there I don't fully understand yet, I don't see anything that would be called bad.
The small overshoot after the dip when load is turned on should be fixed with an increase of C1, try 220pF.
The high frequency ringing in DS0927.jpg  should be just due to parasitics. Confirm by checking the waveform further away from the regulator's output.

More: The overshoot in DS0917.jpg isn't good.
A possible problem that I have just though of is when the short is removed while the fast limiting is still in control,  is likely to cause a large voltage overshoot.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 15, 2019, 06:57:19 am
More: The overshoot in DS0917.jpg isn't good.
A possible problem that I have just though of is when the short is removed while the fast limiting is still in control,  is likely to cause a large voltage overshoot.
Can this overshoot be reduced by reducing C5 ? If not, are there any possibilities to reduce this overshoot ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 15, 2019, 07:00:18 am
More: The overshoot in DS0917.jpg isn't good.
A possible problem that I have just though of is when the short is removed while the fast limiting is still in control,  is likely to cause a large voltage overshoot.
Can this overshoot be reduced by reducing C5 ? If not, are there any possibilities to reduce this overshoot ?
You need to confirm the reason first. Maybe by looking at the Base of Q1 at the same time. What was the duration of the applied short in DS0917.jpg ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 15, 2019, 07:10:22 am
I think that we could be seeing the recovery from the slow limiting. The 1.5V overshoot looks large in relation to the 2V set voltage.
The other possible problem with the fast limiting still should be checked.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 15, 2019, 07:45:37 am
That rapid jump to 2.5V is caused by the current being suddenly diverted from the short to the output capacitor causing an immediate voltage drop across the capacitor's ESR. The rest of the overshoot is because the op-amp and output path transistors can only react so fast.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 15, 2019, 09:11:37 am
@MM: Simulation - here is the effect of the 3A SlowCC current diverted from the short to the 47uF output capacitor with ESR=0.5ohm.

RLOAD1=0.01, RLOAD2=820, Vout=2.1V, C1=220pF, C5=2n2

The current causes a 0.5*3A=1.5V voltage peak (red) at the capacitor's ESR resistor.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 15, 2019, 10:19:47 am
This mean that I should use a lower value capacitor instead of 47uF ?
Or this behaviour of the power supply is normal ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 15, 2019, 10:54:34 am
As expected, mine behaves the same except that the total overshoot is to 2.5V. Putting MLCC's across the output softens the initial rise but did't change the overshoot much. The lower overshoot voltage is likely due to the faster op-amp and power transistors.
I can't see how this behavior would be a problem in practical use.
Unloading while the fast limiting is active could be more serious.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 15, 2019, 11:01:09 am
This mean that I should use a lower value capacitor instead of 47uF ?
Or this behaviour of the power supply is normal ?
You could try lowing the total ESR by fitting an extra 47uF. The extra capacitance might also reduce the overshoot,
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 15, 2019, 11:10:28 am
I will test the power supply using 2x 47uF capacitors on the output.
For C1, it is fine if I will use a 100pF in parallel with a 120pF , which will be in total 220pF ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 15, 2019, 11:11:47 am
I will test the power supply using 2x 47uF capacitors on the output.
For C1, it is fine if I will use a 100pF in parallel with a 120pF , which will be in total 220pF ?
Yes
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 15, 2019, 11:16:36 am
I also want to apply the rule that @imo suggested me, at reply #118, page 5.
If the power supply oscillated at 100pF, and at 150pF it did not oscillated, then the safe value for C1 will be (2..5)x150pF=300pF...750pF, so I should use a 330pF to 1nF capacitor ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 15, 2019, 11:21:36 am
I don't really know. I mainly like to see little overshoot and no ringing if possible. The resistor might have to be decreased also,
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 15, 2019, 12:38:32 pm
I modified the output capacitor to 2x47uF, R30=3k3, C1=220pF, C5=2n2, C4 and R4 removed.
1. Vout=2.10V, SlowCC=3A, RLoad=10R
0934-0936
2. Vout=2.10V, SlowCC=3A, RLoad= 0R
0937-0941

Please have a look at the attached screenshots and tell me what you think.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 15, 2019, 12:57:39 pm
Everything looks fine. I didn't expect you to change R30 but it has caused the correct result.
Your 47uF capacitors might have more than the normal amount of ESR. Mine are 500mΩ.
Did you confirm the parasitic ringing?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 15, 2019, 01:05:23 pm
Yellow = base of 2N5551
Blue = output of the power supply
Vout=2.10V, SlowCC=3A, RLoad=0R

This probably confirm that the ringing is also present at the base of Q1.
Please have a look at the attached screenshots and tell me what you think.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 15, 2019, 01:20:27 pm
I cant make sense of that.
Look at the output of the CC op-amp.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 15, 2019, 01:27:23 pm
The output of the CC op amp (yellow). Same test condition as in my previous post. Output of the power supply with blue.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 15, 2019, 01:43:45 pm
That last test was done with the timebase too fast.
With no load, the output of the cc op-amp should be at its maximum voltage.
We need to see the output of the cc op-amp go from maximum  voltage to some lower voltage where it takes control of Q1 from the CV op-amp.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 15, 2019, 01:48:13 pm
We need to see the output of the cc op-amp go from maximum  voltage to some lower voltage where it takes control of Q1 from the CV op-amp.

1. Can you please explain how to do this test. I did not understood completely how to do this test...
2. What will happen if I will let the power supply as it is in this moment, and I will only fine tune the C1 and C5, to eliminate the possible oscillations ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 15, 2019, 01:55:16 pm
This is where you need to start understanding how it's supposed to work.
Q1 gets controlled by which ever op-amp has the lowest output voltage.
With no load, the cc op-amp should be high and the cv op-amp at some mid voltage.
Confirm this now.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 15, 2019, 02:33:42 pm
Im starting to wonder if the output transistors are being turned on enough to pass 3 Amps.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 15, 2019, 02:35:38 pm
With no load, the cc op-amp should be high and the cv op-amp at some mid voltage.
Confirm this now.
With no load:
CC op amp = 10.90V output
CV op amp = 5.66V output
Supply voltage of the 324 = 12.15V
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 15, 2019, 02:41:37 pm
@MM:

1. imagine there are no diodes, the opamp's outputs are disconnected - the Q1 will be fully opened (because the base current through R1 from Vcc) and the power pack's base current is pulled down, therefore the Vout voltage is near 35V

2. now the diodes are connected - the diodes create a "wired OR" - whatever diode's cathode (CC or CV) is pulled below the Q1's base voltage (here the base is set to about 6-7V) the transistor starts to close itself (and the Vout voltage goes down to 0V), because the forward biased diodes start to conduct and the R1 current diverts and flows into the opamp's outputs (CC or CV or both). The opamp's outputs sink the base current to the ground.

3. so the Q1's base is pulled below 6V either by CV or CC during the operation and that closes the Q1 (as the emitter is fixed at 5.1V) and that pulls the Vout down to 0V.

4. when the CC or CV opamp's outputs voltages are higher than Q1's base voltage -> that does not affect the Q1 as the diodes are reverse biased and the opamps do not source the base of Q1. Therefore this situation is the same as the point 1. above.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 15, 2019, 02:48:18 pm
With no load, the cc op-amp should be high and the cv op-amp at some mid voltage.
Confirm this now.
With no load:
CC op amp = 10.90V output
CV op amp = 5.66V output
Supply voltage of the 324 = 12.15V
That looks right.
To transfer from cv to cc mode, there has to be enough output current to cause the cc op-amp to go low and take control of Q1. At this point the cv op-amp will sense the voltage drop and go high but it will have no control of Q1.
If you think it's safe, short the output for a second to see if the cc LED lights. If not, try  lower current settings.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 15, 2019, 02:54:27 pm
@imo Thank you for the explanation. I understood how it works.

@xavier60 I shorted the output, at 2V and at max output voltage, at SlowCC=3A and the cc led lighted up.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 15, 2019, 03:01:52 pm
@imo Thank you for the explanation. I understood how it works.

@xavier60 I shorted the output, at 2V and at max output voltage, at SlowCC=3A and the cc led lighted up.
See if you can capture the drop of the cc op-amp when the output is shorted. Do at 1A for now.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 15, 2019, 03:13:04 pm
I managed to catch the voltage drop at the CC op amp output using the PSU Shorter.
I set the Vout=26.1V, SlowCC=1A.
Please find attached the results.

Later Edit: I also made some simulations, and I found that it oscillates in simulation with 220pF.

I would also like to use a safer value for C1, in order to eliminate the possibility to oscillate.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 15, 2019, 03:31:30 pm
That looks right, Not sure where to go next.
Looks like the cc op-amp takes about 100µs to slew down and take control. during this time, the cv op-amp should be allowing the Base of Q1 to go higher and the fast limiting should be active.
Our concern was to find out how big the voltage overshoot is when the short is removed while the fast limiting is active.

Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 15, 2019, 03:45:04 pm
It is possible to use a higher value for C1, in order to eliminate the possibility of oscillation ? (as I done with the other LM324 power supply).
I found in simulation that it oscillate with 220pF. I know that is only simulation - as you said - but I want, if possible, to be safe.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: Kleinstein on May 15, 2019, 04:46:05 pm
The picture are still hiding much of the interesting part.

For the ringing in the CC to CV transition one has to distinguish 2 cases: one is the classical oscillation and ringing with 220 pF and likely 470 pF. The other case it the ringing that includes some windup and some stages to reach saturation. One likely has to live with some ringing of the second type unless one would use a really stringent anti-windup.

However a really good anti windup can effect the accuracy near transition and may not even be desirable for the CC part, as the limit could engage too fast. The CV mode regulator needs some current excursions to bring the voltage back. The plans of most commercial supplies do not include much anti-windup, if at all. So in this respect the current circuit is already on the better side.
Avoiding the 2 nd type of ringing may need adjustments to the CC loop part, not just the CV loop.

If looks like the regulator just starts oscillation at some 220 pF or a little more. So C1 at around 1 nF or a little more seems reasonable.

For the compensation it is not just the value of C1 that counts, there are also resistors that set the loop gain. E.g. reducing R30 has a similar effect to increasing C1.
There are also 2 principle types of regulators, that can used quite different compensation. The circuit here uses output stage that sets the current (high output impedance). These usually need the extra phase boost from C4 / R4 or similar (Xavier60 has it at the transistors emitter), an output capacitor and usually a relatively fast regulation.  The other regulator class has a low output impedance power stage (e.g. emitter follower). These can work essentially without an output capacitor and often use a rather slow regulation loop from the OP. This second class tends to be less good with current regulation and gets tricky with more than same 30 V, as usually the OP has to provide the full voltage swing.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 15, 2019, 04:46:48 pm
I found the problem in the circuit. The transistors (TIP3055) were not working correctly. The current was not equally distributed on each power transistor.
I changed the entire circuit, and now it seems to work.
Please find attached the screenshots with the oscilloscope probe on the shunt (0.22R).
Before changing the transistor circuit: 0954
After changing the transistor circuit: 0959.jpg

Please have a look at the attached screenshots and tell me what to do next.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 15, 2019, 04:55:21 pm
New tests:
Vout=1.90V, SlowCC=3A, Rload=0R, measured on the output of the power supply.

Please have a look at the attached screenshots and let me know what else should I test.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 15, 2019, 05:03:55 pm
@MM: to your simulation above: doublecheck what is the ESR of the 47uF capacitor. I think you still using 0.1ohm there.

I would highly suggest NOT TO USE the built in esr, but instead add a special ESR resistor into the schematics.
You can see the ESR value directly in the schematics then, and we may refer to a particular ESR resistor.

Enclosed the SIMULATION ONLY .asc V17 - use it for the simulation.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: Kleinstein on May 15, 2019, 05:05:06 pm
The test still missing and repeatedly asked for if loading the supply to less than current limiting. So this is the more classical load test. E.g. CC limit to 3 A and a test current of some 10 mA (min load) - 1 A  (e.g. 20 Ohms at 20 V) -  10 mA.

The other point would be a short load spike, so that the fast current limit engages, but not yet the slow current limit. So maybe some 5 A for some 20 µs or so.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 15, 2019, 05:19:02 pm
I added a 20R resistor as load, and I set the output voltage at 20V.
SlowCC is 3A. Min load is 820R (this is the resistor that I had).
If the GND was aligned to the grid, then nothing was shown on the scope, only the blue trace.
So I was needed to reduce the V/div.
C1=220p, C5=2n2.

Please have a look at the attached screenshots and tell me what you think.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 15, 2019, 05:23:03 pm
Sim 16mA/1A C1=470pF C5=2n2 Islow=3A Vout=21V

Sim 16mA/1A C1=220pF C5=2n2 Islow=3A Vout=21V
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 15, 2019, 05:52:42 pm
I see that the oscillation have smaller peak to peak values for 220pF...

What should I test next ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 15, 2019, 05:58:50 pm
Look a the CV opamp's output with above test.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 15, 2019, 06:35:55 pm
The output of the CV op amp and the GND on the power supply output GND
Vout=21V, C1=220pF, C5=2n2, SlowCC=3A, Rload max=20R, Rload min=1.2K
0973-0976
Vout=21V, C1=470pF, C5=2n2, SlowCC=3A, Rload max=20R, Rload min=1.2K
0977-0979

If I use higher V/div, then I see only the blue trace on the screen.
I used those load resistors, because those values are the most close to the specified load currents.
Please have a look at the attached screenshots and tell me what you think.

Later Edit: The last screenshot show the pin 3 output of the 555, at PSU Shorter. I used 220k/4k7/330nF. Please also have a look at this and tell me if it is good.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 15, 2019, 08:56:41 pm
I used a new configuration for the PSU Shorter.
I used 220k/220k/100nF.
Vout=20.9V, SlowCC=max (3A), Rload=20R, Rloadmin=1.2k
C1=470pF, C5=2n2.
0985-0989
0990-0992
These were measured on the output of the CV opamp.

Please have a look at the attached screenshots and tell me what you think. Does they look good or not ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 15, 2019, 09:46:08 pm
The activity at the CV op-amp is expected and correct. The negative going pulse at the end is the loop's response to the slight output overshoot.
The shape of the output voltage dip pulse is correct for the load transient tests. Just the same as mine, https://www.eevblog.com/forum/beginners/lm324-power-supply-with-variable-voltage-and-current/msg2405490/#msg2405490 (https://www.eevblog.com/forum/beginners/lm324-power-supply-with-variable-voltage-and-current/msg2405490/#msg2405490)
I can see that the gm is 3 but this is ok because it's offset by your voltage divider having about 3 times more gain than mine.
Expect larger overshoots if a short is removed while the fast limiting is active.
Any high frequency ringing or hash that occurs at current switch off is likely due to parsitics.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: floobydust on May 16, 2019, 12:26:01 am
DS0989, DS0991 shows 500usec dip, what is taking so long.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 16, 2019, 12:33:11 am
DS0989, DS0991 shows 500usec dip, what is taking so long.
There isn't much load current to discharge the output capacitance during the overshoot.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: floobydust on May 16, 2019, 12:36:41 am
With a shorted output in (slow) CC mode, the CV op-amp sits there saturated and can take a long time to recover + the slew time. It's seeing i.e. 7.4V differential (21V setpoint and 0V out). I wondered if we would see that delay, or if SPICE models stay accurate. I limit the differential input voltage on CV op-amp (internal comp cap/integrator windup) to speed up recovery, using a diode.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 16, 2019, 12:52:07 am
With Kleinstein's suggestion, the compensation feedback for the CV op-amp is now taken from the diode OR-ing node.
As far as I can figure, there is no CV windup while the slow CC loop is in control.
The overshoot is caused by the reaction time of the op-amp and output transistors.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 16, 2019, 01:01:05 am
Adding back the correct values for C4 and R4 wont prevent overshoot for all circumstances.
There will be a serious CV windup problem while the fast limiting is active.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 16, 2019, 04:53:41 am
I read and tried to understand all your messages.
Can you please let me know what should I test next ?

There will be a serious CV windup problem while the fast limiting is active.
Should be implemented a solution for this problem ?

...and I will double check the power transistor circuit.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 16, 2019, 06:28:17 am
Try a pulsed short circuit test with a short duration like 100µs. Monitor the output for overshoot while changing the CC setting.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: Kleinstein on May 16, 2019, 07:32:15 am
I read and tried to understand all your messages.
Can you please let me know what should I test next ?

There will be a serious CV windup problem while the fast limiting is active.
Should be implemented a solution for this problem ?

...and I will double check the power transistor circuit.

The first point would be to look if the overshoot with only the fast current limit active is actually that bad.
Preventing that kind of overshoot could however get difficult, as it is hard to sense when the fast current limit will engage. My suggestion would than be a different fast current limit at the low side. A transistor could pulling down the base of Q1 if the shunt voltage exceeds 0.6 V or so.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 16, 2019, 07:40:14 am
Something like this. I don't expect it to work too smoothly.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 16, 2019, 07:56:58 am
Try a pulsed short circuit test with a short duration like 100µs. Monitor the output for overshoot while changing the CC setting.
So I will need to adjust the PSU shorter to output a pulse of about 100us and then to look at the output of the power supply at different slowcc settings ?

And I will need to remove the blue led and the resistor in series with it ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 16, 2019, 08:28:40 am
Try a pulsed short circuit test with a short duration like 100µs. Monitor the output for overshoot while changing the CC setting.
So I will need to adjust the PSU shorter to output a pulse of about 100us and then to look at the output of the power supply at different slowcc settings ?

And I will need to remove the blue led and the resistor in series with it ?
Don't modify anything yet except the shorter. We want to see how bad the problem might be first.
The idea is to apply shorts of short duration that don't allow enough time to transition from fast to slow CC control.
Adjust the CC setting to find the worst voltage overshoots at the output.
No need to show us everything, just the worst of what you might find.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 16, 2019, 11:00:11 am
I think that there is a problem with the Fast CC because I am getting only 1.09V on the RShunt, so this is about 4.95A, but it should be about 8A ... Please see reply #398
I am missing something ?
I don't know what should I do ...

Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 16, 2019, 11:06:45 am
The Base of Q1 might not be going high enough. Bridge out the blue LED.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 16, 2019, 11:14:07 am
I replaced the blue led with a short circuit, and now the current through the Rshunt is about 8A.

But if I bridge out the blue led, then when the power is cut off, the output of the supply will go to max voltage ? (I saw a short pulse on the screen of the oscilloscope when I plugged out the power supply from the mains).
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 16, 2019, 11:16:33 am
I replaced the blue led with a short circuit, and now the current through the Rshunt is about 8A.

But if I bridge out the blue led, then when the power is cut off, the output of the supply will go to max voltage ?
I have previously explained why I think that the UVLO should still work, best is to test it.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 16, 2019, 11:22:53 am
If you have another smaller power supply use it to power the 12V rail. Then see what happens as the voltage of the 12V rail is decreased.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 16, 2019, 11:23:35 am
I tested it, (with 7812) and when I plugged out the PSU from the mains, there appeared a short pulse on the oscilloscope screen, which did not happened when the led was there.

What should I do ?
It is already about 3 weeks since I am working at this PSU, and I still do not find a good working version... and I am very disappointed.  :-\
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 16, 2019, 11:25:34 am
That is not a good test. Can you do a proper test?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 16, 2019, 11:31:29 am
Yes.
I used a LM317 1.25 to 25V power supply. I set the LM317 to 12V and I reduced gradually the voltage to 1.25V. The scope was set to 250uS/div. The trace gone from 28.5V (max output) to GND on the screen, without suddenly going up.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 16, 2019, 11:31:42 am
SIM: with the zener D9=3V3, R7=2k2 and RED LED in the UVLO you get

R30=3k3  I_FastCC=8.1A
R30=4k7  I_FastCC=8.3A

Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 16, 2019, 11:37:51 am
Yes.
I used a LM317 1.25 to 25V power supply. I set the LM317 to 12V and I reduced gradually the voltage to 1.25V. The scope was set to 250uS/div. The trace gone from 28.5V (max output) to GND on the screen, without suddenly going up.
So the UVLO works.
You have not included your age in your profile?  Are you young and still learning?  Will this power supply have a particular application? Knowing this might allow us to better anticipate other possible problems.

More: The regulator should have shut down at about 6V or higher?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 16, 2019, 11:46:05 am
It is already about 3 weeks since I am working at this PSU, and I still do not find a good working version... and I am very disappointed.  :-\
The more you know the more unhappy and in doubt.
Not having eevblog handy you would simply build a PSU based on some schematics from the web, and use it happily  :D
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 16, 2019, 11:55:40 am
New test: D9=3V3 zener, R7=2k2, red led in the UVLO and R30=3k3.
It seems to work now.

@xavier: Yes, I am still learning and I am young. I am a enthusiast at electronics. I like to build circuits. The application of the power supply will be to power different equipment, starting from 1W led and PCB mini drills to digital micro controllers such as Arduino.

I did not measured the output voltage with the oscilloscope, but at some output voltage, the trace gone suddenly to the ground.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 16, 2019, 12:01:18 pm
New test: D9=3V3 zener, R7=2k2, red led in the UVLO and R30=3k3.
It seems to work now.
Are you meaning that the UVLO didn't work with just the blue LED bridged out?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 16, 2019, 12:04:56 pm
@xavier60 I mean that the fast CC is now correctly working after using the configuration suggested by @imo.
With the blue led, at some point when the voltage dropped below 12V, the output voltage of the power supply suddenly descend to 0V.

@imo I did not expect such problem from this power supply, this is why I am i doubt... But, if  you or others can and will help me, then I will try to make the power supply work correctly.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 16, 2019, 12:08:34 pm
@xavier60 I mean that the fast CC is now correctly working after using the configuration suggested by @imo.
With the blue led, at some point when the voltage dropped below 12V, the output voltage of the power supply suddenly descend to 0V.
I'm puzzled by this. No doubt that the fast CC is working properly. Was imo's mod necessary?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 16, 2019, 12:19:12 pm
Yes. Imo's mod was necessary, in my opinion.
Regarding the OVLO, when the  power voltage of LM324 is going down, the output voltage of the power supply is also going down.
But when the power voltage of LM324 is going up, then the output voltage of the power supply starts to go up only when the power voltage of LM324 is about 6-7V.
This happens with imo's mod.
I was wrong in the previous affirmation. I apologize.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 16, 2019, 12:49:01 pm
Please let me know what else should I test, in order to make the power supply to work correctly.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 16, 2019, 01:39:29 pm
There is a so called RED LED test :)
First wire an 1k/1W resistor in parallel to your output capacitors (like a permanent load).
You set the output voltage to the maximum and the SlowCC to minimum, say 20mA (doublecheck what current you get at minimum CC setting).
Edit: Switch PSU off.
Then take an RED LED (could be smoked, be warned) and connect it to the PSU output (anode to OUT+, cathode to OUT- such it lits).
Switch the PSU a few times (ie 10x) on/off. Wait a few seconds between the switchings.
When the LED survives your PSU is perfect..
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 16, 2019, 02:24:51 pm
I set the output to 27.5V, the SlowCC to 18mA (measured with the multimeter set to mA directly on the output of the power supply) and I smoked instantly 2 red leds. When I connected the led, it was smoked instantly. There was no "real smoke", only one led lit up for a fraction of a second then it was off (it died), and the second led did not lit up at all. There also was a 1k/5W resistor on the output.
I think that this is because of the output filter capacitors which are discharging into the led (2x47uF). Am I right ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 16, 2019, 03:48:58 pm
Try to set the 18mA, and switch the PSU off. Wait a bit till the caps discharge. Then wire the LED in. Then switch the power on. Wait a bit and switch it off. Whether the LED survives that.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: Cliff Matthews on May 16, 2019, 03:59:32 pm
My ancient Micronta used to pass that test, but I added a DVM with 10uF MLCC right behind the new binding posts.. Doh!  |O
Title: Re: LM324 Power Supply with variable voltage and current
Post by: Kleinstein on May 16, 2019, 04:33:50 pm
The slow and fine CC limit will wind up in the short time, when still in under-voltage look out.  So while turning on the CC OP will go all the way towards the upper limit, while the voltage is not sufficient to turn Q1 on. This is not that unusual, it just resembles the normal operation. It just take a considerable time for the slow current limit to activate.  In this time only the fast limit (at some 8 A) is active and this is little too much for a small LED, even if only for some 10 µs.

The delayed action of the fast current limit is one reason why the fast current limit is kind of needed.

Quite a few commercial lab supplies likely have a similar limitation.  I would consider this not a bug but more like a feature, giving higher priority to voltage regulation, so that small spikes in the current would not cause trouble the voltage regulation.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 16, 2019, 04:42:27 pm
Try to set the 18mA, and switch the PSU off. Wait a bit till the caps discharge. Then wire the LED in. Then switch the power on. Wait a bit and switch it off. Whether the LED survives that.
Yes, the LED survived. I used an red LED.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 16, 2019, 04:49:37 pm
 :-+
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 16, 2019, 05:26:40 pm
@Kleinstein - I've done a sim with the lower side shunt fast cc and it looks it helps in simulation. It would need to be tested in HW, however.
When working in HW the FastCC 8A peak should disappear.

The below reduces the max 3A SlowCC to 2.89A or less based on the R27 value. That should not be a problem. The 8A fastCC peak is eliminated.
 
You may also try with the 2 resistors like in Xavier's schematics above.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 16, 2019, 07:20:04 pm
You may try with the 2 resistors like in Xavier's schematics above.
Do you mean as it is in the reply #417 ?

Later Edit: it looks like there are some high current pulses if I use the Xavier's schematic.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 17, 2019, 09:27:21 am
Does anybody have some advices regarding this PSU ?
Can this PSU be used as it is, with no problems ?

Title: Re: LM324 Power Supply with variable voltage and current
Post by: Kleinstein on May 17, 2019, 11:39:12 am
I would consider the PSU useful. The regulation and behavior on turn on seems to be about at the level of the cheap Chinese supplies, or a little better. With an LM324/LM358 the precision of the current regulation may not be very good (depends on the luck one has with the OP - not all LM324 have poor offset drift, but they can).

Some check on the heat sink temperature may be a good idea. Without tap switching there can be quite some heat.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 17, 2019, 04:14:41 pm
I am trying to select the proper value for C1, in order for the power supply to not oscillate.
I found that at Vout=26V, SlowCC=0.22A and Rload=10R, the voltage on the shunt looks like the attached screenshot. I can't figure if the blue and thick line is a oscillation or it is only noise.
Please have a look at the attached screenshot and tell me what you think.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: Kleinstein on May 17, 2019, 04:23:46 pm
From the scope trace it is hard to tell if there is some oscillation. Even with a better scaling it could be tricky to see.

The output of the OP for the CV mode loop could be a little more sensitive, though not much.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 17, 2019, 04:32:36 pm
Do you have any suggestions regarding the value for C1 ?
What would be the best value for this capacitor (C1) in order to eliminate any possible oscillation ?

PS: I also tried with 470pF, and the same image appears on the screen.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 17, 2019, 06:51:42 pm
The CV op-amp is supposed to be saturated high and have no control while CC op-amp is in control. You can confirm this.
Why is the waveform not inverted? Where is the probe's ground clip connected?
What does the output look like?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 17, 2019, 07:26:09 pm
The CV op-amp is supposed to be saturated high and have no control while CC op-amp is in control. You can confirm this.
Why is the waveform not inverted? Where is the probe's ground clip connected?
What does the output look like?
1. Yes, the CV op-amp is 10.86V output while CC is in control.
2. The probe ground is connected to the marked point in the attached image. The other end of the oscilloscope probe is connected to the other end of the shunt resistor.
3. The output looks like in the attached screenshot (0015.jpg) whith Vout=26V, SlowCC=0.22A and Rload=10R.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 17, 2019, 07:45:16 pm
@MM: how much time does it take to

1. charge 2x47uF with 220mA from 0V to 26V?
2. discharge 2x47uF (26V) via 10ohm to 0V with max 220mA?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 17, 2019, 08:09:22 pm
1. Charging of the capacitor:
C*V=I*T
V=(I/C)*T
V=K*T
26V=(0.22A/0.000094F)*T
26V=2340*T
T=26/2340=0.011 [seconds]

2. T=R*C=10 \$\Omega\$*0.00094F = 0.00094 [sec]
5*T=5*0.00094=0.0047 [sec]
the capacitor will be fully discharged after 5 time constants (T=RC)
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 17, 2019, 08:52:56 pm
Now look at the edges in your above picture. For example I can see an 11-12ms long rising edge there.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 17, 2019, 10:24:55 pm
All looks well to me. It's best to always connect the probe ground to  OUT-
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 17, 2019, 10:54:27 pm
The CV op-amp's compensation should only be altered to optimize load transient response. Keep this in mind when modifications are done that affect the gm of the output path.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 27, 2019, 07:02:39 pm
Yes, the power supply is working well.
I do not see any issues for now.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 27, 2019, 07:14:17 pm
Yes, the power supply is working well.
I do not see any issues for now.
Good to hear. Is that with the low side fast current limiting working also?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 27, 2019, 07:39:46 pm
The low side fast current limiting was not tested and was not included into the final schematic. The used FastCC is the one from @imo, the one with BD139.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: ggchab on May 28, 2019, 09:10:50 am
I am following this thread with some interest and I am wondering why there is C1 and R14 in the feedback loop of U4 (CV) but only C5 in the feedback loop of U3 (CC).
I made some LTSPICE simulations with a similar circuit and the resistor seems to really improve stability, even if I don't clearly understand why.
Thank you for any answer to my beginner's question.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 28, 2019, 09:31:35 am
I am following this thread with some interest and I am wondering why there is C1 and R14 in the feedback loop of U4 (CV) but only C5 in the feedback loop of U3 (CC).
I made some LTSPICE simulations with a similar circuit and the resistor seems to really improve stability, even if I don't clearly understand why.
Thank you for any answer to my beginner's question.
I don't fully understand what's going on either. With the experience from the last two of my designs, I repeatedly observed that the CC loop becomes unstable with increased Proportional response and perfectly stable with mainly Integral response. In this design, the CC op-amp has an unavoidable Proportional gain of one because it is configured as non-inverting, but isn't enough to cause  problems.
I see a lot of designs where the CC op-amp is configured purely as an inverting Miller Integrator.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 29, 2019, 01:35:59 am
Designs can look similar but important operating principles can be quite different.   
Mainly with the output stages.
There are the voltage follower type where the output stage follows the output voltage of an op-amp that is powered directly by the unregulated rail, yuck!  This type has a characteristically low output impedance. As load resistance decreases, the output stage itself automatically sources more current.
The output stage of the design in this thread has a high impedance constant current  characteristic. Voltage changes at the Base of Q1 control the output current regardless of what the output voltage is. It is termed as  "Transconductance" amplifier. Input voltage controls output current.
These two output stages types usually require different compensation in their CV and CC control loops.
My preference has been for the high impedance type output stage.
The highly regarded Harrison topology is the high impedance type.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 30, 2019, 12:52:19 pm
In the simulation, the diodes D1 and D7 were 1N4007.
If I change them to 1N5408, could the power supply starts to oscillate, if there were no oscillations with 1N4007 ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 30, 2019, 01:23:30 pm
99.999991% not..
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 30, 2019, 01:29:42 pm
... and if I change them to P600K ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 30, 2019, 01:42:42 pm
99.999991% not..
The only difference which may introduce an instability is in their capacitance, P600K is 150pF at 4V.
1N5408 is 30pF. 1N4007 is 15pF.
Add that cap diff to the D1/D7 (the output D1 diode's capacitance does not matter as there is the output capacitance large) and do a simulation...
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on May 30, 2019, 02:32:54 pm
When driving motors I would use a TVS diode, like 1.5KE30A or something like that..
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 30, 2019, 05:32:58 pm
If it is recommended to use a TVS diode, then why in the original schematic was used a 1N4007 ? What is the purpose of the 1N4007 in the original schematic (V17) ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: Kleinstein on May 30, 2019, 07:40:08 pm
D7 in the schematic I found is parallel to the output transistors, preventing the input voltage from being much smaller than the output. This diode can be important if there is a very large capacitor or other voltage source at the output and the supply is turned off. Here the 1N4007 is likely large enough to worst case charge the filter capacitor, when an external source is connected with the supply turned off. If in doubt (very large capacitor) one could use a larger diode, or 2 in parallel (works here because it would be a high current transient that could be critical).
Charing the cap is about as bad as discharging it through the diode (+ shunt + possible fuse).
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 30, 2019, 08:20:16 pm
@Kleinstein And what about the diode on the output of the power supply ?
Can I safely use there a larger current capacity diode ? For example P600K...
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 30, 2019, 08:34:17 pm
I sometimes use my bench supply to charge batteries.
Accidentally connecting a battery with reverse polarity would cause a large fault current through a diode.
I don't have a diode across the output. The design tolerates briefly applied reverse polarity.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 31, 2019, 05:13:38 am
If powering a motor, for example a 3A motor, then the 1N4007 diode is fine for back EMF ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 31, 2019, 05:56:41 am
As far as I know, DC motors produce an inductive voltage spike only when the current path is broken. I can't see how this can be an issue for the power supply.
Just use 3A diodes. If you foresee ever charging batteries, consider omitting the output diode or mount the diode somewhere it wont ruin the PCB if it overheats.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 31, 2019, 06:20:21 am
If I use 3A diode, then the power supply can start to oscillate, because of the diode ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on May 31, 2019, 06:39:17 am
If I use 3A diode, then the power supply can start to oscillate, because of the diode ?
Why would you want to think that? All sorts of things are expected to be connected to a power supply's output without causing instability.
It's not going to care much about a few PicoFarads of junction capacitance.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on May 31, 2019, 03:15:15 pm
So can I also use a P600K or a 6A6 diode on the output ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: Kleinstein on May 31, 2019, 04:06:34 pm
There is no real problem with a larger diode at the output - the first point would be leakage of the diode than could make the current reading to be off a few µA.
If in doubt the backwards diode should be stronger as it should come up with the current of a possible external 2 nd supply.
If charging batteries, there could be a fuse that would bow if there is too much reverse current.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 01, 2019, 03:27:06 pm
Can someone please explain why I am getting this jittering signal when measuring the output of the power supply with Vout=2V, Rload=10R and the output current almost down to zero ?
Video:
https://streamable.com/b8ium

It is a problem with the power supply or a problem with the oscilloscope ?

LE: This jittery signal appears only at this output voltage of the power supply. If I set the power supply to a higher voltage, for example 26V or 14V then the jitter does not appear.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on June 01, 2019, 03:53:07 pm
You shorting the output, right?
It looks ok to me, the small jitter may come from 230V mains hum induced in the wiring.
You may also look at the bridge voltage (your 35V) with the second probe how clean it is.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 01, 2019, 04:05:00 pm
Yes, I am shorting the output.
I made a second video, with the bridge voltage.
I did not managed to see both signals on the screen because one signal was triggered and the other was moving fast...

Video: https://streamable.com/sijci
Title: Re: LM324 Power Supply with variable voltage and current
Post by: Kleinstein on June 01, 2019, 04:15:37 pm
The jittery horizontal moving looks like a trigger problem, so like a poor setting at the scope.
The vertical movement could be something like mains hum or maybe a poor contact somewhere.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 01, 2019, 11:13:22 pm
The output stage will pass some ripple current due to the Early Effect of BJTs.
It is difficult to confirm this as the reason.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: floobydust on June 02, 2019, 01:09:09 am
mike_mike, if you are getting high ripple at load, check your wiring and PCB layout.
Wiring or traces in the wrong spot, you can end up amplifying ripple or adding instability at higher load currents.
Some PCB traces/wiring will develop an unexpected voltage drop across them at load.

The filter capacitor (-) should run right to the sense resistor and then the output (-) banana jack.
The CC op-amp input (circuitry) should connect right at the sense resistor - not up or downstream of it.
The potentiometer returns, and voltage sense divider are also critical. A pic of the PCB layout helps.

You can also line trigger the scope to view mains ripple if you are hunting for that.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 02, 2019, 04:45:29 am
A pic of the PCB layout helps.
The ripple from the last video is at the input of the power supply (on the bridge rectifier) and not at the output.
Please find attached the power supply layout.
There is a very, very big problem. I already ordered in China 5 pieces of pcb, so modifying the layout needs new pcb's, and at the second order I will need to pay the entire shipping taxes which are not cheap.
Modifying the layout also needs new tests ?
And I was trying to do my best while designing the pcb, and I was trying to design it using as example the pcb from the other power supply in this topic.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on June 02, 2019, 07:07:31 am
Nice board!
There is still place for drilling 2 mounting holes when necessary.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: floobydust on June 03, 2019, 03:57:21 am
You've already built the PSU with this exact same PCB layout? Just a little confused what circuit you are actually running, and getting scope traces from.

The first video is 2Vpp ripple at 35Hz ?  Into A 10R load?  :palm:
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 03, 2019, 05:18:37 am
You've already built the PSU with this exact same PCB layout?
Yes.

The first video is 2Vpp ripple at 35Hz ?  Into A 10R load?  :palm:
In that video the slowCC is active (the output current is set to almost 0A), this is the reason i'm getting 2Vpp ripple...
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on June 03, 2019, 05:48:30 am
That is not 2V "ripple" in the first video. It is Vout=2V shorted periodically (35Hz) via 10ohm resistor while SlowCC is at minimum.
Signal looks ok.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: floobydust on June 03, 2019, 05:58:59 am
It looks like a 35Hz oscillator to me. That's not mains "ripple" which is 100/120Hz.
"... measuring the output of the power supply with Vout=2V, Rload=10R and the output current almost down to zero"
"the slowCC is active (the output current is set to almost 0A), this is the reason i'm getting 2Vpp ripple..."
"Yes, I am shorting the output."

I give up trying to follow this thread. Where is the 2Vpp? Please say where you are measuring the scope trace. I hope I'm wrong and it's the short-circuit pulser.

I would expect things to go unstable with the current-limit setpoint set very low. It is unrealistic to dial in a mA or two without hitting the noise floor of the design. Usually there is a small resistor from R25 to 0V to limit the lowest setting.

You've poured the cement, ordering PC boards. If you're still testing after that, hope there are no surprises.
The design looks good. I would've used less gain but that's another argument that other people did not agree with.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on June 03, 2019, 06:22:31 am
..
You've poured the cement, ordering PC boards. If you're still testing after that, hope there are no surprises.
The design looks good. I would've used less gain but that's another argument that other people did not agree with.
@floobydust: this is the "Beginners" section.
A statement like "I would have used less gain" does not help much here. You had the chance to provide a concrete advise how to decrease the gain (and how to measure the gain) during the design phase.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 03, 2019, 07:47:04 am
I would expect things to go unstable with the current-limit setpoint set very low. It is unrealistic to dial in a mA or two without hitting the noise floor of the design. Usually there is a small resistor from R25 to 0V to limit the lowest setting.
Can you please explain this ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 03, 2019, 07:51:22 am
I think that the wobble in the trace from  Reply #479 is the 100Hz input ripple modulating the output capacitor charge rate every time the PSU unloads.
The next logical test is to see how much output ripple there is with continuous CC into the 10Ω resistor.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: floobydust on June 03, 2019, 10:16:52 am
@floobydust: this is the "Beginners" section.
A statement like "I would have used less gain" does not help much here. You had the chance to provide a concrete advise how to decrease the gain (and how to measure the gain) during the design phase.

It was back at the Bode plot in post #352. (https://www.eevblog.com/forum/beginners/lm324-power-supply-with-variable-voltage-and-current/msg2409939/#msg2409939) There's no mention of where the AC source is injecting. If I had the .asc and models I could participate. I saw the 106dB and compare with LM317 just over 60dB yet it achieves 0.1% load regulation.

With several chefs in the kitchen, I just let it go to see how compensation and stability works out, instead of interrupting the thread and ruffling feathers, going into technical discussion on feedback - when OP just wants a working circuit.

I think for beginners it's best to have something tolerant, very stable despite variation in parts and construction.
You get a circuit stable in SPICE at one operating point, but some details are missing, such as real ripple and the actual transistors can have a huge spread for hFE, fT and even AVOL for the LM324. It's a big deal for the Sziklai pair+driver and open-loop gain, and dominant-pole compensation.

It looks like everyone is saying mission accomplished with PCB's in fab. If issues come up we'll have to back up. I thought the bridge voltage is very noisy.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 03, 2019, 11:02:37 am
The next logical test is to see how much output ripple there is with continuous CC into the 10Ω resistor.
Please find attached the screenshots from the output of the power supply, with Vout=2.05V, I=0.17A and RLoad=10R/5W.

If I rotate the current potentiometer, down to 0A, then the ripple disappears.  Same thing happens when I set the current limit higher.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 03, 2019, 11:29:04 am
Is that output ripple more than what is on the input? As with my project, the output ripple disappears in CV mode also but I have only a fraction of that ripple in CC mode.
The cause of the thickening of the trace needs to be found. Is it still there with the mains turned off?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 03, 2019, 11:46:08 am
With the probe on the output of the power supply, with the mains turned off: 502.jpg
Ripple on the input capacitors, with the 10R load at Vout=2.05V: 503.jpg
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 03, 2019, 12:10:06 pm
The trace thickening looks the same with the mains off, so dont worry about it for mow.
The CC ripple is more than can be blamed on Early Effect. Try removing C5 for now. I dont have any more ideas for now.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 03, 2019, 03:46:52 pm
1. This behavior of the power supply can be harmful to the power supply or to the load, or it is something that also happens in other power supplies ?
2. Regarding the screenshot with the mains turned off, it was took with the cable disconnected from the wall socket, and after a few minutes of inactivity of the power supply. Is that the correct measurement ?
3. Regarding the attached schematic, of the power supply that has been discussed earlier in this topic, if I will use a 30 Vac/ 5A transformer, what are the modifications necessary in the schematic ? I need the same output voltage and current (0-30V and 0-3A). The only thing that modifies is the transformer. If the current project will be bad, then I will use this power supply, but only if it can be used with 30 Vac transformer. I want to use the 30Vac transformer, because, using the 24Vac transfomer, when the output voltage is about 25V and the load is about 3A, then the ripple appears on the output of the power supply. But if I go with the output voltage down to 24V, then the ripple disappears.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 03, 2019, 04:49:21 pm
Did removing of C5 reduce the ripple in CC mode?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 03, 2019, 06:07:09 pm
Removing of C5 (2n2) did not reduce the ripple, in CC mode.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 03, 2019, 08:42:45 pm
I should have said, remove the 220µF at the input of the LM7812, I hope that it is causing the ripple.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 03, 2019, 09:10:17 pm
I removed the 220uF at the input of the LM7812, and the ripple disappeared.
Vout=2.05V (without load, with load is less than 2.05V), SlowCC=0.17-0.19A, Rload=10R.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 03, 2019, 09:20:02 pm
I removed the 220uF at the input of the LM7812, and the ripple disappeared.
That's wonderful news, It means that the problem is being caused by the capacitor's ripple current causing voltage drop across the ground track.
Something needs to be altered.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 03, 2019, 09:30:37 pm
Something needs to be altered.
Do you mean the PCB layout ?
It can work correctly without the 220uF capacitor ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 04, 2019, 02:44:53 am
It's more likely that the capacitor's ripple current through the shunt is the main cause of the problem.
If the 7812 is proven to be stable with the small capacitor left, just leave it with the 220µF removed.
It's not worth correcting the PCB design just for this problem as the design will still remain incompletely developed for many other reasons.
This design should not be replicated as is.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 04, 2019, 03:52:16 am
This design should not be replicated as is.
Should I not use this design ?
How to check if 7812 is stable with 220uF capacitor removed ? Just connecting the oscilloscope probe to the output of the 7812 ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: floobydust on June 04, 2019, 04:08:10 am
I think it's architecture, because the capacitor is grounded after the sense-resistor. So ripple currents on the 220uF cap appear across the sense-resistor, and it adds a little unwanted feedback loop from the raw DC (ripple) to the slow CC circuit.
I would increase R1, R2 (5R is quite low) and decrease or eliminate 220uF (C5). Guessing 47R.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 04, 2019, 04:42:25 am
This design should not be replicated as is.
Should I not use this design ?
How to check if 7812 is stable with 220uF capacitor removed ? Just connecting the oscilloscope probe to the output of the 7812 ?
No, we know that the design works fine. I would rather not see it copied by others before it's fully developed. For example, the low side fast limiting should have been tested and that mess on the high side removed.
Check around the 7812 with your CRO.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: floobydust on June 04, 2019, 04:45:43 am
7812 (http://www.ti.com/lit/ds/symlink/lm340.pdf) minimum load is 5mA, I would expect he has that esp. with the LED's.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 04, 2019, 05:02:14 am
3. Regarding the attached schematic, of the power supply that has been discussed earlier in this topic, if I will use a 30 Vac/ 5A transformer, what are the modifications necessary in the schematic ? I need the same output voltage and current (0-30V and 0-3A). The only thing that modifies is the transformer. If the current project will be bad, then I will use this power supply, but only if it can be used with 30 Vac transformer. I want to use the 30Vac transformer, because, using the 24Vac transfomer, when the output voltage is about 25V and the load is about 3A, then the ripple appears on the output of the power supply. But if I go with the output voltage down to 24V, then the ripple disappears.
The 10Ω resistor in the Emitter circuit of the driver transistor will be adding some extra dropout although eliminating this won't completely solve the ripple at high output voltage.
It is difficult to give  certain responses to the topic of voltage, current and heat sinking.
If there are 2 separate 15VAC secondaries, tap switching has great advantages in reducing the possibility of failure of the output transistors. 
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 04, 2019, 05:11:02 am
Regarding the power supply discussed early in this topic, at pct 3, is that such a big problem, if the input ripple appears on the output of the power supply at high output voltage ?
Can the power supply be used without problems if this behavior appears ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 04, 2019, 06:47:14 am
Regarding the power supply discussed early in this topic, at pct 3, is that such a big problem, if the input ripple appears on the output of the power supply at high output voltage ?
Can the power supply be used without problems if this behavior appears ?
Yes, no problem so long as the load doesn't care.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 04, 2019, 09:26:01 am
By removing the 220uF capacitor, it is possible to make the power supply oscillate or making other "strange" things ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 04, 2019, 09:30:44 am
By removing the 220uF capacitor, it is possible to make the power supply oscillate or making other "strange" things ?
Only if the 7812 oscillates which I don't expect.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 04, 2019, 10:50:46 am
I checked with the oscilloscope on the output and on the input of the 7812.
On the output of the 7812:
1. No load 516-521.jpg
2. 2.5A load at the output of the power supply: 522-527.jpg
On the input of the 7812:
1. No load 528-532.jpg
2. 2.5A load at the output of the power supply 533-535.jpg

The wave form in 520 and 521 is noise or oscillation ?
What about the other screenshots ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 04, 2019, 11:07:07 am
Everything looks ok. You have previously proven that the high frequency noise is not produced by the power supply.
I dont know what this noise is caused by. Are you near an FM or TV transmitter?
It's usually difficult to track down.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 04, 2019, 11:22:59 am
Everything looks ok.
So I can peacefully use the power supply ?

Are you near an FM or TV transmitter?
At about 300m distance, there is a GSM antenna.
I don't know if some of my neighbors have FM or TV transmitter...
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 04, 2019, 11:25:40 am
yes, Just use it. Do you have meters on it so know what's happening?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 04, 2019, 11:28:37 am
I have only one analog voltage meter (0-30V dc).
For measuring the current I will use the multimeter...
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 04, 2019, 07:12:25 pm
I made some tests with a 5mm white led as load. I set the output voltage at maximum, then I reduced the output current to minimum and then I connected the white led and I increased the current to about 6.51mA. After about 1 hour and a half, the current through the led was 6.57mA. Then I touched the LM324, and the current dropped to about 6.52-6.53mA.

After this, I made another test. I disconnected the power supply from the mains voltage, then I reconnected it to the mains voltage. Then I measured during 1 hour the current through the led and it was initially 6.50mA and then it dropped to 6.48-6.49mA and it was constantly about 1 hour until the test was stopped by me.

Before these tests I made another one, with another amp meter and another 5k pot, and the results were the same.
Are the results of the tests good ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: floobydust on June 04, 2019, 08:22:54 pm
I think this is normal for the design and parts used.
Temperature change will cause drift in many components. Expect a voltage or current setpoint to move due to temperature. 6.51/6.57 is roughly 1% after 1.5hrs.
As the 7812 heats up, its voltage will drift 1.5mV/°C
The LM324 input offset voltage drift 70uV/°C
0.22R sense resistor is ±300ppm/°C.

I think it (CC) would be worst drifting at high current loads due to the 0.22R sense resistor heating up and then cooling down.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 05, 2019, 01:36:28 pm
Can you please tell me what is the maximum Differential Input Voltage for the led signalization (IC2B) op amp ?
I am measuring maximum 9-10V between the in- and in+ of this op amp.

And I found a document (screenshot) from TI and I wanted to ask if in the LM324 datasheet, the Differential Input Voltage = max 32V, is the voltage measured between the in- and in+ pins of the op amp ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 05, 2019, 07:55:10 pm
I have found that in the datasheet there is a parameter named "input common-mode voltage".
In my design, the pin 5 is at 9.71 and pin 6 is at 9.26V, when there is no load at the output. Also, the LM324 supply voltage is 11.88V
While the CC is active, the supply voltage for LM324 is 12.33V and the output voltage from the 7812 is 11.88V. Pin 5 is at 4.73V and pin 6 is at 9.71V, with respect to ground. Why is this happening ?? Why the voltage at the LM324 power is higher than the voltage at the output of the 7812 ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 05, 2019, 09:30:04 pm
 What side of the shunt(R26) are you using as ground?
The LM324 supply pins see the 12V regulator voltage plus any voltage drop across the shunt.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 05, 2019, 09:47:31 pm
I measured the voltage on the LM324 on pins 4 and 11 and the output of the 7812 across the 10uF capacitor...

Aren't the voltages on pins 5 and 6 too high ? (Please see my previous post)
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 05, 2019, 10:11:26 pm
The voltages on pins 5 and 6 seem normal. The high value resistors should protect the inputs pins from effects of high input difference voltage. I haven't looked at the data sheet.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 05, 2019, 10:49:56 pm
The TI data sheet says 'Differential Input Voltage Range Equal to the Power Supply Voltage"
Keep in mind that for input pins on any device, there might be some significant current draw at extreme voltages which will cause voltage drops across input resistors.  Voltages should be also measured at their source.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: floobydust on June 05, 2019, 11:42:59 pm
I would not worry about overloading that LED op-amp. The 100k resistors limit any input current.

The CC/CV mode LED circuit is typically looking at the CC and CV op-amp's outputs.
So R13, instead of connecting to the pot would go to IC2A's output pin 1. A 1MEG resistor from IC2B's output to (+) input for a little hysteresis as it's acting as a comparator.
This could get rid of the very sensitive R7, if this is your problem.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 06, 2019, 04:11:32 am
The actual configuration of the led op amp should work good if it remains as it is in the last schematic ?

I am not worried about the 2k2 pot... I would let it as it is, if the led op amp is ok.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 06, 2019, 07:35:43 am
The actual configuration of the led op amp should work good if it remains as it is in the last schematic ?

I am not worried about the 2k2 pot... I would let it as it is, if the led op amp is ok.
Read the responses and also the LM324's data sheet, then decide.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 06, 2019, 08:12:57 am
I know that there is an op amp in comparator configuration. If the in+ voltage is higher than in-, then the output of the opamp will be Vcc. If the in- input is higher than in+, then the output of the op amp will be 0V.
I have also had a look in the LM324 datasheet, where differential input voltage is specified = +-32V.
Also in the same datasheet, it is specified Common-mode input voltage range = V+ - 1.5V. Is there any connection between those 2 paramenters ? Which of them should be took into consideration in this circuit ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 06, 2019, 08:47:44 am
Also in the same datasheet, it is specified Common-mode input voltage range = V+ - 1.5V. Is there any connection between those 2 paramenters ? Which of them should be took into consideration in this circuit ?
The "Common-mode input voltage range = V+ - 1.5V" means that it will operate as an op-amp so long as neither input exceeds 10.5V for a 12V supply.
I believe that it will still function properly as a comparator if only one of the inputs exceeds 10.5V. Meaning that the output state will correctly correspond to the input difference polarity.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 07, 2019, 10:34:44 am
I decided to make some modification on the led signalization circuit. I will modify the values of R6, R7 and R8 and I will connect a resistor between the pin 5 and GND.
I am wondering to which GND should I connect the resistor ? To the GND on the left or on the right of the shunt resistor (0.22R) ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 07, 2019, 10:55:37 am
You want the voltage on pin 6 to be roughly at the center of the voltage swing range of the CC op-amp's output.
Ideally the resistor current should avoid flowing through the shunt. Because it's a constant current, it doesn't really matter especially if the Pot and resistors can be replaced with something 10 times higher in value.
Also, the Pot isn't really needed.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 07, 2019, 11:07:59 am
I removed the pot, I used R6=27K, R8=12K, I connected a 100k resistor between the pin 5 and the right side of the shunt resistor.
The voltages on the pin 5 and 6 are as follows:
1. With SlowCC active:
pin 5=2.53V
pin 6=3.67V
2. With 2.5A load without SlowCC active:
pin 5=5.55V
pin 6=3.74V
3. Without load:
pin 5=5.08V
pin 6=3.31V

Regarding what you said in the previous post, the 100k resistor can be connected on any of the GND (left or right of the 0.22 R shunt), but if connected to the right side of the shunt, then it will consume current through the shunt, but it can be connected on either one of the GND's ?

Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 07, 2019, 11:12:57 am
Forget about the other post, I forgot about the extra resistor between pin 5 and ground.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 07, 2019, 11:22:05 am
In the schematic from reply #536, the 100k resistor needs to be connected to the ground on the right side of the 0.22R shunt resistor ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 07, 2019, 11:23:39 am
Ok, it's best to return the R6/R8 divider to the right side of the shunt and reference all measurements to the right side of the shunt.
This is mainly because some of the voltage changes you are seeing are due to changing voltage drop across the shunt making things confusing.

Also connect the extra 100K resistor to the right side of the shunt.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 07, 2019, 11:31:36 am
You mainly want two readings on pin 5.
While there is no load.
Where the PSU is in CC mode at full current setting.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 07, 2019, 11:35:44 am
So I have the attached schematic, with the R6/R8 voltage divider connected to the right side of the shunt and with the 100k resistor connected also to the right side of the shunt.
Is this the correct version of the schematic ?

With max output current, and with an overload, the voltage on pin 5 is 3V and on pin 6 is 3.92V.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 07, 2019, 11:49:07 am
So I have the attached schematic, with the R6/R8 voltage divider connected to the right side of the shunt and with the 100k resistor connected also to the right side of the shunt.
Is this the correct version of the schematic ?

With max output current, and with an overload, the voltage on pin 5 is 3V and on pin 6 is 3.92V.
"Is this the correct version of the schematic ?" I think so.
That all looks about right. Pin 5 swings from 5.5V to below pin 6 with some margin. Pin 6 could be a bit higher for extra margin,
Also, I calculate 3.7V for the R6/R8 divider?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 07, 2019, 11:51:06 am
Also, I calculate 3.7V for the R6/R8 divider?
Yes, I also calculated 3.7V for R6/R8 divider. Probably it is 3.9V because of the resistors, which have 5% tolerances (I think).
Or probably it is higher than 3.7V because of the reason you said in reply #525.

LE: last version of schematic attached
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 07, 2019, 12:00:30 pm
With measurements referenced to the ground symbol which connects to the right side of the shunt, the voltage readings should not  be affected by the shunt voltage drop.
I would like to know the voltage range on the Base of Q1 from no load to full load. It will tell me the gm of the output path.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 07, 2019, 12:03:19 pm
The purpose of C15 is not clear. R21 isn't needed.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 07, 2019, 12:12:32 pm
With measurements referenced to the ground symbol which connects to the right side of the shunt, the voltage readings should not  be affected by the shunt voltage drop.
I would like to know the voltage range on the Base of Q1 from no load to full load. It will tell me the gm of the output path.
I have 3.28-3.30V on the pin 6, with respect to the right side of the shunt GND. This voltage is always the same, even if there is load or there is not load at the output and even if there is active the current limit or not.

The voltage at the base of Q1, with respect to the right side of the shunt GND is: 4.58V with no load and 5.40V with about 2.5A load.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 07, 2019, 12:26:30 pm

I have 3.28-3.30V on the pin 6, with respect to the right side of the shunt GND. This voltage is always the same, even if there is load or there is not load at the output and even if there is active the current limit or not.

The voltage at the base of Q1, with respect to the right side of the shunt GND is: 4.58V with no load and 5.40V with about 2.5A load.
There will be some meter loading pulling the voltage down. The voltage at pin 6 should be close to  R6/R8 divider voltage when there is nothing loading it down. Is the divider still 3.9V?
The gm of the output path is 3.    1V change at the Base of Q1 causes 3A output change.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 07, 2019, 12:39:07 pm
On the R6/R8 divider, there is 3.60V, while on pin 6 there is 3.29V. Is that good ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on June 07, 2019, 12:42:46 pm
The purpose of C15 is not clear. R21 isn't needed.
C15 is the blocking cap at the Vcc/Vss pins of the LM324.
Its Vss is wired at the left hand side of the shunt.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 07, 2019, 12:45:20 pm
Assuming the op-amp isn't causing the loading, it would need a 1MΩ load to pull the voltage down that much.
The op-amp's input pins   actually should be sourcing a very small current.
What are you measuring with?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 07, 2019, 12:52:56 pm
The purpose of C15 is not clear. R21 isn't needed.
C15 is the blocking cap at the Vcc/Vss pins of the LM324.
Its Vss is wired at the left hand side of the shunt.
I see, C15 would be causing some unwanted feedback but there has been no indication of any trouble.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 07, 2019, 02:23:28 pm
I measured using another multimeter and I got 3.61 V on the pin 6 and 3.65 V on the divider.
First time, I measured with a cheap M830BUZ from UNI-T and second time with a UT52 also from UNI-T.

I also found that the input impedance of the M830BUZ is 1M \$\Omega\$ , as you said in the previous reply (it is specified in the multimeter datasheet).

I checked the CC led by connecting a load at about 19.18V output voltage and I reduced slowly the output current until the voltage started to go down. The led started to light right in the moment when the voltage started to go down. Is this procedure correct ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 07, 2019, 07:56:23 pm
That's right. Keep in mind the reduced margin at higher CC settings where pin 5 doesn't drop as much when going from CV to CC mode.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 07, 2019, 08:01:18 pm
What do you mean by "reduced margin" ?
Can you please be more detailed ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: floobydust on June 07, 2019, 08:13:32 pm
I dislike the LED circuit with no hysteresis and relying on T1's base voltage to be exactly the same either on or off, due to calibration of trimmer R7.
T1's base voltage depends largely on PSU output current, so CV at 1A going to CC at 0.9A is little change and I don't expect the LED to work properly.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 07, 2019, 08:39:35 pm
What do you mean by "reduced margin" ?
Can you please be more detailed ?
It's the extra change in voltage after the threshold is crossed. If you are worried, set pin 6 to 4.5V.
Pin 5 will always stay  close to 5.5V while the CC loop is not in control.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 07, 2019, 09:06:49 pm
Ok, I added into the circuit a 10k trimmer between R6 and R8 (as it was in the original schematic) and I set the voltage on pin 6 at 4.5V.
I set the output voltage at 11.98-12.00V, and the current to about 1A, and I used a load with a transistor and a light bulb and I slowly increased the current using the pot from the load schematic (the attached schematic, I used a 10k pot). When the current reached 1.05A, the led illuminated and the output voltage started to decrease slowly as I was rotating the 10k pot.

In your opinion, the led notification circuit is Ok ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 07, 2019, 10:06:54 pm

Although  It is more important to test at high current settings , it will be fine.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 08, 2019, 08:08:27 am
I checked the CC led at 3A current limit (this is the max current limit). The led started to illuminate right in the moment when the current consumed by the load was 2.99A and right in the moment when the power supply output voltage started to decrease.

If this test, and the test from the previous post are good, then the CC led will work correctly in all situations ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 08, 2019, 08:12:53 am
I checked the CC led at 3A current limit (this is the max current limit). The led started to illuminate right in the moment when the current consumed by the load was 2.99A and right in the moment when the power supply output voltage started to decrease.

If this test, and the test from the previous post are good, then the CC led will work correctly in all situations ?
So long as pin 5 drops well below pin 6 on the LED op-amp, which it should be now, it will be reliable.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 08, 2019, 08:22:28 am
I think that I have a new problem now.  :-[ I checked the power supply using 2k2 resistor for R30 instead of 3k3.

The tests are still valid if I change the R30 from 2k2 to 3k3 ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 08, 2019, 08:29:54 am
I think that I have a new problem now.  :-[ I checked the power supply using 2k2 resistor for R30 instead of 3k3.

The tests are still valid if I change the R30 from 2k2 to 3k3 ?
Changing R30 to 3.3K will increase the gm and decrease the voltage at the Base of Q1. I don't expect any problem.
You can check the stability of the CV loop with some load transient tests.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 08, 2019, 11:06:52 am
It's the extra change in voltage after the threshold is crossed. If you are worried, set pin 6 to 4.5V.
Pin 5 will always stay  close to 5.5V while the CC loop is not in control.
Pin 6 needs to be 4.5V with respect to the right or to the left GND of the shunt resistor ?

I think I don't clearly understood what is with those 2 GND's...
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 08, 2019, 11:32:51 am
It's the extra change in voltage after the threshold is crossed. If you are worried, set pin 6 to 4.5V.
Pin 5 will always stay  close to 5.5V while the CC loop is not in control.
Pin 6 needs to be 4.5V with respect to the right or to the left GND of the shunt resistor ?

I think I don't clearly understood what is with those 2 GND's...
We had decided that the right side of the shunt should be called ground.
Important elements of the regulator are referenced to this ground.
For example, the 12V regulator which is also the voltage reference, and also the voltage feedback divider.
The left side of the shunt develops a negative voltage with respect to  ground when the regulator is loaded.
Unless otherwise said , all measurements are taken with respect to  ground.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on September 28, 2019, 02:05:05 pm
Hello, I want to continue testing, if necessary, this power supply schematic (reply #561 shcematic).
The lasts tests were the one with the resistive (R) load.
What are the next steps when testing this power supply ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on September 28, 2019, 02:27:22 pm
Hello, I want to continue testing, if necessary, this power supply schematic (reply #561 shcematic).
The lasts tests were the one with the resistive (R) load.
What are the next steps when testing this power supply ?
I guess the way the voltage regulation responds to load transients could be tested. It will give a good indication of how stable it is.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on September 28, 2019, 02:37:40 pm
I guess the way the voltage regulation responds to load transients could be tested. It will give a good indication of how stable it is.
Ok. I will study and try to test it.
What are the layout design guidelines for this power supply ?
I used for testing the attached layout. Is it any good ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on September 28, 2019, 03:08:28 pm
C5 could be put back into service by moving its negative end to the same track that connects to the negative of  C2. This should avoid the ripple problem.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on September 28, 2019, 03:27:19 pm
Ok, I will do that.
Are there any other necessary modifications or recommendations ?

LE: I added the C5 modification on the board.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on September 28, 2019, 03:42:07 pm
Ok, I will do that.
Are there any other necessary modifications or recommendations ?
It's difficult to spot all problems. The load transient tests might show problems if there are any. Include C5 for the tests.
I also suggest that you tack in the transistor and 2 resistors to test the low side fast limiting idea.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: Kleinstein on September 28, 2019, 03:55:19 pm
For fast output regulation one may want an RC combination in parallel to R12 (from the LTspice schematics).
For high precision R12 should be directly from the output terminals. Similar the negative side should have separate current and voltage sense wires. At least the wires should be short.

The reverse diode at the output usually should be strong enough to carry the full load current - though ideally the requited current rating is more to the possible external supply (e.g. 2 nd LNG) that may be connected.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on September 28, 2019, 04:29:02 pm
Ok, I introduced into the schematic, the modifications proposed by Xavier60, and I made a simulation in LTSpice. I eliminated the Fast CC that was near the power transistors and I used the solution on the R_Shunt.
I see a spike of about 40A on the shunt resistor, so there is something bad.
Please have a look ...
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on September 28, 2019, 04:44:22 pm
I can't explain that result. It is a commonly used method for fast limiting and should work.
I suggest that the mod is applied to the actual power supply and carefully tested by increasing the switched overload current gradually.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on September 28, 2019, 04:53:38 pm
Sorry about the mistake. I corrected.

I see that it is oscillating when the output current is set to max. But when the output current is set to 50% then it looks better.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on September 28, 2019, 04:54:26 pm
The 40A spike shouldn't be possible. If the spike is ignored, the rest looks as expected with the current increasing from zero and limiting at about 5A for 80µs.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on September 28, 2019, 05:11:34 pm
I added the corrected schematic at page 23.
I also made some more experiments in LTSpice, but it looks like the output is always oscillating when the current is set to maximum. Even if I increase the value of C1 and C5 (C1 and C5 from the simulation schematic).
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on September 28, 2019, 10:44:50 pm
Removing the fast limiting components from the high side would cause increased gain of the output stage. I should have asked you to check the stability of the CV loop first and change the compensation if necessary, decrease the resistor and increase the capacitor.
Even if the fast limiting is unstable, the instability should only be brief until the slow loop takes control.
Make certain that the fast limiting current is set higher than the slow CC maximum.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on September 29, 2019, 05:12:14 am
I bread-boarded the design, not in an exact way.
The low side fast limiting does cause brief instability until the slow CC loop takes control.
This was solved by adding a 6.8nF compensation capacitor between C-B of the fast limiting  transistor.
An OR-ing diode was then also needed for the fast limiting transistor.
The compensating capacitor value can be experimented with. I used the particular value of 6.8nF because it is one of the values that my collection is over populated with.

Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on September 29, 2019, 07:39:06 am
I also tested the diode type fast limiting method that I used in my bench supply. Using a 1N914, it worked just fine.
I am using a LM358 with is supposed to be the same or very similar to the LM324.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on September 29, 2019, 08:33:23 am
I also simulated using 1N914 diode (connected as it is in the other schematic - your bench power supply) and I have got the attached results. I removed the Fast CC NPN transistor because I used the 1N914 diode.
Please have a look at the schematic and at the results.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on September 29, 2019, 09:28:35 am
The time scale doesn't show the important detail.
The photo shows the shunt waveform when a short was applied with the CC set to 2A.
There are factors that might change the size of the initial spike, but it's only 10µs.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on September 29, 2019, 10:24:36 am
I added that diode (1N914) into the LTSpice and Eagle schematic. I attached the LTSpice schematic. Please have a look at it.
Can you post the schematic that you tested ?
I want to build power supply and test it using the oscilloscope. I also want to finalize the PCB layout.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on September 29, 2019, 10:48:13 am
I don't have a schematic. I tried to build it the same as your schematic with the parts that I have and leaving out unnecessary bits.
You should modify and test your existing PCB for now.
If you can do this, I would like to see the load transient response first.

R10, 1M, isn't needed.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on September 29, 2019, 11:03:47 am
Ok, I'll do that. I hope that my oscilloscope will arrive next week to start testing.
Before testing, I would like to know if D3 - 1N914 is correctly connected ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on September 29, 2019, 11:07:43 am
Ok, I'll do that. I hope that my oscilloscope will arrive next week to start testing.
Before testing, I would like to know if D3 - 1N914 is correctly connected ?
Yes, D3 is correctly connected.
Also it can be the same type as the 1N4148 diodes.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 08, 2019, 10:32:09 am
Today I feel ready to start testing.
I will test the FastCC using the attached PSU Shorter schematic.

Can you please let me know the start values for C5 (CC loop) and C1 (CV loop) ? Are them the same with the schematic from reply #582 ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 08, 2019, 02:05:25 pm
Today I feel ready to start testing.
I will test the FastCC using the attached PSU Shorter schematic.

Can you please let me know the start values for C5 (CC loop) and C1 (CV loop) ? Are them the same with the schematic from reply #582 ?
Stay with those compensation values. Do the load transient recovery test first to confirm that the design is still stable.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 08, 2019, 02:45:27 pm
I checked with the output voltage at about 26V, output current at maximum (3A) and I used the PSU shorter configuration from my previous reply.
From the LTSpice schematic, C5=2n2 (current loop) and C1=68p (voltage loop).
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 08, 2019, 03:52:21 pm
That's looks like a good start.
Will you also do the load transient test? And why change C1 to 68pF ?
The diode fast limiting works best with the CV compensation set slightly to the slow side.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 08, 2019, 03:58:20 pm
Yes, I will also do the load transient test. But first, I need to be sure that there are no oscillations and the FastCC is working good if there is a short circuit on the output.
In my mind, it remained 68p. I don't know why. I changed it now to 470p.

PS: Please find attached the results with C1=470p.


1. Why in the simulation the maximum current is aprox. 8A and in the real circuit is aprox. 14A ?
2. If I will use a Schottky diode (D3), then the results will be better ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 08, 2019, 10:04:03 pm
Try a schottky diode, even a 1 amp one. Even a fast silicon diode just to see what happens. But leave the original diode in circuit as a back up.
You can even try 400mW and 1W zener diodes, but be certain to put it in circuit the same way as the original diode, don't reverse it.

When the output voltage drops due to the short circuit, the CV loop responds by increasing the drive to the output transistors.
Although the diode speeds up the response of the CC loop, it still takes some time for the output of the CC op-amp to slew down and take control of the output. The size of the current spike is difficult to simulate accurately.
If the current is well within the ratings of the output transistors, then they will be safe. Also the spike is so brief. Look for the Safe Operating Area spec in  the data sheet to see how time affects how much current a transistor can safely pass at given voltages.

The lowside transistor limiting idea will allow a spike to occur also.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 09, 2019, 10:54:06 am
I used a UF4007 in parallel with the 1N4148 and I've got the following screenshots: DS0014-0015.
And with BAT85S, also in parallel with 1N4148: DS0017-0018.

I have also checked only with BAT85S, and the screenshots were the same as with BAT85S and 1N4148.
I checked the SOA of TIP3055, and it looks like at 15ms, and 40V CE voltage, the Ic is less than 2A.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 09, 2019, 01:44:44 pm
I used a UF4007 in parallel with the 1N4148 and I've got the following screenshots: DS0014-0015.
And with BAT85S, also in parallel with 1N4148: DS0017-0018.

I have also checked only with BAT85S, and the screenshots were the same as with BAT85S and 1N4148.
I checked the SOA of TIP3055, and it looks like at 15ms, and 40V CE voltage, the Ic is less than 2A.
Your current spike is 15µs at its base. None of the SOA charts go this low. Even at a duration of 300µs, the TIP3055 is allowed to pass 15A at 40V.
https://www.onsemi.com/pub/Collateral/TIP3055-D.PDF (https://www.onsemi.com/pub/Collateral/TIP3055-D.PDF)
Do the load transient test next.

More: I prefer the result with the UF4007 . There is less under shoot after the spike.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 09, 2019, 02:53:51 pm
It looks like my attention was not good when I checked the TIP3055 SOA chart.
I have got another problem...
In the previous message I sad UF4007, but I used, in reality, FR107 for D3. Sorry about my mistake.
Should I continue testing with FR107 for D3 ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 09, 2019, 08:34:54 pm
Yes, keep using the FR107, it seems to work well.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 10, 2019, 12:06:05 pm
I managed to make a few tests using the oscilloscope and the Switch load. I used for switch load 220k/220k/100nF.
Capacitor in CC loop = 2n2, capacitor in CV loop = 470p.
The oscilloscope probe connected on the output of the power supply.
1. Vo=26.6V, Io=3A, a wire as load at PSU Shorter: 29.jpg

2. Vo=26.6V, Io=3A, Rl=10R: 32, 33.jpg

3. V0=26.6V, Io=almost minimum, Rl=10R: 37, 38.jpg

4. Vo=13.9V, Io=3A, Rl=10R:44, 45.jpg

5. Vo=2.08V, Rl=1R, Io=3A: 46, 47.jpg

6. Vo=2.08V, Rl=1R, Io=1.5A: 49, 50, 51, 52.jpg

I added only the results that I considered important.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 10, 2019, 12:35:17 pm
I mainly want to see the voltage dip where the load turns on. Just a  detailed shot at 2 amps with no current limiting.
It doesn't matter much what the voltage is set to.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 10, 2019, 12:48:35 pm
Can you please explain how to see this voltage dip ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 10, 2019, 12:54:41 pm
Set the trigger polarity to negative going and place the trigger level just below the steady state voltage.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 10, 2019, 01:05:28 pm
Or you could trigger from the Gate drive of the MOSFET either by connecting CH2 to it or using the external trigger input.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 10, 2019, 01:39:20 pm
I used the method described in reply #599.
Please find attached the screenshots.
Vout=26.6V, I=2.6A, Rl=10R (I don't have a resistor which draw exactly 2A).
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 10, 2019, 02:08:57 pm
That's a very good response.  Reasonably fast with no sign of instability.
The fast current limiting spike is higher than I would prefer but it's safe enough.
Reducing it would involve reducing the amount of voltage the CC op-amp has to slew down by to take control. I have no immediate suggestions.
If you want to check something else, look at the settling time for the slow CC with a mild overload.
Although not at all critical, I like to see it have a time constant of about 100µs.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 10, 2019, 02:31:35 pm
I do have a suggestion.
You could experiment with raising the Q point of Q1's Base voltage by using a higher voltage zener, removing the LED and R16, and increase R1 to reduce unnecessary loading of the op-amps. Try 10K then check that the Base of Q1 can be pulled up to close to 12V when needed to be.
The idea is to reduce the voltage that the CC op-amp's output has to slew down by to take control of Q1.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 10, 2019, 04:18:56 pm
Should I test using a 5v1 or a 6v8 Zener diode instead of 3v3 ?
Or the voltage of the Zener diode needs to be higher than my suggestion ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 10, 2019, 05:24:20 pm
Start with the 5.1V,
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 10, 2019, 06:17:52 pm
I made the modifications into the circuit using the 5.1V Zener diode.
I made a quick test, the voltage is variable, the current also. I used 2 x 12V/20W light bulbs in series as load.

The next test is to see on the oscilloscope the output of the CC op amp while driving a overload into the PSU Shorter ?

Can the power supply remain at the latest schematic (the one from post #582, with D3=FR107 and with the added overload led notification) ? If yes, then should I start to test for oscillation and adjust the values for the 2n2 and 470p capacitors ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 10, 2019, 09:23:15 pm
I made the modifications into the circuit using the 5.1V Zener diode.
I made a quick test, the voltage is variable, the current also. I used 2 x 12V/20W light bulbs in series as load.

The next test is to see on the oscilloscope the output of the CC op amp while driving a overload into the PSU Shorter ?
Yes, do that and see if the current spike has been reduced.
Also look at the Base of Q1 to see how high the voltage gets before the CC op-amp takes control.

Can the power supply remain at the latest schematic (the one from post #582, with D3=FR107 and with the added overload led notification) ? If yes, then should I start to test for oscillation and adjust the values for the 2n2 and 470p capacitors ?
Yes, but there should be no need to change the compensation except for increasing R9 later to increase the settling time of the CC loop.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: rstofer on October 11, 2019, 06:03:19 am
What should I do to solve this problem ?
Sorry for bothering you and others with such problems but I searched the internet from top to bottom and I did not found a good power supply schematic. This year I built about 5 power supply each with different schematic and all of them had problems...

That's because none of them work very well.  They all have warts!

If there was a known good PSU, truly capable of delivering high voltage and high current and also capable of delivering less than 1V at 5A (this is the worst case heating), it would be in a sticky at the top of the forum.  PCBs and kits of parts would be offered everywhere.

Every time somebody wanted a PSU, we could just point them at the sticky.  Instead, we continue to hash over the same schematics, with the same failings, endlessly.  There is no rainbow, no pot of gold, only rain!

On a brighter note, you can use a fast acting fuse to protect the transistors.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 11, 2019, 01:43:55 pm
With Vout=26.6V, Iout=3A, PSU Shorter = 220k/4k7/100n.
The current spike has been reduced to 2.61V: 0058.jpg
The base of Q1: 0062-0063.jpg , with the ground probe to right side of R_Shunt.

With Vout=26.6V, Iout=3A, PSU Shorter = 220k/220k/330n.
The base of Q1: 64, 65, 66.jpg

LE: I updated the reply.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 11, 2019, 02:24:27 pm
That's about 12 amps. It might seem like a lot but because the duration is so short, it's safe enough already.
You could experiment more.
A quick way of getting the operating voltage up at the Base of Q1 is to change to 1K the resistor across B-E of the PNP driver transistor.
Also by trying the 6.2V zener.
We don't want to go too high with the operating voltage of Q1's Base because we still want to leave enough drive reserve for the output.
And also the overload detect circuit might be affected.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 11, 2019, 02:33:45 pm
The Q1 Base waveform looks odd, could be a measurement problem. Take the measurement at the Emitter next time.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 11, 2019, 04:16:18 pm
Ok, I will take the measurement in the Emitter of Q1. I will also change the B-E resistor of the PNP transistor to 1k.
I do not have any 6.2V Zener diode, only 6.8V or 5.6V.
Should I use 5.6V or 6.8V Zener ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on October 11, 2019, 08:11:17 pm
The "shorting" pulse shall be longer than the expected response.. Otherwise you will see a lower amplitude of the peak current because the short stopped earlier than the "max peak"..
Thus the short should be, say, 200us, and its period, say, 20ms - not to smoke the transistors (1:100 duty)..
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 11, 2019, 09:32:28 pm
Ok, I will take the measurement in the Emitter of Q1. I will also change the B-E resistor of the PNP transistor to 1k.
I do not have any 6.2V Zener diode, only 6.8V or 5.6V.
Should I use 5.6V or 6.8V Zener ?
First I need a better idea of the range of voltage change at the Base of Q1 as the power supply load changes from light load to the full 3 amp load.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 11, 2019, 10:27:05 pm
The "shorting" pulse shall be longer than the expected response.. Otherwise you will see a lower amplitude of the peak current because the short stopped earlier than the "max peak"..
Thus the short should be, say, 200us, and its period, say, 20ms - not to smoke the transistors (1:100 duty)..
I am trying to find the correct values for R1, R2 and C for the PSU Shorter, but I don't find something to result the 200us short and period of 20ms. It would be good if you can help. I used the calculator from:
https://www.allaboutcircuits.com/tools/555-timer-astable-circuit/ (https://www.allaboutcircuits.com/tools/555-timer-astable-circuit/)

@xavier60: I will return with the results, after modifying the PSU Shorter if the modification will make the results more suggestive.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 11, 2019, 11:27:41 pm
I haven't been paying attention to the shorter. You roughly want an on duration in the order of milliseconds and tens of milliseconds or more for off.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 12, 2019, 05:51:40 am
Are you meaning that the Mosfet from the PSU Shorter needs to be On for about a few miliseconds to tens of miliseconds ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 12, 2019, 06:16:31 am
Are you meaning that the Mosfet from the PSU Shorter needs to be On for about a few miliseconds to tens of miliseconds ?
ON for a few milliseconds to give time for the CC loop to settle. Then OFF for some long time like 100ms or more so that the power transistors don't get too hot.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on October 12, 2019, 07:44:05 am
fyi
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 12, 2019, 08:34:07 am
Using the resistors and capacitor recommended by imo:
R_Shunt: 86-88.jpg with short circuit at PSU_Shorter.
E of Q1 with respect to the GND of the right side of the R_Shunt:90
B of Q1 with respect to the GND of the right side of the R_Shunt:92
E of Q1 with respect to the GND of the left side of the R_Shunt:95
B of Q1 with respect to the GND of the left side of the R_Shunt:93-94

Vout=26.6V, Iout=3A
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 12, 2019, 09:18:54 am
"B of Q1 with respect to the GND of the left side of the R_Shunt:93-94 "
You must mean the right hand side?
Try the 5.6V zener.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 12, 2019, 09:40:47 am
With 5.6V Zener:
On the R_Shunt: 99-101.jpg
with the ground clip of the probe to the left hand of the R_ Shunt
B of Q1: 102
E of Q1: 103
with the ground clip of the probe to the right hand of the R_ Shunt
B of Q1: 104
E of Q1: 105

@xavier60 It was on the left hand size. Please also have a look at the attached screenshots.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 12, 2019, 09:58:18 am
11.4 amps. You could leave it at that. Keep in mind that the peak is very narrow, not flattened out as with the VB-E limiter.
Just do some more tests at other voltage and current settings. Also add some resistance in series with the Shorter, 1 or 2 ohms.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 12, 2019, 10:15:27 am
I would like to see some voltage measurements with a light load, about 100mA.
The zener voltage.
The voltage across R25.
With the 1K across B-E of the PNP driver, R25 should have 1.35V across it.

Extra: Use the right side of the shunt for all measurements. It took me a while to realize that Q1's Base waveform was with respect to the left side of the shunt. This was showing the Base and shunt waveforms added together, not useful.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 12, 2019, 11:17:32 am
I have a problem, again. I forgot to replace the B-E resistor at the PNP driver transistor.
Sorry for any inconvenience...
The results with 3k3 resistor replaced by 1k:
On the R_Shunt: 110-111
with the ground clip of the probe to the left hand side of the R_ Shunt:
B of Q1: 106
E of Q1: 107
with the ground clip of the probe to the right hand of the R_ Shunt
B of Q1: 109
E of Q1: 108
The above tests were made at 26.6V output and 3A output, shorting the output using the PSU Shorter.

With a 150R load resistor at 15V on the output of the power supply:
V on the 5.6V Zener = 5.57V
V on the R25 = 1.42V
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 12, 2019, 11:31:42 am
That's under 10 amps. It can stay that way.
Read my edit in Reply #624 about using the correct ground reference.
What is the reason for the disturbance in DS0099.jpg and DS0111.jpg, 2.5ms after the current spike?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 12, 2019, 11:44:55 am
What is the reason for the disturbance in DS0099.jpg and DS0111.jpg, 2.5ms after the current spike?
I searched on the output of the NE555 and in the C of the BC337 (the NPN transistor from the PSU Shorter) and I did not found that disturbance. So it could be from other source. I don't know which source.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 12, 2019, 11:51:12 am
What is the reason for the disturbance in DS0099.jpg and DS0111.jpg, 2.5ms after the current spike?
I searched on the output of the NE555 and in the C of the BC337 (the NPN transistor from the PSU Shorter) and I did not found that disturbance. So it could be from other source. I don't know which source.
If you want to, do some test at other voltage and current settings and with some resistance in series with the Shorter.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 12, 2019, 12:00:12 pm
Vo=26.6V, Io=2.5A, Rl=1 \$\Omega\$ : 112-114
Vo=14.5V, Io=1.66A, Rl=1  \$\Omega\$ : 115,116

The probe was connected on the R_Shunt.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 12, 2019, 12:07:37 pm
Is there activity in the warning LED circuit that occurs about 2.25ms after the current spike?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 12, 2019, 12:17:59 pm
Double the Shorter's ON time to see how it affects the position of the disturbance.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 12, 2019, 12:33:08 pm
New PSU_Shorter configuration in screenshot.
The results are attached.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 12, 2019, 12:42:22 pm
The disturbance stays about 700µs before the Shorter turns off. The cause must be at the Shorter.
It's good that it isn't a fault of the power supply.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 12, 2019, 02:23:23 pm
Should I test again with the PSU Shorter and different load resistors to see if there are oscillations ?

Will the PSU Shorter remain, during the tests, at the reply #632 configuration ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on October 12, 2019, 04:54:24 pm
It could be the disturbance indicates the end of the shorter pulse (mosfet gets OFF)..
Thus it could come from the PSU..
Show both PSU (ch1) and shorter mosfet's base (ch2) signals (in a single scope picture)..
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 12, 2019, 05:15:08 pm
Here are the results.
I inverted the CH1 because I used the GND of the PSU Shorter as GND for these measurements which was connected to the power supply GND.
CH1: R_Shunt (the left side of R_Shunt, during on the right side was the GND clip).
CH2: Mosfet Gate
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 12, 2019, 05:51:36 pm
The disturbance occurs when the MOSFET turns off, The extra 700µs of current flow would be the charging of the output  capacitor back to regulation voltage. This can be confirmed by looking at the output with CH2.
You can leave the Shorter configured as is.
You next can check to see how the current settles with milder overloads applied. Set the time base to see what the current does a few hundred µs
after the overload starts.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 12, 2019, 06:05:32 pm
Can you please explain what is the meaning of "milder overloads" and the "current settles" ?

I guess milder overloads mean overloads less than 3A, for examle 1.5A. So I need to set the maximum output voltage to 1A, then I need to apply a 1.5A load and see how the current settles ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 12, 2019, 06:28:19 pm
Can you please explain what is the meaning of "milder overloads" and the "current settles" ?

I guess milder overloads mean overloads less than 3A, for examle 1.5A. So I need to set the maximum output voltage to 1A, then I need to apply a 1.5A load and see how the current settles ?
Yes, like that with the initial current about double the set current or what ever you decide to test at. The amount of overload can be varied just by changing the voltage and current settings.
No need to show all of the results, just a few.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 12, 2019, 06:52:29 pm
With the oscilloscope probe on the R_Shunt:
1. Vout=20V, Ilim=1A, Rl=0R
131,132.jpg
2. Vout=10V, Ilim=2A, Rl=0R
133
3. Vout=15V, Ilim=1A, Rl=1R
136,137
4. Vout=5V, Ilim=2A, Rl=1R
138,139
5. Vout=26.6V, Ilim=1A, Rl=10R
140,141.jpg
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 12, 2019, 07:20:37 pm
That all looks well behaved. The settling time has a time constant of about 10µs. I don't really know what is optimum.
So far I have not encountered a load that has made a power supply's CC loop become unstable.
My power supply is currently set to 60µs
You could increase R9 to 22K.
we only need to see 500µs of activity after the start of the overload.
I notice that your default trigger position is always in the center of the screen wasting a lot of screen width. My HP DSO has settings that all the default trigger position to be set to the LH side of the screen.

Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 12, 2019, 08:08:35 pm
New results, using R9=22k. The probe was connected on the R_Shunt resistor.
1. Vout=26.6V, Iout=1A, Rl=10R: 143
2. Vout=15V, Iout=1A, Rl=10R: 144
3. Vout=3.6V, Iout=1A, Rl=1R: 145,146
4. Vout=26.6V, Iout=3A, Rl=1R: 147-149

I tried to show on the screenshots the entire activity were I think that it is necessary.

Regarding the trigger level, I don't know for sure were is the optimal level.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 12, 2019, 09:18:03 pm
That all looks really good. The brief time that the current is allowed overshoot before smoothly settling to the set current is actually a preferred response.
Don't expect it to not destroy LEDs. This should not be a requirement of a good bench supply and I don't expect it.
DS0146.jpg is a good example of where the overshoot has just caused the speed up diode to act.
The only other test I can think of is to  again check the voltage recovery after an overload.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 13, 2019, 06:46:12 am
Please find attached the results with Vout=26.6V, Ilim=2A, Rload=10R, the probe connected on the output of the power supply.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 13, 2019, 06:53:45 am
The load transient response  is still good.
I would like to see that the voltage recovery after a short circuit overload is still good also.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 13, 2019, 07:06:19 am
Voltage recovery after a short circuit:
Vout=26.6V
Iout=3A
Rload=0R
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 13, 2019, 07:14:01 am
It doesn't get any better than that.
There is likely to be some overshoot when unloading from a normal load. This is difficult to avoid. A permanent load resistor usually helps.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 13, 2019, 07:18:13 am
I already installed a 1k/5W resistor on the output. This was installed from the last built configuration of the power supply...

Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 13, 2019, 07:38:02 am
I already installed a 1k/5W resistor on the output. This was installed from the last built configuration of the power supply...
If the resistor is wired across the output terminals, its current will be sensed by the shunt resistor, not a serious problem.
This can be avoided by connecting the bottom end of the resistor to the LH side of the shunt.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 13, 2019, 07:39:47 am
Yes, the resistor was connected across the output terminals of the power supply.

Are there any other tests that I should do ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 13, 2019, 07:51:05 am
Yes, the resistor was connected across the output terminals of the power supply.

Are there any other tests that I should do ?
I can't think of much at the moment, the important stuff all seems fine.
If you are planing to add a digital volt/amp panel meter, it might cause some complications.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 13, 2019, 07:54:04 am
I will install only a analog voltmeter on the front panel of the power supply case.

Should I test again for oscillations, using different loads at different output voltages ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 13, 2019, 08:01:33 am
Also, this is the PCB - approximative -  that I used in the tests. Some of the components were replaced by another value and some were strapped with a wire.

Also the FR107 diode was installed over the 22K resistor.
The 3 non plated holes are for ventilation of the 7812 heat sink and for ventilation of the power resistor.

Also, R16 was removed.

The components with reference designator formed by one letter (R,C) and 1 or 2 digits (1, 10) are corresponding with the components from the LTSPice schematic.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on October 13, 2019, 08:16:04 am
What about 4x 3.2mm dia mounting holes? :)
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 13, 2019, 08:17:41 am
What about 4x 3.2mm dia mounting holes? :)
I don't know were to put them ... I can't make the PCB larger because it will not fit into the case...

The previous PCB was installed using hot glue.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 13, 2019, 08:34:43 am
It is good to test with many different operating conditions.
The space left by R16 can be used for the 1K PNP B-E resistor.
Mounting holes will work anywhere on the PCB where there is room, 3 is enough.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 13, 2019, 09:00:37 am
I have added 4 mounting holes.

The PNP driver resistor (1k) is on the PCB for the transistor which is mounted on the heat sink.

I will test the power supply in different conditions and I will come back with the results.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 13, 2019, 09:20:02 am
The high current tracks could be doubled up with top layer tracks.
Check that UVLO is still working properly.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 13, 2019, 09:23:15 am
Regarding the high current traces, I can reinforce them with solder, if I will make the PCB at home.
How can I correctly check the UVLO ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 13, 2019, 09:43:28 am
Regarding the high current traces, I can reinforce them with solder, if I will make the PCB at home.
How can I check correctly the UVLO ?
Check that there is no rise in output voltage when the mains is switched off.
Be aware that there will be random spikes when the switch contacts arc.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 13, 2019, 09:58:15 am
I checked with the oscilloscope set to AC coupling, the trigger also on the AC coupling. I used single shot trigger.

Testing method: I unplugged the transformer from the AC line.
The results are attached.

Probably there is a special method to find if the voltage is rising when I unplug the transformer, but I don't know that method.

LE: On the multimeter, the output voltage does not rise, but it slowly goes from 26.6V to 0V in about 3 seconds.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 13, 2019, 10:06:03 am
That's the spiking caused by the arcing of the mains switch contacts.
You need to set your DSO to check that there is no rise in output voltage.
Slow auto sweep or chart mode and DC coupled.

" On the multimeter, the output voltage does not rise, but it slowly goes from 26.6V to 0V in about 3 seconds."
That's a good indication of no problem.

Edit: I should have said "Roll mode" instead of "chart"
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 13, 2019, 10:19:04 am
I set the coupling to DC, the trigger to DC coupling and single trigger and I got the following results.
I searched in the oscilloscope manual but I didn't found the terms "auto sweep" or "chart mode".
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 13, 2019, 10:52:16 am
The illustration on page 27 https://www.gwinstek.com/en-global/products/downloadSeriesDownNew/2694/118 (https://www.gwinstek.com/en-global/products/downloadSeriesDownNew/2694/118) shows the DSO set to AUTO mode.
Most of the common oscilloscope terms are not searchable.
You need to figure out how to set it to AUTO mode so that it will sweep continuously without needing triggering.
Set the sweep to about 500ms/div.

I would never consider buying a DSO that has the horizontal default trigger position stuck center screen. Sadly, almost all affordable DSO's have  this flaw.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 13, 2019, 11:00:09 am
I set it to 500ms, then I unplugged the transformer from the AC line and when I saw that the voltage starts to go down, I stopped it and I made a screenshot.
Power supply configuration was: Vout=26.6V, Iout=3A
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 13, 2019, 11:05:23 am
Just confirm a few times that it goes to zero with no abnormal pulses. Try with low voltage settings also.
I would expect the voltage to fall quickly at some point.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 13, 2019, 11:12:43 am
1. Vout=26.6V - at some moment it goes directly to zero volts.
166
2. Vout=15V - 168 is before 167 (chronologically) - a spike is present
167-168
3. Vout=2.1V - those are chronologically - also a spike is present
169-171
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 13, 2019, 11:16:33 am
That's very well behaved.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 13, 2019, 11:26:13 am
Are there any other things that needs testing ?
For example, it is necessary the tuning of the CC and CV loop capacitors ? Or they can remain at the 2n2 and 470p values and just make some tests at different output voltages and currents ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 13, 2019, 07:11:46 pm
I have also found a new difference between the schematic on this topic and the built schematic. The R32 (100R) resistor is not installed in the built schematic.
Does it makes such a big difference ?
Will the schematic work correctly if this resistor is not installed ?

I attached the latest built schematic.
Differences from the schematic to the real circuit:
D1, D7 = P600, 6A6
D3 = FR107

Sorry for creating any inconveniences. I know that is really strange that there are such "problems" in my circuit.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 13, 2019, 08:23:39 pm
I have also found a new difference between the schematic on this topic and the built schematic. The R32 (100R) resistor is not installed in the built schematic.
Does it makes such a big difference ?
Will the schematic work correctly if this resistor is not installed ?

I attached the latest built schematic.
Differences from the schematic to the real circuit:
D1, D7 = P600, 6A6
D3 = FR107
Sorry for creating any inconveniences. I know that is really strange that there are such "problems" in my circuit.
The diodes are fine, a 3A diode would have been enough for D7.
R32 should be fitted. It helps the power transistors turn of more quickly. I think that the transistors take longer to turn off when they are hot.
Someone else might know more about this.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 13, 2019, 08:27:57 pm
Should I install R32 (100R) and start testing again ? If yes, then which tests need to be made again ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 13, 2019, 08:58:38 pm
Should I install R32 (100R) and start testing again ? If yes, then which tests need to be made again ?
Definitely fit R32, having B-E bleed resistors is good design practice.
You should test the voltage overshoot while unloading from a 3A normal load, before and after R32 is fitted.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 13, 2019, 09:02:14 pm
3A is the maximum output current, I do not have a resistor or a group of resistors which draw exactly 3A, can I use a load of 2.66A ?
Or should I test with a short circuit on the output ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 13, 2019, 09:04:49 pm
3A is the maximum output current, I do not have a resistor or a group of resistors which draw exactly 3A, can I use a load of 2.66A ?
Or should I test with a short circuit on the output ?
2.66A is fine. Don't allow it to go into current limiting.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 14, 2019, 04:07:43 am
Voltage recovery after an 2.66A at 26.6V output voltage:
172-174.jpg

Recovery after a short circuit:
175-176

On the R_Shunt during short circuit on output:
178-180.jpg

I made a few more tests, for my curiosity.
All the tests were made using the R32 = 100R.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 14, 2019, 04:22:01 am
Im mainly curious to know what the voltage overshoot is when unloading from a normal load.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 14, 2019, 05:43:44 am
The voltage overshoot is not represented in 172-174 ?
I think I am missing something... how to check the voltage overshoot ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 14, 2019, 07:24:14 am
The voltage overshoot is not represented in 172-174 ?
I think I am missing something... how to check the voltage overshoot ?
Trigger your DSO at the high to low transition of the MOSFET's gate. This will be the time that the power supply unloads.
We are looking for how much the output voltage increases by.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 14, 2019, 11:58:35 am
With yellow color is the output of the power supply and with blue color is the gate of the mosfet.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 14, 2019, 12:05:54 pm
Do the test without allowing the power supply to current limit.
Choose a resistor and voltage setting that draws a bit under 3A.
Set the current limit to maximum so that it doesn't go into current limit mode.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 14, 2019, 12:11:56 pm
Vout=26.6V
Rload=10R
Ilimit=3A

With yellow = output of the power supply
With blue = gate of the mosfet

With R32 (100R) connected: 196,295
Without R32 (100R): 198, 199.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 14, 2019, 12:40:50 pm
The 1V overshoot is one thing, maybe normal. I am puzzled by the way the voltage settles so quickly. What's causing the output capacitors to discharge so quickly.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 14, 2019, 12:51:29 pm
Probably the 1k/5W resistor which is connected in parallel with the output ?

Are you saying that the transient response should be longer ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 14, 2019, 01:34:53 pm
I had the reason worked out a while ago then forgot it. I did the same test on my bench supply.
After the MOSFET turns off, the only place the output current can go is through the output capacitance causing a voltage rise.
The CV loop takes a few µs to reduce the drive to the output transistors. The 5µs overshoot is actually the temporary voltage drop across the capacitors' ESR. The actual capacitance gets charged by only 100mV or so.
You might see some other activity further along caused by the 100mV overshoot being corrected.
Your power supply is working properly.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 14, 2019, 01:57:59 pm
Do I need to test any other things ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 14, 2019, 02:02:49 pm
Do I need to test any other things ?
One minor thing, check that the current can be adjusted to zero, Then I suggest that you  put it into service with the recent changes.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 14, 2019, 02:14:35 pm
Yes, the current can be adjusted to zero. For example, with the 1k resistor on the output, I read 0.0mA on my multimeter, and the led lit when I rotate the current pot down to zero.

LE: and I also read 0.0mA without the 1k resistor.

LE2: ... the fine tuning of the CC and CV loop capacitors is necessary or the capacitors does not allow any tuning ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 14, 2019, 10:12:52 pm
Yes, the current can be adjusted to zero. For example, with the 1k resistor on the output, I read 0.0mA on my multimeter, and the led lit when I rotate the current pot down to zero.

LE: and I also read 0.0mA without the 1k resistor.

LE2: ... the fine tuning of the CC and CV loop capacitors is necessary or the capacitors does not allow any tuning ?
It's not necessary for it to go any faster. If you want to experiment on your own, start with increasing the gm of the output path by reducing R25.
The fast limiting is likely to be affected.
You should just leave it as is.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 15, 2019, 06:33:16 am
One more question that I have probably previos asked but I am still blurred: if I use the power supply as it is in this moment, can it start oscillate ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 15, 2019, 07:02:45 am
One more question that I have probably previos asked but I am still blurred: if I use the power supply as it is in this moment, can it start oscillate ?
It shouldn't, not the CV loop anyway. To be more certain, do the load transient tests while adding very low ESR capacitors across the output, near to the PCB as possible.You can use either large MLCCs or POSCAPs, https://en.wikipedia.org/wiki/Polymer_capacitor
Be aware of the voltage ratings.
If it rings for one or two cycles, it's ok.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 15, 2019, 08:17:43 am
I tried to search for the mentioned capacitors but I did not found them at the local shop. Also I don't have them in my stock at home. An order on the internet only for a few components does not worth it.
Is there any other testing method ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 15, 2019, 08:54:24 am
I tried to search for the mentioned capacitors but I did not found them at the local shop. Also I don't have them in my stock at home. An order on the internet only for a few components does not worth it.
Is there any other testing method ?
No, Just don't bother with the test. I have done the tests on my bench supply which is very similar to yours.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 16, 2019, 09:40:56 am
 After all the tests, can I put the power suppy into service ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 16, 2019, 10:26:22 am
After all the tests, can I put the power suppy into service ?
Yes, it will fine so long as no serious mistakes are made. Also, dont make the wires to the heat sink any longer than they have been, shorter is usually better. No one can easily say how long is too long.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 16, 2019, 12:51:40 pm
Will the power supply work correctly if I will use TIP35C instead of TIP3055 ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 16, 2019, 02:54:50 pm
Will the power supply work correctly if I will use TIP35C instead of TIP3055 ?
That should be fine,
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 16, 2019, 04:55:16 pm
It is a good idea to use a multi turn potentiometer (U7) for fine current adjustment instead of the standard potentiometer that I have been used ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 16, 2019, 09:38:06 pm
It is a good idea to use a multi turn potentiometer (U7) for fine current adjustment instead of the standard potentiometer that I have been used ?
I used 10 turn Pots for voltage and current control with my bench supply to give fine control.
Genuine branded Pots are too expensive and I have experienced some trouble with the cheap knock off Pots which ebay is flooded with.
I mentioned the problems in the other thread, https://www.eevblog.com/forum/projects/linear-lab-power-supply/msg2368746/#msg2368746 (https://www.eevblog.com/forum/projects/linear-lab-power-supply/msg2368746/#msg2368746)
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 17, 2019, 03:05:36 am
I will use some multi turn pots from SR Passives, which I hope are not really that bad ..
I verified one of the pots and I found that it is working good. When I start rotating it, the current is 0mA then - as rotating - the current goes to 2mA.

In one of the previous posts you said that I can remove the 1M resistor (R10) that is connected from the CC pot's wiper to GND. It will be Ok if I will install it back into the circuit ? I read that this resistor was suggested in the topic were you built your power supply.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 17, 2019, 10:44:26 am
I verified with a 5K multi turn pot (10 turns) for U7, and I found that works better than using a single turn potentiometer.

I would like to ask if it is better to add the 1M resistor from pot's wiper to GND ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 17, 2019, 11:02:26 am
I verified with a 5K multi turn pot (10 turns) for U7, and I found that works better than using a single turn potentiometer.

I would like to ask if it is better to add the 1M resistor from pot's wiper to GND ?
There is no need for the bleed resistors if it can be seen from the schematic that the wiper voltage will go down if the wiper looses contact with the Pot's resistive element.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 17, 2019, 06:45:05 pm
One more question: I made again the tests for checking if 7812CV oscillates, and I found that if I connect the probe between the input of 7812 and GND of 7812, I got a strange wave form. I also added a green led in series with a 1k resiston on the output of the 7812CV Please have a look at the attached screenshots (Vout = 26.6V, Ilim=3A):
No load: 255-257.jpg
2.88A load: 268, 269.jpg
Also I am getting with 2.88A load on the input of 7812CV the following screenshots: 270-272.jpg

Is the wave form from the attached screenshots normal ? If no, what should I do ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on October 17, 2019, 07:09:16 pm
It is 100Hz 200mVpp with load, coming from the bridge rectifier. It is normal, imho.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 17, 2019, 07:17:35 pm
Ok, but in the first screenshots (255-257 and 268-269) I have got a waveform that is randomly moving on the screen sometimes it looks like 255.jpg, sometimes like 256.jpg, sometimes like 257.jpg and sometimes it has another form, etc etc. I would like to ask if that waveform is normal ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 17, 2019, 10:04:44 pm
There might be fluctuations of the mains voltage. It would be a very small amount and difficult to detect while looking at the whole waveform.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 18, 2019, 04:14:47 am
I made some more measurement on the input of the power supply (on the filter capacitors) and I found that the fluctuations are also present there.
Vout=26.6V, Ilim=3A, Iload=2.88A.
1. No load, with the GND clip connected to the GND of 7812: 285,287.jpg
2. With load, with the GND clip connected to the GND of 7812: 292,293.jpg
3. No load, with the GND clip connected to the GND of filter capacitors: 294,296.jpg
4. With load, with the GND clip connected to the GND of filter capacitors: 298, 299.jpg

Please have a look at the screenshots and tell me what you think.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 18, 2019, 08:44:10 am
It's small mains fluctuations, likely normal.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 18, 2019, 10:51:28 am
I think I worked like a nothing in this project. I found that I have about 38Vdc on the input of the 7812 in my project  :palm:
I didn't knew why, then I checked the 12V zener diode, and I found that it does not have a voltage drop of 12V. It have about 1-2V voltage drop. This diode is installed correctly... but the input voltage for 7812 was a little bit higher that recommended drop voltage in the datasheet...
But, the output voltage of the 7812 is 11.88V. So the output voltage is ok ...

Are all my tests and measurements pointless ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 18, 2019, 11:04:35 am
Are all my tests and measurements pointless ?
The 7812 didn't fail, so there is no need to suspect that a problem has been caused.
The zener has been damaged by a current surge.
Try a resistor instead of the zener.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on October 18, 2019, 11:18:48 am
Afaik there is a resistor in series with the zener in my schematics above..
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 18, 2019, 11:38:40 am
I tried with a 470R resistor instead of the 5R resistor in series with the 12V zener, and I got the following results:
On the input of the 7812, with no load 29.8V, on the output of 7812: 11.89V
On the input of the 7812, with 2.88A load at Vout=26.6V: 25.5V, on the output of the 7812: 11.89V.

@imo: that resistor was installed in the circuit when I found the problem. Also, it was installed during the tests.

Also, I tried with 820R resistor but I was not satisfied by the voltage on the 220uF capacitor, because was too low (about 20V without load).

The voltage measured on the 470R resistor is about 11-12V, during short circuit on the output (max current).

Are there any other things that needs testing ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 18, 2019, 11:51:41 am
Is the faulty zener still in circuit?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 18, 2019, 11:55:28 am
No, the faulty zener was removed from the circuit.

Also, I removed the 5R resistor (the one which was in series with the zener), and I used a 470 R resistor.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 18, 2019, 12:05:58 pm
Im having trouble accounting for 24mA of current draw.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 18, 2019, 12:09:48 pm
I know that about 10mA are drawn by the green led that I installed at the output of the 7812...
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 18, 2019, 12:12:23 pm
I know that about 10mA are drawn by the green led that I installed at the output of the 7812...
That would just about explain it. All should be well.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 18, 2019, 12:37:44 pm
Ok, then I will use the 470R resistor.

Will the power supply work correctly with the 470R resistor modification ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 18, 2019, 09:20:01 pm
Ok, then I will use the 470R resistor.

Will the power supply work correctly with the 470R resistor modification ?
I don't know what problems the mod will cause, likely none. There would now be less ripple at the 7812's input.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 19, 2019, 10:26:30 am
I made again some of the tests, and I found that in the E of Q1, the waveform looks different in comparison with what we had initially.
Please have a look at the screenshots and tell me what you think.

The rest of the screenshots seems like they look like the previous screenshots.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 19, 2019, 10:34:17 am
That's expected for when the power supply unloads. The large dip is due to the CV loop recovering from a small overshoot.
It is a very well behaved response.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 19, 2019, 12:02:44 pm
I would like to see some voltage measurements with a light load, about 100mA.
The zener voltage.
The voltage across R25.
With the 1K across B-E of the PNP driver, R25 should have 1.35V across it.
I measured again with the latest modifications and I have got:
V (D9) = 5.56V and V (R25) = 1.59V.
Regarding the R25 voltage, it is still normal 1.59V instead of 1.35V ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 19, 2019, 12:33:24 pm
I would like to see some voltage measurements with a light load, about 100mA.
The zener voltage.
The voltage across R25.
With the 1K across B-E of the PNP driver, R25 should have 1.35V across it.
I measured again with the latest modifications and I have got:
V (D9) = 5.56V and V (R25) = 1.59V.
Regarding the R25 voltage, it is still normal 1.59V instead of 1.35V ?
The voltage across R25 does not need to be any particular value. It will vary with output load and the temperature of the PNP driver.
With only the residual output load, the drive current through Q1 is mainly the B-E drop of the PNP driver across the 1K resistor plus a small amount of Base current, about 50µA.
Start by measuring the B-E voltage of the PNP driver.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 19, 2019, 12:46:21 pm
I forgot to specify that the mentioned R25 voltage was measured with 100 mA load at 15V output voltage.

LE: BE voltage of pnp driver is 0.56V. So I got 0.56V / 1000R = 0.00056A
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 19, 2019, 12:56:29 pm
I forgot to specify that the mentioned R25 voltage was measured with 100 mA load at 15V output voltage.
That's OK. The 1.35V was a result of my guess that the PNP driver's B-E was 0.5V.
Im certain that there will be no more problems to be found with the design.
You can easily use your basic electronics knowledge to work out why some things are the way they are.
 
Added: The output voltage has no affect on the operating conditions of Q1, only output current does.
With one exception, when regulation is lost due to dropout.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: Cliff Matthews on October 23, 2019, 09:26:52 pm
OP: Are you sharing any final schematic or gerber files?  Did you resolve the final value of R32 or R25?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 24, 2019, 11:07:39 am
Please find attached the schematics in Eagle and in LTSPice.
Please ask if you need Eagle files.
I marked a few components with dnp - do not place and with strap - the component will be replaced by a wire.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 02, 2020, 07:50:10 am
Hello,
Please find attached the Eagle schematic and layout.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: Cliff Matthews on June 02, 2020, 12:59:48 pm
I'm still not sure of the final values of R32 and R25  :-//
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 02, 2020, 01:31:29 pm
My most recent idea for the Emitter circuit  for Q1 is just a 1K in series with a white or possibly blue LED. The Vcc is dropped to 8V.
The  B-E resistor for the PNP driver will also be 1K.
I haven't actually tested yet. Ill likely be making a new regulator PCB for my bench supply.
https://www.eevblog.com/forum/projects/linear-lab-power-supply/msg2388873/#msg2388873 (https://www.eevblog.com/forum/projects/linear-lab-power-supply/msg2388873/#msg2388873)
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 04, 2020, 10:30:06 am
I'm still not sure of the final values of R32 and R25  :-//
R25 is 2k7, but I can't find R32 on my Eagle schematic...
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 05, 2020, 04:10:22 am
R32 is mentioned in  Reply #670. Looks like it's the B-E resistor for the 2N3055's, 100Ω.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 06, 2020, 12:54:08 am
This is my latest version which uses a white LED to create a positive offset in the emitter circuit of Q1.
My original design used a simple voltage divider from the 8V rail but this causes an output voltage blip during power down only when a TLC 072 is used rather than an LM358. It's to do with the different  minimum operating voltage of the two parts.
 The attached schematic is of it reduced to its simplest working form.
It's essentially the same as what  mike_mike built up, with  unnecessary components mostly removed.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on November 27, 2020, 08:02:21 pm
Hello @xavier60, can you please post the pcb layout of the power supply schematic from Reply #733 ?
Thank you in advance !
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on December 01, 2020, 09:23:54 am
The group of pin headers at the bottom left are for the CV and CC Pots plus other options.
The vertically orientated pair, top left of the group are for optionally switching the 5V reference to the Pots to disable the PSU's output. I haven't test it, but I expect a smoother turn on compared to using the Shutdown option.
 The horizontally orientated pair at the center of the group are for sending the Pots' wiper voltages to a control PCB that I use in my bench supply project.

Updated schematic is in Reply #741
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on December 07, 2020, 08:02:31 pm
I would like to ask what is the little bump (marked with an arrow) that appears on the screenshot ?
The screenshot was took from the LM324 power supply, with the probe on the R_shunt (0.22R). The PSU shorter was using a short circuit instead of a load. The frequency of the PSU Shorter was about 18 Hz.
The scope is a SDS 1022 (I know it could be a better one ...) from Owon.

Schematic of the power supply:
Please find attached the schematics in Eagle and in LTSPice.
Please ask if you need Eagle files.
I marked a few components with dnp - do not place and with strap - the component will be replaced by a wire.

LE: I am asking this because I wanted to test an LM723 power supply, and I found oscillations on the R_shunt of the LM723. So I checked on the LM324 Power supply to check if it is still good after one year and a half of service.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on December 07, 2020, 08:25:03 pm
I would like to ask what is the little bump (marked with an arrow) that appears on the screenshot ?
The screenshot was took from the LM324 power supply, with the probe on the R_shunt (0.22R). The PSU shorter was using a short circuit instead of a load. The frequency of the PSU Shorter was about 18 Hz.
The scope is a SDS 1022 (I know it could be a better one ...) from Owon.

Schematic of the power supply:
Please find attached the schematics in Eagle and in LTSPice.
Please ask if you need Eagle files.
I marked a few components with dnp - do not place and with strap - the component will be replaced by a wire.

LE: I am asking this because I wanted to test an LM723 power supply, and I found oscillations on the R_shunt of the LM723. So I checked on the LM324 Power supply to check if it is still good after one year and a half of service.
I think it's caused by the CV recovering  from a slight voltage overshoot after the short is removed.
You can confirm by looking at the output of the CV opamp at the same time.
You must use the PSU's negative output terminal as ground reference for all measurements.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on December 07, 2020, 08:49:02 pm
Another test: yellow trace is the voltage on the R_shunt (inverted - because I used the negative output of the psu as gnd) and blue trace is the CV op-amp output (pin 1 of LM324).
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on December 07, 2020, 08:54:13 pm
Yes, that confirms it. It is normal operation. You can also look at the PSU's output to see what the overshoot is.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 05, 2021, 08:44:56 am
@xavier60 , can you please clarify what part number are the diodes D1, D2 and D4 ? 1N4148 should be fine ? (schematic from post #735).
Also, the Shutdown will connect to 0V in order to shut down the PSU ?
Can you also show a image with the layout which have the reference designators on the components ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 05, 2021, 10:13:55 am
@xavier60 , can you please clarify what part number are the diodes D1, D2 and D4 ? 1N4148 should be fine ? (schematic from post #735).
Also, the Shutdown will connect to 0V in order to shut down the PSU ?
Can you also show a image with the layout which have the reference designators on the components ?
D1, D2 and D4 are 1N4148 or similar.
Pulling Shutdown to 0V will shut down the power supply.
As I get time Ill add component references to the layout.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 05, 2021, 04:47:34 pm
Just finished the practical circuit, and it seems to work. Sadly, I don't have TLC072, I have only LM358. I did not found TLC072 at my electronics dealer. I built de circuit using LM358. The problem that I found is that the green led (D6) is very dim, It is very hard to see if it is lighting on not. The red led is OK.
The white led is OK, but when I set the voltage to a low value (very close to 0V or even 0V) then it's glow is reduced by a little.
I used standard 5mm led's. Should I use some high brightness led's ?

I would like to ask, the circuit will work normally if using LM358 ? Does it require any modifications ?

The maximum current goes up to 4.5A, should not have been maximum 3A ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 05, 2021, 07:23:08 pm
Just finished the practical circuit, and it seems to work. Sadly, I don't have TLC072, I have only LM358. I did not found TLC072 at my electronics dealer. I built de circuit using LM358. The problem that I found is that the green led (D6) is very dim, It is very hard to see if it is lighting on not. The red led is OK.
The white led is OK, but when I set the voltage to a low value (very close to 0V or even 0V) then it's glow is reduced by a little.
I used standard 5mm led's. Should I use some high brightness led's ?

I would like to ask, the circuit will work normally if using LM358 ? Does it require any modifications ?

The maximum current goes up to 4.5A, should not have been maximum 3A ?
It should work well with an Lm358 like your previous project. The white LED seems to be working normally.
With the PSU output set above 0V what is the CV opamp output voltage? And what voltage is across R31? so we can calculate the CV LED current.
The maximum current range can be reduced by increasing R8.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 05, 2021, 07:28:09 pm
With the PSU output set at 12V, the CV opamp output is 3.36V. Voltage across R31 is 2.80V.

Edit: when disconnecting from the mains the PSU, after a few seconds, the white led goes brighter than when the PSU is connected to the mains.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 05, 2021, 07:37:50 pm
With the PSU output set at 12V, the CV opamp output is 3.36V. Voltage across R31 is 2.80V.

Edit: when disconnecting from the mains the PSU, after a few seconds, the white led goes brighter than when the PSU is connected to the mains.
That's 0.28mA if R31 is 10K. A normal high brightness LED should be bright enough. Ill check mine later. I use cheap 3mm Chinese LEDs bought on ebay. They do fail open circuit sometimes,

It's normal for the white LED to brighten when the regulation drops out because the CV opamp gives Q1 full drive,
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 05, 2021, 07:44:37 pm
I tried with a 3mm led, but it doesn't light as brighter as yours.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 05, 2021, 10:45:40 pm
Mine has 2V across R31 giving a suitable LED brightness. You could try decreasing R31 to increase the LED current. Try 3.3K.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 06, 2021, 06:30:24 am
I decreased R31 to 3.3k, and tried different types of 5mm green led's. Now the voltage across R31 is 2.85V.
Then I found a low current green led which is sufficiently bright even if I use the 10k resistor (R31). The voltage across R31 is now 2.35V, and across the green led 2.22V.
Also, I increased R8 to 330k, and now, the maximum current is about 2.6A.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 06, 2021, 06:32:42 am
Have you done a pulse load test to check the response and stability?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 06, 2021, 06:34:48 am
Not yet. I will try to do some tests.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 06, 2021, 07:06:55 am
I tried some tests with PSU Shorter. The load resistor was 0R, so I tested the PSU to short circuit response until now. Blue trace = pin 3 of LM555, yellow trace = output of PSU.
1. Vout=1.75V
a. Iout=2.6A 97_001, 97_002
b. Iout=1.3A 97_006, 97_007
c. Iout= almost minimum 97_008, 97_009, 97_010

2. Vout=15.14V
a. Iout=2.6A 97_013
b. Iout=1.3A 97_014
c. Iout= almost minimum 97_015

3. Vout=30V
a. Iout=2.6A 97_022, 97_023, 97_024
b. Iout=1.3A 97_019, 97_020, 97_21
c. Iout= almost minimum 97_016, 97_017, 97_018

Please have a look and tell me if the results are good ?

The next step should be testing with different loads, what resistor values should I use ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 06, 2021, 07:30:33 am
Test at 1 amp without going into CC mode.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 06, 2021, 09:36:21 am
It's oscillating at 1A load, current pot set to max output current, without going into CC mode.
1. 10V output, 10R load: 98_000, 98_001
2. 20V output 20R load: 98_002, 98_003

This mean that I should modify the value of C3 and C4 ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 06, 2021, 09:43:14 am
I need to see how it's laid out. Try decreasing R5 and increasing C3.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 06, 2021, 09:48:36 am
This is the layout that I made for this psu. I wanted to connect the 2 pots on the PCB by using 2 terminal blocks.
The PNP power transistor (Q2), 2x TIP35C, 1n5404, emitter resistors (R14,R15), the 100R resistor (R13) and R11 are on the heatsink.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 06, 2021, 10:03:28 am
I increased C3 to 220pF and I decreased R5 to 8k2.
1. Vout = 20V, Rload=20R: 99_000, 99_001
2. Vout=20V, Rload=10R: 99_002, 99_003
3. Vout=10V, Rload=10R: 99_004
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 06, 2021, 10:35:51 am
I would not have expected that small a change of R5 to make such an improvement. Are you certain that C3 was really a 150pF?
The ringing in bmp_99_001 could possibly be happening externally to the PSU. The probe should be connected at the PCB.
If the ringing is external, the amplitude will be greater as the probe is moved closer to the shorter.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 06, 2021, 10:40:42 am
Anyway, I see that the response is 5uS, unnecessarily fast.
Make R5 4.7K and C3 470pF.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 06, 2021, 10:44:59 am
Yes, C3 was really 150pF.
Right on the output of the PSU: 100_000, 100_001
On the PSU Shorter: 100_002
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 06, 2021, 10:51:04 am
That proves that the ringing is external. Try those other values.
For example, my Agilent PSU has a 30uS response.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 06, 2021, 10:55:07 am
I tried with R5=4.7k and C3=470pF
Vout=20V, Rload = 20R
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 06, 2021, 11:08:49 am
Odd that it didnt change much and the ringing is large again?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 06, 2021, 11:11:03 am
Show us mainly the voltage dip when load is turned on.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 06, 2021, 11:13:14 am
I tested again, it was my mistake, because I connected the ground clip to the wrong point.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 06, 2021, 11:18:30 am
Show us mainly the voltage dip when load is turned on.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 06, 2021, 11:26:31 am
The 5uS/Div shot shows all that's important. It all looks fine, could be a bit slower.
Lastly, I would like to see how much the voltage steps at the Base of Q1 during the 1 amp step load.
It will tell me how much gain your output stage has.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 06, 2021, 11:32:44 am
Lastly, I would like to see how much the voltage steps at the Base of Q1 during the 1 amp step load.
It will tell me how much gain your output stage has.
Please find attached...
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 06, 2021, 11:43:03 am
The gm is 8, close to typical and doesn't explain why this build needed different compensation.
Need to see a few more built.

Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 06, 2021, 11:50:16 am
Does the circuit need more testing ?
I would like to know this because I want to build a case for the PSU...
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 06, 2021, 11:54:17 am
Does the circuit need more testing ?
I would like to know this because I want to build a case for the PSU...
You could do some more test at different load currents to be sure.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 06, 2021, 12:15:46 pm
Can you please recommend some load resistors for the PSU shorter and the values for the output current and voltage in order to test the PSU at key points ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 06, 2021, 12:20:23 pm
Can you please recommend some load resistors for the PSU shorter and the values for the output current and voltage in order to test the PSU at key points ?
5 and 10 ohms. You can adjust the voltage to get various currents.
Start at 100mA with your 20 ohm.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 06, 2021, 12:49:49 pm
I tested with 5R, 10R and 20R as load, the current pot was set to maximum.
A few of the results:
Vout = 30V
Rload = 10R: 102_025 to 102_028
Vout = 12V
Rload = 20R: 102_12 to 102_014
Vout = 2V
Rload=5R: 102_007 to 102_011

Please have a look and tell me what you think.

Edit: I also measured the minimum output current, which is a few milliamps. When I rotate the current pot to minimum, the red led does not light up, until I connect a overload to the output of the PSU, for example a red led.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 06, 2021, 07:26:35 pm
The overshoot looks normal. Ill compare it to mine later.
The minimum current not going to zero could be due to opamp offset. If the opamp is socketed, try a few others.
If I had of anticipated this, the problem could have been covered up by a high value resistor from 5V to the inverting input to give it a definite negative offset.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 07, 2021, 03:09:54 am
I tried a LM358N from STMicroelectronics and I found that now the current goes down to zero. Previously, I used LM358P from Texas Instruments.

Which test should I make now ? Should I reduce the output current to 1.3A and test again ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 07, 2021, 03:18:50 am
I tried a LM358N from STMicroelectronics and I found that now the current goes down to zero. Previously, I used LM358P from Texas Instruments.

Which test should I make now ? Should I reduce the output current to 1.3A and test again ?
You can do some load transient recover test to make sure it's still stable which it should be.
No need to show the traces unless something looks wrong.
Mine dips 200mV with a 1A load with about 8uS recovery.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 07, 2021, 04:06:41 am
I made some tests.
1. Vout=12V, Iout max =1.3A
Rload=20R 103_010, 103_011, 103_012

2. Vout=12V, Iout max = 1.3A
Rload=5R 103_016, 103_017

3. Vout=12V, Iout max=0.2A
Rload=10R 103_37, 103_38

4. Vout=2V, Iout max = 1.3A
Rload = 5R, 103_007 to 103_009

I tested at 1.3A and 0.2A, at 2V, 12V and 30V - a total of 18 tests.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 07, 2021, 04:47:05 am
Some show an under damped response make R5 3.3K and C3 1000pF which might be a little high.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 07, 2021, 10:58:54 am
Sorry for the late response...
Please find the screenshots at:
https://ibb.co/k9Z6mHS
https://ibb.co/PC52NjF
https://ibb.co/YtZfMJL
https://ibb.co/cF6CKGL
https://ibb.co/KLZSSgH
https://ibb.co/dmJKLJY
https://ibb.co/XSqjpk4
https://ibb.co/sQ1hFHk
https://ibb.co/DCT5m06
https://ibb.co/znNPkWx
https://ibb.co/BG50Pfg
https://ibb.co/vLWGmvj
https://ibb.co/0yL09K1
https://ibb.co/LhNLxcw
https://ibb.co/rxNj2yr
https://ibb.co/LCNGZLm
https://ibb.co/C5zNdNt
https://ibb.co/ZYHxMcX
https://ibb.co/tp0FQs0
https://ibb.co/ZJWPMBM
https://ibb.co/7JYpCLX
https://ibb.co/K91CLgY
https://ibb.co/6gTwGFL


R5 = 3.3K and C3 = 1nF
1. Vout=12V, Iout max =1.3A
Rload=20R 104_0,1,2

2. Vout=12V, Iout max = 1.3A - the red led was flashing
Rload=5R 104_3,4,5

3. Vout=12V, Iout max=0.2A - the red led was flashing
Rload=10R 104_6,7,8,9

4. Vout=2V, Iout max = 1.3A
Rload = 5R, 104_10,11,12,13

5. Vout=30V, Iout max = 1.3A
Rload = 20R, 104_19,20,21,22

6. Vout = 2V, Ioutmax = 1.3A
Rload = 20R 104_14,15,16,17
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 07, 2021, 11:35:04 am
The response is now what it should be, no sign of any damped oscillations.
Some of the tests show it going into CC mode. Was this intended?
How long are the wires to the sziklai output transistors.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 07, 2021, 11:37:05 am
The response is now what it should be, no sign of any damped oscillations.
Some of the tests show it going into CC mode. Was this intended?
How long are the wires to the sziklai output transistors.
Yes, it was intended going into CC mode.
The wires to the sziklai output transistors are about 15cm long.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 07, 2021, 11:47:09 am
The response is now what it should be, no sign of any damped oscillations.
Some of the tests show it going into CC mode. Was this intended?
How long are the wires to the sziklai output transistors.
Yes, it was intended going into CC mode.
The wires to the sziklai output transistors are about 15cm long.
There is some chance that the wire length and also R11 being at the wrong end that has caused to need for different CV compensation.
But no need to worry, it's fine the way it is.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 07, 2021, 11:58:34 am
Does the PSU require any more testing ?
For example, the CC compensation is OK ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 07, 2021, 12:00:05 pm
Does the PSU require any more testing ?
For example, the CC compensation is OK ?
No, all looks fine.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 07, 2021, 04:38:53 pm
That's good then. Thank you for your help.
One more question: does D8 (1N4004) act as a protection diode for the PSU, when powering inductive loads ? I am asking this because I am planning to power motors, for example the PCB drill, using this PSU...
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 07, 2021, 07:31:37 pm
I read a few messages from your topic, especially this one: https://www.eevblog.com/forum/projects/linear-lab-power-supply/msg2133628/#msg2133628 (https://www.eevblog.com/forum/projects/linear-lab-power-supply/msg2133628/#msg2133628)
I found that the PSU goes into CC mode if there is connected a reverse polarity on the output, but the PSU is also protected for reverse polarity generated by the inductive loads (such as motors) ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 07, 2021, 08:51:27 pm
I read a few messages from your topic, especially this one: https://www.eevblog.com/forum/projects/linear-lab-power-supply/msg2133628/#msg2133628 (https://www.eevblog.com/forum/projects/linear-lab-power-supply/msg2133628/#msg2133628)
I found that the PSU goes into CC mode if there is connected a reverse polarity on the output, but the PSU is also protected for reverse polarity generated by the inductive loads (such as motors) ?
It will tolerate briefly applied reverse polarity. D8 and the PTC R34 protect the preload circuit. If the PSU is to be used in series with another PSU, an 1N5408 or similar should be fitted between the output binding posts.
I did see the discussion but I still don't understand how a DC motor can cause damage.

Extra: I have used my PSU to test small automotive motors like seat motor. Nothing bad happened. I had the 1N4508 across the output at the time.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 08, 2021, 01:46:05 am
Extra: I have used my PSU to test small automotive motors like seat motor. Nothing bad happened. I had the 1N4508 across the output at the time.
1N4508 is a 22A diode, do you mean 1N5408 ?
If using an 1N5408 or P600J across the output, does the PSU require any further testing or modifications ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 08, 2021, 02:41:23 am
Extra: I have used my PSU to test small automotive motors like seat motor. Nothing bad happened. I had the 1N4508 across the output at the time.
1N4508 is a 22A diode, do you mean 1N5408 ?
If using an 1N5408 or P600J across the output, does the PSU require any further testing or modifications ?
Yes, I meant "1N5408".
The PSU would not even know that the diode is there if the polarity is correct. No testing needed.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 08, 2021, 04:04:43 am
I added the diode to my schematic (D11).
Please have a look and tell me if the connection of the diode is correct ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 08, 2021, 06:18:40 am
I added the diode to my schematic (D11).
Please have a look and tell me if the connection of the diode is correct ?
Yes, that's correct.
What is the part number of C2?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 08, 2021, 11:12:40 am
C2 is a electrolytic 47uF/63V capacitor made by Samxon, 105*C, KM(M), C9A.

Edit: part number is KM 47U/63V.

Edit 2:I found that I run out of TIP35C transistors, and I wanted to build the PSU into a case, using a different type of heatsink for the power transistors. What other type of power transistors can be used for this PSU, in order to maintain its stability and performance ? I have TIP3055 and 2N3055. Can one of those 2 transistor part number be safely used for the PSU ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 08, 2021, 09:09:25 pm
C2 is a electrolytic 47uF/63V capacitor made by Samxon, 105*C, KM(M), C9A.

Edit: part number is KM 47U/63V.

Edit 2:I found that I run out of TIP35C transistors, and I wanted to build the PSU into a case, using a different type of heatsink for the power transistors. What other type of power transistors can be used for this PSU, in order to maintain its stability and performance ? I have TIP3055 and 2N3055. Can one of those 2 transistor part number be safely used for the PSU ?
Either of those 2 transistor types should be stable. Can you temporarily try them before you make the case?
With long leads, there might be an advantage having R11 directly across B-E of the driver transistor. What is the driver transistor?
 Check the current sharing  by measuring the voltage drop across the Emitter resistors. The batch of TIP35C transistors I bought were very well matched, requiring only 0.05Ω resistors.

I can't say much about the safety. There are too many unknown variables and difficult calculations.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 08, 2021, 11:45:31 pm
My driver transistor is an BD244CG from On Semiconductor. I used 2x 0.1R/5W current sharing resistors for the 2 NPN power transistors. One 0.1R resistor for each transistor. R11 is close to the driver transistor (2 cm away).
I'll try the 2N3055, should I test as usual, for example at 1A load ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 08, 2021, 11:56:05 pm
My driver transistor is an BD244CG from On Semiconductor. I used 2x 0.1R/5W current sharing resistors for the 2 NPN power transistors. One 0.1R resistor for each transistor. R11 is close to the driver transistor (2 cm away).
I'll try the 2N3055, should I test as usual, for example at 1A load ?
That sounds fine. The BD244CG is a slower transistor than the DH4511 which might also explain the different compensation.
It doesn't matter so long as the PSU is stable.
Test at 1A for a smooth response like shown, https://ibb.co/PC52NjF
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 09, 2021, 04:29:41 am
I will test the PSU and I will come back later with the results.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 09, 2021, 11:08:40 am
Using 2x2N3055:
1. Vout = 20V, Imax = 2.6A, Rload=20R
15_000, 15_001
2. Vout=10V, Imax = 2.6A, Rload=10R
15_002, 15_003
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 09, 2021, 11:23:23 am
That is a good response. Looking back at your previous design, the equivalent compensation is the same. Its compensation resistor is 3 times larger at 10K but this is offset by Q1's Emitter resistor being about 3 times larger, 2.7K instead of 1K. So it all works out to being the same loop gain.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 09, 2021, 11:38:17 am
That's good then.
Are there any other tests that I should make ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 09, 2021, 11:43:56 am
No, it will be fine.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 11, 2021, 12:22:17 pm
What are the consequences if I replace R34 and R37 with a wire in the circuit ?
I saw that R37 limits the current through the LM317, while the R34 limits the current through the preload...
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 11, 2021, 12:33:10 pm
What are the consequences if I replace R34 and R37 with a wire in the circuit ?
I saw that R37 limits the current through the LM317, while the R34 limits the current through the preload...
R34 isn't needed with a permanent reverse polarity protection diode across the output terminals.
R37 is in case the LM317 ever breaks down, very rare. So R37 can be bridged out or something else put there that will act like a fuse.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 13, 2021, 05:48:23 am
I just built a new PCB with a few modifications, for example I replaced the connectors for the potentiometers with another type of connectors and I modified the position of a few other components.
It is sufficiently to test the PSU, by checking the response at 1A load ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 13, 2021, 05:56:23 am
Yes, that will be fine.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 13, 2021, 07:33:26 am
I powered on the circuit and after that, the white and the green led's started flickering, and the PSU does not work normally.
I checked the PCB twice but it seems ok to me. Checked with another LM358, but the same thing happens...
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 13, 2021, 07:42:51 am
Check that the 8V and 5V are stable with your DSO. Check that the CS resistor is connecting the 2 grounds together.
Show the overlay.

ALSO: disable CC mode by removing D2.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 13, 2021, 08:16:28 am
I finally found the problem: it was the connection between the potentiometers and the PCB (I used new connectors, but they are not good, so finally I soldered the wires to the PCB).
Modifications in comparation to my previous build:
1. Used 12V zener (I run out of 10V zener)
2. C3 is also 1nF, but it is not ceramic disk, now it is MLCC
3. 3n3 capacitor, initially it was ceramic disk, now it is film capacitor (it has green color)
4. I used new led's
5. I used LM258 from TI, to check if the PSU works good with it
6. I used new pots (both for current and for voltage)
7. All other components are new, except the LM317 and filter capacitor
8. I used 1x 4700uF/63V in parallel with 3x 2200uF capacitors and a 6A rectifier
9. I used TIP35C as power transistors, and BD244CG

Test:
1. Vout=10V, I=2.89A, Rload=10R
107_000, 107_001
2. Vout=20V, I=2.89A, Rload=20R
107_002, 107_003

Output of LM317: 107_004
Output of Tl431: 107_005
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 13, 2021, 08:27:19 am
That all looks normal. There is no need to show traces like the 2nd one. It's just a disturbance caused by the 555.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 13, 2021, 08:38:27 am
The minimum current not going to zero could be due to opamp offset. If the opamp is socketed, try a few others.
If I had of anticipated this, the problem could have been covered up by a high value resistor from 5V to the inverting input to give it a definite negative offset.
The problem is that with the LM258P, the minimum output current is about 20mA.
If I need the minimum current to be about 0mA, or very close to 0mA, should I connect a resistor like you said ?

Edit: I  checked with a 10M resistor, and now the current starts from about 0.25mA (which is good) and it is starting to increase after 0.5 turns of the potentiometer... (I use a multiturn 10k potentiometer for current).
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 13, 2021, 10:07:41 am
What kind of 10 turn pot are you using? I had a lot of trouble with Bourns  knock-offs.
After some use, the resistance wire would break on the CV pot causing the power supply output to be either 0v or full voltage.
I have had no trouble after changing to these over a year ago, http://www.bochen-cn.com/wxd3-13.html (http://www.bochen-cn.com/wxd3-13.html)
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 13, 2021, 10:13:25 am
This is the pot that I am using for current: POT2218P-10K, from SR Passives.
And for the one for voltage (also 10K), please see the attached datasheet.

Edit: connecting the resistor, as you said in one of the previously replies, between +5V and pin 2 of 358 (or 258), it is a bad ideea ? Or it can lead to problems ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 13, 2021, 10:45:49 am


Edit: connecting the resistor, as you said in one of the previously replies, between +5V and pin 2 of 358 (or 258), it is a bad ideea ? Or it can lead to problems ?
No problem, It just applies a very small amount of offset to the opamp's input.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 13, 2021, 10:50:50 am
Ok, then I will connect a 10M resistor between the +5V rail and pin 2 of Op Amp.
What should I do next ? does this modification require new tests, for example, testing the response at 1A load or the response at short circuit at the output of the PSU ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 13, 2021, 10:54:03 am
Ok, then I will connect a 10M resistor between the +5V rail and pin 2 of Op Amp.
What should I do next ? does this modification require new tests, for example, testing the response at 1A load or the response at short circuit at the output of the PSU ?
It will cause no change in performance. You can check the fast current limiting like with your previous design.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 13, 2021, 11:14:03 am
I connected the ground clip of the scope at negative output of the PSU, the probe at the other end of the 50m \$\Omega\$ resistor and the other probe at the output of 555.
1. Vout = 15V, I=2.89A, Rload = 0R
108_000, 108_001
2. Vout = 32V, I=2.89A, Rload = 0R
108_002, 108_003

It looks like the current through the 2x TIP35C is about a maximum of 25A...
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 13, 2021, 11:31:01 am
Ill have to test mine again to see what it is with the faster opamp.
I'm certain that yours is safe because the spike is so brief at about 10uS even though the data sheet doesn't show a load line for 10uS.
https://www.onsemi.com/pdf/datasheet/tip35a-d.pdf (https://www.onsemi.com/pdf/datasheet/tip35a-d.pdf)
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 13, 2021, 11:39:56 am
... and this is with 2x2N3055 and BD244CG
Vout=32V, I=2.89A, Rload=0R

It looks like this time, the spike is a little bit smaller in amplitude than when using TIP35C...

It is still safe, even for 2N3055 ?
When you check if it is safe or not, do you look at the SOA graphic in datasheet ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 14, 2021, 06:14:57 am
I'd call it safe if they are 2 of these 2N3055's, http://www.farnell.com/datasheets/20519.pdf (http://www.farnell.com/datasheets/20519.pdf)
The SOA graph includes a 50uS load line.

Testing with the CC set to 1A, mine makes an 800mV triangle shaped pulse across the CS resistor, 16A. The pulse is 1.2uS wide at its base.
With the CC set to 5A, it peaks at 20A.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 14, 2021, 10:39:36 am
Testing with the CC set to 1A, mine makes an 800mV triangle shaped pulse across the CS resistor, 16A. The pulse is 1.2uS wide at its base.
With the CC set to 5A, it peaks at 20A.
I think this is because you used another type of Op Amp ?

I think that I will mount the circuit into a case and I will put the PSU to work, together with the transformer, heatsink and a digital ICL7107 voltmeter...
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 14, 2021, 10:55:50 am
Testing with the CC set to 1A, mine makes an 800mV triangle shaped pulse across the CS resistor, 16A. The pulse is 1.2uS wide at its base.
With the CC set to 5A, it peaks at 20A.
I think this is because you used another type of Op Amp ?

I think that I will mount the circuit into a case and I will put the PSU to work, together with the transformer, heatsink and a digital ICL7107 voltmeter...
Mainly due to faster opamp and faster output transistors.
How will you power the digital voltmeter?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 14, 2021, 11:10:07 am
I will power the digital voltmeter using a individual 9Vac/2VA transformer, and a individual +/-5V power supply.
Please find attached the schematic of the voltmeter. The displays that I used have different part numbers, but they are also common anode.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 14, 2021, 11:13:00 am
That's a good way to power it. Trying to use the 8V control rail would cause problems.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 14, 2021, 08:13:02 pm
What if I use more than 2 power transistors (2N3055 or TIP35C) to reduce the dissipation per transistor ?
Is there any thing that needs modifications beside adding 1 or 2 more power transistors, if possible ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 14, 2021, 11:42:06 pm
What if I use more than 2 power transistors (2N3055 or TIP35C) to reduce the dissipation per transistor ?
Is there any thing that needs modifications beside adding 1 or 2 more power transistors, if possible ?
Adding more power transistors might slow it down and affect the stability. Can you do a quick test first?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 15, 2021, 03:00:23 am
... Or probably I could buy 2x higher power transistors than 2N3055 and TIP35C, and replace them, for example 2SC5200, MJ15003, 2N5038 or 2N3772, which would be simpler, but for 3A output current, probably I am fine with only 2 transistors.

Another thing that I could do is to use a transformer tap switcher, using an relay and some additional components, because I have a transformer with 2 secondaries, each 15Vac... I think i will use the tap switching method
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 15, 2021, 04:59:42 am
Using the schematic at pct. 3 from this website: https://sound-au.com/articles/preregulators.htm
I drew my own schematic (please find attached).
Also, using the 12V output I can power the fans that are cooling the heatsink...

If I build this tap switcher, what should I test, beside the thing that it switch the taps of the transformer ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 15, 2021, 09:15:24 am
That will work but might be tricky adjusting the voltage threshold and hysteresis.
Something more refined can be designed with opamps.
Depends on how you disable the PSUs output, directly with a high current switch or if you use a small switch on the Shutdown pin, the relay will change from 30V to 15V every time the PSU output is turned off and if the output  is allowed to go low.
Using a dual opamp, it might be possible to design something that holds the relay's state while the output is switched off.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 15, 2021, 10:19:01 am
Ok, then I will go back to the ideea to add a new transistor, TIP35C / 2N3055.
What should I test ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 15, 2021, 10:52:31 am
Ok, then I will go back to the ideea to add a new transistor, TIP35C / 2N3055.
What should I test ?
Just add the extra transistor and check the stability using 1A pulsed load. You know what the correct response looks like so no need to show the trace if it looks right. I prefer the TIP35C.

You don't want an under damped response, https://www.quora.com/What-are-over-damped-critically-and-under-damped-systems (https://www.quora.com/What-are-over-damped-critically-and-under-damped-systems)

You can always add the tap change later. This is what I have in mind. U1A is configured as a Schmitt trigger, sensing the PSUs output voltage.
One section of S1 connects the PSUs Shutdown pin to ground while the other section disconnects the output of U1A from the input of U1B which stores the relay's state.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 15, 2021, 11:40:47 am
I added the 3rd transistor (TIP35C) to my circuit.
I think that the response is almost good, probably a little bit underdamped...
1. Vout = 20V, Imax = 3.39A, Rload = 20R
111_000, 111_001
2. Vout = 10V, Imax = 3.39A, Rload = 10R
111_002

Edit: also, I used for R8 an 680k resistor in parallel with an 470k resistor, and now the max current is 3.39A.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 15, 2021, 11:56:33 am
Yes, a little underdamped. nothing to worry about.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 15, 2021, 12:26:53 pm
I've seen that if I set the PSU to 0V output and 0A output (so both pots at minimum) then if I press the shutdown button the green and red led's are still ON.
Also, while the PSU is with the red led ON, and if I press the shutdown button, then the red led remains ON.
Are these 2 behaviors normally ?

... and the test with 3x 2N3055. l tested with 3x 2N3055, because when I don't have any TIP35C, I will probably use 2N3055
1. Vout = 20V, Imax=3.39A, Rload=20R
113_000
2. Vout = 10V, Imax=3.39A, Rload=10R
113_001
Are the results still ok, with 2N3055 ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 15, 2021, 12:49:33 pm
Yes, normal.
The preload circuit keeps a residual 10mV on the output. Assuming that the CV opamp has very little offset error, the divided 10mV  will cause the opamp's output to swing low.
The intentional input offset applied to the CC opamp causes the same thing.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 15, 2021, 01:02:44 pm
I was curious and I checked the response of the PSU (3x2N3055) with Vout=20V and Rload=10R, so a 2A load:
114_000
Also, with Vout=32V and Rload=10R, so 3.2A load:
114_001

In this case, the response is also normal ? Or the voltage overshoot should be a little less ?

I know that it is normal for the voltage dip and overshoot to increase if the switched load increases ...

Edit: same test, but using 3xTIP35C:
115_000 - Vout=32V, Rload=10R,
115_001 - Vout=20V, Rload=10R
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 15, 2021, 04:00:42 pm
You could try changing to values of R5 and C3 like before.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 15, 2021, 04:34:58 pm
I tried first to modify the value or R5, leaving C3 at 1nF. Also, I modified R2 from 3k9 to 4k7, to reduce the output voltage from maximum 32V to maximum 27V.
1. R5=3k9, 3xTIP35C
Vout=27V, Imax=3.39A, Rload=10R
116_000
2. R5=4k7, 3xTIP35C
Vout=27V, Imax=3.39A, Rload=10R
116_001
3. R5=4k7, 3x2N3055
Vout=27V, Imax=3.39A, Rload=10R
116_002

Please have a look and tell me what you think ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 15, 2021, 04:51:01 pm
They all look good now. I would have expected it needing a combination of reducing R5 and increasing C3.
Was R5 3.3k?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 15, 2021, 04:57:18 pm
Yes, R5 was 3.3k.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 15, 2021, 05:04:10 pm
Yes, R5 was 3.3k.
I think that means the 1nF was a bit too small with 3.3k. Or likely something going on that I don't understand.
The main thing is it's working right.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 16, 2021, 03:55:01 am
I also tested the PSU with the PSU Shorter, with zero ohm load, to check it's stability when there is a short on the output.
Please have a look and tell me what you think.

1. LM358, 3x TIP35C, Vout=27V, Imax=2.98A
121_000, 121_001
2. LM258, 3X2N3055, Vout=28V, Imax=3.29A
122_000, 122_001
3. On the shunt resistor, LM358, 3x TIP35C, Vout=28V, Imax=2.98A
120_001

The main thing that I don't understand is the waveform marked by the red arrow (121_000_arrow).
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 16, 2021, 04:55:30 am
That would be recovery overshoot followed by some undershoot. Are you able to get TLC072 opamps?

What I'm not certain about is the long delay of the voltage recovering in some of them, as the one with the red arrow.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 16, 2021, 05:13:10 am
Forget that last bit about the delay. It's just looks that way because of the expanded vertical.
All looks fine except for the slow opamp which will not be a problem in use anyway.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 16, 2021, 05:26:46 am
Are you able to get TLC072 opamps?
Sadly, I am not able to get TLC072, because I can't find them at my electronic parts dealer, and if I will get them from another dealer, then it would be very expensive...
I would like to stick to LM358/258.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 16, 2021, 10:54:53 am
I replaced the C3 = 1nF MLCC (multilayer ceramic capacitor) by a ceramic disc capacitor (also 1nF), and I got the following results:
1. 3x2N3055
117_001
2. 3xTIP35C
117_002
This response look like a little bit overdamped, does it is still OK ?

This was the response with 1nF MLCC capacitor:
117_000
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 16, 2021, 11:09:27 am
That possibly explains why C3 capacitance seemed low. Most types of MLCC are used for bypassing and have large tolerances although low values are usually more accurate because they are more likely to be used where accuracy is more important.
 Some overdamping is fine.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 16, 2021, 07:09:13 pm
I checked this time the power supply using the 3x TIP35C transistors... this PSU is already installed into a case, with the transformer, rectifier, heatsink, voltmeter. The voltmeter and fans were disconnected while running the tests. The fans are powered using a separate PSU, with fixed voltage.
What I found is that even if there is R5=4k7 and C3=1nF and op amp is LM358P from TI, there is a little underdamped response.
Please have a look and tell me what you think.
I uploaded only the screenshots were the overshoot is more visible...
1. Vout=27V, Rload=10R
126_013
2. Vout=27V, Rload=47R
126_005
3. Vout=20V, Rload=10R
126_012
4. Vout=4.7V, Rload=4.7R
126_009
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 16, 2021, 07:54:16 pm
... by increasing R5 to 6k8 and leaving C3 at 1nF, I managed to reduce the overshoot:
Vout=27V, Rload=10R
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 16, 2021, 11:24:28 pm
With my PSU, I put a 1nF cap in parallel with C3, 120pF with R5, 10K. The response went  from 8uS to 50uS with a small overshoot bump.
I now think that the small overshoot bump may not indicate underdamped response, so ignore it for now.
The affect of the 1nF on my PSU's response means that there is a big difference, could be because of the different output transistors.

You could just leave yours as it is or do more experimenting if you have nothing else to do.
I'm a bit curious to know if it is still unstable with R5, 10K.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 17, 2021, 04:34:21 am
You could just leave yours as it is or do more experimenting if you have nothing else to do.
I'm a bit curious to know if it is still unstable with R5, 10K.
Should I leave the PSU as it is with R5=4k7 or R5=6k8 ? and C3=1nF  ?

I will try an experiment with R5=10k, for curiosity...
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 17, 2021, 05:23:03 am
You could just leave yours as it is or do more experimenting if you have nothing else to do.
I'm a bit curious to know if it is still unstable with R5, 10K.
Should I leave the PSU as it is with R5=4k7 or R5=6k8 ? and C3=1nF  ?

I will try an experiment with R5=10k, for curiosity...
The response looks good with the 6.8K and 1nF.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 17, 2021, 10:51:01 am
I tried with LM258 instead of 358, at the PSU that is mounted into case.
Vout=27V, Rload=10R, LM258, C3=1nF (ceramic 2kv, blue color), R5=6k8
128_000
Also I tried with R5=10k and C3=1nF (ceramic 2kv - blue color)
Vout=27V, Rload=10R
128_001
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 17, 2021, 03:08:40 pm
I tested again, but this time the response looks good with C3=1nF and R5=4k7, LM258P.
Vout=28V, Rload=10R
1. 3x2N3055
130_000
2. 3xTIP35C
130_001

Please have a look and tell me what you think...
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 17, 2021, 04:16:20 pm
I tested with the exactly same PCB and transistors from the PSU mounted into the case.
I tried a few things to reduce the overshoot.
First I used C3=1nF and R5=4k7, LM358P, 3xTIP35C.
I tried the following things: changed the Q2 to 2N5551, changed the 1N5408 on the output of the PSU with another 1N5408, changed C2 and the 100nF on the output with some new 47uF and 100nF capacitors. I also changed C4 with a new capacitor, also 3n3.
I tested after each of the mentioned modifications.
Initially the response was: 131_000
After modifications it is: 131_005.
Vout = 28V, Rload = 10R.

LE: I got the best response after I made all final modifications that were changing the 47uF and 100nF output capacitors...
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 17, 2021, 07:26:32 pm
U1=LM358, Q2=2N5551, R5=4k7, C3=1nF, C2=47uF in parallel with 100nF ceramic disc (new capacitors).
Vout=27.2V, Imax=2.98A, Rload=10R, C3=1nF film capacitor
133_000
Vout=27.2V, Imax=2.98A, Rload=10R, C3=1nF 1kV ceramic capacitor
133_002
The PSU PCB is the same as in previous reply, the only difference is that the PCB and heatsink were moved to the nearby table for tests.
I think that the overshoot is probably influenced by some external factors...
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 17, 2021, 07:41:31 pm
I tested with the exactly same PCB and transistors from the PSU mounted into the case.
I tried a few things to reduce the overshoot.
First I used C3=1nF and R5=4k7, LM358P, 3xTIP35C.
I tried the following things: changed the Q2 to 2N5551, changed the 1N5408 on the output of the PSU with another 1N5408, changed C2 and the 100nF on the output with some new 47uF and 100nF capacitors. I also changed C4 with a new capacitor, also 3n3.
I tested after each of the mentioned modifications.
Initially the response was: 131_000
After modifications it is: 131_005.
Vout = 28V, Rload = 10R.

LE: I got the best response after I made all final modifications that were changing the 47uF and 100nF output capacitors...
Do you mean that slight bump after recovery? I can make my PSU behave the same way by making C3 too large. I'm certain that it does not indicate a stability problem.
There is no point changing parts that have no affect on the CV loop like C4 and the output diode.
It seems like the replacement output capacitor has lower capacitance than the original.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 17, 2021, 07:50:00 pm
Do you mean that slight bump after recovery?
I mean the bump marked with the red arrow...
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 17, 2021, 07:56:13 pm
Do you mean that slight bump after recovery?
I mean the bump marked with the red arrow...
yes, you can just ignore it.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 19, 2021, 03:18:02 pm
You can always add the tap change later. This is what I have in mind. U1A is configured as a Schmitt trigger, sensing the PSUs output voltage.
One section of S1 connects the PSUs Shutdown pin to ground while the other section disconnects the output of U1A from the input of U1B which stores the relay's state.
There are a few missing values for some resistors in the schematic that you presented, can you please add the values to the schematic ?
I'll add the values that I know:
K1 = 12Vdc/10A relay
D1=1N4007
U1=LM358
"In" is connected to the positive output of the PSU
"Shutdown"  - here I will connect the shutdown of the PSU
S1=is a DPDT switch
R3= 10k preset
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 19, 2021, 10:25:00 pm
I have made some changes. Can you breadboard it first?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 20, 2021, 06:28:48 am
Yes, I will breadboard it.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 20, 2021, 07:47:09 am
I have tested the circuit. By connecting it into the PSU circuit and by rotating the 10k preset, I set the output voltage of about 14V as switch point...
If I set the output voltage to maximum (27.2V), and if I connect a overload to the PSU output, then the relay connects the 15V secondary and disconnects the 30V secondary of the transformer. When I disconnect the overload then the white LED from the PSU PCB flashes one time, before going into normal light mode.
Also, I checked the DPDT switch, and it switch off the output of the PSU.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 20, 2021, 08:07:49 am
The bright flash of the white LED during recovery is expectected as it takes some time for the unreg to rise. R8 and C2 add some delay to the relay change over also.
 With no load connected, measure the  hysteresis by slowly adjusting the PSU's output voltage while taking note of the voltage difference that causes the relay to pull in and drop out.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 20, 2021, 11:48:06 am
When increasing the voltage, the relay goes ON when the voltage is 14.62V.
When decreasing the voltage, the relay goes OFF when the voltage is 13.49V.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 20, 2021, 12:01:58 pm
My calculation says that the  hysteresis should be 250mV. Is C3 a nonpolar type.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 20, 2021, 12:13:52 pm
I checked the circuit on the breadboard, and it looks OK.
Yes, C3 is a nonpolar capacitor.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 20, 2021, 12:18:37 pm
Try removing C3 anyway,
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 20, 2021, 12:30:57 pm
Now I measured 14.7V when increasing the voltage, and 13.7V when decreasing the voltage.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 20, 2021, 12:32:37 pm
Check for oscillations.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 20, 2021, 12:38:10 pm
I removed C3, and one of the terminals of R7 (100k) is now unconnected.
Also, my breadboard is a bit old, if I touch the components or wires with my finger, then the led from the tap changer is flashing...
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 20, 2021, 12:43:44 pm
How well regulated and clean is the 12V? does it drop when the relay pulls in?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 20, 2021, 01:00:21 pm
The 12V supply is from the LM324 PSU that I built previously in this topic.
If does not drop when the relay pulls in, but on my breadboard are imperfect contacts which I cannot fix. My breadboard is not good.
Probably, the one solution is to solder the components into a perfboard.

LE: the voltage at pins 8 and 4 of LM358 is 11.88V when the relay is OFF and 10.5V when the relay is ON...
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 20, 2021, 01:17:20 pm
The 12V supply is from the LM324 PSU that I built previously in this topic.
If does not drop when the relay pulls in, but on my breadboard are imperfect contacts which I cannot fix. My breadboard is not good.
Probably, the one solution is to solder the components into a perfboard.

LE: the voltage at pins 8 and 4 of LM358 is 11.88V when the relay is OFF and 10.5V when the relay is ON...
That voltage drop would be the reason.
An LM7812 or LM3i7 on the final PCB should be stable enough.
Testing it  on perfboard will prove the design. Adding a 1uF capacitor from the trimpot's wiper to ground will help also.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 20, 2021, 02:18:10 pm
I built the circuit on a piece of perfboard. It is working now, the is now about 200-250mV.
When increasing the voltage, the relay goes ON when the voltage is 13V and goes of when decreasing the voltage at 12.8V.
But, if I set the output voltage at 13V, and if I switch OFF the PSU from the Shutdown switch then when switching it ON again, the led goes off then on again and the relay also makes sound.
If I set the output voltage from the PSU at for example 16V or 8V, then this behavior of the led disappears.

The schematic is the one from reply #859.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 20, 2021, 02:39:13 pm
Try it with C3 removed,
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 20, 2021, 02:50:19 pm
I removed C3 and now it look like that behavior of the led and relay disappeared.
By removing C3, one of the terminals of R7 remained unconnected.

Are there any other tests that I should do ?

LE: I tested with a 12V/20W light bulb (halogen) as a load, at a 14.4V output voltage. When I connected the load, the relay made a click and the led gone off and then again on, in a fraction of a second. Also, the CC led of the power supply was on while the red led was off. That was because the light bulb have a low resistance at room temperature...
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 20, 2021, 03:09:02 pm
The purpose of R7 and C3 is to prevent the relay chattering while trying to switch from 15V to 30V while the PSU is at maximum load.
R8 and C2 cause a short fixed delay. R7 and C3 add no delay when the PSU output is shorted at high voltage. We don't want the output transistors having high voltage across them for too long.
 You could do some tests first to see if the chatter problem is there while C3 is removed.
Then maybe make some compromise by shortening the TC of R7,C3 and increasing R8,C2.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 20, 2021, 03:20:52 pm
The purpose of R7 and C3 is to prevent the relay chattering while trying to switch from 15V to 30V while the PSU is at maximum load.
I did not understood exactly what you tried to explain in the above statement. Could you be more specific please ? How can I do this ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 20, 2021, 03:38:14 pm
Set the PSU to 12V with close to maximum load. Then adjust up the voltage until the relay changes from 15V to 30V.
Repeat this while listening for relay chatter.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 20, 2021, 03:44:44 pm
I set the output voltage to 12.5V, connected a 12V/35W halogen bulb and I increased the output voltage.
When increasing the voltage, the relay gone ON at 12.97V, and when decreasing the voltage the relay gone OFF at 12.74V.
There was no chattering, there were only normal transitions.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 20, 2021, 04:02:32 pm
I set the output voltage to 12.5V, connected a 12V/35W halogen bulb and I increased the output voltage.
When increasing the voltage, the relay gone ON at 12.97V, and when decreasing the voltage the relay gone OFF at 12.74V.
There was no chattering, there were only normal transitions.
That's good, no need for R7 and C3. I need a bit more time to rethink the R8,C2 delay. There might be a better way to do it.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 20, 2021, 04:22:47 pm
I would like to see how this version works before committing.
Leave C3 out.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 20, 2021, 04:30:01 pm
I will try this version and I will come back later with the results.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 20, 2021, 07:00:26 pm
I tested the latest version, but it looks like it works like the previous version.
I made this test, and it looks OK:
I set the output voltage to 12.5V, connected a 12V/35W halogen bulb and I increased the output voltage.
When increasing the voltage, the relay gone ON at 12.97V, and when decreasing the voltage the relay gone OFF at 12.74V.
There was no chattering, there were only normal transitions.
But when I set the output voltage to 13V, and connect an 12V/20W light bulb then the PSU enters for a very short period into CC and the relay is going OFF then ON, also the led that is connected in parallel with the relay is flashing one time. Is this normal ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 21, 2021, 12:33:04 am
But when I set the output voltage to 13V, and connect an 12V/20W light bulb then the PSU enters for a very short period into CC and the relay is going OFF then ON, also the led that is connected in parallel with the relay is flashing one time. Is this normal ?
Yes, that can be considered as normal.
The previous timer-latch circuit would not have worked properly in a situation where the input changes back to its original state immediately after a timeout. The output would also change back after a too short time.
The new C2 position and the diodes cause C2 to quickly charge to near 12V immediately after a timeout and output transition.
If the input immediately changes back, the output wont change until some time has passed, determined by R8 and C2, about 8mS.

Check that Q1 is handling the coil current ok.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 21, 2021, 01:40:51 am
Q1 doesn't heat up, it looks like it handles the current OK, but probably it would be better to use a higher current transistor. The relay coil is consuming about 30mA and the LED about 10mA. So a totally of 40mA.

Probably I will change the relay with a better one, this is cheap chinese 10A relay.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 21, 2021, 06:23:58 am
I made a layout in Kicad for the tap switching circuit.
Please have a look and tell me what you think...
Dimensions 51x71mm.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 21, 2021, 06:50:06 am
Looks very compact. Are mounting holes needed?
It's not clear that C1's pad connects to pin 3 of the opamp. Do the tracks look wider than actual?
The tracks to the relay contacts should be wider.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 21, 2021, 06:53:21 am
Mounting holes are not needed.
C1's pad connects to pin 3 of the opamp. The tracks are 1.2mm wide.
The tracks to the relay contacts are 3mm wide. I could make them wider, but those tracks will be covered with tin.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 21, 2021, 10:58:25 am
I've built the circuit on the PCB, and it works, but I saw that my transformer has a secondary of about 17Vac and one of about 12Vac. I connected the tap switcher to the 17V secondary.
I found the following 2 things: when I increase the voltage, when the relay goes ON, then the CC led of the PSU lights for a fraction of a second. The second thing that I saw is that when the output voltage is very close to 13V (the switch point voltage) then if I turn off the PSU, after 2-3 seconds, the relay goes ON then OFF, also the relay's led (I used a amber led).

Edit: and the relay is chattering when powering the 12V/35W light bulb and when I increase the output voltage.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 21, 2021, 11:17:55 am
I've built the circuit on the PCB, and it works, but I saw that my transformer has a secondary of about 17Vac and one of about 12Vac. I connected the tap switcher to the 17V secondary.
I found the following 2 things: when I increase the voltage, when the relay goes ON, then the CC led of the PSU lights for a fraction of a second. The second thing that I saw is that when the output voltage is very close to 13V (the switch point voltage) then if I turn off the PSU, after 2-3 seconds, the relay goes ON then OFF, also the relay's led (I used a amber led).
You have the 2 secondary windings of the main transformer in series. with the tap changer selecting 12VAC or 29VAC?
I cant imagine whey the CC LED should blink when the relay pulls in. Try tracing it with your DSO.
The regulated 12V in the tap changer serves as reference. As the 12V rail drops, the sense threshold voltage also drops. The relay will pull in for lower PSU output voltage.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 21, 2021, 11:27:57 am

Edit: and the relay is chattering when powering the 12V/35W light bulb and when I increase the output voltage.

Is the chatter brief or continuous?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 21, 2021, 11:30:30 am
You have the 2 secondary windings of the main transformer in series. with the tap changer selecting 12VAC or 29VAC?
The relay is selecting 17VAC or 29VAC. The CC led doesn't blink if I power the tap changer from another supply (for example another transformer or the LM324 PSU).
But if I power the tap changer from the voltmeter's transformer, then the voltmeter doesn't work anymore.

Is the chatter brief or continuous?
The chatter is brief.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 21, 2021, 11:41:02 am
You have the 2 secondary windings of the main transformer in series. with the tap changer selecting 12VAC or 29VAC?
The relay is selecting 17VAC or 29VAC. The CC led doesn't blink if I power the tap changer from another supply (for example another transformer or the LM324 PSU).
But if I power the tap changer from the voltmeter's transformer, then the voltmeter doesn't work anymore.

Is the chatter brief or continuous?
The chatter is brief.
I assumed that the tap changer was being powered from a separate transformer to avoid unwanted current through the CS resistor.
Does powering from a separate supply stop the chatter? If not, try increasing the delay by increasing R8.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 21, 2021, 12:26:57 pm
Does powering from a separate supply stop the chatter? If not, try increasing the delay by increasing R8.
Yes, by powering the tap changer from a separate 12Vac transformer, it stops the chatter.
Also, it stops the CC led blink.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 21, 2021, 08:44:43 pm
Should I leave the circuit as it is, by powering the tap switcher from a individual transformer ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 21, 2021, 11:32:45 pm
Should I leave the circuit as it is, by powering the tap switcher from a individual transformer ?
Yes. You could also test for chattering at a higher changeover voltage.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 22, 2021, 12:40:16 pm
I set the relay ON voltage (changeover voltage) at PSU output voltage of about 16.5V.
The chattering did not appear.
I used as load a halogen light bulb 12V/20W.
Now I am powering the tap changer from a separate transformer (12Vac) and the digital voltmeter from another transformer which is also 12Vac secondary.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 22, 2021, 04:11:12 pm
Did you try powering both from the same transformer?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 22, 2021, 04:41:29 pm
Yes. If I power both tap switcher and voltmeter from same transformer, then the voltmeter show "1".

Where '1' means overload...
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on June 23, 2021, 05:18:47 pm
I mounted all the components of the PSU into the case and I made a test and the PSU is working.
I used 3 transformers, one power toroidal 150VA/ 0-17-30Vac, the second 12Vac E+I for tap switcher, and the third, a PCB transformer 9V/2VA, for the digital voltmeter.
I would like to know what modifications should I made to the tap switcher if I want to use a more powerful relay, with 150mA coil current ? It is sufficient to replace the transistor from the tap switcher with a new transistor with higher Ic current ? The current relay is only 30mA coil current. Can I use a N-Channel MOSFET instead of the tap switcher NPN transistor ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on June 23, 2021, 10:00:25 pm
You could use something with the same pinout like a BC337. Increase the Base current if it's not saturating properly.
Just about any N-ch MOSFET will work. I would use an IRF730 because I have a bunch of them and are not much use for anything else.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on September 12, 2021, 11:58:50 am
Hello. I am testing a new PCB for the power supply based on the schematic designed by @xavier60.
I used 3xTIP35C, LM358P, and I have got the following results:
1. Vout=5V, Iout=1.6A, Rload=4R7: 147_003
2. Vout=5V, Iout=3.35A, Rload= 3.20R: 147_006
3. Vout=5V, Iout=max, Rload=4R7: 147_007

Could you please explain the overshoot marked by the red arrow in the screenshot ?
It is an acceptable overshoot for the power supply ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on September 12, 2021, 01:34:21 pm
What did you use for the PNP driver?
Last time, I decided that the overshoot is not a problem and was caused by the CV compensation capacitor being slightly too large.
You could try decreasing the CV compensation capacitor.
Show just us the best result.

It's not really an overshoot, more of a shallow  dip after the voltage first recovers to the original level.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on September 12, 2021, 01:56:55 pm
Im curious to see if the size of the shallow  dip is affected by the length of wiring in series with the test resistor.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on September 12, 2021, 01:59:20 pm
The PNP driver is an BD244CG.
If the response is good then I will leave the CV capacitor as it is.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on September 12, 2021, 02:26:31 pm
Im curious to see if the size of the shallow  dip is affected by the length of wiring in series with the test resistor.
Using long wires in series with the load resistor: aprox. 30cm: 143_001
Using short wires in series with the load resistor: aprox. 10cm: 148_002

For both screenshots: Vout=27.4V, I=max (3.35A), Rload=10 \$\Omega\$

I decided to show the screenshots from 27.4V because at 27.4V I got the best response.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on September 12, 2021, 02:49:37 pm
I see a noticeable difference. I think that the shallow dip is being caused by resonance between wiring inductance and the output capacitor.
So it's an external cause and not really a fault of the design.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on September 12, 2021, 02:52:47 pm
@mike_mike and xavier60:
Great job guys!
I've been still waiting on your final ultimate PSU design!
 :-+
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on September 12, 2021, 03:29:38 pm
I think the ultimate design would involve going back to Harrison topology. For reasons I don't fully understand, the output stage seems to develop higher frequency response. But for most application, totally unnecessary.
Our design here gives more than adequate performance for a much simpler design.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on September 13, 2021, 02:33:10 pm
I made all the tests without using the tap switcher.
On the final PSU, I will use the tap switcher.
It is possible that the tap switcher to introduce instability in the PSU's response ?

LE: I just tested with Vout=15.3V and Rload=5R: 151_001
and with 12.5V and Rload=4R: 151_002

The relay goes ON between 12.5V and 15.3V, at about 14.8V-15V output voltage.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on September 13, 2021, 09:07:38 pm
I see that the response shape is different from relay on to relay off. Not sure why but it's still stable.

After some thought, the response change is caused by the large change in input voltage changing the junction capacitance of the transistors, mainly the driver I think.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on September 14, 2021, 07:45:25 am
I did the same tests on my build of the design. The shape of the load recovery pulse stayed the same regardless of input voltage, 20 or 40 volts.
My first suspect is that PNP driver being too slow. Mine uses the D45H11. A BD140 could be temporarily used as a test.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on September 14, 2021, 11:21:23 am
I will try to test using BD140.
When I tested, I tested at 2 different output voltages, 15.3V and 12.5V. When I tested with 15.3V the input was 40Vdc, but when I tetsted with 12.5V then the input voltage was 20V... Could it was the difference between output voltages ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on September 14, 2021, 06:48:11 pm
The screenshots with BD140 as driver looks like:
1. Vout=12.5V,  Rload=4R: 153_002, Vin=20Vdc (aprox.)
2. Vout=15.3V, Rload=5R: 153_004, Vin=40Vdc
3. Vout=12.5V, Rload=4R: 155_000, Vin=40Vdc
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on September 14, 2021, 09:51:30 pm
That's a faster response although the change in time base setting makes it look much faster than previous tests.
Also it's less affected by the input voltage.
The slow settling after the main pulse should be ale to be corrected by decreasing the compensation capacitor.
But I'd rather see something with higher ratings eventually used rather than a BD140 which would likely be fine. I can't be certain.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on September 15, 2021, 12:07:31 am
I tested with 40V input, 15V output into 4.7Ω.
As well as being a bit faster, I get half the amount of voltage dip.
I also have a few microseconds of settling time which I could correct.
These differences would never be noticeable in normal use.
So I'd suggest putting it back to the way it was for now.
If you do want that extra bit of performance, upgrade the opamp to a TLC071 as well as the D45H11 driver.
Are you using a BC546 for Q1?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on September 15, 2021, 10:02:44 am
I am using a BC546C for Q1.
Ok, I put the BD244CG back into circuit.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on September 16, 2021, 03:52:00 pm
Are there any other tests or modifications that I need to make before installing the PSU into a case and use it as power supply for my workshop ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on September 16, 2021, 11:38:07 pm
Are there any other tests or modifications that I need to make before installing the PSU into a case and use it as power supply for my workshop ?
I can't think of much for now. What sort of loads will it be powering?
What was the reason for the revised PCB?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on September 17, 2021, 07:29:33 pm
I will be powering loads such as DC motors (small PCB drills, 5V, 12V and 24V dc fans), electronic circuits (small audio amplifiers, power led's, Arduino boards), small light bulbs, power led's and more things like that (capacitive, inductive and resistive loads).

The PCB is the same as the previous one. I said a new PCB - because it is built recently (about a week ago). It is not a new revision. If I will build a new version, then I will note the modifications that I made.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on September 18, 2021, 12:14:27 pm
Are there any restrictions regarding the loads powered by this PSU ?
I asked if I can install the PCB into the case, does it need any further modifications or testing ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on September 19, 2021, 05:29:28 am
At the risk of opening another can of worms, check the overshoot at the time that the output is enabled.
Mine has very little but I expect yours to be a little different.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on September 19, 2021, 05:37:19 am
How can I do this ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on September 19, 2021, 05:41:26 am
How can I do this ?
Set it to some voltage like 5V. Enable the output while your DSO is connected to the output in Single mode to capture the voltage rise.
The CC setting will affect the way the voltage rises.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on September 19, 2021, 05:49:09 am
Vout=27.4V, Iout=3.35A
I tested at maximum output voltage and current, because I imagined that here will be more voltage overshoot.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on September 19, 2021, 06:53:41 am
That won't be a problem for most things.
The overshoot should lessen with reduced CC setting.
This is mine at 25V and 3A.

Extra: I did add a 10uF MLCC across of output of mine. I attached it with 10mm leads so that it might not damage the PCB if it were to break down. I don't expect that it has made much change to performance.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on September 19, 2021, 07:30:33 am
Until you find better parts, you could try a possible quick fix.
Connect a 1.5K resistor from the Shutdown pin to the 5V reference.
The idea is to pull the reference voltage down a bit while the PSU is disabled, resulting in some soft-start
effect when it's enabled again.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on September 19, 2021, 08:05:40 am
Tested with the 1k5 resistor from Shutdown pin to the 5V reference.

LE: I searched at my electronic components supplier and I wont be able to get the TLC072 opamp, so I would stick with the LM358.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on September 19, 2021, 08:45:15 am
FYI - I've been using a similar V/A (30V/3A) (https://www.ebay.com/itm/202114872064?_trkparms=ispr%3D1&hash=item2f0efc3300:g:vCcAAOSwVHdaoiSg&amdata=enc%3AAQAGAAACoPYe5NmHp%252B2JMhMi7yxGiTJkPrKr5t53CooMSQt2orsSjVt3vLKCbov98Z19qhuwY8weYM1O0v1g8QnKY6Jt7uL%252FrX%252BAqOj%252FurbLd938QjOjyx4iqluxYTminQXspqHjvN8z1GI4p2fhgSTjLrSAkmBBaEacu0nNGKx2Ho4JdHCb7g%252F%252Bfa7CzGo97z1tQMrpFNNpZ6yrq%252FG%252Bud5PW1zVJyEt7n8jQwzIddfKukstdod9bbj3Wto4j0PhjbxEgYP0dsBo5k8KZAeBtUtr1PTvH5tBW91YiI%252BjdbmQ01zVTrwGY7x%252B3UGRg636gh%252Fnqejn%252FhW4z2QNT5U34PjzyDR0tAg%252FkEYdmpM%252BsZTyMySCaT9%252FbgkvNdfMmv%252FaHRYrVnaF1RQYym8Fm4ETmZlPR89UC620jWbUqQVigrU%252FCLe9%252F75q9mhi1KDiiIO5C1kVrrx8dautS7oB9SLcd6CZLiz%252BQSSUIObKr2q%252FDwwv9Uh5FMfGtM6HC%252FPyP9tSW1QCyxATCyPcBNxIMg8CjLjCg0hSy1%252BjcLu5uEVFF1H0lY06FbctziQCQ5GnY5DIEsapSTGYnUOnxrE7RI1NUVpXiY31P2ikBWvIIy2nse2hFluOQov1h8%252BLm6Hnl4hiQrv2ulIh4KzI3XgWMZhgns5TZ0U4E6YaWkid5xSmT624oTezIcAy3PuJpuCioMGXQNdTaekNOCeEUvD1RBxMT2L9x6%252BO6U%252FLVMlc2xF3qHvJ%252F0ZEMDq3uUI3dl9CN8TkxXDZ7ova5ltCzIcka%252BnGsVxUebD%252BfVBoF0FZndPchATG14Y3dd9plnTkgtPW8SQXrl%252BqsRf3uMkDnguCyOJyZYlesiPZRdQjpPqKlYM4bxt34hr4Y7t%252FgsfykGZZI6YQ9the%252Bzcchw%253D%253D%7Campid%3APL_CLK%7Cclp%3A2334524) meter module in one of my PSU.. I wonder whether it could be wired to your PSU easily..
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on September 19, 2021, 08:51:58 am
@imo, I first need the approval that my PSU is working good, then I will make a case for this PSU, and then I will probably install a V/A meter module. If not, then I will use a simple analog voltmeter, which I already have in my workshop.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on September 19, 2021, 08:57:57 am
@mike: sure, your PSU looks nice..
FYI - this is how the modules are typically wired (pictures from ebay with my comment on max voltage). There are 3-5digits meters available, afaik..
No guarantee the newer one have the same wiring (I did it years back).
Doublecheck!
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on September 19, 2021, 09:11:50 am
I made some comment about those kind of LED panel meters here, https://www.eevblog.com/forum/projects/volts-amps-digital-meters/msg3685030/#msg3685030 (https://www.eevblog.com/forum/projects/volts-amps-digital-meters/msg3685030/#msg3685030)

So I recommend getting a 4 digit  model after confirming from the photos that the board carries the small CMOS switch IC.
If the refresh is slower than advertised, complain to the seller.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on September 19, 2021, 09:18:22 am
@mike: sure, your PSU looks nice..
FYI - this is how the modules are typically wired. There are 3-5digits meters available, afaik..
No guarantee the newer one have the same wiring (I did it years back).
Doublecheck!
I have just looked at the link. I have not seen that style of meter.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on September 19, 2021, 09:21:21 am
My module has got the wires as on the picture (4digits 30V/3A, red/blue led display).
The black wires are common afaik.
Therefore my question on how you would wire it when you are using shunt in the gnd path.

PS: I've glanced at my PSU module and the refresh rate is something like 3-4x per second at least..
PPS: I put a 7805 (with a small heatsink attached) in front of the meter's Vcc, still working  :) (the PSU is single voltage, 28V at filter).
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on September 19, 2021, 09:26:26 am
My module has got the wires as on the picture (4digits 30V/3A, red/blue led display).
The black ones are common afaik.
Therefore my question on how you would wire it when you are using shunt in the gnd path.
mike_mike has a separate 12V supply referenced to the PSU's 0V output terminal, so it should be fine.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on September 19, 2021, 09:41:29 am
Any thoughts regarding my screenshots at reply #928 ?
Tested with the 1k5 resistor from Shutdown pin to the 5V reference.

LE: I searched at my electronic components supplier and I wont be able to get the TLC072 opamp, so I would stick with the LM358.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on September 19, 2021, 09:48:32 am
Any thoughts regarding my screenshots at reply #928 ?
Tested with the 1k5 resistor from Shutdown pin to the 5V reference.

LE: I searched at my electronic components supplier and I wont be able to get the TLC072 opamp, so I would stick with the LM358.
Looks good, no overshoot. You should check at 5V.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on September 19, 2021, 10:00:35 am
This is at 5V output.
Iout=3.35A.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on September 19, 2021, 10:09:37 am
That spike could be a problem at lower voltage setting but reducing the CC setting should reduce it.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on September 19, 2021, 10:17:16 am
Vout=5V, Iout=1.6A
It looks like the spike is bigger, also tested at max output current and the spike is bigger.

Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on September 19, 2021, 10:31:37 am
I have retested at max output current and 5V output.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on September 19, 2021, 11:06:44 am
I have discovered that there is more to this issue. When the PSU is enabled, the charge current of the output capacitor causes the fast current limiting to overreact and this is what is controlling the voltage rise.
I popped an LM358 into mine and did a few tests. I got some overshoot but not as much as yours before the resistor  mod.
Looks like your slow driver transistor is part of the problem.
I had mentioned earlier that my PCB has the option of breaking the reference connection to the pots.
Will the overshoot be a problem for you?
 
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on September 19, 2021, 11:11:16 am
Are you asking about the overshoot that apoears on the oscilloscope when I enable the output ?
If yes, then it should not be a problem.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on September 19, 2021, 11:13:53 am
Are you asking about the overshoot that apoears on the oscilloscope when I enable the output ?
If yes, then it should not be a problem.
Yes.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on September 19, 2021, 11:17:08 am
I don't think that the overshoot could be a problem.
What other transistors can I use for the PNP driver ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on September 19, 2021, 11:43:08 am
The D45H11 is the only one I have used and know as suitable. Any other suggestions will be based on fT as well as power.
MJE171G or MJE172G for now.

Added: MJE15029
           MJE253G
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on September 19, 2021, 11:49:20 am
Ok, then I will install the PCB into a case and use the PSU.
Does the 1k5 resistor which is connected from Shutdown to the 5V reference still needed ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on September 19, 2021, 12:16:27 pm
Ok, then I will install the PCB into a case and use the PSU.
Does the 1k5 resistor which is connected from Shutdown to the 5V reference still needed ?
No, unless you think it makes a worthwhile improvement.
I have added another possible suitable driver to the list. Its main application is as audio driver which has the same type of requirements.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on September 19, 2021, 05:15:42 pm
Ok, I will install the PCB into the case and I will come back with some photos, probably the next week...
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 04, 2021, 03:21:19 pm
Hello @xavier60, I am working at the PSU's case, and I have a question about the red (CC) and green (CV) led's. Both led's have a 10k resistor in series (R30 and R31), and the led's are powered from 8V rail. This means that the current is very small, it is possible to increase the current that goes through these 2 led's ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 04, 2021, 05:47:04 pm
Yes, the LM358 should be able to easily sink 5mA or more per output.
Lastly, check for any output voltage rise during mains power down.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 04, 2021, 07:21:45 pm
I replaced the 10k resistors with 2k2 resistors and the red and green led's with regular led's.
I made a few quick tests, without any load at the output of the PSU, first test with maximum output voltage and the second with about half output voltage.
Please find attached the screenshots from the oscilloscope.

It's the right way I tested ?

165_002 power on
165_003 power off
165_004 power off
165_005 power on
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 05, 2021, 07:51:16 am
That looks good.
I have some 10 turn pots with plastic shafts branded "Bourns"  They did go scratchy but none have had broken resistance wire yet.
When that happens, the PSU's output will jump from zero to full voltage as the pot is turned up.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 05, 2021, 08:03:50 am
For voltage I have a normal single turn pot, but for current I have a 10 turns pot from SR Passives.
Do you suggest adding some extra components in order to protect the load if the pot resistance broke ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 05, 2021, 09:02:42 am
For voltage I have a normal single turn pot, but for current I have a 10 turns pot from SR Passives.
Do you suggest adding some extra components in order to protect the load if the pot resistance broke ?
The single turn pot sounds much safer for the CV. There is no simple way to protect against broken wire.
If the CC pot fails, it likely wont be as instantly destructive to the load because most of the time the PSU will be operating in CV mode.
But you might not know for a while that the CC pot has failed causing the setting to be your maximum 3A.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: Kleinstein on October 05, 2021, 09:52:17 am
The way the setting is done (at the set voltage side) there should be mot bis problem adding a high value pull down resistors. This would trun down the set voltage or current in case of a open wiper. This would make the scale a bit nonlinear.

Using single turn or multi turn pots has pro and cons. A single pot for the setting can be a bit coarse and difficult to set low values. A multi turn pot is slow to change over the full range.  The version with separate fine an coarse adjust can be tricky with wiper failure.

For the current one could consider a simple toogle switch to choose a upper / lower range (e.g. 1/10 of max).
I currently have a single pot, and it is not really satisfactory to set low voltages (like 5 V or 3.3 V).
Still multiple ranges make the scale more complicated. Still a smaller range of maybe 1/5 can be an option, I currently consider for my supply.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on October 06, 2021, 07:49:14 am
Can I continue with the construction of the PSU case ? Are necesary any other modfications ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 06, 2021, 07:51:18 am
Can I continue with the construction of the PSU case ? Are necesary any other modfications ?
It will be fine,
Title: Re: LM324 Power Supply with variable voltage and current
Post by: bingo600 on October 13, 2021, 05:16:20 pm
I have been looking a bit on these pages , but can't seem to locate the "Final Schematic".

Is there any pointers to that ?

Does it have a PCB layout or ?

TIA

/Bingo
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on October 13, 2021, 08:57:05 pm
I have been looking a bit on these pages , but can't seem to locate the "Final Schematic".

Is there any pointers to that ?

Does it have a PCB layout or ?

TIA

/Bingo
On this page are schematics of the simple and full versions. And including the following page, PCB screen dumps.
https://www.eevblog.com/forum/beginners/lm324-power-supply-with-variable-voltage-and-current/725/ (https://www.eevblog.com/forum/beginners/lm324-power-supply-with-variable-voltage-and-current/725/)
Let us know what you plan to do in case improvements  can be suggested.
A few pages on, a transformer tap changer is developed.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on November 28, 2021, 06:52:00 pm
Hello, I am coming with news about the PSU.
Finally I managed to install it into a case. Please have a look at the photos.

https://ibb.co/mGdJ6X2
https://ibb.co/x3VNsx4
https://ibb.co/T2hn1cs
https://ibb.co/v32sg24
Title: Re: LM324 Power Supply with variable voltage and current
Post by: not1xor1 on November 29, 2021, 06:02:10 am
Hello, I am coming with news about the PSU.
Finally I managed to install it into a case. Please have a look at the photos.

https://ibb.co/mGdJ6X2
https://ibb.co/x3VNsx4
https://ibb.co/T2hn1cs
https://ibb.co/v32sg24

a cyber.... or... maybe a woodenpunk PSU ?  :D
just kidding,  I used to encase electronics in wooden boxes like your ages ago... when I was young
BTW how do you intend to cover it? Remember to leave a way out for the hot air...
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on December 02, 2021, 03:28:27 am
I will cover it using a piece of plywood and I will drill some holes for the hot air.
The fan is taking out the air from the inside of the PSU, and it is not blowing the air from outside to the inside.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on December 14, 2021, 04:19:16 pm
Hi! I got a new scope (GDS-1102B), and I wanted to use it for the first time testing the PSU again.
The results are comparable with the old scope, but I wanted to know why it looks more noisy than my old Owon, even if I use the BW Limit (20MHz) ? CH1 = output of the PSU, CH2 = output of the LM555 at PSU Shorter
The last character of the PNG file:
4 = the output with 2.7A switched load (with the PSU Shorter)
5 = with the output shorted (with PSU Shorter)
6,7 = on the R_Shunt with the output shorted (with PSU Shorter)
8 = the output of the PSU, without any load.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on December 14, 2021, 05:24:37 pm
 While taking that last reading, turn off the mains to the power supply.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on December 14, 2021, 05:30:16 pm
With the power supply mains turned off.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on December 14, 2021, 05:35:42 pm
Try adjusting the Time Base and Trigger Level to get a lock on signal. Its frequency might give a clue about the source of it.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on December 14, 2021, 05:46:54 pm
I adjusted the Trigger Level and Time Base and also the V/div for the CH1 and I got the following screenshots: DS0011, DS0012
It is possible to appear this signal due to long wires and/or radio interference with the scope ?
If I short to ground the CH1 probe: DS0013.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on December 14, 2021, 05:54:24 pm
There looks to be more than one signal. The main one is about 100Mhz, an FM radio broadcast maybe.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on December 24, 2021, 07:24:20 am
A few more tests using different capacitor values for C3. R5 was 4k7 in all tests. CH1 was connected to the PSU output and CH2 to NE555 output (PSU Shorter). Rload was 9R, Vout was 27V.
1. Missing C4: 0014.png
[attach=1]
2. C4=100pF: 0015-16.png
[attach=2]
[attach=3]
3. C4=470pF: 0018.png
[attach=4]
4. C4=560pF: 0019.png
[attach=5]
5. C4=820pF: 0020.png
[attach=6]
6. C4=1nF: 0022.png
[attach=7]
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on December 24, 2021, 07:47:14 am
The last one looks good. You should try to keep the DSO settings the same.
Also set your trigger zero reference to the left side of the screen, if your DSO allows this.
Having the trigger zero reference in the middle wastes a lot of the trace, showing nothing useful.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on December 28, 2021, 04:49:26 pm
In my project initially R2 was 4k7, but now I modified it to 3k9 as it was in @xavier60 original schematic. With 4k7 the max output voltage was about 27V, now with 3k9 it is 32.77V.
Please find attached the screenshots:
1. CH1 on PSU output, CH2 on 555 output, with Rload = 0 R - 0038, 0039, 0040
2. CH1 on R_Shunt, CH2 on 555 output, Rload = 0 R - 0041, 0042
3. CH1 on PSU output, CH2 on 555 output, Rload = 10R - 0043, 0044, 0045.png

I used a 32Vac/200VA step down power transformer.

Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on December 28, 2021, 11:09:02 pm
[attachimg=2]That's a good response. Changing R2 shouldn't change the compensation.
Did you find the source of the high frequency?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on December 29, 2021, 03:54:51 am
No I didn't found the source of the high frequency.
There is an cell phone antenna on a building at about 200-300 meters from my workplace, could it be the reason for the high frequency ?

All the screenshots from my previous reply were made with 20MHz bandwidth limit ON.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on December 29, 2021, 04:20:33 am
No I didn't found the source of the high frequency.
There is an cell phone antenna on a building at about 200-300 meters from my workplace, could it be the reason for the high frequency ?

All the screenshots from my previous reply were made with 20MHz bandwidth limit ON.
Im not certain what frequency cell phones use.
I see some trace thickening in the last 2 shots.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on December 29, 2021, 04:28:51 am
But is it a normal or an abnormal behavior for the signal to be noisy ?
I looked over the internet and I've saw that digital oscilloscopes are noisy in general ... does the noise on my scope looks higher than it should be ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on December 29, 2021, 04:51:18 am
Some random noise voltage might be normal but if it has a distinct frequency, then it's either circuit oscillation or some external source which maybe can be ignored. It was 100Mhz last time which shouldn't show with the 20Mhz band width limit enabled.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on December 29, 2021, 05:00:46 am
Ok, then I will try to do some test when I will get back to the workshop, probably tonight...
Please let me know if you have some test suggestions.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on December 29, 2021, 05:05:34 pm
Please find attached some screenshots with the probe shorted to gnd.
1. BW Limit OFF: 0046, 0047
2. BW Limit ON: 0048, 0049

Please have a look and tell me what you think.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on December 29, 2021, 06:14:28 pm
The 2nd shot looks like SMPS hash.  If it's not coming from a nearby power supply. it could be coming through the mains and you will never likely find the source.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on December 31, 2021, 11:56:06 am
I made a few more tests, this time with 3x TIP35C as power transistors, with the PSU mounted into a case. The previous screenshots were with 3x 2N3055 as power transistors.
Vout=31.64V for all screenshots.
CH1=PSU output, CH2=NE555 output

1. Rload=10R: 0051,0052.png
2. Rload=0R: 0053.png

CH1=the R_Shunt, CH2=NE555 output
3. Rload=0R:0054, 0055.png

The thing that I observed is that on the R_Shunt, the voltage spike is about 1.3V, which means that 1.3V divided by 0.05 Ohms means 26A, and 26 A divided by 3 x TIP35C means 8.66A/transistor. I observed in the TIP35C datasheet, on the SOA graphic that on the 300uS and 40V CE voltage the maximum current is about 5A, while on my circuit the current is 8.66A/ transistor and the spike duration is about 40uS.

Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on December 31, 2021, 12:15:54 pm
I would call that spike something less than 20uS due to its shape not being a rectangular.
I'm sure that the transistors wont mind. If you want to see something less, try a faster opamp like the TLC072.
What is your driver transistor now?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on December 31, 2021, 12:22:32 pm
The driver transistor is a BD244CG.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 30, 2022, 02:09:59 am
Hello @xavier60, it's been a while since I started using the power supply (I am talking about the last schematic). It is working good, I don't have any problems.
Your last question was about the driver transistor, and I mentioned that it is a BD244CG.
Do you have any other thoughts about the psu ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on March 30, 2022, 06:59:28 am
Hello @xavier60, it's been a while since I started using the power supply (I am talking about the last schematic). It is working good, I don't have any problems.
Your last question was about the driver transistor, and I mentioned that it is a BD244CG.
Do you have any other thoughts about the psu ?
That's good to hear. I had hoped that the design would have become more popular by now.
One improvement I can think of is to enable/disable the output by turning off the reference voltage rather than using the Shutdown input.
Im certain that it will cure the voltage overshoot.
I use mine almost daily.
https://www.eevblog.com/forum/projects/linear-lab-power-supply/msg2409717/#msg2409717 (https://www.eevblog.com/forum/projects/linear-lab-power-supply/msg2409717/#msg2409717)
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 30, 2022, 08:32:30 am
By turning off the reference voltage means that I should use the DC on-off switch to switch off the voltage reference by connecting to ground the K of the TL431 ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: Kleinstein on March 30, 2022, 09:14:37 am
I would kepp the actual refrence running and shut off the voltage at the pot to set the voltage. This way the reference chip would stay warm and show a little less slow thermal settling.

The design looks nice and simple, as it can get away with a single transformer. It is definitely a step up from the LM723 based ones with usually rather poor current regulation.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: kallek on March 30, 2022, 11:47:48 am
I am going to build this power supply. Thank you xavier60 for sharing it!

Should I get the TL072, or will the LM358 work as well? And what are the requirements for the output stage transistors? Will almost any power transistors do the job, if they can dissipate enough heat?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on March 30, 2022, 12:37:44 pm
I am going to build this power supply. Thank you xavier60 for sharing it!

Should I get the TL072, or will the LM358 work as well? And what are the requirements for the output stage transistors? Will almost any power transistors do the job, if they can dissipate enough heat?
It needs to be the TLC072 or LM358. The important spec for the opamp is that it will work properly with it's inputs at ground voltage, 0V.
The TLC072 being much faster makes the fast current limiting react faster but it's not really that important.
There is nothing much better than the D45H11 for the driver and I used two TIP35C's for the output for 5A with 15VAC/30VAC secondary switching. The two TIP35C's are directly mounted to a spreader plate witch is insulated from the fan cooled heat-sink with Silpad material.
So the requirements are no different to most other linear PSU's. There are a lot of factors witch are difficult to measure and calculate, so one must go for something that's hopefully a bit of overkill.
https://www.eevblog.com/forum/projects/linear-lab-power-supply/msg2388873/#msg2388873 (https://www.eevblog.com/forum/projects/linear-lab-power-supply/msg2388873/#msg2388873)
Ill have look for the version that I'm currently using in my PSU and put the links here shortly.

 mike_mike's layout.
https://www.eevblog.com/forum/beginners/lm324-power-supply-with-variable-voltage-and-current/msg3583296/#msg3583296 (https://www.eevblog.com/forum/beginners/lm324-power-supply-with-variable-voltage-and-current/msg3583296/#msg3583296)
Mine,
https://www.eevblog.com/forum/beginners/lm324-power-supply-with-variable-voltage-and-current/msg3582664/#msg3582664 (https://www.eevblog.com/forum/beginners/lm324-power-supply-with-variable-voltage-and-current/msg3582664/#msg3582664)
The LED in the Emitter circuit of Q1 can be blue or white. As discussed a few posts back, the output enable switch should be made to disconnect the 5V reference from the CV and CC pots. But leave the Shutdown input option intact.
Also you need to be prepared to do some load transient tests to make certain that is all ok,
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 30, 2022, 01:50:54 pm
@xavier60, leaving the power supply as it is shound be a bad idea ?

.... or how to wire the dc on/off switch in order to work in connection with the tap changer ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on March 30, 2022, 01:59:38 pm
@xavier60, leaving the power supply as it is shound be a bad idea ?

.... or how to wire the dc on/off switch in order to work in connection with the tap changer ?
No, it's fine the way it is. It was a suggested improvement.
The switch needs to be wired so that both poles are on at the same time.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: kallek on March 30, 2022, 02:05:58 pm
Thank you, I think I will read the whole thread next and start from there. Thank you mike_mike for sharing your project, it looks very nice. :-+
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 30, 2022, 03:19:31 pm
I managed to make it work, but only when the 2 poles of the switch are not on at the same time (one pole on and the other pole off).
When I turn the DC off, the white led goes off for a very short time and then it goes back on. When I turn the DC on again, then the white led stays on.
Please find attached the schematic.

Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on March 30, 2022, 03:33:15 pm
Because you are using the pole to short circuit the reference, the switch wiring stays the same, one pole on while the other is off.
I think it might be better to use the pole to disconnect the reference 5V from the pots.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 30, 2022, 03:37:32 pm
By disconnecting the 5V reference from the pots, then one end of the pots will remain disconnected ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on March 30, 2022, 03:39:32 pm
By disconnecting the 5V reference from the pots, then one end of the pots will remain disconnected ?
Yes, while the switch's pole is off.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 30, 2022, 03:43:19 pm
Something like shown in the attached schematic ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on March 30, 2022, 03:44:39 pm
Yes, try that.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 30, 2022, 04:14:28 pm
I tried the above schematic but when switching from off to on, then the relay clicks one time. And when the dc is off then the green led is still on.

LE: if possible, I would like to stick with the original design, the one before the switch modifications.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on March 30, 2022, 04:17:48 pm
How have you wired the switch poles?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 30, 2022, 04:21:22 pm
The first pole is wired like in the first schematic, and the second pole is connected as a switch that is connecting and disconnecting the wire between the 5V reference and the pot's pins (reply #997 schematic)
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on March 30, 2022, 04:25:05 pm
Is one pole on while the other pole is off?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 30, 2022, 04:26:21 pm
Both poles are on at the same time.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on March 30, 2022, 04:30:11 pm
Both poles are on at the same time.
That's right. It should be working.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 30, 2022, 04:32:28 pm
I am always hearing the relay clicking when the psu is going from off to on state.
For example: Vout=32V, I out=3A, I am turning off the psu then I turn it on and while I am pressing the switch I hear the relay clicking. Even if the relay was initially on.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on March 30, 2022, 04:38:35 pm
Put the switch in the position where there is 5V on the pots and the PSU has output.
Then check that the pole in the tap change circuit is on.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on March 30, 2022, 04:54:22 pm
Maybe there is a big problem with the idea if the pole for the reference turns off before the other pole.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on March 30, 2022, 05:05:24 pm
With the way it originally was, the switch contacts timing avoided glitches. The pole in the tap changer opened before the pole on the Shutdown closed. This prevented the tap changer responding to the drop of PSU output voltage.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 30, 2022, 05:26:02 pm
I don't think that I will find a perfect switch.
If I will use the power supply with the actual relay clicking, it could be a problem ? For example will the relay be damaged ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 30, 2022, 06:14:34 pm
No, it's fine the way it is. It was a suggested improvement.
The switch needs to be wired so that both poles are on at the same time.
Ok, then I would like to leave the psu as it is.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on March 30, 2022, 09:21:08 pm
No, it's fine the way it is. It was a suggested improvement.
The switch needs to be wired so that both poles are on at the same time.
Ok, then I would like to leave the psu as it is.
I fell asleep here. Yes, it will have to stay the way it is. I can't think of a simple solution for the relay clicking which we were wanting to avoid in the first place  in the design of the tap change circuit.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on March 30, 2022, 09:43:12 pm
No, it's fine the way it is. It was a suggested improvement.
The switch needs to be wired so that both poles are on at the same time.
Ok, then I would like to leave the psu as it is.
Actually I have just thought of something. Increasing C2 in the tap change circuit will increase the delay to change time.
There still could be unforeseeable complications.  So experiment only if you have plenty of spare time to use.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 31, 2022, 08:35:54 am
I will leave the psu as it was before the last suggested improvement.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: not1xor1 on March 31, 2022, 12:10:34 pm
I tried to simulate with LTspice that schematic with TLC072 (PS4s03.jpg - is that the last schematic?) but it oscillates at about 1-2kHz. The bode plot is scary...  :scared:

If anybody would like to check I can post a zip with the models I used.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on March 31, 2022, 12:45:06 pm
I tried to simulate with LTspice that schematic with TLC072 (PS4s03.jpg - is that the last schematic?) but it oscillates at about 1-2kHz. The bode plot is scary...  :scared:

If anybody would like to check I can post a zip with the models I used.
The latest is PS42 012.png on https://www.eevblog.com/forum/beginners/lm324-power-supply-with-variable-voltage-and-current/msg3582664/#msg3582664 (https://www.eevblog.com/forum/beginners/lm324-power-supply-with-variable-voltage-and-current/msg3582664/#msg3582664)
It's not significantly different.
The CV loop should oscillate over 100Khz with no compensation.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on March 31, 2022, 04:34:56 pm
Is there anything that I should do if the psu oscillates ? I checked the psu, some time ago, when I finished the latest schematic, and it seems that it didn't oscillate (at that moment).
What else should I do ? is there anything that I should modify or test ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on March 31, 2022, 09:05:22 pm
Is there anything that I should do if the psu oscillates ? I checked the psu, some time ago, when I finished the latest schematic, and it seems that it didn't oscillate (at that moment).
What else should I do ? is there anything that I should modify or test ?
You could test it again, it will be fine.  I use the same design in my main bench PSU and have not seen oscillation problems in almost 3 years.
There is very likely a mistake in the simulation.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: Kleinstein on March 31, 2022, 09:40:35 pm
The ESR of C2 could make a difference for the stability and help the voltage loop.
There are other parts that are not modeled perfectly.  One such part is inductance of the shunt, that can have an effect, though often also to make a real world circuit oscillate if the simulation is stable.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on April 01, 2022, 12:34:02 am
A sure way to make it oscillate is to apply type 1 compensation(C + no R) and an extremely low ESR cap across the output.
This is commonly known to apply in general to current sourcing designs such as Harrison topology and LDO regulators.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: not1xor1 on April 01, 2022, 09:10:04 am
I tried to simulate with LTspice that schematic with TLC072 (PS4s03.jpg - is that the last schematic?) but it oscillates at about 1-2kHz. The bode plot is scary...  :scared:

If anybody would like to check I can post a zip with the models I used.
The latest is PS42 012.png on https://www.eevblog.com/forum/beginners/lm324-power-supply-with-variable-voltage-and-current/msg3582664/#msg3582664 (https://www.eevblog.com/forum/beginners/lm324-power-supply-with-variable-voltage-and-current/msg3582664/#msg3582664)
It's not significantly different.
The CV loop should oscillate over 100Khz with no compensation.

I downloaded the TLC072 model from TI and the TIP35 one from onsemi.
The bodeplot of a simple circuit with just TLC072 matches the datasheet one, so the library should be OK.
Unfortunately the test (control voltage only) yields quite wild results. (See image below)
I'm including the simulation in order to allow to check what is wrong with that.
Please let me know what is wrong ... or if it is just a simulation problem.

(https://www.eevblog.com/forum/beginners/lm324-power-supply-with-variable-voltage-and-current/?action=dlattach;attach=1452880)

thanks
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on April 01, 2022, 11:50:24 am
Your signal injection point isn't in the usual spot. It should be between the + output and R16.
I have just been doing some testing on my actual PSU. Ill report back when I make sense of it all.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on April 01, 2022, 12:00:12 pm
Ok, with a 1A load, loop gain is 0dB at 115KHz. Allowing for the phase inversion, the output lags the waveform at the top of R16 by 120°.
So I guess the stability phase margin is 60°.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on April 02, 2022, 10:29:34 am
@xavier60 Did you made any other tests with the psu ? If yes, then could you please share with us the conclusions ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on April 02, 2022, 10:39:07 am
@xavier60 Did you made any other tests with the psu ? If yes, then could you please share with us the conclusions ?
No, just the stability phase margin test. 115Khz isn't all that fast but the stability is the most important thing which is proven to be  very good.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on April 02, 2022, 02:28:28 pm
I finally ordered some electronic components and I also ordered D45H11 PNP transistor.
I think that I will receive the products on tuesday or wednesday and then I should be ready to do some tests with the new PNP driver transistor.
What tests do I need to make ? The same as before ? Testing at different loads and different output voltages, and also testing on the current limit resistor ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on April 02, 2022, 08:47:03 pm
I finally ordered some electronic components and I also ordered D45H11 PNP transistor.
I think that I will receive the products on tuesday or wednesday and then I should be ready to do some tests with the new PNP driver transistor.
What tests do I need to make ? The same as before ? Testing at different loads and different output voltages, and also testing on the current limit resistor ?
Mainly the load transient tests at various currents to check the stability. If it doesn't look right, the CV compensation will need to be altered.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on April 04, 2022, 02:19:02 am
One more question before testing: should I use my 20MHz scope (Owon SDS 1022) or my 100MHz scope (GW Instek GDS1102B) ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on April 04, 2022, 02:59:50 am
One more question before testing: should I use my 20MHz scope (Owon SDS 1022) or my 100MHz scope (GW Instek GDS1102B) ?
It doesn't matter at all. My DSO is 100MHz which I set the bandwidth limit on to 20MHz which just reduces a bit of noise sometimes, not that important.
Use the one that gives the most easiest to understand upload images where the settings can be clearly seen.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on April 05, 2022, 02:13:44 pm
I am back with the results.
I verified at 32V output, 11R load.
Yellow trace = output of the psu
Blue trace = output of the NE555.

Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on April 05, 2022, 02:21:37 pm
To me it looks like the CV compensating capacitor can be a lower value to allow faster response although it's fine the way it is.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on April 05, 2022, 02:27:49 pm
If it is fine, then I will leave the 1nF (CV) compensating capacitor unchanged, if it is possible.
I made further testing and I want to share some of the results.
1. Vout = 15V, Iout=3A, Rload=4.7R
[attach=1]
2. Vout=15V, Iout=3A, Rload=10R
[attach=2]
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on April 06, 2022, 02:21:03 am
... and a few more tests. Please have a look and tell me what you think.
1. Vout= 4.8V, Iout=3A, Rl=12 ohm: 0015, 0016
2. Vout=13V, Iout=3A, Rl=4.7 ohm: 0010
3. Vout=13.2V, Iout=1.5A, Rl=10 ohm: 0021
4. Vout= 14.79V, Iout=1.5A, Rl=10 ohm: 0022
5. Vout=3.23V, Iout=almost zero A, Rl=27R: 0029
6. Vout=3.23V, Iout=almost zero A, Rl=10R: 0032, 0033 (0033 is with BW limit enabled for CH1)

The yellow trace shows the output of the psu and the blue trace shows the output of the NE555.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on April 06, 2022, 02:24:31 pm
I also tested with the probe on the R_Shunt
1. Vout=32V, Iout=3A: 0054
2. Vout=16V, Iout=1.5A: 0052
3. Vout=about 5V, Iout=~0.5A: 0050
4. The following waveform appear on the R_Shunt resistor, when I make zoom in: 0058,0057

Please have a look and tell me what you think.

LE: I made all the tests with BW limit enabled (20MHz).
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on April 06, 2022, 09:15:23 pm
Except for the crosstalk, it all looks as expected. If CH2 is the output of the 555, why is it inverted?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on April 07, 2022, 02:27:58 am
The signal coming from output of NE555 (pin 3) was always like this.
Please find attached the schematic of the PSU load switch. It is possible that R7 to be different value but I want to share the schematic in order to see why the CH2 is inverted.
Also, why on the 0057 and 0058 screenshots I see that signal ? (marked with red arrows)
Do you have any explanation for the crosstalk ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on April 07, 2022, 07:13:46 am
I see, I had forgotten about Q3 between the 555 and Gate.
Try disconnecting the probe ground lead of CH2.
It will make CH2 waveform look worse but CH1 should be more accurate.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on April 07, 2022, 07:51:19 am
I am using a single ground clip, which is connected at the output of the psu. CH2 does not have any ground clip.
When I tested, the ground clip was connected at the psu output gnd, and the CH1 probe at the left pin of the R_shunt.
Should I try by connecting the ground clip right on the pin of R_Shunt ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on April 07, 2022, 08:21:28 am
I am using a single ground clip, which is connected at the output of the psu. CH2 does not have any ground clip.
When I tested, the ground clip was connected at the psu output gnd, and the CH1 probe at the left pin of the R_shunt.
Should I try by connecting the ground clip right on the pin of R_Shunt ?
The spike that the 2nd red arrow points to is expected, it's what the first arrow points to that I don't understand. It might even be normal.
Try disconnecting CH2 probe totally and trigger from CH1. No need to show us if it looks the same as before.
Don't change anything else.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on April 07, 2022, 01:35:33 pm
It doesn't look exactly the same as before. The first spike is somehow bigger in comparison to the first screenshot.
Please have a look at the screenshots and tell me what you think.

I triggered on the CH1, and I disconnected CH2. The points were I connected the probe were the same as before.
If I move the GND clip right to the other end of R_Shunt, then the waveform does not change, it is the same as 0059 and 0060 screenshots.

LE: Also, I think that the first spike was also present in the previous tests that I made using the Owon oscilloscope. Please have a look there: https://www.eevblog.com/forum/beginners/lm324-power-supply-with-variable-voltage-and-current/msg3587377/#msg3587377 (https://www.eevblog.com/forum/beginners/lm324-power-supply-with-variable-voltage-and-current/msg3587377/#msg3587377)
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on April 07, 2022, 08:45:10 pm
I suspect that the first spike is being caused by the output transistors being briefly turned on by their own Miller capacitance during the rapid fall of the output voltage. This is happening before the opamp is reacting which is the 2nd spike.
So this would just be normal behavior of the design.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on April 07, 2022, 09:45:55 pm
It doesn't look exactly the same as before. The first spike is somehow bigger in comparison to the first screenshot.
Please have a look at the screenshots and tell me what you think.
Notice that there is also less positive pre-shoot, likely due to different probe usage. A lot of things can affect the way DSO's display fast signals.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on April 08, 2022, 02:19:37 am
Are there any other tests that I should make ?
I would like to install the psu into a new case which I think that looks better than the wooden one, if it is possible.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on April 08, 2022, 02:49:16 am
Noting too important at this stage. Go ahead and install it.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on April 08, 2022, 03:08:04 am
Ok. I will specify that when installing the new case, I will use one older PCB for the main psu PCB. The difference between the older PCB and the one that I used for tests, is the position of the connectors for the voltage and current pots. Also, in the new case I will install the tap changer and a circuit that controls 2 fans which will cool the heat sink. I will use a toroidal transformer which has 150VA-200VA power and it is modified by me to have a 30Vac secondary with 17Vac median socket. After the modification I insulated the entire transformer using some electrical tape (this is what I had at that moment) which I don't know if it is good or not for using on transformers.

The older layout: https://www.eevblog.com/forum/beginners/lm324-power-supply-with-variable-voltage-and-current/msg3583296/#msg3583296 (https://www.eevblog.com/forum/beginners/lm324-power-supply-with-variable-voltage-and-current/msg3583296/#msg3583296) the 10M resistor from pin 2 of LM358 to the K of TL431 is now shown on the layout but it is connected in the practical circuit, also the 1k resistor between the Base and Col pads is not connected (I marked it as DNP - do not place), because I mounted it on the heat sink transistors.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on April 08, 2022, 06:22:57 am
Ok. I will specify that when installing the new case, I will use one older PCB for the main psu PCB. The difference between the older PCB and the one that I used for tests, is the position of the connectors for the voltage and current pots. Also, in the new case I will install the tap changer and a circuit that controls 2 fans which will cool the heat sink. I will use a toroidal transformer which has 150VA-200VA power and it is modified by me to have a 30Vac secondary with 17Vac median socket. After the modification I insulated the entire transformer using some electrical tape (this is what I had at that moment) which I don't know if it is good or not for using on transformers.

The older layout: https://www.eevblog.com/forum/beginners/lm324-power-supply-with-variable-voltage-and-current/msg3583296/#msg3583296 (https://www.eevblog.com/forum/beginners/lm324-power-supply-with-variable-voltage-and-current/msg3583296/#msg3583296) the 10M resistor from pin 2 of LM358 to the K of TL431 is now shown on the layout but it is connected in the practical circuit, also the 1k resistor between the Base and Col pads is not connected (I marked it as DNP - do not place), because I mounted it on the heat sink transistors.
I guess snugly wrapped PVC tape should not be a hazard on the outside of the transformer. I would like to see rubber washers used.
The insulation between primary and secondary is still original?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on April 08, 2022, 07:54:23 am
Yes, the insulation between primary and secondary is still original.
Also, I used rubber washers when I mounted the transformer into the case.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on April 08, 2022, 02:40:23 pm
Please find attached some photos of the practical PSU.
It is not finished yet.
I have to install 2 80x80 mm fans on the heat sink and a 9V power supply for the fans. The fans will be 12V fans, but I will power them at 9V (for less audible noise).
The red switch is for turning the psu on/off, the switch with on/off markings is for DC on/off. The first led (from top to bottom) is for AC on, the second and 3rd led's are the led's from the schematic and the last led is from the tap changer circuit.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on April 09, 2022, 07:54:24 am
Please find attached the photos with the fans and 9V power supply added.

Please have a look and tell me what you think.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on April 09, 2022, 09:14:06 am
That looks like very effective cooling.
Good to see 3 power transistors. It helps compensates for the thermal resistance added by the insulating washers.
What are the washers?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on April 09, 2022, 09:51:49 am
The washers are made from mica, that's all that I know about them. I don't know the thickness or other properties of the washers. I bought them a few years ago, at a very low price...
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on April 09, 2022, 10:15:16 am
Mica is good.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on April 09, 2022, 01:53:14 pm
I just tested the pcb that is installed into the case and I got the following screenshots.
The screenshots look a little bit different, is the screenshot on the R_Shunt still good (0067.png) ? it looks like the first negative spike is bigger in comparison with the other pcb. In this pcb I used another type of capacitor (for the CV capacitor), but it is also 1nF (it is not ceramic, it is polypropylene capacitor) and the main filter capacitor is 6800uF in this pcb, while in the first one was 4700uF.
The other screenshot is on the output with 32V output and 10R load.

LE: also in this circuit, a analog voltmeter was connected to the output and some of the wires were not the same length as the first circuit that I tested.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on April 09, 2022, 02:35:20 pm
I changed the 1nF capacitor (CV loop), with a blue color capacitor, also 1nF, and the LM358 with a new one and now the wave form looks like the attached screenshots. Does they still look normal ?

Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on April 09, 2022, 10:05:26 pm
To prove that the first spike is being caused by the fast fall time of the output voltage, try a 1Ω in series with the shorter.
Extra: the probe's ground lead needs to be connected close the the right side of the CS resistor.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on April 09, 2022, 11:32:21 pm
I tested with no resistor (0076.png) and with a 1 ohm resistor (0075.png) in series with the PSU shorter.
Please find the results attached. Please have a look and tell me what you think.

LE: I kept the gnd and CH1 probe in the same place on both screenshots.

LE2: Please also find attached the results when the CH1 and GND of the oscilloscope were connected right on the R_Shunt terminals: 0077.png - no resistor in series with the PSU_shorter and 0078.png - 1R resistor in series with the PSU_Shorter.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on April 10, 2022, 12:59:29 am
It seems there is a combination of 2 reasons for the first spike, Miller capacitance of the output transistors and ground wiring inductance giving exaggerated DSO readings. All nothing to worry about.
Im not too sure why the shape of the second pulse changed if the new capacitor is the same value. Because it's physically large, it might be causing more parasitic capacitance to a nearby part of the circuit.
Because there is no sign of instability, there nothing to worry about.
Just to demonstrate to yourself the significance of wiring inductance, take a DSO reading across a few centimeters of ground wire between the PSU and shorter while doing shorting tests with and without the 1Ω resistor.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on April 10, 2022, 06:07:39 am
I made a test, with the CH1 probe connected to the right side of R_Shunt and the GND probe connected to the output of the PSU (about 2-3 cm distance).
With R=1 ohm: 0085
Without R=1 ohm: 0084.
I think that now is clear that the GND have some influence in readings.

Please have a look at the screenshots and tell me what you think.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on April 10, 2022, 10:36:48 am
In those examples it would be mainly the current from the discharging output capacitor causing a voltage spike across the wire's impedance, inductance + resistance. Whatever I think is causing the spike across the CS resistor, it should not be related to the output capacitor's discharge current.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on April 10, 2022, 11:28:28 am
In the first part of the reply you are saying that the spike is from the discharge of the output capacitor, and in the second part of the reply you are saying that the spike on the CS resistor is not related to the output capacitor ?
If the spike on the CS resistor is not related to the output capacitor, then would it be related to other things ? is it still normal ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on April 10, 2022, 11:42:26 am
In the first part of the reply you are saying that the spike is from the discharge of the output capacitor, and in the second part of the reply you are saying that the spike on the CS resistor is not related to the output capacitor ?
If the spike on the CS resistor is not related to the output capacitor, then would it be related to other things ? is it still normal ?
Yes, capacitor discharge current only flows externally to the regulator PCB because it's at the output of the PCB.
None of this discharge current flows through the CS resistor.
Yes, the first spike across the CS resistor is caused by something else. One suspect is self turn on of the output transistors. I have not thought of an easy way to confirm this.
The main thing is that there is no ringing at all, meaning there are no stability problems.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on July 15, 2023, 07:14:00 am
Hello @xavier60 , when I attended your psu design, the current limit was set at about maximum 5A, but I changed it to maximum 3A.
After using the psu for a while I notified that I need a maximum of 5A, for some of the loads.
I know that I need to change the value of R8 and that I need a more powerful transformer in order to achieve the 5A output.
Also I know that I should make again some tests, with different loads at the output of the psu.
What other components do I need to change in order to have a maximum of 5A at the output ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on July 15, 2023, 07:33:57 am
Hello @xavier60 , when I attended your psu design, the current limit was set at about maximum 5A, but I changed it to maximum 3A.
After using the psu for a while I notified that I need a maximum of 5A, for some of the loads.
I know that I need to change the value of R8 and that I need a more powerful transformer in order to achieve the 5A output.
Also I know that I should make again some tests, with different loads at the output of the psu.
What other components do I need to change in order to have a maximum of 5A at the output ?
There should be no need to check the stability.
If the PSU still looks like this, https://www.eevblog.com/forum/beginners/lm324-power-supply-with-variable-voltage-and-current/msg4109188/#msg4109188 (https://www.eevblog.com/forum/beginners/lm324-power-supply-with-variable-voltage-and-current/msg4109188/#msg4109188)
I feel that it's able to safely handle well over the expected 60W of dissipation. It's difficult to know exactly. Measuring the heatsink temperature close to an output transistor might give us some idea. I'm still not certain by how much junction temperate degrades SOA.

No other changes should be needed,
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on July 15, 2023, 07:46:43 am
I have some more TIP3055 power transistors at home, and I wanted to know if 4xTIP3055 are suitable for the 5A version of the psu (initially I used 3xTIP35C) ?
If using 4x TIP3055, then should I try to make again some tests ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on July 15, 2023, 07:59:32 am
I have some more TIP3055 power transistors at home, and I wanted to know if 4xTIP3055 are suitable for the 5A version of the psu (initially I used 3xTIP35C) ?
If using 4x TIP3055, then should I try to make again some tests ?
According to this data sheet, https://www.onsemi.com/pdf/datasheet/tip3055-d.pdf (https://www.onsemi.com/pdf/datasheet/tip3055-d.pdf) , one at TC = 25°C is just enough.
So 4 of them will allow plenty of derating for higher temperature.

Title: Re: LM324 Power Supply with variable voltage and current
Post by: Kleinstein on July 15, 2023, 08:13:15 am
The TIP3055 is a bit weaker than the TIP35. So the change may not give much more power. The limiting point is likely the SOA curve. It allows for some 2 A at 40 V and close to 1 A at 50 V if at 25 C. The problem is that a higher temperature has a similar effect as a high voltage. At 60 C for the transistor may only work reliably up to 30-40 V. So 5 A from 4 x TIP3055 may be boarderline. It depends on the transformer voltage and heat sinking.
For high power like 5 A it is really worth considering transformer tap switching or similar. This mainly helps with the heat sink, but can still be a big plus.

Speed wise the transistors are about the same and thus no real need for extended tests of the stability. A short test, e.g. compare the transient response or a difficult scenario may still be useful.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on July 15, 2023, 08:17:46 am
Im assuming that the PSU is still using tap switching. The data sheet does have the info for calculating the SOA/temperature derating.
Im still trying to make sense of it.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on July 15, 2023, 09:31:08 am
1.25A per transistor X 15V = 18.75W
Data sheet says, Thermal Resistance Junction−to−Case RJC ~1.4 °C/W. Allowed junction temperature, 150°C.
150°C - 18.75w X 1.4 °C/W = 123.75°C, maximum allowable TC.
Assuming 1°C/W for the mica washer, maximum allowable heatsink temperature is 123.75°C - 18.75w x 1°C/W = 105°C.
This agrees closely with the 0.72W/°C above 25°C derating spec.
123.75°C - 25°C X 0.72W/°C = 71.1W derate from 90W leaves 18.9W
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on July 15, 2023, 09:47:52 am
Yes, the PSU is still using tap switching.

Then the maximum allowed power dissipation for 1x TIP3055 is 18.9W ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on July 15, 2023, 09:53:51 am
Yes, the PSU is still using tap switching.

Then the maximum allowed power dissipation for 1x TIP3055 is 18.9W ?
The maximum expected dissipation is 18.9W for each.
This allows maximum heatsink temperature of 105°C, which is very unlikely while the fans are working.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on July 15, 2023, 09:57:52 am
This allows maximum heatsink temperature of 105°C, which is very unlikely while the fans are working.
This mean that if the heatsink is cooler than 105°C then the power dissipation could be higher than 18.9W ?
Yes, the fans will be controller by a sensor circuit, that will make them spin faster is the temperature is high.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on July 15, 2023, 10:08:46 am
This allows maximum heatsink temperature of 105°C, which is very unlikely while the fans are working.
This mean that if the heatsink is cooler than 105°C then the power dissipation could be higher than 18.9W ?
Yes. keep in mind that there are variables that might not exactly match what I used in my calculations. For example, I used 15V worst case. It may be a bit higher with the new transformer. And temperature is very difficult to measure properly. For example, heatsink temperature should be measured by a probe buried in the metal just under a mica washer.
Im certain that it will all be safe.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on July 15, 2023, 10:29:21 am
The stress on the driver transistor is more difficult to calculate because the current is unknown.
I automatically always use a D45H11.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on July 15, 2023, 10:35:46 am
I am also using D45H11.
I made a few tests, just to see the response.
1. 010-011.png
Vout=32.79V
Imax=5.2A
Rload=5.7R

2. 012-013.png
Vout=32.79V
Imax=5.2A
Rload=6.7R

3. 014.png
Vout=32.79V
Imax=5.2A
Rload=0R

4. 015-016.png (the probe was connected on the pins of R18)
Vout=32.79V
Imax=5.2A
Rload=0R
Title: Re: LM324 Power Supply with variable voltage and current
Post by: Kleinstein on July 15, 2023, 10:42:00 am
With tap switching one would not have to worry that much about the heat sink temperature. Still 15 V are a bit optimistic: the older posts suggest 40 and 20 V for the input steps. So the worst case voltage drop is more like a little more than 20 V (like 25 V to have reserve for the drop on relay switching).
There is still the short time peak before the relay actually switches. So the transistors would also have to be good for 40 V for some 10 ms or so.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on July 15, 2023, 11:26:31 am
Response looks normal.

1. 010-011.png
Vout=32.79V
Imax=5.2A
Rload=5.7R,
 should have caused current limiting.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on July 15, 2023, 11:28:28 am
should have caused current limiting.
Yes, this is true, the red led was blinking. But on the oscilloscope it appeared as a normal response.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on July 15, 2023, 11:29:31 am
With tap switching one would not have to worry that much about the heat sink temperature. Still 15 V are a bit optimistic: the older posts suggest 40 and 20 V for the input steps. So the worst case voltage drop is more like a little more than 20 V (like 25 V to have reserve for the drop on relay switching).
There is still the short time peak before the relay actually switches. So the transistors would also have to be good for 40 V for some 10 ms or so.
If the 0.72W/°C above 25°C derating spec also applies to pulse loads, there is still plenty of safe margin.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on July 15, 2023, 11:37:01 am
With tap switching one would not have to worry that much about the heat sink temperature. Still 15 V are a bit optimistic: the older posts suggest 40 and 20 V for the input steps. So the worst case voltage drop is more like a little more than 20 V (like 25 V to have reserve for the drop on relay switching).
There is still the short time peak before the relay actually switches. So the transistors would also have to be good for 40 V for some 10 ms or so.
If the 0.72W/°C above 25°C derating spec also applies to pulse loads, there is still plenty of safe margin.
Not so certain now. I think I have been misreading the SOA chart.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on July 15, 2023, 12:10:23 pm
The way I see it now, to safely handle 5A at 40V for 10mS, TC should be under 67°C
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on July 15, 2023, 01:55:10 pm
Are you trying to say that I should better use TIP35 ?
Are there any alternatives for the TIP35 ?

I am not sure what temperature would TIP3055 have because the heatsink is limited as dimensions in order to fit on the back of the psu case. The dimensions of the heatsink are h=80mm, L=165mm, fins are 35mm and it has 14 fins. I will mount 2x 80x80x25mm fans on the heatsink and I will power them from a fan controller which will use a sensor to control the speed of the fans.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: Kleinstein on July 15, 2023, 02:36:44 pm
With tap switching (20/40V input) the TIP3055 should be OK. There are alternatives, but most of them are more expensive unless you get a special offer (hopefully still the correct parts).
If in doubt 1 more transistor may be easier than a larger heat sink or more expensive transistors.  With a fan the heat sink should be large enough.

The SOA is anyway a parameter that is usually not individually tested for the cheaper BJTs (there are premium audio parts that are tested).
On the other side having the SOA from sample testing usually means that most parts are actually better than the specs as they have to add some safty margin for scattering.
So to be on the safe side one should do a worst case (maybe even shift the switching threshold a little to get worse than normal) test before using the supply with any sensitive load.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on July 15, 2023, 03:03:09 pm
Yes, add one more TIP3055 if possible.
This SOA vulnerability could be even worse in my own PSU with only 2 TIP35C. But so far no blown output transistors. The only problem so far has been a blown LM317 while powering an ignition circuit.
A PSU is at its most vulnerable from SOA break down  when the output is shorted while it's already working is a state that cause a high temperature rise of the output transistors.

Also while the high voltage tap is selected.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on July 15, 2023, 03:14:17 pm
4 TIP35 will be much better than the 4 TIP3055.
Are TIP35 difficult to get?
In the mean time, you could try to measure the heatsink temperature. I do it by putting thermal grease down an empty screw hole close to a transistor, then placing a thermocouple probe into the hole.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on July 15, 2023, 03:35:34 pm
I added one more TIP3055. Now the psu have 5xTIP3055.
I also made some tests with 5x TIP3055, I post the results:
1. 017.png With the probe on R_Shunt, Vout=32.79V, Imax=Iout=5.2A
2. 018.png With the probe on output of the psu, Vout=32.79, Iout=Imax=5.2A
3. 019,020.png With the probe on the output, Vout=32.79V, Imax=5.2A, Rload=6.7R

Edit: the TIP35 are not as cheap as TIP3055, and I have in my workshop more TIP3055 than TIP35, this was the reason that I choose TIP3055.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on July 15, 2023, 03:41:48 pm
That all looks normal.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: Terry Bites on July 15, 2023, 03:48:43 pm
congratulations. I think you have one of the highest responses to your post ever.
We all love a 324, oh yeah!
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on July 16, 2023, 07:47:07 am
@xavier60 , are the protection diodes on the output and on the power transistors enough if they are only 3A diodes ? (1N5408) ?
Should I change them to 6A diodes ? P600 or 6A6 diodes ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on July 16, 2023, 08:12:28 am
The diode across the output transistors has to be able to charge the reservoir capacitors if a large battery is correctly connected to the PSU while not being powered by the mains. 1N5408 is specified to handle 200A for 8.3mS which should be more than enough unless your reservoir capacitors are very large.
What are you expecting the diode across the output to protect against?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on July 16, 2023, 08:22:45 am
What are you expecting the diode across the output to protect against?
For example if I power a motor, to protect against back emf.

I removed the old 1N5408 and I put 6A6 (at the output) and P600k (on the power transistors).
I made a few tests:
1. 036.png - with the probe on the output of the psu, Vout=32.8V, I=5.2A=Imax
2. 039.png - with the probe on the R_Shunt, Vout=32.8V, I=5.2A=Imax
3. 041, 043 - with the probe on the output of the psu, Vout=32.8V, Imax=5.2A, Rload=6.7R
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on July 16, 2023, 08:38:46 am
What are you expecting the diode across the output to protect against?
For example if I power a motor, to protect against back emf.
Personally, I don't think that motor back EMF can damage a typical PSU. In any case, putting an 1N5408 across the output won't hurt anything unless a large battery is connected the wrong way to the PSU. The diode will pass a high current, causing the output leads to likely melt.
Current sourcing PSUs can actually briefly tolerate reverse polarity applied to the output. I have purposely connected a 12V lead acid battery the wrong way to my PSU for 1 second. It survived ok. Although it's very stressful for the output transistors and output capacitor.
I think the main reason PSUs have the diode across the output is in case PSUs are connected in series. If there is an overload, the diode will prevent more than a small amount of reverse polarity being applied to the weaker PSU.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on July 16, 2023, 09:13:14 am
Is necessary testing again the psu if changing the diodes ? from 3A to 6A diodes ?
Or, should I leave the 3A diodes into the circuit ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on July 16, 2023, 09:23:08 am
Is there any point in testing again the psu if changing the diodes ?
No, the diodes dont affect stability. What sort motors do you test?
The 3A diodes will be fine.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on July 16, 2023, 09:41:46 am
For now, I will test only 12V and 24V fans (1-2W power).
But I don't know what types of motor I will test in the future.

Edit: Probably I will power some pcb drill motors which are bigger than the fan motors.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on July 16, 2023, 01:34:25 pm
I will power some pcb drill motors
For example I have a 12V/45W pcb drill and I will power it from this psu.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on July 22, 2023, 05:25:06 am
Is there any difference in using 0.22 \$\Omega\$ /5W resistors connected in E of the TIP3055 transisors instead of 0.1  \$\Omega\$ /5W resistors ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on July 22, 2023, 06:20:41 am
Higher resistance improves current sharing. No problem so long as the dissipation is reasonable and the resistors are all the same value as each other.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on December 12, 2023, 04:27:36 pm
Hello @xavier60, the power supply is working OK, but I wanted to make the green led to be more bright, so I modified R30 and R31 from 2.2k to 1k each. This means that the red led will also be more bright, but this is not a problem.
Do I need to remake all the tests because of this modification ?

edit: I measured the voltage across R30 and R31 and it looks like: V(R30) = 5.247V and the current through R30 is 0.0052A=5.2mA (this happens when red led is on and green led is off) and V(R31)=2.911V and the current through R31 is 0.0029A=2.9mA (this happens when red led is off and green led is on).
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on December 12, 2023, 07:07:01 pm
Hello @xavier60, the power supply is working OK, but I wanted to make the green led to be more bright, so I modified R30 and R31 from 2.2k to 1k each. This means that the red led will also be more bright, but this is not a problem.
Do I need to remake all the tests because of this modification ?
The CV and CC opamps will be sinking more current. You will need to calculate how close it is the maximum rating.
Repost the schematic for now.  It would have been better to find brighter LEDs.

Edit: You also need to include the current through the pull-up resistor.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on December 12, 2023, 07:10:45 pm
Schematic attached.
I could find brighter leds.

I am still searching for the schematic which contains the driver (D45H11) and power transistors (5xTIP35CW in this particular schematic).

edit: I will use some brighter LED's and I will replace R30 and R31 by 2k2. The 2k2 value is the one used until now. Please find below the link to the modification of the value of R30 and R31:
https://www.eevblog.com/forum/beginners/lm324-power-supply-with-variable-voltage-and-current/msg3728311/#msg3728311 (https://www.eevblog.com/forum/beginners/lm324-power-supply-with-variable-voltage-and-current/msg3728311/#msg3728311)
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on December 12, 2023, 07:31:10 pm
Adding 0.5mA for R7 totals 5.7mA which is within spec for a TI part which can be as low as 10mA output sinking.
I still don't like it.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on December 12, 2023, 07:39:02 pm
Then what is your recomendation ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on December 12, 2023, 07:53:34 pm
Then what is your recomendation ?
Find brighter LEDs. All modern LEDs will be much brighter than what you have. Im using cheap 3mm LEDs I got on ebay with 10K resistors.
The PSU should be ok to use so long as it's regulating properly. To be certain, you need to confirm that both opamps are able to pull the Base
of Q1 well below cutoff. Not a simple test. 
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on December 12, 2023, 08:29:25 pm
If your PSU has R41 fitted, it should allow the CC setting to go below zero which will make the CC LED light up with no output load and the CC pot set to minimum.
If this is the case, this is when the Base voltage of Q1 can be checked for cutoff.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on December 12, 2023, 08:55:10 pm
I modified R30 and R31 to 10k, and I used 5mm high brightess led's. The PSU has R41 fitted.
Look what I found on the oscilloscope:
I don't know why there is that waveform (the yellow channel). The blue channel is the output signal from the PSU testing circuit (psu shorter).
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on December 12, 2023, 09:11:55 pm
That is odd. Try doing the test with the ground lead for CH2 disconnected.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on December 12, 2023, 09:29:26 pm
It happened after replacing de R30 and R31 by 10k resistors and after installing the brighter led's.
So I suspect that something does not work because of the replaced components.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on December 12, 2023, 09:33:37 pm
It happened after replacing de R30 and R31 by 10k resistors and after installing the brighter led's.
So I suspect that something does not work because of the replaced components.
I dont see why, one way to prove it, put it all back the way it was.
Very long wiring could possibly cause that affect.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on December 12, 2023, 10:02:07 pm
I did a test on mine at 10V and 2A with the TLC072 replaced by an LM358. I got a nice clean voltage dip of the expected shape measured directly at the PSU's output terminals.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on December 13, 2023, 02:52:26 pm
I replaced R30 and R31 by 2k2 as it was initially.
Now the waveform looks ok.
What should I do next ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on December 13, 2023, 03:08:28 pm
I replaced R30 and R31 by 2k2 as it was initially.
Now the waveform looks ok.
What should I do next ?
Im not really sure. I have not been able to reproduce the same problem here.
You could just leave it like that or ate the LEDs too bright now?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on December 13, 2023, 03:20:07 pm
Now the led's are too bright (currently they are high brighness led's), but I will replace them by normal led's, and their brightness will be ok.

Later edit: I changed the led's to normal led's and they are not too bright now.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on December 13, 2023, 04:55:52 pm
I remember that the PSU worked on my project when I first built it. Why it isn't work correctly anymore ?
I replaced: the bridge rectifier, the power transistors, the 10k (R30 and R31) resistors, the 2 led's (green and red), the load which I used at the load switcher.

Edit: If I remove the red and the green led, then the response looks almost normal.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on December 13, 2023, 05:08:53 pm
Are there other problems than the mis-shaped load transient pulse?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on December 13, 2023, 05:13:50 pm
Are there other problems than the mis-shaped load transient pulse?
Until now, no.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on December 13, 2023, 10:37:49 pm
Is it only the presence of the CV LED that distorts the pulse shape? The opamp's supply rail should be checked.
Edit:
Try another opamp if not done already.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on December 14, 2023, 03:28:03 am
This is the opamp supply waveform (from pin 4 to pin 8 ).
I tried another opamp, the result is the same as before.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on December 14, 2023, 03:35:41 am
I think that's normal.
Check the output of the CV and CC opamps. The output of the CC opamp should be always pinned high.
The output of the CV opamp should look the same as the Base of Q1. Show one of them if the same.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on December 14, 2023, 03:42:06 am
Connect CH1 ground clip to the output side of the CS resistor. Don't connect CH2 ground to anything.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on December 14, 2023, 03:46:58 am
I connected CH1 ground to the output side of CS resistor.
1. on pin 1: 231_000.jpg
2. on pin 7 231_001.jpg
3. on B of Q1 231_002.jpg
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on December 14, 2023, 03:59:54 am
001 appears to be the Emitter of Q1 but that's ok.
I can't see anything unusual at that time base. Expand the the + transition at center screen.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on December 14, 2023, 04:07:32 am
The base of Q1.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on December 14, 2023, 04:19:14 am
I see you do show it. The distortion is visable there, I dont know why.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on December 14, 2023, 04:50:44 am
What should I do next ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on December 14, 2023, 05:16:46 am
I tried another pcb and the same waveform appeared on the oscilloscope .
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on December 14, 2023, 07:00:26 am
I tried another pcb and the same waveform appeared on the oscilloscope .
With mine, there is no overshoot at the output of the CV opamp. It seems that your compensation is no longer suitable for some reason.
What are the current values for your CV compensation RC?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on December 14, 2023, 02:36:42 pm
R5=4k7 and C3=1nF.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on December 14, 2023, 04:57:03 pm
I made a test and I found that only the green led is making problems, in constant voltage mode and by using the electronic load with a resistor of 7.8R. If I connect it, then that strange response appeares, but if I leave the green led disconnected then the response look normal. I checked this using 2 pcb's, and the same problem appeared.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on December 14, 2023, 05:05:32 pm
R5=4k7 and C3=1nF.
That should already be making it slow enough. You could try going a bit smaller with the resistor   and larger with the capacitor to see what it does.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on December 14, 2023, 05:39:41 pm
I tried with 3.9K and then I changed the capacitor to a new one (also 1nF) but the waveform looks the same.

How can I calculate of How can I check if it is safe for the 358 if I use R30=R31=2k2 ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on December 14, 2023, 05:55:01 pm
This could be a waste of time, try decreasing R7 from 10K to 4.7K
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on December 14, 2023, 06:28:37 pm
With R7=4k7.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on December 14, 2023, 06:30:32 pm
Is that with the LED connected also?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on December 14, 2023, 06:32:35 pm
Yes both led's are connected. I used a 3mm green led and a 3mm red led.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on December 14, 2023, 06:42:52 pm
Well, that's a nice response then. Hope it stays that way.
To calculate the maximum opamp current, we first need to have some idea of the lowest possible output voltage, say 1V.
 LED current is  (7V - LED voltage) divided by R30 or R31. Add 1.5mA for R7.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on December 14, 2023, 06:57:05 pm
Ok, the voltage on the led is 2.25V.
(7-2.25)/10k=0.475mA
The total maximum current = 1.5mA (the current throug R7)+0.475 (current through led)=1.945mA.

What tests should I do after modifying the R7 value ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on December 14, 2023, 07:00:52 pm
Ok, the voltage on the led is 2.25V.
(7-2.25)/10k=0.475mA
The total maximum current = 1.5mA (the current throug R7)+0.475 (current through led)=1.945mA.

What tests should I do after modifying the R7 value ?
You could change R5 back to 4.7K and check the response again.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on December 14, 2023, 07:13:07 pm
The R5 was already 4k7 in my previous post and screenshot.
The below screenshot is with 5mm regular red led and 5mm regular green led.
[attach=1]

The 5mm regular led are not sufficiently bright and I will probably use the 3mm led's which are brighter.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on December 15, 2023, 03:24:35 am
Do I need to do any other test, using different load resistance, to check the stability ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on December 15, 2023, 03:26:31 am
Do I need to do any other test, using different load resistance, to check the stability ?
You could do that.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on December 15, 2023, 04:00:48 am
1. Vout= 32.8V, Rload=6.7R: 000.jpg
2. Vout=32.8V, Rl=10R: 001.jpg
3. Vout=15.2V, Rl=10R: 002, Rl=8.45R: 003, Rl=5R: 004
4. Vout=2V, Rl=5R: 005, Rl=0.66R, Rl=006

Please have a look and tell me what you think.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on December 15, 2023, 05:02:14 am
That all looks normal, no signs of instability.
In future, no need to post all of the traces if they look good.

When a high load is suddenly applied causing the output of the CV opamp to immediately step up by a volt or so, some current briefly flows through the compensation RC, causing a brief current decrease through D1 so increasing its dynamic resistance. The increase in total compensation resistance would have been the cause of the brief instability near the start of the load transient pulse.
Decreasing R7 maintains higher current through D1.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on December 16, 2023, 04:19:09 pm
This is with 0.5 ohm load and 2.5V output, it is still normal ?  I am asking because of the voltage drop, which is 2.5V, which is equal to the output voltage.
The maximum output current set to 5.18A.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on December 16, 2023, 07:59:39 pm
I did a quick test on mine and got a 500mV dip. My lead lengths are longer than they should be for the test.
Your build turned out to have a much slower response than mine, I don't think it fully explains your result.
It didn't drop that much in previous tests.
You could take a look at the opamp outputs to see what's happening.
Dont use AC coupling on your DSO when it's not needed.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on December 16, 2023, 08:21:11 pm
I did the test again, this time I connected the oscilloscope probe (yellow trace) to the pins of the 47uF capacitor, C2.
244_000 = output of the PSU
244_001 = pin 7 of LM358
244_002 = pin 1 of LM358
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on December 16, 2023, 08:30:30 pm
Now that's close to what I would expect.
It also shows that in practice PSUs don't need to be super fast when the response can be degraded so much by typical lead lengths used on the bench.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on December 17, 2023, 11:32:10 am
Please have a look at the attached screenshots.
That oscillation has conection with the moment when the load is changing from off to on ? It is normal ?
I tested at Vout=2.5V, Rload=10R.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on December 17, 2023, 08:47:32 pm
It looks like ringing in the external wiring.
What is odd, why does the voltage on CH2 drop before on CH1?

Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on December 17, 2023, 09:20:36 pm
CH2 is the waveform on the output of NE555, I think that probably it is normal because CH2 needs to drop first then CH1...
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on December 17, 2023, 09:50:27 pm
So it's the output transition of the 555 ringing the capacitance of the MOSFET and wiring inductance. Is there more ringing at the Drain of the MOSFET?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on December 18, 2023, 03:39:58 am
Yes it is more ringing at the drain of the mosfet. The mosfet is a 2SK1257.
Blue channel = output of NE555
Yellow channel = drain of the mosfet.

This means that the wiring damp the oscillation at the Drain of the mosfet ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on December 18, 2023, 05:18:46 pm
What should I do now ?
Is ringing normal ?
Please have a look at the previous post and tell me what you think ...
Title: Re: LM324 Power Supply with variable voltage and current
Post by: iMo on December 18, 2023, 05:46:34 pm
There is an npn transistor between the power mosfet and the 555, afaik..
Also the frequency of the ringing is aprox 15MHz.. That might come from leads inductance..
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on December 18, 2023, 06:48:45 pm
What should I do now ?
Is ringing normal ?
Please have a look at the previous post and tell me what you think ...
That ringing is normal and external to the PSU.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on December 19, 2023, 06:19:23 am
The stimulus for the ringing could be actually originating from the NE555 itself. Try putting a resistor in series with the CH2 probe tip, between 1K and 10K.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on December 19, 2023, 03:47:48 pm
Please find attached the screenshot when I used a 4.7k resistor between the pin 3 of NE555 and the tip of CH2 probe (blue trace).
The yellow trace is the output of the PSU, Vout=2.5V, Rload = 10R.

It looks like the ringing almost disappeared.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on December 19, 2023, 08:19:10 pm
That's much cleaner.
Edit: probes should usually be set to X10.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on December 19, 2023, 09:04:01 pm
Edit: probes should usually be set to X10.
Yes, they were set to X10.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: p.larner on December 20, 2023, 11:02:25 pm
hope there will be a schematic+pcb artwork released for this when sorted!.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on December 20, 2023, 11:47:20 pm
hope there will be a schematic+pcb artwork released for this when sorted!.
My build of the design has been working well for years.
https://www.eevblog.com/forum/beginners/lm324-power-supply-with-variable-voltage-and-current/msg3582664/#msg3582664 (https://www.eevblog.com/forum/beginners/lm324-power-supply-with-variable-voltage-and-current/msg3582664/#msg3582664)
My PCB files are Protel 98. I suspect that mike_mike's is Kicad which I'm sure he will share.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on December 21, 2023, 03:22:12 am
Please find attached the kicad files.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on December 24, 2023, 10:12:50 pm
Please find attached the kicad files.
You should also include the output stage in the schematic. Use the same reference numbers as used in mine.
https://www.eevblog.com/forum/beginners/lm324-power-supply-with-variable-voltage-and-current/msg3582664/#msg3582664 (https://www.eevblog.com/forum/beginners/lm324-power-supply-with-variable-voltage-and-current/msg3582664/#msg3582664)
Title: Re: LM324 Power Supply with variable voltage and current
Post by: p.larner on December 25, 2023, 03:57:09 am
thank you for the download merry xmas.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on December 25, 2023, 08:32:59 pm
And the transformer tap switcher files.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on December 26, 2023, 01:55:22 am
A word about the Emitter sharing resistors, R14 and R15. Although I have used 50mΩ, 100mΩ resistors should be used unless Q3 qnd Q4 are very well matched as mine happen to be.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on December 26, 2023, 05:40:28 am
So if I use 5 transistors, should I also use 0.1R emitter sharing resistors instead of 0.22R resistors ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on December 26, 2023, 06:20:11 am
So if I use 5 transistors, should I also use 0.1R emitter sharing resistors instead of 0.22R resistors ?
No.
Using that many transistors is usually for SOA reasons to get the current per transistor down. So, voltage loss becomes less of a concern.
The trade-off is, good sharing against voltage loss.
You can calculate the voltage loss, also measure the voltage across each resistor to check the sharing.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on December 26, 2023, 06:28:27 am
What is your maximum current? I should have asked.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on December 26, 2023, 06:41:22 am
The maximum current is 5A (I mean the output current of the PSU).
I used 5 transistors, so the current through each should be 1A. So 1A*0.22R = 0.22V across each resistor.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on December 26, 2023, 06:47:00 am
The maximum current is 5A (I mean the output current of the PSU).
I used 5 transistors, so the current through each should be 1A. So 1A*0.22R = 0.22V across each resistor.
Not a problem, leave it as is.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: dennislewis on February 20, 2024, 01:47:08 pm
I want to say thanks for the time and effort put into this project. The sharing of ideas was helpful.

mike_mike the pcb looks nice.

Did any others build this and/or have comments on the project ?


Title: Re: LM324 Power Supply with variable voltage and current
Post by: dennislewis on February 25, 2024, 12:47:35 am
Would you be so kind as to identify the components labeled R34 & R37 100mA with part number and mfg ?

Thanks
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on February 25, 2024, 12:58:01 am
Would you be so kind as to identify the components labeled R34 & R37 100mA with part number and mfg ?

Thanks
They are a 100mA Polyswitch such as RXEF010.
Added: A blue LED should work fine in place of the white LED.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on April 05, 2024, 03:15:04 am
I tested again with another scope (unit UTD2052CEX+) and the output of the power supply looks like this now (see the attached screenshots).
It is normally to look like this or there are some problems ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on April 05, 2024, 03:30:25 am
The effect might be caused by long wires. Is the probe connected directly to the PSU's output terminals?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on April 05, 2024, 01:26:41 pm
Yes, the probe is connected to the PSU's output terminals.
I checked second time, using another PCB. Please have a look at the screenshots. I think that it is better now.
I had a problem with the PSU before the screenshots from my previous reply, because I accidentally connected a 12V/1A PSU to the output GND of my PSU and I think that I damaged some components.

EDIT: It looks like previous screenshots, I compared it with the wrong screenshot.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on April 05, 2024, 02:22:36 pm
Ok, all good then. It was looking like the problem that was caused by R7 when it was 10K.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on April 05, 2024, 08:42:51 pm
The damaged component from one of the PCB's was the C2 capacitor (47uF), the output capacitor. I replaced it with a new one and the response looks like the attached screenshot.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: ejd.pol on April 08, 2024, 09:15:14 am
Hello,

I stumbled on this thread by accident, and it fits perfectly with some vague plans I have to build a micro-controlled PSU.
This means that (eventually) i would like to make some changes, but to prepare for that, I want to understand the design.
So, I started from the Kicad files posted recently by Mike_mike (many thanks for that!), and first rearranged the schematics
with the purpose to make it simpler to follow the flow of how it operates, and so give a better overview.
In particular, the two opamps now point from left to right, reducing the number of wires going the wrong way.
This makes the schematics more tidy. See for yourself in the attached screenshot. (I have preserved the component designators.)

I like the simplicity of the CV/CC controls, and I will certainly keep the shutdown connections.
Admittedly, I have made a first change: replacing the TL431 reference by a REF02.
This change is not because of the accuracy: in a later step, the two pots will be replaced by DACs,
such that a micro can control the voltage and current settings. The PSU can then be calibrated in software.
The change is intended to increase stability of the output voltage over temperature and age.
It may be necessary to raise the 8V supply by a few volts to accommodate the new reference.

At this point I have the following questions regarding the design, I hope you can help to answer them.
(I have learned a lot from scanning the previous 47 pages of posts, but may have missed an answer or two.)

1) In the local feedback loop of U1b (CV output), R5 (4k7) is connected so at to include D1 in the loop.
   Why is D1 included in the local feedback loop? (Alternatively, R5 could be connected to the output of U1b.)
2) What is the purpose of R7A1 (10k)? (And why does it have an unusual designator?)
3) What is the purpose of R10? Especially when Q1 starts drawing current (depending on the power stage),
   it causes the reference for Q1 (emitter voltage) to rise, making life more difficult for the opamps.
4) What is the purpose of R41 (10M)?

In the new schematics, I have drawn boxes around subsections of the circuit that are interesting for playing around with.
The box around the reference and the two pots is clear: this is where the microcontroller should hook into.
(I don't trust a micro to control the pass stage directly; too many uncertainties.
But it is good for controlling the setpoints, sensing user controls (except shutdown), and displaying information.)

There is also a box around the resistor divider providing the feedback signal for CV control.
It may be advantageous to use special resistors to match the stability of the reference and pots (or DACs).
Also here, accuracy is less of a concern.

Finally, I have drawn a box around the pass-transistor stage and its driver.
The pass stage should behave like a PNP transistor. In case I understand the CV/CC control loop well enough,
connecting a power PNP transistor (2955 or so) to the three terminals should produce a working PSU. (Is that correct?)
To increase output power, it is then possible to hook up instead a Sziklai pair consisting of a smaller PNP
that drives one (or multiple) larger NPN power transistors to do the heavy lifting.
But the behavior of the attached circuit should resemble the behavior of a PNP transistor
(The emitter sinks current, the base and collector source current. This is why I have relabeled
the connection terminals to indicate their function according to the single PNP transistor configuration.)

So far, so good (I hope), and all feedback is highly appreciated: comments, corrections, and suggestions.
In case there is any interest in the new schematic and/or planned modifications, I can post the Kicad files as well.

Kind regards, Evert-Jan
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on April 08, 2024, 11:18:17 am


1) In the local feedback loop of U1b (CV output), R5 (4k7) is connected so at to include D1 in the loop.
   Why is D1 included in the local feedback loop? (Alternatively, R5 could be connected to the output of U1b.)
That greatly reduces voltage overshoot when the PSU transitions from CC to CV mode. Short discussion here. 
https://www.eevblog.com/forum/projects/oscillation-in-psu-simulation/msg3023338/#msg3023338 (https://www.eevblog.com/forum/projects/oscillation-in-psu-simulation/msg3023338/#msg3023338)
Quote
2) What is the purpose of R7A1 (10k)? (And why does it have an unusual designator?)
Depending on the type of opamp used and at what supply voltage it loses control of its output, R7A1 is there to help prevent Q1 from being turned on during power down due to loss of mains power and causing a voltage spike at the PSU's output. It may not be needed.
The purpose of the LED is also to prevent power down spikes as well as allowing the opamps to completely turn off Q1. Although I haven't tested it, the LED could be replaced by a TL431.
The unusual designator, because it was an afterthought that wasn't tidied up.
Quote
3) What is the purpose of R10? Especially when Q1 starts drawing current (depending on the power stage),
   it causes the reference for Q1 (emitter voltage) to rise, making life more difficult for the opamps.
The path from the Base of Q1 to the PSU's output is a transconductance amplifier, Voltage signal in, current out. R10 sets the gm or gain of the output stage. The gain needs to be high enough to keep Q1's current low. Too much gain could cause instability, especially with having a sluggish Sziklai pair in the signal path.
Quote
4) What is the purpose of R41 (10M)?
It applies some positive bias to the inverting input of the CC opamp, ensuring the CC can be set to zero.

Keep in mind that loads placed on the 8V that return current to ground, the right-hand side of the CS resistor R18, will be measured.
 This is ok if the current is low and not fluctuating.
Otherwise, a separate control supply will be needed.
I used the TLC072 in my build of the design, now superseded.
The pass element needs to be high gain PNP such as a Sziklai pair or Darlington. I have not tested a Darlington.
With my build, the output is turned on and off via the Shutdown input. Using this method causes such an abrupt turn on, the charge up of the output capacitor causes brief current limiting, followed by a small voltage overshoot.
A better controlled turn on could be achieved by enabling and disabling the reference.

I'll go over your post again.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: ejd.pol on April 08, 2024, 07:47:58 pm
Many thanks for your answers! They greatly help to improve my understanding of the design.
Also the remark about the current being included is definitely something to keep in mind.
Apart from the change of the TL431 to the REF02, the designs should be the same.
Do you see any disadvantage in increasing the 8V supply to 10V?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on April 09, 2024, 12:04:57 am
Many thanks for your answers! They greatly help to improve my understanding of the design.
Also the remark about the current being included is definitely something to keep in mind.
Apart from the change of the TL431 to the REF02, the designs should be the same.
Do you see any disadvantage in increasing the 8V supply to 10V?
Increasing to 10V will increase the current limiting response time to sudden overloads. It will need to be tested but may not be a problem.
It can be dealt with in 2 ways. A faster opamp. The TLV9162IDGKR replaces the TLC072.
Also, by raising the operating voltage of Q1's Base. Presently, it is being set by the convenient ~2.7V drop of a blue or white LED.

Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on April 10, 2024, 04:10:55 am
@xavier60 , I would like to ask a question: I need to use the tap changer circuit for another power supply. For example, a LM317 power supply or a LM723 power supply (0-30V/ 0-3A - schematic attached).
What are the modifications that I need to do on the tap changer schematic (schematic attached) ?
I will also remove the DC off switch, I only need the tap changing part of the schematic.
Should I first connect J1 to J2 ? (in1 and in2 are connected to the PSU output)
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on April 10, 2024, 04:31:01 am
@xavier60 , I would like to ask a question: I need to use the tap changer circuit for another power supply. For example, a LM317 power supply or a LM723 power supply (0-30V/ 0-3A - schematic attached).
What are the modifications that I need to do on the tap changer schematic (schematic attached) ?
I will also remove the DC off switch, I only need the tap changing part of the schematic.
Should I first connect J1 to J2 ? (in1 and in2 are connected to the PSU output)
Yes, connect J1 to J2. It should work normally.
BTW, the design that has the LM723 is a Harrison type.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on April 13, 2024, 10:52:13 am
Regarding the schematic at reply #1182, I mounted 4 x TIP35C instead of 2XBD911. I also wanted to use a higher power driver transistor instead of BD139. I chose TIP41C, and I got the attached screenshot on the oscilloscope:
[attach=2]

Also, if I replaced BD139 by BD241C, I got the attached screenshot:
[attach=1]

The load was 11R at 34.11V output voltage, and the current potentiometer was at maximum.
Do I need a higher speed driver transistor ?

I mean that in the first screenshot the recovery is very slow while in the second screenshot (the one with BD241C) the recovery has some damped oscillation but it recover faster.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on April 13, 2024, 11:06:40 am
Regarding the schematic at reply #1182, I mounted 4 x TIP35C instead of 2XBD911. I also wanted to use a higher power driver transistor instead of BD139. I chose TIP41C, and I got the attached screenshot on the oscilloscope:
(Attachment Link)

Also, if I replaced BD139 by BD241C, I got the attached screenshot:
(Attachment Link)

The load was 11R at 34.11V output voltage, and the current potentiometer was at maximum.
Do I need a higher speed driver transistor ?
I dont understand what's happening in the first test so put it back to what gives the second result where it seems to need compensation adjustment. First try replacing C10 with a 10K and 1nF in series.
EDIT: Start with the condition that has the ringing.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on April 13, 2024, 11:40:02 am
EDIT: Start with the condition that has the ringing.
Ok, the condition that has the ringing is the one that uses BD241C as driver transistor.
I tested in the same condition as above, but with 10k in series with 1n, instead of C10. The result is attached.

I forgot to mention, my schematic is modified.
The modifications are:
1. U2 is TL082
2. R23 = 1 ohm
3. R5 =10k
4. instead of P2 (rectifier), I have a power supply which has 7812 and 1912.
5. RV1 is 50k
6. I use 4xTIP35C instead of 2xBD911
7. I use BD241C as driver instead of BD139.

The schematic is from an old magazine from Romania. I made the modifications, because the members of a romanian forum recommended them.

... and before replacing LM358 by TL082, the power supply was oscillating.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on April 13, 2024, 11:59:45 am
That's good enough to leave as is or you can progressively reduce the capacitor to improve the settling time.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on April 13, 2024, 12:58:35 pm
I reduced the capacitor to 220p (0056.png) and to 100p (0059.png).
I think that the one with 220p is better.
Is it necessary to reduce the capacitor lower than 100p, to check if the circuit is stable ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on April 13, 2024, 01:03:44 pm
That's a very nice response with the 220pF. As the capacitor size is reduced further, ringing will be expected, so no point.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on April 13, 2024, 04:35:27 pm
I made a test, using the old PCB of the LM723 power supply and a new group of 4 x TIP35C and BD241C.
This time the results were a little bit different, I found that on the screenshot is a damped oscillation, please have a look at the screenshot.
 
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on April 13, 2024, 07:19:04 pm
Likely because Type 1 compensation using just a capacitor is not suitable for current sourcing designs like the Harrison.
It should be Type 2, series RC.   
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on April 14, 2024, 04:41:46 am
Should I use some random values for R and C ?
I saw that there are a lot of calculations around this Type 2 compensation, probably a simplified method is to check using different values for R and C.
https://developerhelp.microchip.com/xwiki/bin/view/applications/power/switching-regulators-/digital-compensator-design-tool/type-II-analog/
Title: Re: LM324 Power Supply with variable voltage and current
Post by: Jwillis on April 14, 2024, 06:52:08 am
Something concerns me with the last schematic you posted. J1 33Vac, C61 and  C62. Is that an error or is that the way it's supposed to be. Just that there's two polarized capacitors on an 33V AC line. Or is that supposed to be rectified 33V.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on April 14, 2024, 07:15:22 am
@Jwillis It is a mistake. There are about 40-41 Vdc. The transformer is a 2x15Vac. I am using the tap switcher with this supply, otherwise the voltage drop on the power transistors is high and the power dissipation is making them very hot.
The rectified voltage is about 40-41 Vdc.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on April 14, 2024, 07:59:08 am
Should I use some random values for R and C ?
I saw that there are a lot of calculations around this Type 2 compensation, probably a simplified method is to check using different values for R and C.
https://developerhelp.microchip.com/xwiki/bin/view/applications/power/switching-regulators-/digital-compensator-design-tool/type-II-analog/
I dont know enough to take this any further.  That response shape indicates good stability along with a fast response. The only thing likely to upset it is to put a very low ESR capacitor directly across the output at the PCB.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on April 22, 2024, 03:39:47 am
I am trying to mount all the components into a case, and make a new power supply with LM723 and TL084 schematic using the 2x15Vac transformer.
I also have the tap changer transformer (12Vac) and the 2x12Vac transformer for the LM723.
I wanted to use only 2 transformers, the 2x15Vac and the 2x12Vac for the LM723. It is possible to power the tap changer, the cooling fans and the digital voltmeter from the same 2x15Vac transformer as the power supply ? Is that possible ? Or from the 2x12Vac transformer ?
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on April 22, 2024, 04:08:48 am
I am trying to mount all the components into a case, and make a new power supply with LM723 and TL084 schematic using the 2x15Vac transformer.
I also have the tap changer transformer (12Vac) and the 2x12Vac transformer for the LM723.
I wanted to use only 2 transformers, the 2x15Vac and the 2x12Vac for the LM723. It is possible to power the tap changer, the cooling fans and the digital voltmeter from the same 2x15Vac transformer as the power supply ? Is that possible ? Or from the 2x12Vac transformer ?
Initial thoughts are, the fans only can be powered from the 2x15Vac transformer.
The tap changer might be able to be powered from the 2x12Vac transformer with modifications so that it can accept negative sensing input voltage.  Because the DVM can only measure positive voltage, it needs to be powered WRT the PSU's negative output. So the unmodified tap changer might as well be powered from the same supply.
 Keep in mind that ground on a Harrison PSU is the positive output.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: mike_mike on April 22, 2024, 04:48:12 pm
I could use a transformer for this power supply which has a secondary voltage of 2x15Vac, and another secondary of 28Vac. I could use the 28Vac secondary for the tap changer circuit. First I could bring down the voltage to about 15-20Vdc using a LM317T and then I could power the tap switcher (the input of L7812) from the output of the LM317T.
Title: Re: LM324 Power Supply with variable voltage and current
Post by: xavier60 on April 23, 2024, 07:49:39 am
I could use a transformer for this power supply which has a secondary voltage of 2x15Vac, and another secondary of 28Vac. I could use the 28Vac secondary for the tap changer circuit. First I could bring down the voltage to about 15-20Vdc using a LM317T and then I could power the tap switcher (the input of L7812) from the output of the LM317T.
That should be fine. The voltage would be too close to the limit of just an LM7812.