Evaluation of reference current extraction methods for DSP implementation in active power filters

11
Electric Power Systems Research 79 (2009) 1342–1352 Contents lists available at ScienceDirect Electric Power Systems Research journal homepage: www.elsevier.com/locate/epsr Evaluation of reference current extraction methods for DSP implementation in active power filters K. Vardar, E. Akpınar , T. Sürgevil Dokuz Eylul University, Department of Electrical and Electronics Engineering, Kaynaklar Kampusu, 35160 Buca, Izmir, Turkey article info Article history: Received 21 April 2008 Received in revised form 25 March 2009 Accepted 14 April 2009 Available online 23 May 2009 Keywords: Active power filters Digital signal processor applications Harmonics detection methods abstract Generation of current references constitutes an important part in the control of active power filters (APFs) used in power system, since any inaccuracy in reference currents yields to incorrect compensation. In this paper, harmonic detection methods for generating reference currents have been evaluated on the basis of three-phase balanced and unbalanced load currents processed in the digital signal processor (DSP). The advantages and disadvantages of several methods found in the literature have been discussed on the basis of simulation results. Three of these methods have been programmed in the TMS320F2812 digital signal processor (DSP) unit and their performances are evaluated from the viewpoint of practical considerations. Finally, instantaneous reactive power method to estimate the APF reference currents is implemented and its practical results obtained under balanced and unbalanced loads are given. © 2009 Elsevier B.V. All rights reserved. 1. Introduction The APFs have been widely used to control harmonic distor- tion in power systems. The APFs use power electronics converters (such as PWM voltage or current source converters) in order to inject harmonic components to the electrical network that can- cel out the harmonics in the source currents caused by non-linear loads. Fig. 1 shows the single-line diagram of a typical shunt APF compensating the current harmonics of a three-phase load. Besides harmonics compensating capability, APFs are also used in the solu- tion of reactive power compensation and load balancing. They have a significant advantage over the passive filters since they do not cause resonance problems in the network. A conceptual survey on APF topologies, control methods and practical applications can be found in the literature [1–8]. In the process of harmonic compensation, detection of the load current harmonics is one part, while the generation of compen- sating harmonic currents by means of converter switching is the other part of APF. The performance of active power filters depends on the harmonic detection methods for generating current refer- ences, current control method, and dynamic characteristics of APF power converter circuit. Of all these criteria related to design of APF, generation of current references constitutes an important part that affects the filtering performance since any inaccurate phase and magnitude of reference currents yields to incorrect compensation and hence performance degradation [9–11]. Some of the loads such Corresponding author. Tel.: +90 232 4127163; fax: +90 232 4531085. E-mail address: [email protected] (E. Akpınar). as arc furnaces in power system are varying very fast. Therefore, the response time of APFs when compensating the harmonics of rapidly changing loads should be considered as a critical parameter. So, a fast and accurate detection of harmonic components in current or voltage waveforms is essential in APFs for varying loads. Many har- monic detection methods were proposed and their performances were evaluated in papers that can be found in the literature [12–17]. There are several methods for extracting the harmonics content of a non-sinusoidal load current. In this paper, these methods are simulated in MATLAB and compared to each other in order to spec- ify the advantages and disadvantages in terms of response time and filtering capability against the variations in frequency, phase, and amplitude of load currents. Three methods are also compared in terms of execution times and programming complexity aspects in the DSP unit. In Section 2, the methods of reference current gener- ation are investigated and algorithms are introduced. In Section 3, the performances of these methods are analyzed by using Matlab package program. The results obtained from the DSP programming of the methods are compared and discussed in Section 4. Finally, a three-phase APF implementation by using the IRPT is given in Section 5. 2. Methods of reference current generation There are several methods for determining harmonic con- tent of the load current. The control reference signal for an APF can be obtained either using frequency domain or time domain techniques. The frequency domain technique investigated in this section is Fast Fourier Transform (FFT). The time domain techniques include Instantaneous Reactive Power Theory (IRPT), Single-phase 0378-7796/$ – see front matter © 2009 Elsevier B.V. All rights reserved. doi:10.1016/j.epsr.2009.04.004

Transcript of Evaluation of reference current extraction methods for DSP implementation in active power filters

Ea

KD

a

ARRAA

KADH

1

t(iclchtacAf

csooepgama

0d

Electric Power Systems Research 79 (2009) 1342–1352

Contents lists available at ScienceDirect

Electric Power Systems Research

journa l homepage: www.e lsev ier .com/ locate /epsr

valuation of reference current extraction methods for DSP implementation inctive power filters

. Vardar, E. Akpınar ∗, T. Sürgevilokuz Eylul University, Department of Electrical and Electronics Engineering, Kaynaklar Kampusu, 35160 Buca, Izmir, Turkey

r t i c l e i n f o

rticle history:eceived 21 April 2008eceived in revised form 25 March 2009

a b s t r a c t

Generation of current references constitutes an important part in the control of active power filters (APFs)used in power system, since any inaccuracy in reference currents yields to incorrect compensation. In this

ccepted 14 April 2009vailable online 23 May 2009

eywords:ctive power filtersigital signal processor applications

paper, harmonic detection methods for generating reference currents have been evaluated on the basis ofthree-phase balanced and unbalanced load currents processed in the digital signal processor (DSP). Theadvantages and disadvantages of several methods found in the literature have been discussed on the basisof simulation results. Three of these methods have been programmed in the TMS320F2812 digital signalprocessor (DSP) unit and their performances are evaluated from the viewpoint of practical considerations.Finally, instantaneous reactive power method to estimate the APF reference currents is implemented and

ed u

armonics detection methods its practical results obtain

. Introduction

The APFs have been widely used to control harmonic distor-ion in power systems. The APFs use power electronics converterssuch as PWM voltage or current source converters) in order tonject harmonic components to the electrical network that can-el out the harmonics in the source currents caused by non-linearoads. Fig. 1 shows the single-line diagram of a typical shunt APFompensating the current harmonics of a three-phase load. Besidesarmonics compensating capability, APFs are also used in the solu-ion of reactive power compensation and load balancing. They havesignificant advantage over the passive filters since they do not

