Electronics > Projects, Designs, and Technical Stuff
Constant current mode for DIY power supply
<< < (5/5)
aiq25:

--- Quote from: not1xor1 on February 26, 2019, 08:53:54 am ---Just remember that thanks to the feedback opamp inputs are kept at the same voltage.
Dismiss the 2.5V of U3 and U4 as they are not relevant for the purpose.
The circuit just tries to keep the voltage through R1 (0.33*I in this test circuit) equal to the value between the cathode-like terminal of U2 and the potentiometer cursor.
When the voltage drop trhough R1 is less than that value the darlington (Q1+Q2) is in saturation and there is no current regulation.

The maximum current is when the pot cursor is connected to the anode of U2.
So let's call:
w = wiper position ranging from 0 (min current - close to the cathode) to 1 (max current - close to the anode)
I = current
R = R1 value
V = U2 voltage
Now we have
R*I = V*w
i.e. the regulated current I is I= V*w/R

The potentiometer value is not critical. High values are more affected by opamp bias, but in any case the intrinsic non-linearity of the potentiometer would likely be greater.

--- End quote ---

Thank you for the explanation. Is there a way I can make the current setting digital? It will be ideal if I can use a PWM signal to get DC voltage and set the current but I can't figure out how to do it with this circuit, that way I can use a micro to set it. I like the analog solution as well.

I came up an idea by adding a differential amplifier to replace the pot and subtract the voltage from a DC source from the anode of U2. But then this solution again becomes two op-amp solution. Attached is what I came up, sorry it's a bit messy layout, I was just messing around in SPICE.

I modified the circuit by changing to TL431 as the references and also use a P-Channel MOSFET.
not1xor1:

--- Quote from: aiq25 on February 27, 2019, 04:21:54 am ---
--- Quote from: not1xor1 on February 26, 2019, 08:53:54 am ---Just remember that thanks to the feedback opamp inputs are kept at the same voltage.
Dismiss the 2.5V of U3 and U4 as they are not relevant for the purpose.
The circuit just tries to keep the voltage through R1 (0.33*I in this test circuit) equal to the value between the cathode-like terminal of U2 and the potentiometer cursor.
When the voltage drop trhough R1 is less than that value the darlington (Q1+Q2) is in saturation and there is no current regulation.

The maximum current is when the pot cursor is connected to the anode of U2.
So let's call:
w = wiper position ranging from 0 (min current - close to the cathode) to 1 (max current - close to the anode)
I = current
R = R1 value
V = U2 voltage
Now we have
R*I = V*w
i.e. the regulated current I is I= V*w/R

The potentiometer value is not critical. High values are more affected by opamp bias, but in any case the intrinsic non-linearity of the potentiometer would likely be greater.

--- End quote ---

Thank you for the explanation. Is there a way I can make the current setting digital? It will be ideal if I can use a PWM signal to get DC voltage and set the current but I can't figure out how to do it with this circuit, that way I can use a micro to set it. I like the analog solution as well.

I came up an idea by adding a differential amplifier to replace the pot and subtract the voltage from a DC source from the anode of U2. But then this solution again becomes two op-amp solution. Attached is what I came up, sorry it's a bit messy layout, I was just messing around in SPICE.

I modified the circuit by changing to TL431 as the references and also use a P-Channel MOSFET.

--- End quote ---

The differential amplifier is out of the feedback loop so it doesn't affect the circuit stability. Just remember to add a buffer between the filtered PWM and the differential input.
TL431 should be fine, just ensure to properly bias them (i.e. current must by >= 1mA). They are cheap, so you might by a few tenths or even 100 for few dollars and select a matched pair.
The MOSFET might be a problem since most of them are unsuitable for linear operations. The one you used in the simulation is specified for DC operations (in the SOA graphic) but would be able to dissipate 42W only with an ideal (0K/W) heatsink.
Provided that the specified SOA is real (not just calculated), to withstand (12V less LM317 dropout) * 1.5A you would need to solder that MOSFET directly to a large copper heatsink
Navigation
Message Index
Previous page
There was an error while thanking
Thanking...

Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod