MATLAB: How to chose pwm and buck converter parameters

batterybuck convertercharge controllerControl System ToolboxMATLABMATLAB and Simulink Student Suitepower_conversion_controlpower_electronics_controlpulse width modulationpwmpwm frequencysimpowersystemsSimscapeSimscape ElectSimscape Electrical

Hello.
I am looking at this example https://uk.mathworks.com/matlabcentral/fileexchange/73115-mppt-solar-charge-controller-model of a MPPT Solar charge controller model. I would like to simulate it for irradiance variations during a day of around 12 hours (12*3600 seconds of simulation time). The simulation becomes very slow. Is there anything that can modify in order to increase the simulation speed? I was wondering if I can change the buck converter's parameters, or the PWM frequency, or sampling time. I am a beginner so any answer would be very helpful.
Thank you

Best Answer

Hello Eleni,
following up on your new question, you can model the buck converter using an average model to remove the switching. There is an SPS block that works with powergui. You could then switch to a larger fixed step for a discrete powergui or switch to continuous.
To do this, you will need to modify the MPPT algorithm to instead of outputting the PWM signal, to output the duty cycle, between 0 and 1 and feed this into the average model of the block in the link above.
Regards,
Joel
Related Question