ause resonance problems in the network. A conceptual survey onPF topologies, control methods and practical applications can be

ound in the literature [1–8].In the process of harmonic compensation, detection of the load

urrent harmonics is one part, while the generation of compen-ating harmonic currents by means of converter switching is thether part of APF. The performance of active power filters dependsn the harmonic detection methods for generating current refer-nces, current control method, and dynamic characteristics of APFower converter circuit. Of all these criteria related to design of APF,

eneration of current references constitutes an important part thatffects the filtering performance since any inaccurate phase andagnitude of reference currents yields to incorrect compensation

nd hence performance degradation [9–11]. Some of the loads such

∗ Corresponding author. Tel.: +90 232 4127163; fax: +90 232 4531085.E-mail address: [email protected] (E. Akpınar).

378-7796/$ – see front matter © 2009 Elsevier B.V. All rights reserved.oi:10.1016/j.epsr.2009.04.004

nder balanced and unbalanced loads are given.© 2009 Elsevier B.V. All rights reserved.

as arc furnaces in power system are varying very fast. Therefore, theresponse time of APFs when compensating the harmonics of rapidlychanging loads should be considered as a critical parameter. So, afast and accurate detection of harmonic components in current orvoltage waveforms is essential in APFs for varying loads. Many har-monic detection methods were proposed and their performanceswere evaluated in papers that can be found in the literature [12–17].

There are several methods for extracting the harmonics contentof a non-sinusoidal load current. In this paper, these methods aresimulated in MATLAB and compared to each other in order to spec-ify the advantages and disadvantages in terms of response time andfiltering capability against the variations in frequency, phase, andamplitude of load currents. Three methods are also compared interms of execution times and programming complexity aspects inthe DSP unit. In Section 2, the methods of reference current gener-ation are investigated and algorithms are introduced. In Section 3,the performances of these methods are analyzed by using Matlabpackage program. The results obtained from the DSP programmingof the methods are compared and discussed in Section 4. Finally,a three-phase APF implementation by using the IRPT is given inSection 5.

2. Methods of reference current generation

There are several methods for determining harmonic con-

tent of the load current. The control reference signal for an APFcan be obtained either using frequency domain or time domaintechniques. The frequency domain technique investigated in thissection is Fast Fourier Transform (FFT). The time domain techniquesinclude Instantaneous Reactive Power Theory (IRPT), Single-phase

K. Vardar et al. / Electric Power Systems Research 79 (2009) 1342–1352 1343

of AP

IFtL

gtrutD

2

iyfntmiiAfpTro

Fig. 1. Single-line diagram

nstantaneous Reactive Power method, Synchronous Referencerame (SRF) method, Generalized Integral method, Adaptive Fil-er method, Delayless Filtering based on Neural Network, Adaptiveinear Neuron (ADALINE) method and Wavelet method.

Each of these methods are modeled using Matlab package pro-ram and the results are compared on these bases: response timeo load variations, calculation complexity, noise immunity, accu-acy of harmonic current prediction, power frequency variation andnbalanced loading. According to the outcomes of Matlab simula-ions, three out of those methods are programmed in TMS320F2812SP and execution times of these methods are compared.

.1. Fast Fourier transform

The amplitude and phase information of the harmonic seriesn a periodic signal can be calculated by using the Fourier anal-sis [14,15]. Fast Fourier Transform (FFT) is an efficient algorithmor computing the Discrete Fourier Transform (DFT) of discrete sig-als. The FFT reduces the amount of time for calculation by usinghe number of sampled points N, which is a power of two. This

ethod is preferred in some digital signal processing applicationsf the waveform is processed on-line using microcontrollers hav-ng a higher clock frequency. The basic operational principal of anPF requires extracting harmonics to be eliminated (or minimized)

rom the entire current waveform of the load. Therefore, the FFT is aowerful tool for harmonic analyses in active power filters as well.he drawback of this application is the execution time of the algo-ithm implemented in processor, because it needs sampled dataver one period to estimate the spectrum of harmonics. If the load

Fig. 2. Block diagram

F with a non-linear load.

current varies in every period or in every few periods, the FFT algo-rithm may not provide sufficient information on-line to follow theharmonic content of the load.

2.2. Instantaneous reactive power theory (IRPT)

In a three-phase system, harmonic current components can befound by using the IRPT [14,15] as shown in the block diagram inFig. 2. The dc and ac components in these instantaneous active andreactive powers are due to fundamental and harmonic currents ofthe load, respectively. The power values of the dc components arefiltered out by two high-pass filters. Thus, the remaining part isextracted as active and reactive powers caused by the load harmoniccurrents. Here it must be noted that the delay of response is basedon filters’ performance. Using the output of filters, the referencecurrents for each phase of the APF are generated, first in stationary�� coordinates and then in abc variables using Clarke’s transfor-mation. This method does not take zero sequence components andhence the effect of unbalanced voltages and currents into account.The IRPT is widely used for three-phase balanced non-linear loads,such as rectifiers.

