Velocity Reviews > vhdl coding for five phase svpwm for 5 phase stepper motor

# vhdl coding for five phase svpwm for 5 phase stepper motor

Keerthana
Junior Member
Join Date: Mar 2012
Posts: 1

 03-24-2012
Dear Sir,
i'm doing my final year project.please help me to develop a vhdl coding for five phase svpwm.it will be very urgent.now only i got your link for vhdl codings.pls help me.
here i attached my matlab coding.pls send the synthezisable vhdl coding
function [gp,v, thetta] =svpwm(t)
st=t*314;
s=1;
vdc=220;
Ts=0.000333;
%delta=2825.84;
k=1.6180;
alpha=(2*pi)/5;

% Fundamental Voltage
va=vdc*cos(st);
vb=vdc*cos(st-alpha);
vc=vdc*cos(st-(2*alpha));
vd=vdc*cos(st-(3*alpha));
ve=vdc*cos(st-(4*alpha));

%d-q plane voltage
v_ds1=(2/5)*((va)-(0.3090*vb)+(0.8090*vc)+(0.8090*vd)+(0.0348*ve));
v_qs1=(2/5)*(0+(0.9516*vb)-(0.8090*vc)+(0.3090*vd)-(0.3090*ve));
v_ds3=(2/5)*((-va*0.8090)-(0.0348*vb)-(vc)-(0.3090*vd)+(0.8090*ve));
v_qs3=(2/5)*((-va*0.3090)-(0.3090*vb)-0+(0.8090*vd)-(0.3090*ve));
v_d=sqrt((v_ds1)^2+(v_ds3)^2);
v_q=sqrt((v_qs1)^2+(v_qs3)^2);
%Vref calculation
v_ref=sqrt((v_d)^2+(v_q)^2);
theta=1/tan(v_d/v_q);

%voltage calculation
T=(2/5)*[ 1 0 1 0 0.707
cos(alpha) sin(alpha) cos(3*alpha) sin(3*alpha) 0.707
cos(2*alpha) sin(alpha) cos(6*alpha) sin(6*alpha) 0.707
cos(3*alpha) sin(alpha) cos(9*alpha) sin(9*alpha) 0.707
cos(4*alpha) sin(alpha) cos(12*alpha) sin(12*alpha) 0.707];%(1/(sqrt2))
dq=[v_ds1
v_qs1
v_ds3
v_qs3
0];

V=T*dq;

%switching time calculation
t1=(2/5)*(v_ref/vdc)*((sin((pi/5)-theta))/(sin((pi/5))*(1/(1+k^2))));
t2=(2/5)*(v_ref/vdc)*((sin(theta))/(sin(pi/5))*(k/(1+k^2)));
t3=(2/5)*(v_ref/vdc)*((sin((pi/5)-theta))/(sin((pi/5))*(k/(1+k^2))));
t4=(2/5)*(v_ref/vdc)*((sin(theta))/(sin((pi/5))*(1/(1+k^2))));
t0=Ts-t1-t2-t3-t4;

if s==1
sa=t1+t2+t3+t4+(t0/2);
sb=(t0/2);
sc=(t0/2)+t1;
sd=(t0/2)+t1+t2;
se=(t0/2)+t1+t2+t3;

elseif s==2
sa=t1+t2+t3+t4+(t0/2);
sb=(t0/2)+t1;
sc=(t0/2)+t1+t2;
sd=(t0/2)+t1+t2+t3;
se=(t0/2);
elseif s==3
sa=(t0/2)+t1+t2+t3;
sb=t1+t2+t3+t4+(t0/2);
sc=(t0/2);
sd=(t0/2)+t1;
se=(t0/2)+t1+t2;

elseif s==4
sa=(t0/2);
sb=t1+t2+t3+t4+(t0/2);
sc=(t0/2)+t1;
sd=(t0/2)+t1+t2;
se=(t0/2)+t1+t2+t3;

elseif s==5
sa=(t0/2);
sb=(t0/2)+t1;
sc=t1+t2+t3+t4+(t0/2);
sd=(t0/2)+t1+t2;
se=(t0/2)+t1+t2+t3;

elseif s==6
sa=(t0/2)+t1;
sb=(t0/2)+t1+t2;
sc=t1+t2+t3+t4+(t0/2);
sd=(t0/2)+t1;
se=(t0/2);

elseif s==7
sa=(t0/2)+t1;
sb=(t0/2)+t1+t2;
sc=(t0/2)+t1;
sd=t1+t2+t3+t4+(t0/2);
se=(t0/2);

elseif s==8
sa=(t0/2)+t1+t2;
sb=(t0/2)+t1+t2+t3;
sc=(t0/2);
sd=t1+t2+t3+t4+(t0/2);
se=(t0/2)+t1;

elseif s==9
sa=(t0/2)+t1+t2;
sb=(t0/2)+t1+t2+t3;
sc=(t0/2);
sd=(t0/2)+t1;
se=t1+t2+t3+t4+(t0/2);

else
sa=(t0/2)+t1+t2+t3;
sb=(t0/2);
sc=(t0/2)+t1;
sd=(t0/2)+t1+t2;
se=t1+t2+t3+t4+(t0/2);
end

gp=[sa,sb,sc,sd,se,];
v=[V];
thetta=[theta];

Last edited by Keerthana; 03-27-2012 at 05:25 PM.. Reason: for quick reply.urgent need of coding