Vous êtes sur la page 1sur 6

Low-Cost Digital Implementation of Proportional-Resonant Current Controllers for PV Inverter Applications Using Delta Operator

Dezso Sera, Tamas Kerekes, Marian Lungeanu, Pezhman Nakhost, Remus Teodorescu, Gert K. Andersen
Institute of Energy Technology Aalborg University Pontoppidanstraede 101 DK-9220, Aalborg East, Denmark s_dezso@yahoo.com, kerekes_tamas@yahoo.com, marian_fr@yahoo.com pezhman@sol.dk, ret@iet.auc.dk, gka@iet.aau.dk
Abstract The performances of the P+Resonant controller in case of current control for a single phase grid connected inverter have been proved to be superior to the PI controller, since it is able to remove the phase error of the control at the fundamental frequency of the grid. It offers also the possibility of selective harmonic compensation. However, in case of digital implementation on a low-cost fixedpoint DSP, the limited computational power and the limited numerical representation precision can restrict the utilization of it. The present paper proposes a different way of digital implementation of the P+Resonant controller with selective harmonic compensation on a low-cost fixed-point DSP. The resonant part of the P+R has been implemented as a second order filter based on Delta operator. The current controller, together with harmonic compensation for the 3rd, 5th, and 7th harmonics has been successfully tested in practice with a 1.5KW PV inverter, achieving a 1.2% Total Harmonic Distortion (THD) of the grid current

Marco Liserre
Dept of Electrotechnical and Electronic Eng. Polytechnic of Bari via E. Orabona 4 70125 - Bari - Italy liserre@poliba.it or liserre@ieee.org

I. INTRODUCTION Harmonics level is still a controversial issue for PV inverters. The IEEE 929 standard from 2000 allows a limit of 5% for the current THD factor with individual limits of 4% for each odd harmonic from 3rd to 9th and 2% for 11th to 15th. These levels are far more stringent than other domestic appliances such as IEC61000-3-2 as PV systems are viewed as generation sources and so are subject to higher standards than load systems. The use of a second order integrator offers higher performances than the PI [1], considering the theoretically infinite gain at a certain frequency, called resonant frequency. Thus, by choosing the resonant frequency in an appropriate manner, it can be used also for selective harmonic compensation. This technique has been primarily used in three-phase active filter applications as reported in [2] and also in [3] where closed-loop harmonic control is introduced. Another approach reported in [4] where a new type of stationaryframe regulators called P+Resonant is introduced and applied to three-phase PWM inverter control. Previous work [1] proposes the implementation of the second order integrator using two first-order integrators forming a loop. In [1] this method has been used for current control and selective harmonic compensation. Although it clearly outperforms the PI controller, still lower performances than expected are observed, due to discretization problems.

[5] proposes the implementation of the resonant integrator as a second order resonant filter. This method offers the controllability of the gain at the resonant frequency as well as the narrowness of the controller characteristic. Although this method offers more control on the controller behavior, its discrete-time implementation, using the z operator creates some difficulties. In order to avoid the error in the resonant frequency (i.e. to resonate on the desired frequency) it needs high-precision representation of its coefficients, especially at high sampling frequencies. Furthermore, the filter internal variables (to be explained later) in the vicinity of the resonant frequency become very high and thereby in a case of a lowcost 16Bits DSP its implementation needs special care. Also [5] proposes the implementation of the above mentioned second order resonant filter using Delta operator. The Delta operator based controller offers high performance even with low precision representation of the filter coefficients. This paper proposes to use the filter approach with deltabased implementation of the resonant controller for the current control with selective harmonic compensation of a practical single-phase PV inverter using low-cost fixed-point DSP. II. CURRENT CONTROL OF SINGLE-PHASE INVERTER The control scheme for the current control of the green power inverter can be shown as in the following figure:

Fig. 1. The current control of the Green Power Inverter

The input of the current controller is the error

0-7803-9252-3/05/$20.00 2005 IEEE

2517

Authorized licensed use limited to: UNIVERSIDADE FEDERAL DE MINAS GERAIS. Downloaded on February 9, 2009 at 06:34 from IEEE Xplore. Restrictions apply.

