MATLAB_Урок5.pdf

download MATLAB_Урок5.pdf

of 8

Transcript of MATLAB_Урок5.pdf

  • 8/11/2019 MATLAB_5.pdf

    1/8

    -

    , - - . -

    - () .

    , - [1].

    1. -

    - . : -

    310 , -

    1 , 50 -

    0,95. 10 , 5 . - MOSFET-,

    - .

    . 1 , , -

    , - 1.

    Discrete PWM Generator (. 1). - (. 1),

    - (: ) . Parametrs . Generator Mode (-

    ). :

    1-arm bridge (2 pulses) (2 );

    2-arm bridge (4 pulses)

    (4 ); 3-arm bridge (6 pulses)

    (6 );

    Double 3-arm bridge (12 pulses)

    (12 ); Carrier frequency (Hz) (); Sample time ; Internal generation jf modulating signal(s) -

    () -

    (). . Modulation index () -

    ( 0 1). Frequency of output voltage (Hz) -

    (); Phase of output voltage (degrees)

    ().

    . 1, 0,95 ,

    - .

    , 12006

    MATLAB

    5.

    ,. . .,

    [email protected]

    , , : , - . Simulink SimPowerSystems ,

    . , 14.

    22 www.finestreet.ru

    1

    Sample Time (s) 1e5Powergui

    SimPowerSystems

    Lconnector L( )

    SimPowerSystems\Connectors

    Ground (output) ()SimPowerSystems\Connectors

    Scope Simulink\Sinks

    DC Voltage Source

    DC

    SimPowerSystems\

    Electrical Sources

    Voltage Measurement Um

    SimPowerSystems\Measurements

    Current Measurement InSimPowerSystems\Measurements

    10 0,005 C = inf

    Series RLC Branch RLC

    ResistanceInductance

    Capacitance

    SimPowerSystems\ Elements

    Number of bridge arms 2Port configuration ABC as output terminalsPower Electronic devices MOSFET/Diodes

    Universal Bridge

    Discrete PWM Generator

    Simulink\Extra Library\Discrete Control Blocks

    SimPowerSystems\Power Electronics

    (. . 1)

    Amplitude (V) 310

    SE#7(1).qxd 2/22/2006 12:50 PM Page 22

  • 8/11/2019 MATLAB_5.pdf

    2/8

    Universal Bridge , , - (. 1). -

    -, - . ,

    -, Invert , Simulation/

    Simulation parameters, Stop

    time 0,1, Max step size auto.

    ode15s.

    -

    Powergui Sample time (. 2).

    RL- (. 3). , - -

    0,02 (. 3) . ,

    -

    , 1 , -

    L. - . 3. -

    - .

    50 (. 3). - , - ,

    (. 3). -

    -

    -

    . Parametrs, , -

    Scope

    Parametrs. Data history . Limit

    data points to last, Variable name () -, In. Format ()

    Structurewith time ( ). - , -

    -, Um. -

    Powergui Sample time, 0,10,01

    . - - = 0,001,

    0,00001. Powergui - , - (. 1

    ). .

    -

    Powergui (. 2),

    , 12006

    23www.finestreet.ru

    . 1. ()

    Discrete PWM Generator ()

    Universal Bridge ()

    . 2. Powergui

    . 3. (, ) (, )

    SE#7(1).qxd 2/22/2006 12:50 PM Page 23

  • 8/11/2019 MATLAB_5.pdf

    3/8

    FFTAnalysis - Powergui: FFT

    Tools (. 4). ( ): Structure []

    , - In Um, -

    - ;

    Input ; Signal number ; Start time (s) [ ] -

    , - ;

    Number of cicles [ -

    ] -, ;

    : Display FFT window -

    ; Display entire signal -

    . :

    Fundamental frequency (Hz)

    (); Max Frequency (Hz) -

    , ;

    Frequency axis .

    Hertz() Harmonic order( );

    Display style . -

    : Bar (relative Fund. or DC) (-

    -

    ); List (relative Fund. or DC) (-

    -

    ); Bar (relative to specified base)

    ( -

    ); List (relative to specified base)

    ( -

    ). Base value .

    (. 4): - In 1; 0,01 (

    ); 4 (

    5, ); FFT ; 50 ; 2500 ;

    ; - . Display - 4 - In (. 4). , -

    50

    29,17 . -

    1%(0,3 ) .

    2 . - , THD TotalHarmonic Distronsion, -

    7%. . 4 - -

    , , , THD - (- - 5 -

    ). Um (. 4) -

    295 , -

    2 - 65 (. 4). 1%.

    - 43,7%.

    -

    . - , -

    , -. -

    . 5 - , -

    -. - I, U

    t To Workspace (- Simulink, Sinks) Clock( Simulink, Sources)

    (. 5). Clock - Decimation.

    1. - To Workspace Variable name

    I, U t ( - ), - Decimation ( 10), -

    0,00001 - Save format ( ) Array.

    -

    Invert_W, , -

    , 12006

    24 www.finestreet.ru

    . 4. Powergui: FFT Tools

    In () Um ()

    ( )

    . 5. ()

    ()

    SE#7(1).qxd 2/22/2006 12:50 PM Page 24

  • 8/11/2019 MATLAB_5.pdf

    4/8

    . - ,

    MATLAB View/Workspace. , -

    (. 5). , - -

    10011 I, U, t.

    MATLAB

    plot (t, I)

    ,

    t I. -

    . ( Enter) - , (. 3),

    (. 6). - U -,

    plot (t, U).

    -

    ( I) - . - File/New/M-file -

    (

    Untitled), - . (. 7) -

    .

    .

    % - . ,

    10 . - - 10001, -

    . - , Nd. ,

    MATLAB - () -

    2n.

    , - .

    (. 7)

    fft ( - I ) abs -

    . -

    , MATLAB, , - help fft. - -

    , - t(1:250), s(1:250) , -

    . - File/Save As - , Furie,

    . -

    Debug/Save and Run

    Debug/Run ( , ). . 7 -

    , - . , - 15 , -

    . . - -

    2 , . 4.

    -

    -. -

    ,

    . MATLAB -

    - , - ,

    . - ,

    , -.

    -

    , - -

    MATLAB, - .

    n- -

    , (1)

    (1) -

    , - ; x(t) - ; u(t) -

    ;y(t) (); A, B, C, D : A , -

    nxn n, - ; B , - n, -

    ; C ( -, n); D -

    ( , ).

    power2sys, -

    - , - SimPowerSystem

    Simulink.:

    power2sys -

    A, B, C, D , (1). -

    Simulink - - -

    MATLAB.

    :

    power2sys('sys', 'structure')

    sys.

    power2sys('sys', 'ss')

    - A, B, C, D.

    power2sys - SimPowerSystem . -

    , ss statespace ( ). - -

    LC- -, ,

    . R (. 8).

    - -

    , 12006

    25www.finestreet.ru

    . 6. I

    ,

    . 7. ()

    ()

    SE#7(1).qxd 2/22/2006 12:50 PM Page 25

  • 8/11/2019 MATLAB_5.pdf

    5/8

    . -

    -

    power2sys LC-.

    2. - LC- L1 = 15 ,

    C1 = 2 R = 8 - LC- L1 = 15 ,C1 = 2 , L2 = 3 , C2 = 15 , R = 8

    .

    . 9 ( LC_1_Filter)

    . 9 ( LC_2_Filter), 2.

    LC_1_Filter -

    . - (. 10). MATLAB

    :

    >> H1=power2sys('LC_1_Filter', 'ss')

    , - , -

    , - ( - ),

    a =

    U c_ C1 =2 e- 6 I l_ L1 =0 .0 15

    Uc_C1=2e-6 -6.25e+004 5e+005

    Il_L1=0.015 -1000 0

    b =

    U_Controlled

    Uc_C1=2e-6 0

    Il_L1=0.015 1000

    c =

    U c_ C1 =2 e- 6 I l_ L1 =0 .0 15

    U_Voltage Me 1 0

    d =

    U_Controlled

    U_Voltage Me 0

    Continuous-time model.

    , -

    Il L1 -

    Uc C1,

    U_Voltage Measurement Uc_C1 U_Controlled. , -

    Continuous-time model. - tf, -

    1 (ss-) - s, -

    . - ss--

    , :

    >> W1=tf(H1)

    -

    Transfer function from input U_Controlled Voltage Source to out-

    put U_Voltage Measurement:

    5e008------------------------

    s^2 + 6.25e004 s + 5e008

    , -

    .10, - :

    >> H2=power2sys('LC_2_Filter', 'ss')

    a =

    Uc_C1=2e-6 Uc_C2=15e-6 Il_L1=0.015 Il_L2=3e-3

    Uc_C1=2e-6 0 0 5e+005 -5e+005

    Uc_C2=15e-6 0 -6667 0 6.667e+004

    Il_L1=0.015 -1000 0 0 0

    Il_L2=3e-3 333.3 -333.3 0 0

    b =

    U_Controlled

    Uc_C1=2e-6 0

    Uc_C2=15e-6 0

    Il_L1=0.015 1000

    Il_L2=3e-3 0

    c =

    Uc_C1=2e-6 Uc_C2=15e-6 Il_L1=0.015 Il_L2=3e-3

    U_Voltage Me 0 1 0 0

    d =

    U_Controlled

    U_Voltage Me 0

    Continuous-time model.

    -

    >> W2=tf(H2)

    - , - .

    - .

    Transfer function from input U_Controlled Voltage Source to out-

    put U_Voltage Measurement:

    1.111e016

    --------------------------------------------------------

    s^4 + 6667 s^3 + 6. 889e008 s^2 + 4.444e012 s + 1.111e016

    - ( -

    - ), MATLAB -

    , 12006

    26 www.finestreet.ru

    . 8.

    LC-

    . 9. - ()

    () LC-

    2

    3

    R = 8 , L= 0, C= infR = 0, L= 0,015, C = infR= 0, L= 0, C =2e6

    R = 0, L = 0,003 , C = infR=0, L=0, C = 15e6

    Source Type AC

    Lconnector L

    Scope

    Voltage Measurement

    Series RLC Branch

    RLCResistance R

    Inductance L1Capacitance C1

    Inductance L2Capacitance C2

    Controlled Voltage Source

    SimPowerSystems\Connectors

    Simulink\Sinks

    SimPowerSystems\Measurements

    SimPowerSystems\Elements

    SimPowerSystems\Electrical Sources

    Wafe form sinAmplitude 1 V

    Frequency 1000 HzSignal Generator Simulink\Sources

    SE#7(1).qxd 2/22/2006 12:50 PM Page 26

  • 8/11/2019 MATLAB_5.pdf

    6/8

    >> bode(W1)

    (. 11). , - 0 100 -

    , 1 . 180.

    - -

    , -

    , - freqs , - -

    . - , -

    s , - -.

    :

    >> freqs([5e008],[1 6.25e004 5e008])

    -

    (. 11), - , - (magnitude)

    () -

    . -

    >> bode(W2)

    >> freqs([1.111e016],[1 6667 6.889e008 4.444e012 1.111e016])

    (. 11, ). ,

    ( ) - 180 360 - .

    ,

    . 0 180,

    , .

    , 12006

    27www.finestreet.ru

    . 10.

    - () () LC-

    . 11. (, ) - (, ) LC- (, ) (, )

    SE#7(1).qxd 2/22/2006 12:50 PM Page 27

  • 8/11/2019 MATLAB_5.pdf

    7/8

    , 10 - -

    - 180.

    ,

    , -- .

    MATLAB c2d.

    WZ=c2d(sys,Ts,'met')

    sys, Ts -

    met.

    help c2d.

    - - tustin.

    - . -

    , - W2. :

    >> WZ2=c2d(W2,2e-5,'tustin')

    - ,

    Sampling time

    Transfer function from input U_Controlled Voltage Source to output

    U_Voltage Measurement:

    9.746e-005 z^4 + 0.0003898 z^3 + 0.0005847 z^2 + 0.0003898 z + 9.746e-005

    -------------------------------------------------------------------------

    z^4 3.617 z^3 + 5.142 z^2 3.399 z + 0.8753

    Sampling time: 2e-005

    - -

    freqz,

    - -, :

    >> freqz([9.746e-005 0.0003898 0.0005847 0.0003898 9.746e-005],[1 -

    3.6175.142 -3.399 0.8753])

    . 12., , -

    0,17 - fs/2 = 0,5/Ts. -, 1, -

    180 . 180 360, -

    .

    ltiview

    ltiview( )

    - . -

    . - ss ( ),

    tf(

    ) zpk (- ,

    , ).

    () - MATLAB. - MATLAB

    ltiview. - - (. 13),

    -

    , .

    , , , -

    H2 - ss, - . -

    LTI View

    File/Import.

    Import System Data -

    System in Workspace. - -

    H2(. 13). - OK. LTI View -

    (. 13). -

    , LTI View

    Edit/Plot Configurations PlotConfigurations (. 13). 1 (

    ) Response type - . - OK, LTI View

    (. 13). -

    -

    : Step ; Impulse ; Bode ; Bode Magnitude

    ; Niquist (); Nicols ; Singular Value

    - ;

    Pole/Zero .

    . 13 - .

    , - s, :

    s = j, . -

    0 . 5.

    1.

    - - Powergui.

    -

    , -

    Powergui: FFT Tools -

    .2. -

    , -

    , - -

    .3.

    MATLAB power2sys -

    .

    , 12006

    28 www.finestreet.ru

    . 12. - LC-

    SE#7(1).qxd 2/22/2006 12:50 PM Page 28

  • 8/11/2019 MATLAB_5.pdf

    8/8

    4. ( ), -

    .

    5. c2d

    -

    .

    6. -

    ltiview - -

    .

    1. - . .

    MATLAB (R13) //Exponenta PRO. .

    2003. 2. . 8082.

    , 12006

    29www.finestreet.ru

    . 13. LTI View (, , , ), Import System Data () Plot Configurations ()

    SE#7(1).qxd 2/22/2006 12:50 PM Page 29