Electrical – advantages and disadvantages of using a microcontroller vs dedicated switching controller for a switching power supply

faultmicrocontrollerswitch-mode-power-supplyswitching-regulator

Trying to build a constant current power supply for a laser diode here. I don't think I can use an off the shelf one because of the large 10A max current and because the current has to be controlled electronically by PWM.

So, I will design a buck converter. But I don't know if it's better to build one based on a microcontroller or use a dedicated chip like TI's simple switcher?

For software people like me, a microcontroller solution will be more familiar and have the fewest components – one chip to rule them all. I've searched for other people's experience on this and it seems quite feasible according to Olin's response

Can I use a microcontroller to control the output voltage of a switching powersupply?

The main downside to me is that I can't drive a MCU directly from a 24V source, so I will have to add another regulator. But even that might be simpler than using a dedicated switching chip.

I'm also afraid about fault tolerance. A MCU clearly has way more components inside that can fail. If the switcher fails in the on state, that can burn out the laser diode or worse, start a fire. To mitigate that, I was thinking of installing a watch dog timer, combined with a fuse for the laser.

——————-update—————————–

My first LM5117 circuit using nichrome wire for testing; potentiometer for adjusting switching frequency (output voltage has strong dependence on it)

Best Answer

Well as you mentioned, the microcontroller has a dominant advantage of ease of use (because of the ability to program it) when you want it to behave as switches for particular components for your machine.

The main advantage of having a microcontroller is the ability to make things conditional and intelligent based on how the user perceives data to be sufficient for what they're trying to accomplish. With a microcontroller, you are able to predict and perform behavior instead of relying on the electronic switch to do it for you and thus you could really prevent error within the machine.

Some disadvantages I can think of is cost or programming error. The cost of a microcontroller can get pretty expensive. You can probably make your own circuit for a much cheaper price because those Arduino/Beaglebone/Raspberry Pi modules can get pricey. Programming can also be disadvantage. What if you accidentally messed up on your code and then you distribute the product to your client? Programming can also take longer to perform than circuit analysis.