%%% Electric traction motor vectorial control simulation%%% %%%%%%%%%%%%%%%%%%% Electric Drives %%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%% 02/11/2021%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Init clearvars; close all; clc; %% Condiciones setup en el caso real %%%%%%%%%%%%%%%%%%%% Parametros de entrada %%%%%%%%%%%%%%%%%%%%%%%%% Potencia = 486.21; % Potencia del motor T_max = 2.451; % Par maximo del motor Vnom = 135.8; % Tension nominal rms Vdc = 340; % Tension DC Rs = 0.3398; % Resistencia de fase Ld = 0.6154e-3; % d axis inductance (H) Lq = 1.094e-3; % q axis inductance (H) Phi_r = 46.6027e-3; % Estimated rotor magnetic flux (Wb) clock = 20000; % Reloj del sistema delay_velocidad = 200; fc_corrientes = 1e3; % Frecuendia corte filtros corriente (Hz) p = 3; % Pares de Polos CPR = 300; % Precision del encoder desfase_z_d = 1.33203528; %%%%%%%%%%%%%%%%%%%%%%%%%%%%% Calculos %%%%%%%%%%%%%%%%%%%%%%%%%%%%% time_step = 1/clock; f_triangular = clock/10; % Frecuencia onda triangular cte_encoder = 2*pi/500; Vmax = Vdc/sqrt(2)/sqrt(3); % Max phase voltage (V) (sinusoidal PWM generation) wb = Vmax/Phi_r; % per unit speed (pu) k = Ld/Lq; kp_id = Rs/(k*Lq); % d current PI proportional gain kp_iq = Rs/(Lq); % q current PI proportional gain ki_id=(Rs/(k*Lq)+wb/k*kp_id)^2/(4*wb/k); % d current PI integral gain ki_iq=(Rs/(Lq)+wb*kp_iq)^2/(4*wb); % q current PI integral gain nmax = 0.98 * clock/2 * 60 / CPR; % gain_velocidad = clock/delay_velocidad * 60/(2*pi); n_lim_direccion = nmax/10; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Parametros de la maquina Ld_real = 0.6154e-3; % Real d axis inductance (H) Lq_real = 1.093e-3; % Real q axis inductance (H) Phi_r_real = 0.334539e-3; % Real rotor magnetic flux (Wb)