MCU control of smps - Page 1
Forum section: electronics / projects

author: Jeroen3
author_rank: Super Contributor
timestamp: October 26, 2014, 08:20:09 pm
content: First I must confess I'm not that familiar with power supply design (mostly using Recom and LDO's). That's why this design is a challenge.Basically I'm looking for a way to create a variable voltage (or current?) using a switch-mode power supply.The goal is to dim (over USB of course) multiple strips of 12V LED's up to 2 Amps. Without linear mosfets or direct PWM outputs.As the first is easy, it has obvious drawbacks for small enclosures. The latter however, has less obvious drawbacks:- Flickering, LED's are made to be fed DC, not AC.- EMI, running high current PWM over long distance emits all kinds of trouble. Right now I have direct pwm output, and I can "hear" the pwm since the LED's are next to my speakers.Currently my search for capable buck converters isn't successful. Some offer "tracking" options, yet this is designed for ramp-up usage, not for continuous usage.Most of them use a feedback using a resistor divider. Which you can offset using an opamp. But you risk destabilizing it's control loop.Some offer current limiting capabilities using a current output (to which you attach a resistor), you might be able to use a current mirror to control this.I was initially looking for a smps with some kind of analog (0 to Vcc) or pwm input. Maybe a digital protocol.Those seem to be limited to low voltage CPU and GPU power applications.Does someone know of any chip or design related? Or a better approach?Sidenote, the goal is to fit three channels into a 35x50x13mm pcb area. As it's looking now I'm in need of some huge inductors, and I'm not sure if it's going to fit.

author: nctnico
author_rank: Super Contributor
timestamp: October 26, 2014, 08:55:12 pm
content: There are boost converters for LED drivers which have a current control pin. That is one solution.Another solution is to use a buck converter and feed the error amplifier summing point with an offset voltage through a resistor. You can even use a (filtered) PWM output.

author: Mad ID
author_rank: Regular Contributor
timestamp: October 26, 2014, 11:09:48 pm
content: You are wrong, simply add a third resistor in the middle of the feedback resistors and drive it with a buffer. The buffer buffers an RC filtered PWM and you can regulate the output voltage. I've done that multiple times and it's standard practice.

author: dannyf
author_rank: Super Contributor
timestamp: October 26, 2014, 11:11:46 pm
content: QuoteDepending on how you want to get the mcu involved.The simplest would be for the actual dc/dc conversion to be done by a separate module. That module will likely need to have a feedback from its output (either voltage or current). Your mcu can influence that feedback point, thus exercising control over the output. This can be done via either open loop or close loop (for the mcu).A more involved approach would consist of a pwm generator from the mcu, its duty cycle influenced by your desired output and the converter's output (voltage or current).This approach can be very computationally extensive if you need high dynamic performance + stability over a large range of output. It is unlikely you need that here.

author: Jeroen3
author_rank: Super Contributor
timestamp: October 27, 2014, 09:05:10 am
content: Quote from: Mad ID on October 26, 2014, 11:09:48 pmI like that idea. That's doable using some small internal switch smps ic.If you offset the feedback voltage a few millivolts positive, the regulator will output a lower voltage. Without compromising the feedback bandwidth a lot.When indeed as easy as biasing the resistor divider in the middle, this will surely be the best solution.I'll have to make a test design for this. Any recommendation on what IC to use?An TL494, as inside my lab power supply, is a huge component for my small target area.Current control isn't really achievable since there is no knowlegde of the connected load. Dimming would be only effective in the first few % of total load when 10 cm strip is connected instead of 5 meter.

author: Mad ID
author_rank: Regular Contributor
timestamp: October 27, 2014, 09:11:49 am
content: Quote from: Jeroen3 on October 27, 2014, 09:05:10 amI don't have any particular SMPS IC to recommend you, but can say that this adjustment technique will probably work with any smps ICGood luck.

author: Jeroen3
author_rank: Super Contributor
timestamp: October 27, 2014, 09:54:09 am
content: One thing I don't know yet. What will happen when the output voltage == input voltage?Does the coil survive DC? The idea is to feed 12 V, and reduce this when dimming.

author: diyaudio
author_rank: Frequent Contributor
timestamp: October 27, 2014, 10:45:49 am
content: Quote from: AcHmed99 on October 26, 2014, 08:41:50 pmThis is the path I would recommend as well. the TL494 can operate both as current and voltage mode. interfaced with simple 8-pin mico (of your choice) with a dac, the internal EA has fixed 2.5 reference and 3 points that imposes and controls duty cycle up to 99%, EA1, EA2 and a Dead Time control pin PIN-4 (I think)vie been repairing car audio amplifiers for a while with this chip, its a rather jelly bean part for power electronics.

author: Jeroen3
author_rank: Super Contributor
timestamp: October 27, 2014, 07:31:58 pm
content: I've just tested it with one of those highly affordable LM2596 boards. If I regulate the on board pot to Vout 12V, while Vin is 12V, it turns off. Which is good, no unnecessary switching.When I inject current into the resistor divider, 0 to 2 mA in this case, I can regulate the Vout down from 12 to 5 volts.Concluding that all I need is a pwm output to a filtered voltage follower (with diode?) to lower the output voltage of a SMPS IC.Only one detail, Vout dropped 1 Volt of Vin. And now 12 Watts of power is dissipating into the coil or the internal switch.I don't want that!

author: miceuz
author_rank: Frequent Contributor
timestamp: October 27, 2014, 08:00:27 pm
content: I was able to hack a random chinese SMPS by removing a potentiometer that was there for fine-tuning and connecting PWM DAC from mcu instead of the wiper leg. Had to change one resistor in the SMPS feedback network to make it's output voltage to be in the range I need.

author: Marco
author_rank: Super Contributor
timestamp: October 27, 2014, 08:15:22 pm
content: There are tons of synchronous buck converters on alixpress and ebay, if they are what they say they are this gets rid of another 0.3V drop (from the Schottky).

author: Jeroen3
author_rank: Super Contributor
timestamp: October 28, 2014, 08:06:44 am
content: The LM2596 doesn't go 1005 duty cycle when feedback isn't grounded.One of the little * in the specsheet:Feedback pin removed from output and connected to 0V to force the output transistor switch ONThat why it generating drop. The TPS54340 seems more suitable for the job.

author: Jeroen3
author_rank: Super Contributor
timestamp: November 15, 2014, 11:53:52 pm
content: I got to play around with some AOZ1037's on a little demo board I made. They can really regulate when Vin==Vout.And, when injecting current into R2 of the feedback diodes I'm able to lower the output voltage.My calculations for coil & caps are currently wrong, since there are massive instabilities and voltage ripple when I load the supply.The given calculations spit out 12uF for input and 20uF for output... Even with 100 uF tantalum and 220uF electrolytic the input current ripple is problematic.The output has 100 mV ripple (no load) using the same set of caps, but this increases to 2 Volts when I load 1 Amps, after that it gives up and turns off.An application note suggested 2x22 uF ceramic, but that is an ideal part, expensive and weird shaped (stacked mlcc's).Guess I'd need to play around a bit more with this.Update:I've put on 27 uH with an Isat of 5Amps, output is very stable <10mV. Apart from some oscillation points of 100 mV on specific load values.The control mechanism doesn't work at all, the regulator becomes very unstable and even short-circuits the inputs for some reason.Guess I need to think of some fancy amplifier circuit to make feedback adjustable with a pwm/dac signal.