2.3. Single-phase instantaneous reactive power

The application of active power filters in a single-phase sys-tem independent of load level also needs the reference waveformof harmonics in load current. In single-phase PQ theory, voltageand current waveforms are expressed in terms of their real andimaginary axis components, which could be corresponding to ��

of IRPT method.

1344 K. Vardar et al. / Electric Power Systems Research 79 (2009) 1342–1352

phase

vp

S

wp

tfiFb

i

sithd

2

PbTt+o

Fig. 3. Block diagram of single-

ariables in IRPT. The instantaneous active and reactive powers sup-lied to a single-phase load are given as follows [18,19]:

= [vr(t)ir(t) + vi(t)ii(t)] + j[vr(t)ii(t) − vi(t)ir(t)] (1)

here subscripts r and i represent the real and imaginary axis com-onents.

The power transferred at the higher frequencies of current ratherhan fundamental can be extracted by employing two high-passlters on real and imaginary parts of the complex power as shownig. 3. Hence, the reference current for the active power filter cane obtained as follows:

∗f = pvr(t) − qvi(t)

v2r (t) + v2

i(t)

(2)

The main advantage of this method is the ability to generateinusoidal reference for each phase in the case of current imbalancen a three-phase system. IRPT can be applied to single-phase sys-em by creating two virtual currents and two virtual voltages thatave the same magnitude as the measured voltage and current andisplaced by 120◦ phase shift [20].

.4. Synchronous reference frame (SRF) method

Synchronous reference frame (SRF) method [21] is based onark transformation and shown in Fig. 4. There are mainly two

locks corresponding to positive and negative sequence controllers.he positive sequence component of load current is transformedo de–qe axes by generating positive sequence phase information� from PLL circuit. The detail of mathematical implementationf PLL software in the synchronization of three-phase system is

Fig. 4. Block diagram

instantaneous reactive power.

given in [22] and its application in Matlab simulations can befound in package program. AC quantities in positive sequencewaveform include all harmonic components while dc quantity isfundamental component of load current. The negative sequencecomponent of load current is also transformed to de–qe axesby generating negative sequence phase information −� from thePLL. If voltages and currents in the three-phase system are bal-anced, the output of this block will be zero. As long as it is notthe aim to compensate current imbalance in the load currents, the negative sequence current components are subtracted fromthe reference current waveforms and the active filter only compen-sates the load current harmonics.

2.5. Generalized integral method

The IRPT method has faster response to the transients of loadcurrent, however, it may cause a steady-state error at the non-continuous load current waveform. A three-phase rectifier loadhas this type of variation during the commutation of diodes, ifthe overlap angle is negligible. The generalized integral methodhas a good tracking capability for non-continuous load current[13]. A generalized integral method implements the integrationin time by using a second order transfer functions, which willgive an infinite gain at the selected resonant frequency. There isa transfer function for each harmonic frequency and each behaves

as independent band-stop (notch) filters as being shown for threeharmonic frequencies in Fig. 5. This technique can be used success-fully for each phase current of three-phase system even thoughthe load is unbalanced, if the harmonic content of the load isknown.

of SFR method.

K. Vardar et al. / Electric Power Systems Research 79 (2009) 1342–1352 1345

2

to

i

wrnwhatwags

2

hTtdite

2

nwa

Fig. 5. Block diagram of generalized integral method.

.6. Adaptive filter method

The load current and supply voltage are input to the digital adap-ive filter. In this method, the load current may be written in termsf real, reactive and harmonic components as follows [23]:

(t) = ip(t) + iq(t) + ih(t) (3)

here ip(t), iq(t), and ih(t) are real, reactive, and harmonic currents,espectively. This method extracts the real and reactive compo-ents, which are respectively in phase with and 90◦ phase shiftedith respect to supply voltage. The rest of the load current is thearmonic component. The change of supply frequency does notffect the response of the filter. The MATLAB/Simulink scheme ofhe adaptive digital filter is given in Fig. 6. There are two branches,hich are “upper branch” and “lower branch” evaluating active

nd reactive current components, respectively in the block dia-ram shown below. Harmonic current component is obtained byubtracting these currents from total load current.

.7. Delayless filtering based on neural network

A delayless filtering application of feed forward neural networkas been also used in the extraction of harmonics from load current.he delay due to filtering is an important parameter, which affectshe load current tracking. The structure of three-phase square-waveelayless filtering by neural network can be found in [24] and shown

n Fig. 7. This technique uses three-phase currents together in timeherefore the harmonics of unbalanced three-phase load cannot bestimated properly.

.8. Adaptive linear neuron (ADALINE) method

Another type of neural network application is adaptive lineareuron (ADALINE) method [25]. This technique has only a feed for-ard neuron. The basic block of this network having n inputs andsingle output is shown in Fig. 8. The input output relationship is

Fig. 6. Digital adaptive filter structure.

Fig. 7. Block diagram of neural networks method.

expressed by using the following equation:

y =N∑

n=1

wnin + b (4)

where wn is the weighting values, in is inputs of neuron, and bis bias value. This method relies on offline training of the net-work with predetermined input–output patterns. The load currentis sampled and held in a buffer within n dimensional vector duringhalf period. This buffer consists of elements of input layer in andthe reference current y for active power filter is computed fromthe Eq. (4). This method is implemented for each phase currentindependently therefore the method is applicable for unbalancedthree-phase loads.

