1
\$\begingroup\$

I am planning to use stm32f103cbt6 MCU as a feedback controller (voltage or current) for a synchronous buck converter by using gate driver IC, mosfets, inductor, capacitor and etc. Is there any concern that I need to be aware of? I have heard some comments while back that it's not possible to use this kind of MCU as a feedback controller... but not sure what the reason was or even if that is true. I am just driving mosfets with 20kHz complementary PWMs to control gate driver IC based on voltage or current read from the load at the output of converter. Can anyone please confirm if it's possible to achieve? if not, what is the reason?

Following is spec. of the design.

  1. Input voltage range : 20V +/- 10%
  2. output voltage range : 5V to 10V +/-15%
  3. Current : 200mA to 400mA +/- 15%
  4. Ripple voltae : +/-10% of output voltage
  5. load transient : not important
  6. Bandwidth : not important

Datasheet of mcu : [https://www.allelco.com/pdf-95/STM32F103R8T6.pdf][1]

\$\endgroup\$
15
  • \$\begingroup\$ please put a link to the stm32f103cbt6 datasheet in your post so people don't need to look up the datasheet individually. \$\endgroup\$ Commented Oct 27, 2023 at 17:27
  • 2
    \$\begingroup\$ Digital SMPS Vs. Analog SMPS \$\endgroup\$ Commented Oct 27, 2023 at 17:37
  • 1
    \$\begingroup\$ @MathKeepsMeBusy it's not mean to be normal power supply, instead it's intended to be used as brake application to engage or disengage the inductor as a load. So I don't have very strict requirement in terms of output. \$\endgroup\$ Commented Oct 27, 2023 at 18:28
  • 1
    \$\begingroup\$ If the load is inductive, maybe you can just PWM the inductor directly to get the current you need. You might not need another inductor or even a voltage loop, controlling the current might be enough. Hard to say with the limited information available. \$\endgroup\$ Commented Oct 27, 2023 at 19:17
  • 1
    \$\begingroup\$ Discrete time, or sampled data control loops (which is what this is) are tricky and not as straightforward (at least IMM) as analog control loops. For example a stable loop can go unstable just by changing the sample rate. \$\endgroup\$ Commented Oct 27, 2023 at 19:31

1 Answer 1

1
\$\begingroup\$

Your basic question is whether there is any risk to using an MCU as the feedback controller in a buck converter circuit. I'm not aware of any general rule of thumb that says this can't work, but I'm not sure you're going to achieve good output regulation with this scheme.

Let's talk about the FB (feedback) pin on these synchronous buck controller ICs. Here is an internal diagram from a randomly selected but fairly typical synchronous buck controller (TLV62585). TLV72585 internal block diagram

And here are the external connections in the intended usage scenario:

typical schematic for TLV62585

This device, like most of them, expects to see a resistor-divided copy of the V_OUT signal on the FB pin. This particular one switches at a fixed rate of 1.2 MHz, and will adjust the low-side MOSFET's off time (i.e., the switch's duty cycle) to try to keep the voltage in regulation. The input to the FB pin is compared to an internal band gap reference, and that determines whether it should increase or decrease this off time. (This is just one example IC. There is huge variability in how these devices work, like how loop compensation is done and other parameters.)

What I believe you're describing is a scenario in which you will use the microcontroller's ADC to sense the V_OUT level (and/or current, if you include a sense resistor somewhere) and then drive the FB pin with a PWM signal that flips between GND and 3.3V. However, since you want to do your PWM switching at a relatively slow rate compared to the a typical IC's switching frequency (you mention 20kHz), many switching cycles will occur between these jumps between 3.3V and GND on FB. Even if your particular IC is only switching at 200kHz, that would be 10 full cycles for every one of your PWM intervals. Thus, the FB input is going to see 3.3V for some period of time and respond by increasing the low-side MOSFET's off time as much as it can, then later it's going to see 0V on FB for some period of time and respond by decreasing the MOSFET's off time as much as it can.

I think this mismatch in switching frequencies between your PWM signaling and the IC's internal switching rate could have unexpected results. When your PWM is at 3.3V, some number of cycles are going to elapse where the IC will be repeatedly decreasing its duty cycle and yet not seeing any "improvement" in V_OUT regulation because your microcontroller either can't or won't respond that fast. Conversely, some number of cycles will elapse during which your PWM signal is at GND and therefore the IC keeps increasing it's duty cycle because it's failing to see a return to regulation. This all seems like a recipe for voltage overshoot in both directions. That said, you say you have it working in simulation with your specific parts, so it may well work in the real world.

I'd like to suggest a simpler approach. You state in a comment that "it's not meant to be a normal power supply, instead it's intended to be used as brake application to engage or disengage the inductor as a load." The inductor is part of an LC filter, and I'm not sure I'm totally understanding you when you say that the inductor itself is the load. However, assuming that's the case, you could just use the synchronous buck IC as its intended (i.e., feed FB with the resistor-divided V_OUT signal as shown above) and switch your brake on and off by using the IC's enable pin.

Most of these devices, even ones that cost less than $0.70 in volume, have some type of enable input that is intended to be controlled with digital logic. The example device I used above calls it EN and Figure 17 in its datasheet shows that if you toggle the enable pin off with your microcontroller, the V_OUT voltage will drop to zero within 500 microseconds. Perhaps that be an easier way to cut the power than manually toggling the FB pin?

You can, of course, still sense the voltage and/or current with your micro's ADC and have software logic that decides whether to enable or disable based on that.

I have one other thought for you, which is that some of the switch mode DC-DC converter ICs from Analog have an input for the switching clock, which is intended to be driven by a crystal oscillator, microcontroller or some other type of square wave generator. If you go this route, you would fully control the switching frequency and could bring it down to the same 20kHz as your sensing/feedback logic. However, be sure that the IC is actually able to operate at this low frequency. There are mathematical relationships between the input and output voltages, the switching frequency, and the size of the inductor that govern whether you're operating in continuous or discontinuous mode. Some devices cannot work in discontinuous mode.

I hope this was helpful. I don't fully understand your goal, so I'm not sure if I'm addressing your question well, but maybe someone else will find it useful. Good luck.

\$\endgroup\$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.