Sie sind auf Seite 1von 13

ELEC 5564M POWER GENERATION BY RENEWABLE SOURCES

SIMULATING A DC-DC BOOST CONVERTER USING MATLAB PART 2

Liena Vilde 200589145

MSc Electrical Engineering and Renewable Energy Systems University of Leeds

2010

1. Introduction
The aim of this assignment is to develop a flowchart for a program that simulates an induction machine. This is done using the state-space model of the machine in stationary or synchronously rotating reference frame. The method for solving the resultant differential equations is chosen to be the 4th order Runge-Kutta method. This method is tested in Matlab for the program previously written program for simulating a buck converter.

2. Induction Machine Model


The machine model can be developed either using Stationary Reference Frame (SRF) or Synchronous Rotating Reference Frame (SRRF). The example looked at in this case will be the SRF. The complex stator current can be expressed as a three-phase current or in the more simple two-phase d-q-0 (direct-quadrature-axis) form as follows: is ( t ) ! ias  aibs  a 2ics ! ids  jiqs a!e
j 2T 3

The relationship between the currents in both forms is shown below (=t).     2T   2T  U U  cos   cosU cos   3  3  i as i ds    2T   2T      2   i U U iqs! sin U sin  sin     bs   3  3  3    ics    i0    1  1 1   2 2   2  1 i  ds 2  U ! 0  !  iqs  3   0  

1 2 3 2

1  i as    2  ibs    3    ics    2 




The three-phase rotor current can be expressed similarly: 

ir ( t ) ! iar  aibr  a2icr ! iEr  jiFr


Transformation to d-q axis leads to

i dr  cos  Ur  !  iqr   sin U r 

i Er   sin Ur     iFr  cos U r  

The stator and rotor voltages in SRF and the d-q axis flux linkages for stator and rotor are as follows:

Vss ! RS iss  Vrs ! Rr irs 

d Pss dt