between the measured and reference grid current (ig ref and ig). In order to synchronize the injected grid current with the grid voltage (to achieve unity power factor), the phase of the reference current is taken from the grid voltage, calculated by the Phase Lock Loop (PLL) block. The current controller output is the reference grid voltage, which divided by the DC source voltage gives the duty cycle for the inverter. The current loop of the scheme from the above figure can be depicted as:

Closed loop Bode plot - Controller - Plant


Bode Diagram

10 0
Magnitude (dB)

Fund

3rd 5th 7th

-10 -20 -30 -40 -50


90

0 Phase (deg)

-90

-180

-270 10
0

10

10

10

10

Frequency (Hz)

Fig. 2. Block diagram with the transfer functions in the current control loop

Fig. 3. Closed loop Bode plot of the entire system with (dotted line) and without (continuous line) harmonic compensation

The P+Resonant controller transfer function can be expressed as:


H PR ( s ) = K P + K I s 2 s 2 + 0

Adding the harmonic compensation does not alter the system dynamics, having effect only at the selected harmonics frequency. III. SHIFT-AND DELTA OPERATOR BASED IMPLEMENTATION OF THE RESONANT CONTROLLER By discretizing (3), the discrete form of the P+Resonant controller becomes:
H PR ( z ) = K P + b0 = 0 b1 = c + 0ecT sin (0T ) c ecT cos (0T ) b2 = c e2cT c ecT cos (0T ) 0ecT sin (0T ) a1 = 2ecT cos (0T ) a2 = e2cT KI + c2
2 0

(1)

The compensators transfer functions have similar form to the controller:


H Ck ( s ) = K Ik s s 2 + ( k 0 )
2

(2)

where k = 3, 5, 7, according to the selected harmonics to be compensated. However, the above transfer functions need some adjustment for practical implementation, which will become evident in the next section. To obtain adjustable gain at the resonance, an additional term has to be added to it, called cut-off frequency. The modified form of the controller becomes
H PR ( s ) = K P + K I s + c 2 2 s + 2 c s + c2 + 0

b0 + b1 z 1 + b2 z 2 , where 1 2 1 + a1 z + a2 z

(5)

(3)

The transfer functions of the harmonic compensators will change in the same manner:
H Ck ( s ) = K Ik
2 s + 2ck s + ck + ( k 0 ) 2

s + ck

(4)

The PWM modulator transfer function is Hd(s) and it contains the processing delay of the PWM inverters, typically one sample. [6]. The LCL filter transfer function is expressed in [7] The P+Resonant controller parameters from (3) have been tuned by the pole-zero placement of the discrete-time closed loop system, considering it without harmonic compensation. The chosen parameters for the current controller (Kp = 5 and Ki = 800) give the following closed loop Bode for the entire system:

It can be seen that the second (resonant) part of 5, in the brackets, has the canonical form of a second order discrete filter. This is the critical part of the P+Resonant controller in terms of sensitivity to the rounding errors and coefficients representation precision. In the following will be investigated and compared the shift and delta-based resonant controllers in a case of a 16 bits implementation on a low-cost fixed-point DSP. To understand the differences between the shift and delta parameterized resonant filters, a short introduction to the delta operator is given. A complete analysis and theoretical background can be found in [5], [8], and [9].

2518
Authorized licensed use limited to: UNIVERSIDADE FEDERAL DE MINAS GERAIS. Downloaded on February 9, 2009 at 06:34 from IEEE Xplore. Restrictions apply.

Definition of the delta operator In order to define the delta operator, first the shift operator should be defined. The shift operator, q shifts the discrete-time input with one sample [8]:
qxk = xk +1
th

(6)

It should be emphasized that the difference between the shift-based and delta-based transfer function is given by the implementation method, not the design. The corresponding continuous-time transfer function is the same for both, and for infinite representation precision their response is also equivalent. The canonical form of the shift based second order filter from (1) is the following:
H (z) = b0 + b1 z 1 + b2 z 2 1 + a1 z 1 + a2 z 2

where xk is the k element of the input sequence. If initial conditions are ignored, q can be replaced by z. As Eq. (6) is not causal, in practice the inverse shift operator is used, which has the form:
q xk = xk 1 , or z 1 xk = xk 1
1

(15)

(7)

In the same way can be defined the canonical form of the based second order filter: [5]
H ( ) =