2.9. Wavelet method

The wavelet decomposition and reconstruction algorithm isused for detecting the harmonics in load current. Discrete Meyerwavelet is used as mother wavelet due to its orthogonal andbi-orthogonal properties to generate reference signal for APF.Simulation results show that the wavelet algorithm can abstractthe fundamental component of supply currents effectively. Thesequence f(n) obtained after digitizing original signal f(t), can bedecomposed into an approximate signal aj and a detail signal dj inspecific frequency bands. The original signal can be expressed as

f (n) = d1(n) + a1(n) = d1(n) + d2(n) + a2(n) =M∑

j=1

dj(n) + aM(n)

(5)

where aj(n) = aj+1(n) + dj+1(n).Hence, the fundamental current component can be obtained

from one of the detail or approximate signals that are decom-posed in the frequency range of interest. The wavelet applicationon the harmonic detection is given in [26,27] for pulsating loadcurrents.

Fig. 8. Structure of adaptive linear neuron (ADALINE).

1346K

.Vardaret

al./ElectricPow

erSystem

sResearch

79(2009)

1342–1352

Table 1Performance comparison of the harmonic extraction methods.

Method Number of phases Injected currentharmonics

Calculationcomplexity

Noiseimmunity

Accuracy Response time Performance againstfrequency variations

Limitations on source and loading conditions

Unbalancedsupply

Distortedsupply

Unbalancedload

FFT 1/3-phase Can be employedfor selectiveharmonicelimination

Few (depends onnumber ofsamples per cycle)

Bad(anti-aliasingfilter isrequired)

Good Slow (one-completecycle)

Bad Suitable Suitable Suitable

IRPT 3-phase only Not suitable forselective harmonicelimination

Few Depends onHPF

Good(dependson HPF)

Depends on HPF timeresponse

Bad Requiresbalanced supplyvoltages

Requiresundistortedsupplyvoltages*

Requiresbalanced loadfor properoperation

Single-phase pq 1/3-phase Not suitable forselective harmonicelimination

Few Depends onHPF

Good(dependson HPF)

Depends on HPF timeresponse

Bad Suitable Requiresundistortedsupplyvoltages*

Suitable

SRF 3-phase only Can be employedfor selectiveharmonicelimination

Complex Depends onPLL and HPF

Good(dependson PLL andHPF)

Depends on PLL andHPF time response

Good (due to PLL) Suitable Suitable Suitable

Generalized integral method 1/3-phase Can be employedfor selectiveharmonicelimination

Complex Depends onfilter bandwidth

Dependson filterband width

Depends on filterband width

Bad (due to fixednotch filterfrequencies)

Suitable Suitable Suitable

Adaptive filter method 1/3-phase Not suitable forselective harmonicelimination

Few Depends onfilter bandwidth

Dependson filterband width

Depends on filterband width

Good (due toadaptive structure)

Suitable Suitable Suitable

Delayless NN filter 1/3-phase Not suitable forselective harmonicelimination

Complex Good at lowdistortion

Good at bwTHD

Good Bad Suitable Suitable Not suitable

ADALINE 1/3-phase Not suitable forselective harmonicelimination

Complex Good Considerablygood

Very good Good Suitable Suitable Suitable

Wavelet 1/3-phase Can be employedfor harmonicelimination in afrequency range ofinterest**

Complex Good Good Very good Good Suitable Suitable Suitable

* Unless their fundamental sine waveforms obtained with a PLL circuit.** Determined by the sampling rate and number of levels.

ystems

3

La

F(

K. Vardar et al. / Electric Power S

. Simulation results

The methods outlined in Section 2 are simulated in MAT-AB/Simulink environment under different operating conditionsnd their performances are summarized in Table 1. The case study

ig. 9. Simulation results for the investigated methods; (a) load current and fundamental wg) adaptive filter method (h) delayless filter based on NN (i) ADALINE (j) wavelet method

Research 79 (2009) 1342–1352 1347

is performed at three-stages: In the first interval, the load current

has 0.75 pu fundamental component at 50 Hz, 0.2 pu 5th harmonicand 0.08 pu 7th harmonic components during 0.0–0.1 s of simu-lation time. The second interval is between 0.1 and 0.2 s and thefundamental component of the load current is increased to 1.0 pu

aveform (b) FFT (c) IRPT (d) single-phase PQ (e) SRF (f) generalized integral method.

1 ystems

alsss

twmafreo

mtommpaHicfiststotclplc

ottafi

dif

mwl

348 K. Vardar et al. / Electric Power S

t 0.1 s. Finally, during 0.2–0.3 s, the fundamental frequency of theoad current is set to 45 Hz and the responses of the methods againstuch a frequency deviation are investigated as shown in Fig. 9a. Inimulations, the supply voltages are assumed to be balanced andinusoidal.

Fig. 9b shows the results for FFT method. This method respondso amplitude variation in one-cycle and produces incorrect resultshen supply frequency deviates. In general, frequency domainethods respond to load variations in one supply cycle and requirelarge amount of computation. FFT method is vulnerable to

requency deviations. Therefore, either PLL or zero-crossing algo-ithms should be implemented within the FFT technique in order tostimate the harmonics correctly due to the variation of frequencyf the supply.

The simulation results for IRPT, single-phase PQ method, and SRFethods are shown in Fig. 9c, d and e, respectively. In IRPT method,

