File Exchange

image thumbnail

Active Power Factor Correction

version 1.0.1 (43.3 KB) by Siddharth Jawahar
Simulink model used in the "Power Factor Correction Control" MathWorks video


Updated 09 Jan 2019

View Version History

View License

This submission contains a Simulink model and a MATLAB script that was used in the “Power Factor Correction Control” MathWorks video. The model contains a cascaded digital controller for active power factor correction implemented with a boost converter.
Gains of PI controllers in the outer voltage loop and inner current loop were tuned as shown in the video. The MATLAB scripts sets the physical properties of the passive components of the model and the design requirements.

Cite As

Siddharth Jawahar (2021). Active Power Factor Correction (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (15)


Dinesh Kumar


bhavesh rathod

Also when I try to run it in normal mode, I am getting an error: "The sample time after propagation is [0, 0]. Enter a discrete sample time in 'Active_PFC/Controls/PLL/Angle/Discrete-Time Integrator2'."

caleb jiang

Hello, I followed the tuner process of the inner current loop. However, I get the error as follow:
In "frestimate(modelname,op,io,in)", it is required for each of the linearization output I/O points that the sample time of the Simulink signal where it is located is one of the following:
1. It is either continuous or fixed in minor time step.
2. Its sample rate is equal to the sample rate of the input signal "in".
The linearization I/O io(2) does not satisfy this requirement. Consider either changing the sample time of Simulink signal where io(2) is located to continuous sample time or changing the sample time of input signal "in".

Did I make any mistake?

Eleyele Abidemi

I am also experiencing the same issue as shubham Agrawal here. can you please rectifiy


shubham agrawal

when i am tuning the inner current loop as shown in the video of matlab on youtube,after taking initial conditions and taking input the 'fixed sine stream' when i am estimating the bode plot,the simulation goes in infinite loop,and only simulating the model is coming in the bottom of the window,please solve this issue!

Graham Dudgeon

Hi Robin - The slx file uses a callback to run the parameter file. The callback can be found in File -> Model Properties -> Callbacks -> PreLoad Fcn. This runs the parameter file just before the model is loaded into memory.

The PLL is used to get a clean angular reference for the control system, as the voltage measurement is 'contaminated' with harmonics. The model is simply a reference - feel free to remove components and see the impact on the system response.

Robin Gangopadhya

In the example, the active_pfc.m file has the parameters. But in the slx file one cannot find the .mat file anywhere.
How is this hidden? How are the parameters found by the model as it runs?...question from a nubbie such as me!
- Why is a PLL needed? In analog world where this topology was used since forever, there was no such complex block ever used.
Inductor current peaks track the input sinewave, a filter restores the current waveform to the extent possible-due to filter alone. Check out LT1249, 1248, 1509 etc from Analog Devices.
PLL block must be eating into time available to derive next gate pulse, will it not? Unless, the target MCU has PLL hardware built into it.
Or it is coded entirely as digital PLL which might be faster.
What if our topology does not need it?...we do not even need an input current shaping algorithm at all?

Anas Berbar


Sir, Please make it compatible with MATLAB 2016b

Vivek Shinde


MATLAB Release Compatibility
Created with R2018b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!