Now, the replacement of the shift operator in Eq. (7) with difference operator leads to the definition of the delta operator [8]:

0 + 1 1 + 2 2 1 + 1 1 + 2 2

(16)

where 0, 1, 2 and 1, 2 are the filter coefficients. The coefficients for H() can be found by introducing the expression for z from Eq. (11) into Eq. (15). After the rearrangement of Eq. (15) and equating the corresponding coefficients, one can find the relationship between the coefficients of the shift- and delta based second order filters:
0 =b0 2b +b 1 = 0 1 b0 +b1 +b 2 2 = 2 0 =a 0 =1 1 = 2+a1 1+a1 +a 2 2 = 2

q 1

(8)

where is defined as the sampling period. However, its value will be redefined later in order to optmize the numerical properties. By analogy to the relation between q and z, a transform variable associated with can be defined as:

(17)

z 1

(9)

Introducing Eq. (8) to Eq. (6) will result in:


x x xk = k +1 k ,

(10)

Using the above equations (17), the delta-based filters coefficients can be derived using commonly known design techniques for shift-based filters [5] Shift and delta based implementation The investigation of the z and delta based fiters numerical behavior, have been made using Direct Form II. The structure of the second-order filter in DFII can be shown as:

In resemblance with Eq. (7), a causal form of must be used in practical applications, which will have the form:

z 1 = 1 z 1

(11)

The delta transform Given a sequence, {xk}, the one-sided z-transform of it, Z{xk} can be defined as [8]:
X ( z ) = Z { xk } = xk z k
k =0

(12)

Using the above definition Eq. (12), the delta transform has the following definition:
X ( ) = D{xk } = xk (1 + )
k =0
k

(13) (14)
Fig. 4. DFII implementation of the shift-based second order filter in Simulink

X ( ) = X ( z ) z =1+

From Eq. (14) one can see that the delta transformation has the same method as the z-transformation, just replacing z with 1 + . The properties of the delta transform are treated thoroughly in [8]

The same structure is used to implement the delta -1 parameterized filter, only replacing the z operation with the
1

. It can be implemented in Simulink as [5], [9]:

2519
Authorized licensed use limited to: UNIVERSIDADE FEDERAL DE MINAS GERAIS. Downloaded on February 9, 2009 at 06:34 from IEEE Xplore. Restrictions apply.

based controller considering the resonant frequency increases. As a result, at 15 kHz sampling frequency, its gain is very low at the intended resonant frequency (50 Hz), causing a high steady-state error. The discretization errors of the z-based controller increase also when its characteristic becomes sharper, i.e. c decreases.
Fig. 5. The realization of delta operation in Simulink
35 30

In order to verify the response of the z and delta based controllers, the above structures have been implemented in Simulink. It has to be noted that the implementation have been made entirely on 16b. However, in the case of the shift based filter, it was necessary to use 32bit representation for the filter internal variables (s0, s1, s2 from Fig. 5), since, around the resonance they increase far beyond the range which can be represented on 16 bits. Comparison of the shift and delta based P+Resonant controllers Using the above described implementation, the response of the shift and delta based P+Resonant controllers have been compared. In order to evaluate their response in function of the input signal frequency, it has been made simulations over a range of frequencies around the resonance.
400 350 300 gain (abs) 250 200 150 100 50 0 40
400 350 300 gain (abs) 250 200 150 100 50 0 40 42 44 46 48 50 52 54 frequency (Hz) 56 58 60
s - reference delta shift

25 gain (abs) 20 15 10 5 0 40 800


s - reference

s - reference delta shift 42 44 46 48 50 52 54 frequency (Hz) 56 58 60

700 600 gain (abs) 500 400 300 200 100 0 40 42 44 46 48 50 52 54 frequency (Hz)

delta shift

56

58

60

Fig. 7. Gain comparison of the shift and delta based filter in respect to the continuous counterpart with cut-off frequencies of 15 rad/sec (top) and 0.5 rad/sec (bottom).

42

44

46

48 50 52 54 frequency (Hz)

56

58

60