he duration of transient response against the load variations takesne supply cycle, while it takes 2.5 cycles in SRF method. IRPTethod is insensitive to frequency deviations and its performancesainly depend on low-pass filter characteristics. IRPT method also

roduces incorrect reference currents under load current imbal-nce since it distributes any current imbalance to other phases.owever, since the negative sequence controller block detects any

mbalance in the load currents and subtracts negative sequenceomponent from the reference currents in SRF method, the activelter reference currents are produced such that they only compen-ate the load current harmonics. The SRF method is also capableo generate the reference current for active power filter at a pre-pecified frequency by setting the rotating reference frame speedo the same frequency. In single-phase PQ method, the durationf the transient response against amplitude variation is observedo be half supply cycle. This method produces incorrect referenceurrents under frequency deviation. This is due to obtaining theeading source voltage and load current by �/2 via a fixed trans-ort delay to obtain imaginary axis components. That causes the

eading phase angle being different from �/2 if the frequency ishanged.

Generalized integral method produces a 1.5 cycle delay at itsutput as shown in Fig. 9f. There is a trade off between the fil-ering performance and response time, since it is dependent onhe filter bandwidth. Its performance against the frequency vari-tions is not satisfactory due to fixed cut-off frequencies of notchlters.

Adaptive filter method produces output in approximately 1 cycleelay as shown in Fig. 9g. Filter cut-off frequency varies depend-

ng on the supply frequency and hence its performance against

requency deviations is good due to its adaptive structure.

The results for Delayless filtering based on neural networkethod are shown in Fig. 9h. Designed feed forward neural net-ork is formed by 3, 10 and 3 neurons in the input layer, hidden

ayer and output layer, respectively. The training set is produced

Fig. 10. Block diagram of dig

Research 79 (2009) 1342–1352

in Matlab offline. The training is completed after 1000 iterationsand mean square error is obtained as 1.9 × 10−6. In the results, itwas observed that the current reference produced by this methodis not capable to compensate all harmonic contents in the loadcurrent waveform. When the total harmonic distortion of the loadcurrent is high, this method is unable to extract the fundamentalcomponent.

The results of adaptive linear neuron method are shown inFig. 9i. The response of the method against load variations, bothin amplitude and frequency, is satisfactory. It produces a responseat one quarter cycle delay during load transients. Its performanceis dependent on training data and best performance is obtainedwhen the network is trained with all possible load conditions.The input of the linear neuron is the weighted sum of the sam-pled values of the input signal constructed in 60-element frame.The output is the instantaneous value of the fundamental sinewaveform. In the training stage of the neural network, the inputsignals at varying amplitude and frequency have been used. Theinput signals, which are varying at fundamental frequency between45 and 55 Hz and 5th, 7th, 11th, and 13th harmonics at variousmagnitudes, are applied to the neural network for training. Inaddition, these training signals are perturbed with white noise hav-ing a variance of 0.01 in order to obtain a better noise rejection.The input training data were sampled at 6 kHz and using gradi-ent method, the training of the neural network was completedafter 4000 iterations and the mean square error was obtained as1.02132 × 10−5.

Wavelet method produces a response at one quarter cycle delayas shown in Fig. 9j. Its response to amplitude and frequency varia-tions in load currents is fast and quite satisfactory.

Three methods out of nine have been selected to be programmedin the digital signal processing unit based on the criteria such thatthe algorithm can be implemented for three-phase system with afaster response against frequency, load variation and unbalancedloading. Among the IRPT and SRF, the former one is preferredbecause its transient response is faster since SRF requires PLL whichinserts delay to response in application. The adaptive filter methodand ADALINE are preferred among the methods that can be imple-mented for single-phase and unbalanced systems because of theirgood response to frequency variation. Although the wavelet algo-rithm is good for frequency variation, it was not implemented dueto its complexity for implementation and large number of mathe-matical calculations

4. Reference current estimation in DSP

TMS320F2812 digital signal processor (DSP) board of TexasInstruments was used for hardware implementation of referencecurrent generation. The F2812 DSP board contains a fixed-pointprocessor with 150 MIPS speed, 128 K Words internal flash mem-ory, 64 K Words external SRAM memory, and 12-channel PWM

ital filter and variables.

ystems

ga

gria

F

K. Vardar et al. / Electric Power S

enerator. The processor also contains two 8-channel independentnalog-to-digital converters.

The software implementation of reference current waveform

eneration was accomplished in Code Composer Studio (CCS) envi-onment. The CCS provides a C++ compiler/linker that allows themplementation of both fixed and floating-point operations. Inddition, the IQMATH library provides a powerful tool in order fulfill

ig. 11. Results for the tested methods (a) IRPT, (b) adaptive filter and (c) ADALINE.

Research 79 (2009) 1342–1352 1349

the floating-point operations more effectively and efficiently. Themethods were implemented via floating-point operations usingboth standard and IQMATH libraries.

Three harmonic extraction methods (IRPT, adaptive filter andadaptive linear neuron methods) are tested on eZdsp TMS320F2812board. The load is considered as a non-linear load and drawing thecurrent, which contains 5th and 7th harmonic components.

4.1. IRPT method

