Variable voltage with high current - Page 1
Forum section: electronics / beginners

author: PinheadBE
author_rank: Regular Contributor
timestamp: April 07, 2024, 06:56:34 pm
content: Hi,You will probably yell at me that my question is silly, but, I face a problem and can't decide how to tackle it....Here is my need:- From a 5 V powered application, a PIC microntroller outputs a voltage between (roughly) 2 V and 5 V by means of its internal DAC- Based on that voltage, I need to be able to source a current that can go up to 1.5 A- That output must be stable DC, not PWM (otherwise it would have been too easy :-) )- Precision is not critical, but stability is (I mean, the voltage must be somewhat stabilized so that it remains constant wheter the current is 0.1 A or 1 A)Remember that the DAC cannot output high currents: it will need a high-gain bufferAs I said, the solution must be stupidly simple, but I can't see it.....Any help ?

author: Ian.M
author_rank: Super Contributor
timestamp: April 07, 2024, 07:17:35 pm
content: If you had a min. +6.5V supply capable of 1.5A, you could simply use aLT3081, and connect its SET pin to a low impedance voltage source instead of the usual voltage setting resistor, i.e. to the buffered output of your DAC, (or filtered and buffered PWM).However if all you've got is 5V, it gets a lot nastier, and due to voltage drop in the pass transistor, without a boost stage you aren't going to get output right up to the rail, especially at 1.5A out.

author: PinheadBE
author_rank: Regular Contributor
timestamp: April 07, 2024, 07:31:25 pm
content: Hi, and thanks Ian,Indeed, the dropout voltage for that one is a bit high for my application.But based on your idea of using a variable LDO, I found that I had some MIC35302 laying around (DS attached), whose characteristics should be OK (3 A max current, and a low dropout of 600 mV worst case, more like 450 mv in my application, which is acceptable)But the output voltage is set by a voltage divider on the output, so that the voltage on the ADJ pin remains at 1.240 V.How can I achieve this with the DAC of the PIC ?

author: Ian.M
author_rank: Super Contributor
timestamp: April 07, 2024, 07:44:25 pm
content: To lower (or raise) the output voltage, inject a small controlled current to the feedback divider at the ADJ pin. As the feedback loop servos the ADJ pin at the reference voltage, you can simply use a resistor between your DAC output (or filtered PWM) and the ADJ pin.The math is fairly simple: if you make the current injection resistor equal to R1, and select R1,R2 for 5V out, then 5V at the DAC output will give Vref at the regulator output and Vref at the DAC output will give 5V regulator output, and proportionally in between.

author: mariush
author_rank: Super Contributor
timestamp: April 07, 2024, 07:45:46 pm
content: You could try a couple digital potentiometers in the adjust feedback of a linear regulator, but you would need the voltage to be ABOVE the output voltage by some amount for the linear regulator to work rightBecause your maximum output will be 5v max, you can use digital pots with maximum 5.5v-6v voltage on the pins, but there's HV versions that can tolerate up to around 20-25v.For example a LM1085 or any *1085 would be rated for up to 3A, with maximum input voltage as low as 15v depending on package and version (goes up to 27v-29v) and would need 1.3v to 1.5v dropout voltage.You can get fancier more expensive linear regulators like ISL80102 for example -https://www.digikey.com/en/products/detail/renesas-electronics-corporation/ISL80102IRAJZ-TK/2334473- that have a dropout voltage of only 0.15v at 2AWith he tISL80102 above, you'd just use a digital potentiometer (or two) to replace the bottom 1K resistor .. with the other resistor set at 2.61k , the 1k gives you ~1.8v , and 287 ohm will give you 5v outFor digital potentiometers, a 64 tap 1k digital pot is around 1$ :https://www.digikey.com/en/products/detail/analog-devices-inc/AD5258BRMZ1-R7/995740256 taps will be around 5$https://www.digikey.com/en/products/detail/analog-devices-inc/AD8400ARZ1-REEL/994213You could get finer gradient and keep it cheap by paralleling two digital pots , for example parallel a 50k one with the 1k one ... 50k in parallel with 1k gives you 980 ohm ...So for example if you want 909 ohm but can't get it by setting the 1k pot to this precise value, you could use either 50k in parallel with pot set at 926 ohm, or you could just change the 50k port to 10k and parallel with 1k ... that gives you the same 909 ohmAn 128 tap 50k is under 1$ , for examplehttps://www.digikey.com/en/products/detail/microchip-technology/MCP4018T-503E-LT/2059663

