% fonctionnes de commutation convertisseur triphasé PWM sinusoidal. Jesus Morales % ELE4801. Machines et entraînements électriques. Hiver 2018. close all; clear; clc f = 100; w = 2*pi*f; fsw = 3e3; wsw = 2*pi*fsw; Tsw = 1/fsw; d = 0.8; dt = 1e-6; t = 0:dt:2/f; N = length(t); s1 = zeros(1,N); s2 = zeros(1,N); s3 = zeros(1,N); d1 = d*sin(w*t); d2 = d*sin(w*t-2*pi/3); d3 = d*sin(w*t+2*pi/3); tri = zeros(1,N); for n=1:N delta = mod(wsw*t(n)+pi/2,2*pi); if delta < pi/2, tri(n) = delta/(pi/2); elseif delta < 3*pi/2, tri(n) = 2 - delta/(pi/2); else tri(n) = delta/(pi/2)-4; end if d1(n) > tri(n), s1(n) = 1; end if d2(n) > tri(n), s2(n) = 1; end if d3(n) > tri(n), s3(n) = 1; end end figure; subplot(4,1,1); plot(w*t,tri); hold on; ylim([-1.2 1.2]); title('PWM sinusoïdal') plot(w*t/(pi/3),d1); plot(w*t,d2); plot(w*t/(pi/3),d3); xlabel('\omega_1t (rad)') legend('triangulaire','duty cycle phase A','duty cycle phase B','duty cycle phase C') subplot(4,1,2); plot(w*t,s1); ylim([-0.2 1.2]); title('s_1') xlabel('\omega_1t (rad)') subplot(4,1,3); plot(w*t,s2); ylim([-0.2 1.2]); title('s_2') xlabel('\omega_1t (rad)') subplot(4,1,4); plot(w*t,s3); ylim([-0.2 1.2]); title('s_3') xlabel('\omega_1t (rad)')