function [Vabc,tri,d1,d2,d3,theta_m] = inverseur(Vref,thetas_n,wn,wm,tn) global wsw Vdc dt d = 2/(Vdc) * Vref; % duty-cycle % Bloc de saturation pour d if d > 1, d = 1; elseif d < 0, d = 0; end % integration numérique de ws theta_m = thetas_n + dt/2*(wn + wm); d1 = d*cos( theta_m ); d2 = d*cos( theta_m - 2*pi/3 ); d3 = d*cos( theta_m + 2*pi/3 ); delta = mod( wsw*tn + pi/2 , 2*pi); if delta < pi/2, tri = delta/(pi/2); elseif delta < 3*pi/2, tri = 2 - delta/(pi/2); else tri = delta/(pi/2)-4; end if d1 > tri, s1 = 1; else s1 = 0; end if d2 > tri, s2 = 1; else s2 = 0; end if d3 > tri, s3 = 1; else s3 = 0; end % Tensions ligne - neutre Van = s1*Vdc; Vbn = s2*Vdc; Vcn = s3*Vdc; Vn = -1/3 * (Van+Vbn+Vcn); % Tensions ligne - terre Va = Van + Vn; Vb = Vbn + Vn; Vc = Vcn + Vn; Vabc = [Va;Vb;Vc];