% ELE4801. Machines et entraînements électriques. Hiver 2018. % Moteur d'induction avec control de vitesse V/Hz. Jesus Morales. close all; clear; clc %__________________________________________________________ % Definition des paramètres global rs Xls Xm Xlr rr J P dt Xrr Xss D Vdc wsw Vb wb P = 4; f0 = 60; wb = 2*pi*f0; Vb = 220*sqrt(2/3); rs = 0.435; Xls = 0.754; Xm = 26.13; Xlr = 0.754; rr = 0.816; J = 0.089; dt = 1e-5; Tmax = 4; t = 0:dt:Tmax; N = length(t); %___________________________________________________________ % convertisseur triphasé Vdc = 450; fsw = 1.5e3; wsw = 2*pi*fsw; Tsw = 1/fsw; d1 = zeros(1,N); d2 = zeros(1,N); d3 = zeros(1,N); tri = zeros(1,N); d = zeros(1,N); Vabc = zeros(3,N); theta_s = zeros(1,N); ws = zeros(1,N); Vref = zeros(1,N); %___________________________________________________________ Xrr = Xlr + Xm; Xss = Xls + Xm; D = Xrr*Xss - Xm^2; M = 1/D* [ Xrr 0 0 -Xm 0 0 0 Xrr 0 0 -Xm 0 0 0 D/Xls 0 0 0 -Xm 0 0 Xss 0 0 0 -Xm 0 0 Xss 0 0 0 0 0 0 D/Xlr ]; Vqd0 = zeros(3,N); Fqd0 = zeros(6,N); TL = ones(1,N)*0; U = [Vqd0;TL]; X = zeros(7,N); Iqd0 = zeros(6,N); wr = zeros(1,N); theta_r = zeros(1,N); Iabcs = zeros(3,N); Iabcr = zeros(3,N); % Initialisation wr_ref = wb ; wr_n = 0; xn = 0; werr_n = 0; [Vref(1),ws(1),xn,werr_n] = V_f_controleur(Vb,wr_ref,wr_n,xn,werr_n); thetas_0 = 0; ws_0 = 0; [Vabc(:,1),tri(1),d1(1),d2(1),d3(1)] = inverseur(Vref(1),thetas_0,ws_0,ws(1),t(1)); Ks = transformation_mat( theta_s(1) ); Vqd0(:,1) = Ks * Vabc(:,1); U(:,1) = [Vqd0(:,1);TL(1)]; tic for n = 1:N-1 [Vref(n+1),ws(n+1),xn,werr_n] = V_f_controleur(Vb,wr_ref,wr(n),xn,werr_n); [Vabc(:,n+1),tri(n+1),d1(n+1),d2(n+1),d3(n+1),theta_s(n+1)] = inverseur(Vref(n+1),theta_s(n),ws(n),ws(n+1),t(n+1)); Ks = transformation_mat( theta_s(n+1) ); Vqd0(:,n+1) = Ks * Vabc(:,n+1); U(:,n+1) = [Vqd0(:,n+1);TL(n+1)]; X(:,n+1) = espace_d_etat(X(:,n),U(:,n),U(:,n+1),ws(n),ws(n+1)); Fqd0(:,n+1) = X(1:6,n+1); % Flux magnetique Iqd0(:,n+1) = M*Fqd0(:,n+1); % Courants Iabcs(:,n+1) = Ks \ Iqd0(1:3,n+1); wr(n+1) = X(7,n+1); theta_r(n+1) = theta_r(n) + dt/2*( wr(n) + wr(n+1) ); beta = theta_s(n+1) - theta_r(n+1); Kr = transformation_mat( beta ); Iabcr(:,n+1) = Kr \ Iqd0(4:6,n+1); end toc %____________________________________________________________________ % Calcul des variables dependentes % rad/s 60s/(2*pi)rad = tours/minute vitesse = (2*wr/P) *60/(2*pi) ; % rpm % Fqs = Fqd0(1,:); Fds = Fqd0(2,:); % Fqr = Fqd0(4,:); Fdr = Fqd0(5,:); % Te = 3*P*Xm./(4*D*ws) .* (Fqs.*Fdr - Fqr.*Fds); % couple électrique (formule alternatif) Iqs = Iqd0(1,:); Ids = Iqd0(2,:); Iqr = Iqd0(4,:); Idr = Iqd0(5,:); LM = Xm/wb; Te = 3/2 * (P/2) * LM * (Iqs.*Idr - Iqr.*Ids); pe = sum(Vabc.*Iabcs); %____________________________________________________________________ % Graphiques figure (1); subplot(2,1,1); plot(t,ws/(2*pi)); grid; title('f') xlabel('Temps (s)'); ylabel('Fréquence (Hz)') subplot(2,1,2); plot(t,Vref); grid; title('V_r_e_f') xlabel('Temps (s)'); ylabel('Tension (Volts)') figure (2); subplot(2,1,1); plot(t,d1); hold on; plot(t,d2); plot(t,d3); %plot(t,tri) xlabel('Temps (s)'); ylabel('d'); legend('da','db','dc'); title('Duty cycle'); subplot(2,1,2); plot(t,Vabc), legend('Va','Vb','Vc'); title('Tensions inverseur'); xlabel('Temps (s)'); ylabel('Tension (Volts)') figure(3) subplot(3,1,1); plot(t,Iabcs(1,:)); title('i_a_s'); xlabel('Temps (s)'); ylabel('Courant (A)'); grid subplot(3,1,2); plot(t,Iabcs(2,:)); title('i_b_s'); xlabel('Temps (s)'); ylabel('Courant (A)'); grid subplot(3,1,3); plot(t,Iabcs(3,:)); title('i_c_s'); xlabel('Temps (s)'); ylabel('Courant (A)'); grid figure(4) subplot(3,1,1); plot(t,Iabcr(1,:)); title('i_a_r'); xlabel('Temps (s)'); ylabel('Courant (A)'); grid subplot(3,1,2); plot(t,Iabcr(2,:)); title('i_b_r'); xlabel('Temps (s)'); ylabel('Courant (A)'); grid subplot(3,1,3); plot(t,Iabcr(3,:)); title('i_c_r'); xlabel('Temps (s)'); ylabel('Courant (A)'); grid figure(5) subplot(3,1,1); plot(t,wr*2/P); title('\omega_r'); xlabel('Temps (s)'); ylabel('rpm'); grid subplot(3,1,2); plot(t,Te); title('T_e'); xlabel('Temps (s)'); ylabel('N*m'); grid subplot(3,1,3); plot(t,pe); title('Puissance électrique'); xlabel('Temps (s)'); ylabel('W'); grid