When the controller characteristic is more flat (Fig. 7, top) the gain difference of the two controllers at 50Hz is not important. In the other hand, when the controller gain at the resonant frequency is increasing, (Fig. 7, bottom) the numerical errors of the shift based one become accentuated. IV. EXPERIMENTAL RESULTS The hardware setup used to validate the presented simulation results consists of the following equipment: A Danfoss VLT 5000 1.5kW inverter, a Spectrum Digital eZdsp card with a TMS320 F2812 DSP, two series connected Delta Elektronika 300-5 300V/5A dc voltage sources, an LCL filter with resonant frequency of 4.9 kHz, and a Voltech PM100 power analyzer.

s - reference delta shift

Fig. 6. Gain comparison of the shift and delta based filter in respect to the continuous counterpart at sampling frequencies of 5 and 15 kHz (up to down)

As the sampling frequency goes high, the error of the shift

2520
Authorized licensed use limited to: UNIVERSIDADE FEDERAL DE MINAS GERAIS. Downloaded on February 9, 2009 at 06:34 from IEEE Xplore. Restrictions apply.

I g [A] vs. time [s]


10 5

Ig [A]

0 -5 -10 0.06 0.065 0.07 0.075 0.08 0.085 0.09 0.095

Vg [V] vs. time [s]


400 200

Vg [V]

0 -200 -400 0.06 0.065 0.07 0.075 0.08 0.085 0.09 0.095

time [s]

Fig. 8. Experimental setup of the grid connected green power inverter

Fig. 10. The grid current and voltage for the delta based controller without harmonic compensation when the grid reference current Ig=10 A peak. The measured current THD=10.5 %, the voltage THD=7.1 % and PF=0.994

V [V]

The tests have been made in the following conditions: Dc voltage Udc = 450V and the grid voltage had an approximate value of THD = 2% background distortion. The control system has been implemented in Matlab/Simulink and using the Real-Time Workshop together with the Texas Instruments Code Composer Studio, it has been compiled and downloaded to the TMS320 F2812 DSP. The control system sampling frequency was 8192Hz, same as the switching frequency. The harmonic compensation using z-based controllers have not been implemented since they involve 32bit numbers for their internal variables, increasing the burden of the CPU and thereby the used DSP could not run the code in real time.
Ig [A] vs. time [s]
10 5

It can be seen from the above figures that in terms of the current waveform quality, these two controllers perform similar. However, as mentioned before, it was not possible to implement harmonic compensation using the shift-based controller, while in the case of the delta operator based one, the DSP was able to run the code in real time with harmonic rd th th compensation for the 3 , 5 , and 7 harmonics. In the following will be presented the experimental results using delta operator based P+Resonant controllers with harmonic compensation:
Grid voltage 400 200 0 -200 -400

0.005

0.01

0.015

0.02 Grid current

0.025

0.03

0.035

0.04

I g [A]

0 -5

20 10

-10 0.06 0.065 0.07 0.075 0.08 0.085 0.09 0.095

I [A]

0 -10 -20

Vg [V] vs. time [s]


400 200

0.005

0.01

0.015

Vg [V]

0.02 time [s]

0.025

0.03

0.035

0.04

0 -200 -400 0.06 0.065 0.07 0.075 0.08 0.085 0.09 0.095

time [s]

Fig. 11. The grid- voltage and current waveforms with delta based rd th th controller with 3 , 5 , and 7 harmonic compensation when the grid current Ig=10 A peak. The measured current THD=1.2 %, the voltage THD=1.6 % and PF=0.999

Fig. 9. The grid current and voltage waveforms with z-based controller without harmonic compensation when the grid reference current Ig=10 A peak. The measured current THD=10.7 %, the voltage THDV=7.1 % and PF=0.993

2521
Authorized licensed use limited to: UNIVERSIDADE FEDERAL DE MINAS GERAIS. Downloaded on February 9, 2009 at 06:34 from IEEE Xplore. Restrictions apply.

FFT of grid current 7 Iref-peak=10A 6 THDI = 10.5; THDV = 1.44; PF = 0.999 5 1st = 6.94A;
Harmonic current [A] 5 6 7

FFT of grid current

Iref-peak=10A THDI = 1.2; THDV = 1.6; PF = 0.999 1st = 6.9A;