IRPT method was implemented using floating-point calculationsthrough standard and IQMATH type variables. In the implementa-tion of this algorithm, a 10th order Butterworth digital low-passfilter was designed using Matlab filter design toolbox in orderto extract the instantaneous real and reactive powers created byfundamental component of voltage and current from the entirewaveform. The cut-off frequency of the filter was chosen to be100 Hz with a sampling frequency of 10 kHz. The direct Form II real-ization of the digital LPF with the 5-cascaded blocks was used asshown in Fig. 10. This method has the feedforward part containingthe numerator coefficients and feedback part having the denomi-nator coefficients of the filter transfer function. This method usesthe minimum number of delay elements that is equal to the orderof the transfer function denominator.

The waveforms given in Fig. 11a show that results are similar toones obtained from Matlab simulations. The low-pass filter affectsthe performance of this method. The standard calculations take3039 CPU cycle, while it takes 300 CPU cycle using IQMATH library.Considering one CPU cycle as 40 ns, the maximum available sam-pling frequencies for standard and IQMATH calculations have beenobtained as 8226 Hz and 83.33 kHz, respectively.

4.2. Adaptive filter method

The adaptive filter method was implemented in F2812 DSPusing both standard and IQMATH floating-point calculations. Thesampling frequency was chosen to be 10 kHz. The results for thismethod are given in Fig. 11b. The test results are similar to thoseobtained from Matlab simulations. The performance of this methoddepends on sampling frequency and filter parameters. This methodwas implemented for single-phase systems, so this algorithm mustbe repeated 3 times when it is designed for three-phase sys-tems. The complete cycle for this algorithm takes 567 and 250CPU cycles using standard and IQMATH calculations, respectively.Hence, the maximum sampling frequencies are obtained as 14.66and 33.33 kHz, respectively for three-phase system.

4.3. Adaptive linear neuron method

When implementing this method in DSP, the weighting factorscomputed in Matlab through the training of the network have been

Table 2Required CPU cycles for the F2812 implementation of the methods.

Method With standard floating-pointvariable types (CPU cycle andcorresponding maximumsampling frequency)

With IQMATH floating-pointvariable types (CPU cycle andcorresponding maximumsampling frequency)

IRPT 3039 3008.226 kHz 83.333 kHz

Adaptive filter 3 × 567 3 × 25014.666 kHz 33.333 kHz

ADALINE 3 × 3100 3 × 3002.688 kHz 27.777 kHz

1 ystems

u

62,

5022

52, 0

0078

6, −0

5, −0

wwpTtiafvlwtfmcumb

etoasp

350 K. Vardar et al. / Electric Power S

sed and these factors are given below:

w1[60] = {0.33793, 0.091308, 0.60414, 0.467, −0.028711, −0.0618

−0.18069, 0.87735, 0.36669, 0.0017934, 0.66031, 0.27976, −0.05

0.50848, −0.298, 0.53963, −0.73417, 0.99526, −0.35752, −0.387

0.83916, −0.52617, −0.32566, 0.36713, −0.44794, −0.14738, −1.

−0.0068225, −0.35424, −0.18247, −0.65888, −0.028151, 0.2698

0.41765, 0.20669, −0.26189, −0.07493, 0.38505, −1.0227, 0.1815

b1 = 0.88073; b2 = 0.11658; w2 = −0.13229;

here w1 and b1 are the constants of linear neuron stated in (4), and2 and b2 are the constants of the linear transfer function at the out-ut of the neural neuron, which has the form of yout = w2 × y + b2.hese weighting factors are defined as constants in software. Usinghese pre-calculated weighting factors, the ADALINE method wasmplemented in DSP and the results are given in Fig. 11c. The resultsre similar to those obtained from Matlab simulations. The per-ormance of this method is the best considering the load currentariations in amplitude and frequency. In the DSP program, theoad current amplitude was changed to 0.5 pu at t = 0.1 s and itas observed that the ADALINE method responds to this varia-

ion approximately in a half cycle. This method was implementedor single-phase systems and the number of calculations should be

ultiplied by 3 when it is designed for a three-phase system. Theomplete cycle of this algorithm takes 3100 and 300 CPU cyclessing standard and IQMATH calculations, respectively. Hence, theaximum available sampling frequencies for a three-phase system

ecome 2.688 and 27.77 kHz, respectively.

The sampling rates for these three methods according to their

xecution times are given in Table 2. Since the digital LPF is designedo operate at 10 kHz sampling frequency, the method fails if it isperated at a lower sampling rate due to execution time of thelgorithm. Similarly, adaptive linear neuron method will fail at aampling rate of 2.688 kHz, since the training data of the neuron isrepared at a sampling rate of 6 kHz.

Fig. 12. Measured test results under balanced non-linear load transition; (a) lo

Research 79 (2009) 1342–1352

0.039123, 0.37293, 0.69523,

, 0.27593, −0.031484, 0.20825,

.83009, 0.51546, −0.70713, −0.95053,

, 0.82392, 0.036318, −0.23515,

.21849, 0.017129, 0.80304, −0.41513,

.7781, 0.08288, −0.066937};

As being shown in Table 2, the fastest algorithm for the softwareimplementation is the IPRT method, while the ADALINE method isthe slowest. Although the adaptive filter method has a very sim-ple structure, it cannot effectively use the IQMATH library in DSPand its execution time becomes longer. The method that is notsuitable to operate at the sampling frequencies is underlined inTable 2.

TMS320F2812 is a fixed-point processor but it also executesfloating-point calculations with the higher execution time. Table 2shows how much time is saved in CPU cycle if the variables aredefined as IQMATH type. It should be noted that the numbers ofADC units used in the DSP to read the variables like as dc linkvoltage, three line currents of load, phase voltages and filter phasecurrents dramatically affect the sampling frequency and executionof program. This task is not considered in the CPU cycles given inTable 2.

