40 lines
1.1 KiB
Matlab
40 lines
1.1 KiB
Matlab
%%%%%%%%%%%%%%%%%%%% Parametros de entrada %%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
Vnom = 230;
|
|
Vdc = 340;
|
|
|
|
|
|
f_max = .5; %% Frecuencia objetivo
|
|
f_triangular = 10; %% Frecuencia onda triangular
|
|
fc_corrietnes = 1000;
|
|
|
|
|
|
t_arranque = 0; %% Tiempo para llegar a esa frecuencia
|
|
t_estacionario = 10; %% Tiempo estacionario
|
|
t_parada = 0; %% Tiempo de frenado
|
|
|
|
|
|
clock = 10000; %% Reloj del sistema
|
|
t_sim = t_arranque + t_estacionario + t_parada; %% Tiempo de la simulacion
|
|
|
|
p = 6; %% Pares de Polos
|
|
CPR = 500; %% Precision del encoder
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Calculos %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
time_step = 1/clock;
|
|
|
|
if t_arranque == 0
|
|
flag_VF = 1;
|
|
else
|
|
flag_VF = 0;
|
|
end
|
|
|
|
slope = f_max / t_arranque;
|
|
cte = 1/f_max;
|
|
|
|
cte_encoder = 360/500;
|
|
|
|
gain_corrientes = 5; |