Relatorio Final Space Vector

Embed Size (px)

Citation preview

  • 8/11/2019 Relatorio Final Space Vector

    1/16

    COPPE / UFRJPROGRAMA DE ENGENHARIA ELTRICA

    CPE 713 MICROPROCESSADORES APLICADOA ELETRNICA DE POTNCIA

    MODULAO SPACE VECTOR EM LINGUAGEM C

    PROFESSOR L. G. B. ROLIM

    ALUNO: SAMUEL ALVES DE SOUZA

    15/12/2011

  • 8/11/2019 Relatorio Final Space Vector

    2/16

    CPE713 Terceiro Trabalho Entrega 07/11/11

    1) Escrever uma funo em C para calcular os valores instantneos dos sinais de

    referncia para modulao space vector, com as seguintes caractersticas: os parmetros de entrada so as coordenadas ve vdo vetor resultante a sersintetizado, com amplitudes normalizadas (-1,0 < {v, v} < 1,0). os parmetros de sada so as referncias (ndices de modulao) ma , mb e mcnormalizadas (-1,0 < {ma , mb , mc} < 1,0) a serem comparadas com as portadorastriangulares para comandar cada fase de um inversor.

    2) Criar um projeto no CCS para testar a funo do item 1 e medir seudesempenho (tempo mdio de execuo) usando o simulador para CPU da famliaC2000.

    Bibliografia:[1] http://dx.doi.org/10.1109/ISIE.1999.798657[2] http://dx.doi.org/10.1109/IECON.1999.822220[3] http://dx.doi.org/10.1590/S0103-17592005000100002[4] http://dx.doi.org/10.1109/CERMA.2009.42

  • 8/11/2019 Relatorio Final Space Vector

    3/16

    1) Cdigo em linguagem C:

    / * 3o. Trabal ho CPE713 2011_03

    SPACE VECTOR PWMProf . L. G. B. Rol i mAl uno: Samuel Al ves de Souza */

    #i ncl ude / / ut i l i zado par a cal cul o seno/ coseno#def i ne np 1000 / / t amanho do vet or de dados para gr f i co

    f l oat v[np]; / / vet or de dados par a gr f i counsi gned i nt p=0; / / i ni ci al i zao do pont ei r o do vet or de dadosunsi gned i nt set or =0; / / set or do space vect orf l oat w=377. 0; / / f r equenci a em r ad/ sf l oat k1=1. 0; / / t enso val pha e vbetha normal i zadaf l oat t =0. 0; / / t empo emsegundosf l oat val pha; / / t enso Val pha normal i zadaf l oat vbet ha; / / t enso Vbeta normal i zadaf l oat t ang; / / t angent e=Vbet a/ Val phaf l oat t emp_1; / / val or t empor r i of l oat t emp_2; / / val or t empor r i of l oat x; / / t empo x cl cul o ndi ce modul ao (r azo c cl i ca) f ase af l oat y; / / t empo y cl cul o ndi ce modul ao (r azo c cl i ca) f ase bf l oat z; / / t empo z cl cul o ndi ce modul ao ( r azo c cl i ca) f ase cf l oat ma; / / ndi ce de modul ao (r azo c cl i ca) f ase af l oat mb; / / ndi ce de modul ao (r azo c cl i ca) f ase bf l oat mc; / / ndi ce de modul ao (r azo c cl i ca) f ase cf l oat t 1; / / t empo de apl i cao vet or espaci al bsi cof l oat t 2; / / t empo de apl i cao vet or espaci al bsi cof l oat t s=0. 0005; / / t s=1/ f s f s=2 kHz f r equenci a de chaveament o

    voi d mai n(voi d){

    while(1){

    / * s i mul a gerao dos par amet r os de ent r ada: val pha e vbethaobs. : val pha e vbetha normal i zados por Vdc/ r ai z( 3

    val pha ( - 1, +1) e vbet ha( - 1, +1) */val pha=k1*cos(w*t );vbetha=k1*si n(w*t );t ang=vbetha/val pha;

    / * t empos ( x, y e z) de apl i cao dos vetores espaci as bsi cost omados como f r ao do per odo de chaveamento */

    t emp_1=vbet ha/2;t emp_2=0. 8660254*val pha;x=vbetha;y=t emp_1+t emp_2;z=t emp_1-t emp_2;

    / * i dent i f i ca setor * /if ((val pha==0)&&(vbetha==0))set or =0;else if ((val pha>0)&&(t ang>=0)&&(t ang

  • 8/11/2019 Relatorio Final Space Vector

    4/16

    else if ((val pha>0)&&(t ang>1. 73205))set or =2;else if ((val pha

  • 8/11/2019 Relatorio Final Space Vector

    5/16

    case 6: / * setor 6: t 1=y, t 2=- x ( ma, mc, mb) */t 1=y;t 2=-x;ma=(1-t 1-t 2)/2; / * taon=( 1- t 1- t 2) / 2 */mc=ma+t 1; / * t con=t aon+t 1 */mb=mc+t 2; / * t bon=t con+t 2 */

    break;

    }

    t =t +0. 00005;v[p]=ma;if(++p==np) p=0;

    }

    }-

  • 8/11/2019 Relatorio Final Space Vector

    6/16

    2) Tempo mdio de execuo no TMS320F28335 usando o simulador Texas:

    O tempo mdio de execuo foi aproximadamente 782 ciclos de clock.

  • 8/11/2019 Relatorio Final Space Vector

    7/16

    3) Grficos:

    As entradas v e v so componentes do vetor espacial resultante e so

    normalizadas pela mxima magnitude da tenso de fase ( )3(Vcc .

    Entrada (-1,0 < v,< 1,0).

    Entrada (-1,0 < v< 1,0).

    Setor

  • 8/11/2019 Relatorio Final Space Vector

    8/16

    As sadas so os ndices de modulao normalizados.

    Sada (-1,0 < ma < 1,0)

    Sada (-1,0 < mb < 1,0)

    Sada (-1,0 < mc< 1,0)

  • 8/11/2019 Relatorio Final Space Vector

    9/16

    4) Observaes;

    Para desenvolvimento deste trabalho trabalho revisado a teoria de modulao

    space vector, sendo utilizado as apresentaes das aulas da disciplina Controlede Mquinas Eltricas ( prof. Walter), o livro Modern Power Eletronics and ACDives (Bimal K. Bose) ed. 2002 e o material da Texas Instruments referente aobloco space vector (segue em anexo).

    Procurou-se seguir a sequncia apresentada pela Texas, porm a determinaodo setor foi definido fazer de outra forma e foram encontados erros nas tabela 69,70 e 71, sendo necessrio fazer todo o desenvolvimento para localizar o erro eento o programa em linguagem C funcionar adequadamente.

    Sequncia do cdigo C desenvolvido:

    1-Gerao das componentes valpha e vbetha normalizadas (-1, +1);

    2-Cculo de x, y e z (trs valores possveis de tempo de aplicao dos vetoresespaciais) ;

    3-Determinao do setor aonde se localiza o vetor espacial resultante (baseadonos valores da tangente e nos sinais de valpha e vbetha);

    4-Clculo de t1 e t2 (tempos de aplicao) dos vetores espaciais bsicosnormalizados pelo perodo t ( t1+t2+t0).

    5-Clculo dos ndices de moduo (razes cclicas) taon, tbon e tcon;

    6-Atribuio dos ndices de modulao as pernas (braos) do inversor.

  • 8/11/2019 Relatorio Final Space Vector

    10/16

    Background Information

    SVGEN_DQ 197

    Background Information

    The Space Vector Pulse Width Modulation (SVPWM) refers to a special switching se-

    quence of the upper three power devices of a three-phase voltage source inverters(VSI) used in application such as AC induction and permanent magnet synchronous

    motor drives. This special switching scheme for the power devices results in 3 pseudo-

    sinusoidal currents in the stator phases.

    motor phases

    VDC +

    a cb

    Q6Q4Q2

    Q5Q3Q1

    Va Vb Vc

    ca b

    Figure 27. Power Circuit Topology for a Three-Phase VSI

    It has been shown that SVPWM generates less harmonic distortion in the output volt-

    ages or currents in the windings of the motor load and provides more efficient use of

    DC supply voltage, in comparison to direct sinusoidal modulation technique.

    ca b

    VDC

    a

    A

    b

    B

    c

    C

    Z

    Z Z

    N

    ACI or PMSM

    Figure 28. Power Bridge for a Three-Phase VSI

    For the three phase power inverter configurations shown in Figure 27 and Figure 28,

    there are eight possible combinations of on and off states of the upper power transis-

    tors. These combinations and the resulting instantaneous output line-to-line and

    phase voltages, for a dc bus voltage of VDC,are shown in Table 68.

  • 8/11/2019 Relatorio Final Space Vector

    11/16

    Background Information

    198 SPRU456

    Table 68. Device On/Off Patterns and Resulting Instantaneous Voltages of a3-Phase Power Inverter

    c b a V AN VBN VCN VAB VBC VCA

    0 0 0 0 0 0 0 0 0

    0 0 1 2VDC/3 VDC/3 VDC/3 VDC 0 VDC

    0 1 0 VDC/3 2VDC/3 VDC/3 VDC VDC 0

    0 1 1 VDC/3 VDC/3 2VDC/3 0 VDC VDC

    1 0 0 VDC/3 VDC/3 2VDC/3 0 VDC VDC

    1 0 1 VDC/3 2VDC/3 VDC/3 VDC VDC 0

    1 1 0 2VDC/3 VDC/3 VDC/3 VDC 0 VDC

    1 1 1 0 0 0 0 0 0

    The quadrature quantities (in the (,) frame) corresponding to these 3 phase voltagesare given by the general Clarke transform equation:VsVAN

    Vs (2VBNVAN) 3

    In matrix from the above equation is also expressed as,

    VsVs 23

    1

    0

    12

    32

    12

    32

    VANVBNVCN

    Due to the fact that only 8 combinations are possible for the power switches, VsandVscan also take only a finite number of values in the (,) frame according to the sta-tus of the transistor command signals (c,b,a). These values of Vsand Vsfor the corre-

    sponding instantaneous values of the phase voltages (VAN, VBN,VCN) are listed in

    Table 69.

    Table 69. Switching Patterns, Corresponding Space Vectors and their (,)Components

    c b a V s Vs Vector

    0 0 0 0 0 O0

    0 0 1 0 U0

    0 1 0 U120

    0 1 1 U60

    1 0 0 U240

    1 0 1 U300

    1 1 0 0 U180

    1 1 1 0 0 O111

    23

    VDC

    VDC

    3VDC3

    VDC3

    VDC

    3

    VDC3

    VDC

    3VDC3

    VDC

    3

    23

    VDC

  • 8/11/2019 Relatorio Final Space Vector

    12/16

    Background Information

    SVGEN_DQ 199

    These values of Vsand Vs,listed in Table 69, are called the (,) components of thebasic space vectors corresponding to the appropriate transistor command signal

    (c,b,a). The space vectors corresponding to the signal (c,b,a) are listed in the last col-

    umn in Table 69. For example, (c,b,a)=001 indicates that the space vector is U0.Theeight basic space vectors defined by the combination of the switches are also shown

    in Figure 29.

    U120(010)

    U240(100)

    U60(011)

    U300(101)

    U180(110) U0(001)O111(111) O0(000)

    Figure 29. Basic Space Vectors

    Projection of the stator reference voltage vector Uout

    The objective of Space Vector PWM technique is to approximate a given stator refer-

    ence voltage vector Uoutby combination of the switching pattern corresponding to the

    basic space vectors. The reference vector Uoutis represented by its (,) components,Ualfa and Ubeta. Figure 30 shows the reference voltage vector, its (,) components

    and two of the basic space vectors, U0and U60. The figure also indicates the resultantand components for the space vectors U0and U60. Vsrepresents the sum ofthe components of U0and U60, while Vsrepresents the sum of the componentsof U0and U60. Therefore,

    Vs 0VDC3

    VDC

    3

    Vs 2VDC3 VDC3 VDC

  • 8/11/2019 Relatorio Final Space Vector

    13/16

    Background Information

    200 SPRU456

    0

    V

    s

    U60(011)

    UbetaUout

    T3T

    U60

    T1T

    U0Ualfa U0(001) Vs

    60

    Figure 30. Projection of the Reference Voltage Vector

    For the case in Figure 30, the reference vector Uoutis in the sector contained by U0and

    U60.Therefore Uoutis represented by U0and U60. So we can write,

    TT1T3T0

    UoutT1T

    U0T3T

    U60

    where, T1 and T3are the respective durations in time for which U0and U60are applied

    within period T. T0 is the time duration for which the null vector is applied. These time

    durations can be calculated as follows:

    UbetaT3T

    |U60| sin

    UalfaT1T

    |U0| T3T

    |U60| cos

    (60)

    (60)

    From Table 69 and Figure 30 it is evident that the magnitude of all the space vectors

    is 2VDC/3. When this is normalized by the maximum phase voltage(line to neutral),

    VDC/3, the magnitude of the space vectors become 2/3 i.e., the normalized magni-tudes are |U0|= |U60| =2/3. Therefore, from the last two equations the time durationsare calculated as,

    T1T

    2 3

    UalfaUbetaT3TUbeta

    Where, Ualfa and Ubeta also represent the normalized (,) components of Uoutwithrespect to the maximum phase voltage(VDC/3). The rest of the period is spent in applyingthe null vector T0. The time durations, as a fraction of the total T, are given by,

    t1T1T 3 UalfaUbeta

    t2T3TUbeta

  • 8/11/2019 Relatorio Final Space Vector

    14/16

    Background Information

    SVGEN_DQ 201

    In a similar manner, if Uoutis in sector contained by U60and U120,then by knowing

    |U60| = |U120| = 2/3 (normalized with respect to VDC/3), the time durations can bederived as,

    t1T2T 1

    2 3 UalfaUbeta

    t2T3T 1

    2 3 UalfaUbeta

    where, T2is the duration in time for which U120is applied within period T

    Now, if we define 3 variables X, Y and Z according to the following equations,

    Y 12 3 UalfaUbeta

    Z 12 3 UalfaUbeta

    XUbeta

    Then for the first example, when Uoutis in sector contained by U0and U60,t1= Z, t2=X.

    For the second example, when Uoutis in sector contained by U60and U120, t1=Z, t2=Y.

    In a similar manner t1 and t2 can be calculated for the cases when Uoutis in sectors

    contained by other space vectors. For different sectors the expressions for t1 and t2

    in terms of X, Y and Z are listed in Table 70.

    Table 70. t1 and t2 Definitions for Different Sectors in Terms of X, Y and ZVariables

    Sector U0, U60 U60, U120 U120, U180 U180, U240 U240, U300 U300, U0

    t1 Z Z X X Y Y

    t2 X Y Y Z Z X

    In order to know which of the above variables apply, the knowledge of the sector con-

    taining the reference voltage vector is needed. This is achieved by first converting the

    (,) components of the reference vector Uoutinto a balanced three phase quantities.That is, Ualfa and Ubeta are converted to a balanced three phase quantities Vref1, Vref1and Vref1according to the following inverse clarke transformation:

    Vref1Ubeta

    Vref2UbetaUalfa 3

    2

    Vref3UbetaUalfa 3

    2

    Note that, this transformation projects the quadrature or component, Ubeta, intoVref1.This means that the voltages Vref1Vref2and Vref3are all phase advanced by 90

    O

    when compared to the corresponding voltages generated by the conventional inverse

    clarke transformation which projects the component, Ualfa, into phase voltage VAN.The following equations describe the (,) components and the reference voltages:

  • 8/11/2019 Relatorio Final Space Vector

    15/16

    Background Information

    202 SPRU456

    Ualfa sintUbeta costVref1 costVref2 cos(t 120 )Vref3 cos(t 120 )

    Note that, the above voltages are all normalized by the maximum phase volt-

    age(VDC/3).

    907FFFh

    0

    8000h

    Ubeta

    Ualfa

    Figure 31. (,) Components of Stator Reference Voltage

    1207FFFh

    0

    8000h

    Vref1 Vref2Vref3

    Figure 32. Voltages Vref1Vref2and Vref3

    From the last three equations the following decisions can be made on the sector infor-

    mation:

    If Vref1> 0 then a=1, else a=0

    If Vref2> 0 then b=1, else b=0

    If Vref3> 0 then c=1, else c=0

    The variablesectorin the code is defined as, sector = 4c+2b+a

    For example, in Figure 29 a=1 for the vectors U300,U0and U60. For these vectors the

    phase of Vref1are t=300,t=0 and t=60respectively. Therefore, Vref1> 0 when a=1.

    The (,) components, Ualfa and Ubeta, defined above represent the output phasevoltages VAN, VBNand VCN. The following equations describe these phase voltages:

    VAN sintVBN sin(t )VCN sin(t )

    120

    120

    The Space Vector PWM module is divided in several parts:

    Determination of the sector

    Calculation ofX, YandZ

  • 8/11/2019 Relatorio Final Space Vector

    16/16

    Background Information

    SVGEN_DQ 203

    Calculation of t1and t2

    Determination of the duty cycle taon, tbonand tcon

    Assignment of the duty cycles to Ta, Tband Tc

    The variables taon, tbonand tconare calculated using the following equations:

    taonPWMPRD t1 t2

    2tbontaon t1tconTbon t2

    Then the right duty cycle (txon) is assigned to the right motor phase (in other words,

    to Ta, Tb and Tc) according to the sector. Table 71 depicts this determination.

    Table 71. Assigning the Right Duty Cycle to the Right Motor Phase

    Sector U0, U60 U60, U120 U120, U180 U180, U240 U240, U300 U300, U0

    Ta taon tbon tcon tcon tbon taon

    Tb tbon taon taon tbon tcon tcon

    Tc tcon tcon tbon taon taon tbon

    Example:

    Sector contained by U0and U60.

    T

    t

    t

    t

    PWM1

    PWM3

    PWM5

    t

    Ta

    Tc

    Tb

    tcon

    tbon

    taon

    T04 T62 T62 T04 T04 T64 T44 T04

    V0 V6 V4 V7 V7 V6 V4 V0

    Figure 33. PWM Patterns and Duty Cycles for Sector Contained by U0andU60

    Table 72. Variable Cross Ref Table

    Variables in the Equations Variables in the Code

    a r1

    b r2

    c r3

    Vref1 Va