MATLAB: How to control duty cycle of a MOSFET using PI controller

buck-boost convertercontrol

I have designed a buck boost converter, how can I use a PI controller which will automatically change the duty cycle of the mosfet as per my desired output voltage or current?

Best Answer

So the output of the PID controller should output a duty cycle between 0 and 1.
Then, this duty cycle can be passed into, for example, a PWM Generator block. This will generate the PWM waveform needed by the MOSFET block.
- Sebastian
Related Question