vhdl coding for five phase svpwm for 5 phase stepper motor

Discussion in 'Hardware' started by Keerthana, Mar 24, 2012.

  1. Keerthana

    Keerthana

    Joined:
    Mar 24, 2012
    Messages:
    1
    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: Mar 27, 2012
    Keerthana, Mar 24, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. asapanya

    Vhdl Coding

    asapanya, Mar 8, 2006, in forum: Hardware
    Replies:
    12
    Views:
    3,040
    bigal
    May 7, 2007
  2. mreddy.a

    Phase locked loop VHDL code

    mreddy.a, Sep 16, 2007, in forum: Hardware
    Replies:
    0
    Views:
    1,658
    mreddy.a
    Sep 16, 2007
  3. Giuen
    Replies:
    0
    Views:
    584
    Giuen
    Sep 12, 2008
  4. crispvlsi

    i2c coding in VHDL

    crispvlsi, Oct 16, 2008, in forum: Software
    Replies:
    1
    Views:
    867
    crispvlsi
    Oct 16, 2008
  5. becool_nikks
    Replies:
    0
    Views:
    1,892
    becool_nikks
    Mar 6, 2009
Loading...

Share This Page