Using delta operator based P+Resonant controllers, it was th possible to use harmonic compensation up to the 7 harmonics. Without any harmonic compensation the grid current THD was above 10.5%, which does not fulfill the IEEE 929 rd standard. Turning on the compensation for the 3 harmonic, decreases the current harmonics level but still not comply with standard. A drastic decrease in the THD can be seen when the th compensation for the 5 harmonic is turned on, the THD decreases to 2.2 %, well below the limit in the IEEE standard. Turning on the compensation for the 7 harmonic, a further improvement of the grid current waveform quality is achieved, resulting in a THD of 1.2%.
th

Harmonic current [A]

3rd = 5.7% 4 5th = 5.4% 3 7th = 1.4%

3rd = 0.8% 4 5th = 0.85% 3 7th = 0.6%

9th = 1.1%

9th = 1.8%

11th = 0.4% 1
1

11th = 0.9%

50 150 250 350 450 550 650 750 850 frequency [Hz]

[Hz

50 150 250 350 450 550 650 750 850 frequency [Hz]

[Hz

Fig.12. The harmonics content of the measured grid current without rd th harmonic compensation (left) and with compensation for the 3 , 5 th 7 harmonics (right), using delta operator based current controller.
no harm. comp. 3rd harm. comp
12 10 8 6 4 2 0

VI. REFERENCES [1] R. Teodorescu, F. Blaabjerg, A new control structure for grid-connected LCL PV inverters with zero steadystate error and selective harmonic compensation Applied Power Electronics Conference and Exposition, 2004. APEC '04. Nineteenth Annual IEEE [2] X. Yuan, W. Merk, H. Stemmler, J. Allmeling, Stationary-Frame Generalized Integrators for Current Control of Active Power Filters with Zero Steady-State Error for Current Harmonics of Concern Under Unbalanced and Distorted Operating Conditions IEEE Trans. on Ind. App., vol. 38, no. 2, Mar./Apr. 2002, pp.523 532. [3] P. Mattavelli A Closed-Loop Selective Harmonic Compensation for Active Filters IEEE Trans. on Ind. App., vol. 37, no. 1, january/february, 2001, pp. 81 89. [4] D. N. Zmood, D. G. Holmes, Stationary Frame Current Regulation of PWM Inverters with Zero Steady-State Error IEEE Trans. on Power Electr., vol. 18, no. 3, May 2003, pp. 814 822. [5] Michael J. Newman, Donald G. Holmes, Delta Operator Digital Filters for High Performance Inverter Applications, IEEE Transactions on Power Electronics, vol. 18, no.1, January 2003. [6] D.G. Holmes and T. Lipo, Pulse Width Modulation for Power Converters: Principles and Practice, 2003, ISBN 0471208140. [7] J. H. R. Enslin and P. J. M. Heskes, Harmonic interaction between a large number of distributed power inverters and the distributed network, PESC 2003, pp. 1742-1747 [8] Richard H. Middleton, Graham C. Goodwin, Digital Control And Estimation: a unified approach, Prentice Hall, 1990. [9] Michael J. Newman, Design And Control Of A Universal Custom Power Conditioner (UCPC), PhD thesis, Monash University Australia, September 2003.

3rd, 5th harm.comp 3rd,5th, 7th harm.comp

THD [%] of the grid current

Fig.13. The THD of the grid current with different harmonic compensations. The IEEE 929 standard level (5%) is indicated with the bold line.

V. CONCLUSIONS A current control strategy based on P+Resonant controller have been designed and experimentally tested, using a low cost fixed-point DSP. The current controller has been implemented as a second order filter, using delta operator. It has been compared to the traditional z-operator, and the results show that the delta parameterized controller clearly outperforms the z-based one, due to its less sensibility to the coefficients rounding errors, even at very low representation precision. The other main disadvantage of the shift-based controller comparing to the delta based one is that its internal variables around the resonant frequency increase beyond the range that can be represented on 16 bits. Thereby its implementation involves 32 bits values, which considerably increase the burden of the DSP. In the present case the used DSP was unable to run the code in real-time, when harmonic compensation was used.

2522
Authorized licensed use limited to: UNIVERSIDADE FEDERAL DE MINAS GERAIS. Downloaded on February 9, 2009 at 06:34 from IEEE Xplore. Restrictions apply.

Vous aimerez peut-être aussi