SINUSOIDAL PULSE- WIDTH MODULATION

To generate output pulses by varying modulating index (ma) and to find the THD and FFT analysis.





Software Used: MATLAB R2018a

Theory:

The term SPWM stands for “Sinusoidal pulse width modulation” is a technique of pulse width modulation used in inverters. An inverter generates an output of AC voltage from an input of DC with the help of switching circuits to reproduce a sine wave by generating one or more square pulses of voltage per half cycle. If the size of the pulses is adjusted, the output is said to be pulse width modulated. 

Main idea behind this conversion is the fact that sine wave has a higher magnitude at its centre (90 degrees) and it's reducing as go far from the centre both side (toward 0 degree and 180 degrees). Thus, supplying dc voltage of varying width such that it has high width around the centre and smaller at far from centre resembles sine shape. This DC voltage can be switched from either from 0 to Vdc or from Vdc to –Vdc to produce the same effect which calls unipolar and bipolar technique respectively. Name unipolar is given as switched DC voltage applied to the load remains positive during the positive cycle and negative during the negative cycle. While in bipolar method this voltage switches in both the direction throughout the cycle. Thus, the bipolar method produces twice the voltage stress on load than maximum AC voltage that can be produced by the inverter. Thus, the unipolar method is more preferable.

UNIPOLAR SINUSOIDAL PULSE- WIDTH MODULATION

MATLAB Code:

clc; %clear the command window

clear all; %clear the workspace

close all; %close all previous figure window

f=50; %Frequency

w=2*pi*f;

t=0:0.00001 :1/f; %range of time period

s1=sin(w*t); %positive sine pulse

s2=-sin(w*t); %negative sine pulse

car2=asin(sin(10*w*t))*(1.333); %carrier pulse

 

ma=0.01:0.01:1

 for(i=1:max(size(ma)))

   sq2=ma(i)*s1;

   sq3=ma(i)*s2;

  

o1(i,:)=(car2>=sq2 );

o2(i,:)=(car2<=sq2 );

o3(i,:)=o1(i,:)-o2(i,:)

 

o11(i,:)=(car2>=sq3 );

o22(i,:)=(car2<=sq3 );

o4(i,:)=o11(i,:)-o22(i,:)

o5(i,:)=(-o3(i,:)+o4(i,:)) %output pulse

   

   

N=max(size(o5(i,:)));

y(i,:)=(2/N)*abs(fft(o5(i,:),N));    %FFT analysis formula

C1(i,:)=sum(y(i,:).^2); %Sum of the hormonic components in output signal

C2(i,:)=sqrt(C1(i,:)-y(i,2).^2);    %Square root of (sum of hormonic components-First hormonic component)

C3(i,:)=C2(i,:)/y(i,2); % Finding Total hormonic distortion(THD)

end

 

figure()

plot(t,o5(50,:)%  Plot of Output signal with modulation index=0.5

figure()  %To plot separate figure

bar(ma,C3(:,1))

axis([0 .1 -1 11])

figure()

plot(ma,y(:,2:2:8)); % Plot of Modulation index vs. THD

set(gca,'Xdir','reverse');

 

Waveforms:

Fig5.1.1: Comparison of Reference with Carrier wave

Fig5.1.2: Reference Pulse of different ma

Fig5.1.3: Harmonics Profile of Unipolar SPWM

Fig5.1.4: Output Pulse for Unipolar SPWM for ma=0.50

Fig.5.1.5: FFT Analysis of Unipolar PWM

 

BIPOLAR SINUSOIDAL PULSE- WIDTH MODULATION

MATLAB Code:

clc; %clear the command window

clear all; %clear the workspace

close all; %close all previous figure window

f=50; %Frequency

w=2*pi*f;

t=0:0.00001 :1/f; %range of time period

s1=sin(w*t);

car2=asin(sin(10*w*t))*(1.333);

 

% subplot(4,1,1)

% plot(t,car2)

% hold on

% plot(t,s1)

%

% subplot(4,1,2)

% plot(t,o1)

%

% subplot(4,1,3)

% plot(t,o2)

% subplot(4,1,4)

% plot(t,o3)

 

ma=0.01:0.01:1;

 for(i=1:max(size(ma)))

   sq2=ma(i)*s1; %modulation index * reference signal

  

o1(i,:)=(car2>=sq2);

o2(i,:)=(car2<=sq2);

o3(i,:)=o1(i,:)-o2(i,:) %Output Pulse

    plot(t,sq2)

    hold on

   

    N=max(size(o3(i,:)));

    y(i,:)=(2/N)*abs(fft(o3(i,:),N)); %FFT analysis formula

    C1(i,:)=sum(y(i,:).^2);%Sum of the hormonic components in output signal

    C2(i,:)=sqrt(C1(i,:)-y(i,2).^2);  %Square root of (sum of hormonic components-First hormonic component)

    C3(i,:)=C2(i,:)/y(i,2);  % Finding Total hormonic distortion(THD)

end

 

figure()

plot(t,o3(50,:))    %  Plot of Output signal with modulation index=0.5

figure()            %To plot separate figure

bar(ma,C3(:,1))

axis([0 .1 -1 11])

figure()

plot(ma,y(:,2:2:8));     % Plot of Modulation index vs. THD

set(gca,'Xdir','reverse');

 

Waveforms:

Fig5.2.1: Comparison of Reference with Carrier wave

Fig5.2.2: A reference signal of different ma

Fig5.2.3: Output Pulse for ma=0.50


Fig5.2.4: Harmonics Profile for Bipolar- PWM


Fig5.2.5: FFT Analysis of Bipolar PWM

Observation:

1.     As the ma increases, THD of the output pulse decreases as seen from FFT analysis of a signal.

2.     By varying the ma value, we can vary the width of the output pulse.

3.     For unipolar PWM compares the 2 sine waves whereas for bipolar compare only one Sine wave.

4.     In unipolar as well as bipolar, the fundamental component dominates and remaining have almost close to zero harmonics value as seen from ma vs amplitude graph.

5.     The output pulse which is seen symbolises the sine wave only first the pulse is less than increases at centre max and then decreases in case of Unipolar PWM whereas in case of bipolar where only one sine wave is compared does not gives like waveform which looks like sinusoidal. So we can say unipolar is the best technique. 

6.     If we compare the THD in case of Unipolar it has an amplitude of 14 but in case of bipolar it has an amplitude of 160 so Bipolar in the sense has more harmonics content.

 

Result: By the above experiment we can say that if ma is varied from 0 to 1, output pulse generation will be as shown in fig 5.1.4 and 5.2.3 for ma = 0.50. THD and FFT analysis is also done for the same ma i.e. 0.50.

  

Post a Comment

Please do not enter any spam links in the comments...

Previous Post Next Post