author: PinheadBE
author_rank: Regular Contributor
timestamp: April 07, 2024, 07:53:37 pm
content: Quote from: Ian.M on April 07, 2024, 07:44:25 pmYes, but that would need that I readback the output voltage to be able to adjust it, and thus allowing a ADC input pin for that.... which is no more available :-/Isn't it ?On the other hand, I've found out that, in the PIC I use (PIC16F1778), I can use a pin to connect to either side of the ladder.So, for example, I can use an internal connection to the ladder for GND, but reroute the upper side of the ladder to a pin, and then replace R2 with that.No need to readback to output voltage (precision is not *that* critical), because I have the formula to set the DAC value...Does this sound right ?

author: Ian.M
author_rank: Super Contributor
timestamp: April 07, 2024, 08:13:12 pm
content: Using the DAC divider chain (or a digipot) as the regulator feedback divider is not the preferred way to digitally control it. See the second paragraph of my reply above and the attached LTspice sim. For precision, you'll need to buffer the DAC output as its source resistance is poorly controlled and varies with the tap selected.

author: Zero999
author_rank: Super Contributor
timestamp: April 07, 2024, 09:09:31 pm
content: If you don't have a higher voltage rail, than 5V, then you'll have to accept there will be some voltage drop, when set to 5V, assuming you don't want to go switched mode.

author: JustMeHere
author_rank: Frequent Contributor
timestamp: April 07, 2024, 09:28:49 pm
content: Watch this and use PWM... (Use an RC filter)

author: PinheadBE
author_rank: Regular Contributor
timestamp: April 08, 2024, 05:01:41 pm
content: Quote from: Ian.M on April 07, 2024, 08:13:12 pmYes, indeed.I think the DAC output in PIC's are already buffered, otherwise I can easily route it internally to one of the op amps configured in unity gain.Quote from: Zero999 on April 07, 2024, 09:09:31 pmA drop up to 500 mV is acceptable. Lots of LDO's fit in that limitation, even with currents in the range of 1 A to 1.5 AGoing to switch mode isn't worth the complication (as I see it)Quote from: JustMeHere on April 07, 2024, 09:28:49 pmPWM, of course, but then ? I need a decent amount of current.I already considered adding a transistor in emitter follower mode, but the gain may not be high enough.Then, a Darlington mounted as emitter follower ?About the dissipated power: for an output of 2 V and a voltage rail of 5 V, with a (max) current of 1.5 A, that trannie will dissipate up to 4.5 W.... Ouch !And there are such 6 channels in my app..... Ouch² !

author: xvr
author_rank: Frequent Contributor
timestamp: April 08, 2024, 05:55:06 pm
content: You can use opamp from Apex product line -https://www.apexanalog.com/products/matrix_high-current.htmlBut they quite expensive

author: Ian.M
author_rank: Super Contributor
timestamp: April 08, 2024, 06:55:31 pm
content: So do any of the Apex power OPAMPs drive to within 500mV of the rails at 1.5A out? It doesn't matter how expensive they are or aren't if they cant do the job!@PinheadBE,Six channels at 1.5A and 3V drop implies at least 27W dissipation for any linear solution. No problem with a decent heatsink and fan. More worrying is the min 9A supply current @5V. That's high enough that voltage drops in wiring can be significant, and connectors expensive.Can the application tolerate the ripple of a typical DC-DC buck module? If so, digitally controlling one buck module per channel by injecting current at its IC's ADJ pin is a far better option. Minimal heatsinking will be required and if you *do* have a higher supply voltage available, you can use that to feed them, removing the voltage drop problem and reducing the supply current considerably. eg. with all channels at 5V and fully loaded, the input current at 19V would be under 3A, easily within the capabilities of a second hand netbook or laptop PSU.

author: Zero999
author_rank: Super Contributor
timestamp: April 08, 2024, 09:45:07 pm
content: Can you stretch to a voltage doubler circuit? You'll need another output to generate a squarewave.Use an op-amp buffer, with the op-amp run off a voltage doubler, with a logic level MOSFET on the output. The drop-out voltage will depend on the on resistance of the MOSFET.If a pull-up resistor is connected to the output of the op-amp, then it doesn't even need to have a proper rail-to-rail output. It will help it push the gate voltage closer to the positive rail. The crappy old LM358 will probably do. You might need to add a compensation capacitor and resistor, to avoid oscillation, with the op-amp driving the capacitive load.

