boost_converter_1rtbox.plecs
初始化中,说1e-6是两台box的,2e-6是一台box的
%input parameters
Vin = 480;
Vinmax = 800;
Vout = 950;
fc = 20e3;
Ts_fpga = 7.5e-9;
prd = round(1/(fc * Ts_fpga));
f = 1/(Ts_fpga*prd); %Switching frequency
ftoggle = 50; %was f/400 ~50 Hz for two box configuration.
Tsw = 1/f;
RL = 15e-3;
dIL = 5;
dUL = 10;
P = 52e3;
Iout = P/Vout;
ILrefmax = P/Vin;
ILrefmin = P/Vinmax;
% Boost Converter design
D = 1 - Vin/Vout;
Rload = Vout/Iout;
L = Vin * D / dIL / f;
C = Iout * D / dUL / f;
% Initial conditions
IL0 = P/Vin;
VC0 = Vout;
% HIL simulation
Tdisc.Plant = 2e-6; %%was 1e-6 for two box configuration.
Tdisc.Controller = Tsw;
% Controller parameters
Tsig = 3/2*Tdisc.Controller;
K1 = 1/RL;
Tn = L/RL;
Ti = 2*K1*Tsig;
Kp = Tn/Ti;
Ki = 1/Ti;
Kbc = Ki/Kp;
% Scaling
Vout_scl = 4/Vout;
Vin_scl = 4/Vinmax;
IL_scl = 4/ILrefmax;
注意其中的代码:先设定好fc,然后根据FPGA的主频频率,通过取余得到 PWM_OUT所需要的频率值,因此不是完全绝对的值,而是一个近似值。。。。。。
fc = 20e3;
Ts_fpga = 7.5e-9;
prd = round(1/(fc * Ts_fpga));
f = 1/(Ts_fpga*prd); %Switching frequency
2e-6;;;小步长达不到,dspace比较多,,开关管的个数,,,130个开关元器件,,电容电感,,12个,,最多MMC,,,5电平,,,1个产品 ,,,5电平,,7电平估计也要级联了,,主要限制是步长,,步长
通过PWM OUT来设定开关频率