Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Hardware (http://www.velocityreviews.com/forums/f5-hardware.html)
-   -   vhdl coding for five phase svpwm for 5 phase stepper motor (http://www.velocityreviews.com/forums/t938283-vhdl-coding-for-five-phase-svpwm-for-5-phase-stepper-motor.html)

Keerthana 03-24-2012 06:06 AM

vhdl coding for five phase svpwm for 5 phase stepper motor
 
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];


All times are GMT. The time now is 01:12 AM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57