Parametri_final

V1 = 230;
V2 = 230;
V3 = 230;
Vdc = 670;
fsw = 4000;
%L_filt = 3e-3;
%C_filt = 100e-6;
%C_filt_est = 100e-6;
%L_n = 5e-3; 
L_filt = 1e-3;
C_filt = 9.2e-6;

m = 1.0;
w = 2*pi*50; 

% SAMPLE TIME !
Tsample = 0.1e-6    *4;

Power.Ts = 0.5e-6   *4;
Measur.Ts = 50e-6   *2;
Control.Ts = 200e-6 *2;
Ref.Ts = 0.0002;

Power.NbrSamp = Power.Ts / Tsample;
Measur.NbrSamp = Measur.Ts / Tsample;
Control.NbrSamp = Control.Ts / Tsample;
Ref.NbrSamp = Ref.Ts / Tsample;

% Trofani i jednofazni teret

R3f = 4.57143   *4;      %max 3f load
m = 1.0;        % amplitudni indeks modulacije osnovnog harmonika
R1f = 4     *44;        % promijena 1f tereta

%   incijalizacija parametara
uklop1      = 0;    % uklop jednofaznog tereta = FALSE
mod_switch  = 0;    % odabir modualcija 0 .. space vector
m3rd        = 1/4;    % amplitude treceg harmonika
verzija     = 1; 

% pocetak space vector
% +-----------------------------------------------------------------------+
% |                          space vector                                 |
% +-----------------------------------------------------------------------+
 
mod_switch  = 1;    % odabir modualcija 1 .. space vector
 
% +------------------+
% | simetricni teret | 
% +------------------+

uklop1       = 0; 

% +--------------------+
% | nesimetricni teret |
% +--------------------+
 
uklop1       = 1;    % uklop jednofaznog tereta = TRUE

%mod_switch  = 1;
%verzija     = 4;

%% Inverter controller parameters

Kcp = 5 /2;
Kcp0 = 5 /2;
Tci = 0.001;
Tci0 = 0.001;
Tcr = 0.001;

Kvp = 1;
Kvp0 = 1;
Tvi = 0.01;
Tvi0 = 0.01;
Tvr = 0;

if (Tci == 0 ) CC_Tci = 0; else CC_Tci = 1/Tci*Control.Ts; end
if (Tci0 == 0 ) CC_Tci0 = 0; else CC_Tci0 = 1/Tci0*Control.Ts; end
if (Tcr == 0 ) CC_Tcr = 0; else CC_Tcr = 1/Tcr*Control.Ts; end
if (Tvi == 0 ) VC_Tci = 0; else VC_Tci = 1/Tvi*Control.Ts; end
if (Tvi0 == 0 ) VC_Tci0 = 0; else VC_Tci0 = 1/Tvi0*Control.Ts; end
if (Tvr == 0 ) VC_Tcr = 0; else VC_Tcr = 1/Tvr*Control.Ts; end

%% Step-up Converter controller parameters

Kpv_boost = 0.01;
Tiv_boost = 0.1;

Kpc_boost = 0.01;
Tic_boost = 0.05;

if (Tiv_boost == 0 ) VC_Tiv_boost = 0; else VC_Tiv_boost = 1/Tiv_boost*Control.Ts; end
if (Tic_boost == 0 ) CC_Tic_boost = 0; else CC_Tic_boost = 1/Tic_boost*Control.Ts; end