author: PinheadBE
author_rank: Regular Contributor
timestamp: April 08, 2024, 10:15:41 pm
content: I can live with a decent amount of ripple in the voltageCould those cheapo modules based on LM2596 do the trick (given a proper heatsink) ?https://www.aliexpress.com/item/1125417277.htmlI have a dozen laying around, and, yes, I have also a 12 V - 8 A SMPS (tested up to 8 A) that I could use for this purpose.Now, (and sorry to ask), how can I control those modules from a micro-controller ?They have a trimpot onboard, but I guess I should use something else.... a DAC, PWM, something else ?(Digital potentiometers are, I guess, a possibility, but I have to find affordable ones, since the only ones I know of so far are Dallas-branded and quite expensive)

author: Ian.M
author_rank: Super Contributor
timestamp: April 09, 2024, 01:46:08 am
content: Most of those modules are fitted with fake LM2596 chips that are actually far more similar to the LM2576 which operates at 52KHz vs the genuine LM2596 150KHz. As the passives are as per LM2596 design equations this results in at best 1/3 the nominal load current capability, so they are good for 1A peak, and tend to overheat much past 500mA continuous. See this writeup for details:https://k6jca.blogspot.com/2018/02/counterfeit-lm2596-regulator-boards.htmlWith that out the way, a genuine LM2596, with both it and the Schottky free-wheeling diode properly heatsinked would be easily capable of your requirements.To control the output voltage of these and similar switching converters with ground-referenced feedback works the same way as controlling a LDO with ground-referenced feedback. See my comments in replies #3 and #6 above. Start by setting the module for 5V out (with >5V in). Then, injecting current at the ADJ pin will lower the output. With your DAC at its max output, connect a resistor, initially the same value as the pot on the module, between thebufferedDAC output (or filtered and buffered PWM output), and decrease its resistance till you get the control range you want. N.B. if the DAC output goes below the buck IC's reference voltage the output voltage will increase, so you may want to iteratively tweak the module's voltage set pot with DAC out at minimum and the resistor connecting the DAC to ADJ, with DAC out at maximum, to best match the desired output voltage range. Once you've figured out the best DAC coupling resistor value, you can substitute a fixed resistor of the next lower preferred value, same for all channels, re-trim the module pot, and tweak the range scaling in software.

author: PinheadBE
author_rank: Regular Contributor
timestamp: April 11, 2024, 05:44:54 pm
content: I took some measures....Indeed, my modules have fake chips aboard.See ripple noise in the following conditions:- 12 V In- 5 V Out- 1A or 2A load (my dummy load is not purely resistive, which could explain why the ripple noise is so high and distorded)(See screenshots and values attached)Note that the temperatures were taken without any heatsink or fan, each time after 10-15 min of runningStrangely, the ripple level is higher at 1 A than at 2 A, but for my app, even 300 mV at that frequency is not a problem at all.The input capacitor heats up also, but I guess this is only due to its proximity to the chip.I will try to mount a heatsink at the rear of the PCB after having scratched the silkscreen. Thermal vias are already visible .I have seen that idea in the blog spot of k6jca mentionned by Ian.With that in place, I bet that I can source 1.5 A without a problemI will also add and/or replace the output caps to try to lower a bit the ripple.However, sorry for that, but I still don't understand how I can.....Quote from: Ian.M on April 09, 2024, 01:46:08 am

author: Ian.M
author_rank: Super Contributor
timestamp: April 12, 2024, 06:04:03 am
content: Sorry I was referring to a pin by the wrong name.Its a general technique for digital control of all adjustable regulators (both linear and switching) with an internal reference voltage that's relative to ground, and that use a potential divider from the output for feedback. Some regulators call the pin in question that the potential divider tap connects to 'ADJ' but the LM2596 calls the pin in question 'Feedback', and that's where you inject a current to vary the output. As the feedback loop tries to maintain this pin at the reference voltage, a simple resistor from a adjustable voltage source can be used to inject a known current, then assuming negligible input current, KCL lets you calculate the resulting change in voltage across the upper resistor in the feedback divider, and thus the change of output voltage.

author: PinheadBE
author_rank: Regular Contributor
timestamp: April 14, 2024, 08:25:13 pm
content: I finally understood how to add current to the feedback pin to be able to control the output voltage, in this case, with a PWM signa (but could be a buffered DAC also)See this blog article, and the accimpanying video. Very instructivehttps://krakkus.com/2023/03/09/hacking-a-dc-to-dc-converter/#adding-currentHope this will also help others !