Control a buck converter with a µController ?

Thread Starter

Zouglou LeMagicien

Joined Feb 12, 2019
33
Hey

I was wondering can we control a buck converter with a µController ? By that, I mean applied a certain signal (which is the value that we want at the output) to the buck to regulate the output. I know that it is possible to regulate the buck by creating a PWM with the µController and applied it to have the correct output but I'm asking if there is any easiest way :)

Regards,

Chris
 

BobTPH

Joined Jun 5, 2013
8,998
Yes, a microcontroller can be used to control a buck converter. The buck converter can be absolutely minimal, just a switch element, diode and caoacitor, plus a resistor divider for measuring output voltage and/or a series resistor to measure current.

The controller will then measure the output and adjust the duty output to regulate the voltage or current.

Bob
 

OBW0549

Joined Mar 2, 2015
3,566

Attachments

Thread Starter

Zouglou LeMagicien

Joined Feb 12, 2019
33
Thanks for your reply, but is there a buck that can memories the output info and then regulate automatically the pwm command on the gate ? For example, we want 5V at the output and we send 5V to the module with an Arduino. The module will know that we want 5V and regulate it automattically
 

OBW0549

Joined Mar 2, 2015
3,566
is there a buck that can memories the output info and then regulate automatically the pwm command on the gate ? For example, we want 5V at the output and we send 5V to the module with an Arduino. The module will know that we want 5V and regulate it automattically
I've never encountered such a thing; you'll probably have to do that memorizing function yourself, with a PIC or whatever other μC you choose.
 

MrAl

Joined Jun 17, 2014
11,494
Thanks for your reply, but is there a buck that can memories the output info and then regulate automatically the pwm command on the gate ? For example, we want 5V at the output and we send 5V to the module with an Arduino. The module will know that we want 5V and regulate it automattically
You just need to be able to control the reference voltage. Not all bucks allow access to that however so you need one that does or else you have to control the feedback which is harder to do (with maybe a digital pot for example and then the uC controls the pot instead).
 

ronsimpson

Joined Oct 7, 2019
3,043
If you want 5V you can choose the resistors in the feed back look and it will give you 5V. No need to memorize. No need for the micro.

If you want to set the voltage and have it memorize; there are "digital pots" and some have eeprom inside so it will wake up set to the right point. (pot=variable resistor)
----edited----
Not a good picture but; the pwm IC is looking for 800mV on the FB pin. If the voltage is to low or high the duty cycle will change to make the voltage 800mV. R1 & R2 divide the output voltage down to 800mV. In this case it takes 8.8V at "OUT" to make 0.8V at "FB". This is normally how the voltage gets set.
1587760230491.png
There are many ways to have a micro set the OUT voltage. One way is to replace R2 with a digital pot that varies the value and can be set by the computer.
 
Last edited:

Thread Starter

Zouglou LeMagicien

Joined Feb 12, 2019
33
You just need to be able to control the reference voltage. Not all bucks allow access to that however so you need one that does or else you have to control the feedback which is harder to do (with maybe a digital pot for example and then the uC controls the pot instead).
Oh yeah maybe i could search to control the reference voltage instead, do you have any example of buck converter like that ?
 
Last edited:

Thread Starter

Zouglou LeMagicien

Joined Feb 12, 2019
33
If you want 5V you can choose the resistors in the feed back look and it will give you 5V. No need to memorize. No need for the micro.

If you want to set the voltage and have it memorize; there are "digital pots" and some have eeprom inside so it will wake up set to the right point. (pot=variable resistor)
----edited----
Not a good picture but; the pwm IC is looking for 800mV on the FB pin. If the voltage is to low or high the duty cycle will change to make the voltage 800mV. R1 & R2 divide the output voltage down to 800mV. In this case it takes 8.8V at "OUT" to make 0.8V at "FB". This is normally how the voltage gets set.
View attachment 205293
There are many ways to have a micro set the OUT voltage. One way is to replace R2 with a digital pot that varies the value and can be set by the computer.
That was just an example de 5V :)
I heard about the digital pots, i will check on this, thanks !
 

Thread Starter

Zouglou LeMagicien

Joined Feb 12, 2019
33
What I need, is a buck with : 24V input, 10V to 18V output with a maximum current of 1A. And I need to control the voltage output with a µController. To use less GPIO, I was searching for a simple command like i said but it seems complicated to find, so I think i would need a feedback pin on my µController which will regulate a digital pot
 

MrAl

Joined Jun 17, 2014
11,494
Oh yeah maybe i could search to control the reference voltage instead, do you have any example of buck converter like that ?
The type that use a controller IC to do the controlling of the output voltage. They usually have a reference input terminal going to one of the internal op amps which acts as the error amp.
It is the ones that have a built in reference voltage that dont have a pin for the reference itself as they try to make things 'simpler' but of course that comes at a price.
This is actually the best way to do it but yes you do have to have the right controller.
 

MrAl

Joined Jun 17, 2014
11,494
Yeah you reminded me that another way to control might be through the soft start pin, but that would mean the output would have to be monitored with the uC too not as good as when the controller chip does the monitoring and adjusting.
 

ronsimpson

Joined Oct 7, 2019
3,043
Many people try to use a "software PWM". That works but when the software brakes things go horribly wrong. The control loop is too slow and no cycle by cycle current limit.

A boost supply has the possibility to make "millions" of volts if no feedback. Things brake. Because I do not trust software, do not trust software engineers, etc. I want the hard ware to be solid. I want the software to have only limited control. (example: set the voltage from 10 to 18V and no more) I want the control loop to be in hardware so if the interrupt hangs up the PWM will work just fine. (or at least not brake something) I want the current limit to work with in 20nS with or with out the computer's help.

I would use the Soft Start Pin for turn off only. Often I use a analog out from the computer to tug up/down slightly on the FB pin thus just adjusting what the power supply is doing.
 

crutschow

Joined Mar 14, 2008
34,462
Below is the LTspice simulation of a typical buck-regulator circuit, using a DAC voltage to adjust the regulator output voltage.
The regulator has a 2.2V reference and the effect of the DAC voltage on the output voltage is determined by the relative values of R1, R2, R5, R6.
Note that the maximum output voltage occurs when the DAC voltage is 0V and the minimum when the DAC voltage is 4V.

1587862018488.png
 
Last edited:

MrAl

Joined Jun 17, 2014
11,494
Below is the LTspice simulation of a typical buck-regulator circuit, using a DAC voltage to adjust the regulator output voltage.
The regulator has a 2.2V reference and the effect of the DAC voltage on the output voltage is determined by the relative values of R1, R2, R5, R6.
Note that the maximum output voltage occurs when the DAC voltage is 0V and the minimum when the DAC voltage is 4V.

View attachment 205405
This is one time when you really have to do the math. That method can cause severe instability. That is i think because the higher the "control voltage" goes the less effect the output has on the feedback. The main idea is that the feedback is normally perfectly linear but that kind of feedback makes it strictly speaking non linear. There is a chance though that it could work of a smaller range.

If i get a chance i'll go through this again and show what happens. It is easy to see right off though the control voltage goes too high there is no feedback anymore.
 
Top