5. Implementation of IRPT

The IRPT method is implemented by using TMS320F2812 DSP

unit to design three-phase, 380-V and 30-A active power filter. Thealgorithm of the program using IQMATH type of variables is testedunder balanced and unbalanced non-linear loads. Two loads areconnected in parallel; first one is the three-phase diode bridge recti-fier as balanced load and second one is resistive load as unbalanced

ad current, (b) supply current (c) supply voltage and (d) dc link voltage.

K. Vardar et al. / Electric Power Systems Research 79 (2009) 1342–1352 1351

F steady-state (a) load current, (b) supply currents, (c) APF currents and (d) dc link voltage.

lpbtlopriaicrssfiAcqhsct

tbfiAftacmtcd

ig. 13. Measured test results during the operation of APF under unbalanced load at

oad. In experiments, the APF is started unloaded then the three-hase diode bridge rectifier switched on to the supply drawingalanced load currents at a magnitude of about 10 A. The varia-ions of the load current, supply current, supply voltage, and dcink voltage during this transient are shown in Fig. 12. The responsef APF to transient load change is approximately 0.01 s (half sup-ly cycle), which is the interval from the instant the diode bridgeectifier is turned on to the instant the supply current settles tots steady-state value. The total harmonic distortions (THD) of loadnd supply currents are measured as 27.73% and 18.4%, respectively,ncluding 63rd harmonic. The total harmonic distortion of supplyurrent is effected by higher harmonics (greater than 15) in theange of 4%. As the load current level increases, the percentage ofwitching ripples will decrease in THD. The notches appear on theupply current waveform at the time when the diodes in the recti-er load starts the conduction during the operation of the APF. ThePF currents fail to track the immediate change of the referenceurrent waveforms at these instants. The allowable switching fre-uency by the overall system does not overcome to suppress theseigher frequency current components. If it is aimed to eliminateuch notches in the supply current, the immediate change of loadurrents can be smoothed by inserting line inductances in front ofhe rectifier.

The system is operated under unbalanced load by insertinghree-phase unbalanced resistive load in parallel to the three-phaseridge rectifier. The variation of the load current, supply currents,lter currents and dc link voltage at steady-state is shown in Fig. 13.s shown in Fig. 13c, the filter injects the current at fundamental

requency in addition to harmonics during the unbalanced opera-ion of the load. When the reference currents of active power filterre computed from the IRPT algorithm, any imbalance in the load

urrents is distributed to other phases. As a result, the fundamentalagnitudes of the compensated supply currents are different than

he fundamental current magnitudes of the uncompensated loadurrents as shown in Fig. 13a and b. The photo of active power filteresigned is given in Fig. 14. Fig. 14. Photo of active power filter designed.

1 ystems

6

bwmpmtufispftbioI

A

NCuf

R