d Psr  j[ r Psr dt e pPeds ! Vdes  Rsid s


e e pPedr ! Vder  Rrid r  [ r Pqr

e e pPeqs ! Vqs  Rsiqs

e e pPeqr ! Vqr  Rriqr  [ r Pedr

p!

d dt

Subsequently, the d-q currents are derived: 

! L s is  L m ir

P r ! L r ir  L m is
e ! a?L r Pds  L m Pdr A ids e ! a?L r Pqs  L m Pqr A iqs e idr ! a?L s Pdr  L m Pds A e ! a?L s Pqr  L m Pqs A iqs

a!

1 Ls L r  L2 m

Substituting the new equations into the flux linkages for rotor and stator voltages results in the following:

V !Ri 
s s s s s

d Ls iss dt dLi

 d L i
s m r

dt

dt dt V  ds  R  s  pLs 0    Vqs   0 Rs  pLs  !  Vdr   pLm [ r Lm    Vqr   [ r Lm pLm 

V !Ri 
s r s r r

 d L i  [
s r r s m s

L i  L i
s r r s m s

pLm 0 Rr  pLr [ r Lm

  Ids     Iqs  pLm    Idr  [ r Lm     Iqr  Rr  pLr  

The relationships between the rotor speed, d-q currents and turbine and generator torque can be expressed as:

Tm  Te ! Jp[ r  D[ r d[ r 1 ! Tm  Te  D[ r J dt 3P Te ! Lm iqsidr  idsiqr 4


[1] 

3. 4th Order Runge-Kutta Method


The 4 th order Runge-Kutta method is a method of finding the solution to first order initial value differential equations using approximation. Every next value of y as a function of x can be found from the formula below y n 1 ! y n  where  k1 ! f ( x n , y n )  k 2 ! f x n    k 3 ! f x n   1  1 h, y n  hk1  2  2  1 1 h, y n  hk 2   2 2 h k1  2 k2  2 k3  k4 6

k 2 ! f x n  h, y n  hk 3 In the equations k1 is estimation of the slope at the point where iteration begins, k2 and k3 are approximating the slope at the mid point between k1 and k4, and k4 is the estimation of the slope at the end point. h is the step size, in case of boost converter and induction generator simulations h=dt. The new value of y is the sum of the initial (previous) value of y and the weighted average of the k values. [2]

4. Flowchart
In order to write a Matlab program simulating an induction generator for a wind turbine, the first step is to define all the machine parameters and the required or chosen size of the time step for the simulation. Given machine parameters: Inertia Friction Machine power Poles Load Torque Line Voltage Line Frequency Stator Resistance Rotor Resistance Stator Leakage Inductance Rotor Leakage Inductance Mutual Inductance Stator Self Inductance Rotor Self Inductance Simulation Step Size

J=0.025284 [kgm2/s] B=0.005 [Nms] HP=5.0 [Horse Power] HP746.15 [W] 4 -1 [Nm] 230 [Vrms] 50 [Hz] 100 [rad/s] 0.5673 [] 0.7091 [] 3.01 [mH] 3.01 [mH] 75.239 [mH] 78.239 [mH] 78.239 [mH] 2 [ms]

The next step is defining the known initial values of the time-variant parameters. Knowing the starting and finishing time of the simulation and the size of the time increment (simulation step size), the length of the time value array can be calculated. This is also the number of iteration loops for the Runge -Kutta method (or any other numerical method). Next, the initial value of time has to be set as the first loop and the state-space matrices have to be defined, linking the state variables to be calculated with the defined parameters. Once the relationships between all the parameters are defined, the Runge-Kutta method can be implemented as described in the previous chapter. At the end of each loop, the new value of the state variables is found and stored in an array, the time value is incremented and loop starts again with the new value as the initial value. Once the program has run the necessary number of loops, the arrays containing the values of the state variables corresponding to the array of time values can be used for calculating other parameters, such as turbine and generator torque in this case. The flowchart for this program is shown below.

5. Program Listing
clc; clear all; close all; %Specified values Vin=12; L=100e-6; C=970e-6; R=3; k=0.25; %Input voltage %Load resistance %Duty cycle

%Frequency and timing values %Switching frequency fs=20e3; Tp=1/fs; %Switching preiod %Switch ON time Ton=k*Tp; %Maximum time value tmax=1000*Tp; dt=30.005e-6; %Sampling time t=0:dt:tmax; %Initial values iL(1)=0; vC(1)=0; %Number of t values duration=length(t); %Number of time values (number of loops) for n=2:duration tinst=mod(t,Tp); %Instantaneous time value within the time preriod %for determining the state of the switch if tinst(n)<=Ton %ON %A=[0 0; 0 -1/(R*C)]; D=0; else D=1; %Time values with an incerement dt

%OFF %A=[0 -1/L; 1/C -1/(R*C)];

end %State space matrices A=[0 -D/L; D/C -1/(R*C)];

B=[1/L; 0]; %Runge-Kutta: k1=(A*[iL(n-1);vC(n-1)]+B*Vin); k2=(A*[iL(n-1);vC(n-1)]+B*Vin+0.5*k1); k3=(A*[iL(n-1);vC(n-1)]+B*Vin+0.5*k2); k4=(A*[iL(n-1);vC(n-1)]+B*Vin+k3); x=[iL(n-1); vC(n-1)]+(dt/6)*(k1+2*k2+2*k3+k4);

% %Forward Euler % x1=[iL(n-1); vC(n-1)]+dt*(A*[iL(n-1); vC(n-1)]+B*Vin); % % %Back Euler % x2=[iL(n-1); vC(n-1)]+dt*(A*x1+B*Vin); % % %Trapezium % x=(x1+x2)/2; iL(n)=x(1); %iL values vC(n)=x(2); %vC values end;

iR=vC/R; figure(1) plot(t,vC) grid; figure(2) plot(t,iL, t,iR) grid;


[3]

%Output current

10

6. Results and Discussion


Figures 2 and 3 show the waveforms of capacitor voltage VC, inductor current IL and output current IR when duty cycle is 0.25. The mean value of V C is 16.17V, mean value of IL is 7.7A and mean value of IR is 5.39A. Input voltage is kept constant at 12V. The waveforms look exactly like previously, when VC,, IL were calculated using the trapezium method, which validates the program written for simulating the boost converter using the Runge-Kutta method.

Figure 3

11

Figure 4 As with the trapezoidal method, the precision of the result depends on the size of the time increment dt: the smaller the step size, the more iteration loops are performed and a better result is achieved, however it significantly increases simulation time. Comparing both methods, they both require the same information about initial conditions, however for long running time and high number of iteration loops, program using Runge-Kutta method will have to perform more calculations than program using Trapezium rule. This is not a problem for low loop count or large memory to store the values for k1, k2, k3 and k4 for each loop. For the numerical method to work, dt has to be smaller than the smallest time constant in the circuit, if dt is increased too high, th e response becomes unstable: the oscillations in the voltage and current waveforms do not settle down. Figures 4 and 5 show the resulting waveforms when dt=30s, the oscillations are much higher than they have to be, but they are reducing. At dt=30.005s oscillations are visibly increasing and the response has become unstable as shown in Figures 6 and 7.

Figure 4

Figure 5

Figure 6

Figure 7

12

7. Conclusions
The limiting factor for using the Runge-Kutta method of integration is similar to the trapezoidal method: it is a method of approximating the result and the precision depends on dt. Choosing a small dt considerably increases the simulation time. This can be reduced by only looking at the particular period of time that is of interest, but it is still necessary to know the initial values of the circuit parameters at the beginning of this time period. When the sampling time is increased, not only the precision of the results decreases, but there is also a risk of the sampling time being too big with respect to the time the switch is on or off and it would be impossible to distinguish between On and Off states, which have to be taken into account for calculating IL and VC, since the state-space equations would change. For the induction motor model, using two-phase d-q currents significantly reduces the number of variables in the mathematical model of the induction machine, compared to the three-phase current model. Two reference frames can be used for the model SRF (Stationary Reference Frame) and SRRF (Synchronously Rotating Reference Frame). The state-space matrix for the induction generator has been derived and can be used to calculate the mechanical parameters of the induction generator and to simulate the machine in Matlab.

8. References
[1] Electrical Generator Machines in Wind Energy Systems, L. Zhang, 2010 [2] Advanced Engineering Mathematics, 3rd ed., D. Zill, M. Cullen, 2006 [3] Getting Started With Matlab, The MathWorks, 2007

13

Das könnte Ihnen auch gefallen