[

[

[

[

[

[

[

[

[

[

[

[

[

[

[

[

[

[

352 K. Vardar et al. / Electric Power S

. Conclusions

The performance of nine harmonic extraction methods haveeen evaluated by using Matlab simulations and three of them,hich are IRPT method, Adaptive filter method, and ADALINEethod were implemented in DSP unit in order evaluate their

erformance as well as the programming difficulties with theethods. The IRPT method has a faster response to load varia-

ions. However, it is not effectively compensating harmonics ofnbalanced loads and not effective for load balancing. Adaptivelter method is robust to frequency variations and performs con-iderably good transient response. ADALINE method gives bettererformance against the load current variations in amplitude andrequency. Its computational time is the longest among threeested algorithms in the digital signal processor. But it shoulde noted that the SRF method can also be preferred to elim-

nate the specific harmonics at estimated frequencies insteadf injecting whole spectrum of harmonics as being done byRPT.

cknowledgement

This work was carried out as a part of project, “Power Qualityational Projects”, sponsored by Turkish Scientific and Researchouncil and Turkish Electrical Power Transmission Co. (TEIAS)nder contract 106G012. We also thank KOM ENERJI Systems Co.or providing test facilities.

eferences

[1] W.M. Grady, M.J. Samotyj, A.H. Noyola, Survey of active line conditioningmethodologies, IEEE Trans. Power Deliv. 5 (3) (1990) 1536–1542.

[2] H. Akagi, Trends in active power line conditioners, IEEE Trans. Power Electron.9 (3) (1994) 263–268.

[3] H. Akagi, New trends in active filters for power conditioning, IEEE Trans. Ind.Appl. 32 (6) (1996) 1312–1322.

[4] B. Singh, K. Al-Haddad, A. Chandra, A review of active filters for power qualityimprovement, IEEE Trans. Ind. Electron. 46 (5) (1999) 960–971.

[5] M. El-Habrouk, M.K. Darwish, P. Mehta, Active power filters: a review, IEE Proc.Electron. Power Appl. 147 (5) (2000) 403–413.

[6] G.G. Terbobri, M.F. Sadison, M.S. Khanniche, Trends of real time controlled activepower filters, in: International Conference on Power Electronics and VariableSpeed Drives, 2000, pp. 410–415.

[7] H. Akagi, Active harmonic filters, Proc. IEEE 93 (12) (2005) 2128–2141.[8] H. Akagi, Active filters for power conditioning, in: T.L. Skvarerina (Ed.), The

Power Electronics Handbook, CRC Press, New York, 2002, pp. 499–517.[9] B.M. Han, B.Y. Bae, S.J. Ovaska, Reference signal generator for active power filters

using improved adaptive predictive filter, IEEE Trans. Ind. Electron. 52 (2) (2005)576–584.

10] S.J. Ovaska, T. Bose, O. Vainio, Genetic algorithm-assisted design of adaptivepredictive filters for 50/60 Hz power systems instrumentation, IEEE Trans. Inst.

Meas. 54 (5) (2005) 2041–2048.

11] S. Valiviita, S.J. Ovaska, Delayless method to generate current reference for activefilters, IEEE Trans. Ind. Electron. 45 (4) (1998) 559–567.

12] S. Rechka, E. Ngandui, J. Xu, P. Sicard, Analysis of harmonic detection algorithmsand their application to active power filters for harmonic compensation andresonance damping, Can. J. Elect. Comp. Eng. 28 (2003) 41–51.

Research 79 (2009) 1342–1352

13] L. Asiminoaei, F. Blaabjerg, S. Hansen, Evaluation of harmonic detectionmethods for active power filter applications, in: Applied Power ElectronicsConference and Exposition 1, 2005, pp. 635–641.

14] S. Rechka, E. Ngandui, J. Xu, P. Sicard, A comparative study of harmonic detec-tion algorithms for active filters and hybrid active filters, IEEE PESC 1 (2002)357–363.

15] S. Rechka, E. Ngandui, J. Xu, P. Sicard, Performance evaluation of harmonicsdetection methods applied to harmonics in presence of common power qualityproblems, ELECTRIMACS (2002) 363–375.

16] A.A. Girgis, W.B. Chang, E.B. Makram, A digital recursive measurement schemefor on-line tracking of power system harmonics, IEEE Trans. Power Deliv. 6 (3)(1991) 1153–1160.

17] J.S. Tepper, J.W. Dixon, G. Venegas, L. Moran, A simple frequency-independentmethod for calculating the reactive and harmonic current in a nonlinear load,IEEE Trans. Ind. Electron. 43 (6) (1996) 647–654.

18] M.T. Haque, T. Ise, Implementation of single-phase pq theory, Power Convers.Conf. 2 (2002) 761–765.

19] V. Khadkikar, A. Chandra, B.N. Singh, Generalised single-phase p-q theory foractive power filtering: simulation and DSP-based experimental investigation,IET Power Electron. 2 (1) (2009) 67–78.

20] J.G. Pinto, P. Neves, R. Pregitzer, L.F.C. Monterio, J.L. Afonso, Single-phase shuntactive filter with digital control, in: ICREPQ’07, 28–30 March, Spain, 2007.

21] S. Bhattachharya, T.M. Frank, D.M. Divan, B. Banerjee, Active filter system imple-mentation, IEEE Ind. Appl. Magazine 4 (1998) 47–63.

22] M. Aiello, A. Cataliotti, V. Cosentino, S. Nuccio, Synchronization techniquesfor power quality instruments, IEEE Trans. Instrument. Meas. 56 (October (5))(2007) 1511–1519.

23] A. Ozdemir, A digital adaptive filter for detecting harmonic, active and reactivecurrents, Meas. Sci. Technol. 5 (2004) 1316–1322.

24] J. Zhao, B.K. Bose, Neural-network-based waveform processing and delaylessfiltering in power electronics and AC drives, IEEE Trans. Ind. Electron. 51 (5)(2004) 981–991.

25] S.P. Dubey, P. Singh, H.V. Manjunath, DSP based neural network controlledparallel hybrid active power filter, Int. J. Emerg. Electr. Power Syst. 4 (2005)1–14.

26] H. Liu, G. Liu, Y. Shen, A novel harmonics detection method based on waveletalgorithm for active power filter, in: World Congress on Intelligent Control andAutomation, 2006, pp. 7617–7621.

27] H.T. Yalazan, T. Sürgevil, E. Akpınar, Wavelet transform application in activepower filter used for slip energy recovery drives, in: ACEMP’07, 2007, pp.398–402.

Kadir Vardar received the B.Sc., M.Sc. degrees in electrical and electronics engineeringfrom the Dumlupınar University in 2001 and 2004 respectively. He is currently aPh.D. student at the Electrical and Electronics Engineering Department of DokuzEylül University. His research interest is focused on active power filters.

Eyüp Akpınar obtained the B.Sc., M.Sc. and Ph.D. degrees in electrical engineeringfrom the Middle East Technical University (METU) in 1981, 1984 and 1991, respec-tively in Turkey. He was awarded a scholarship by the British Council to do partof his Ph.D. thesis at the University of New Castle upon Tyne in the UK. He wasa research associate at the Center for the Industrial Application of Electric Powerand Instrumentation in Electrical Engineering Department at the University of NewOrleans in the USA in 1991. He did research at the same department as a visitingasst. prof. in 1992 and 1993. He was awarded The overseas Premium Paper Awardby the IEE in the UK in 1993. He is now working as a prof. at the Departmentof Electrical and Electronics Engineering at the Dokuz Eylül University in Turkey.His research area is the electrical machines, power electronics and power qualityproblems.

Tolga Sürgevil received the B.Sc., M.Sc., and Ph.D. degrees in electrical and elec-tronics engineering from the Dokuz Eylül University in 1994, 1998, and 2004,respectively. He is currently a asst. prof. at the same department. His research inter-ests focus on wind energy conversion systems, PWM converters and active powerfilters.