Electric Power Systems Harmonics - Identification and Measurements

The presence of non-linear loads and the increasing number of distributed generation power systems (DGPS) in electrical grids contribute to change the characteristics of voltage and current waveforms in power systems, which differ from pure sinusoidal constant amplitude signals. Under these conditions advanced signal processing techniques are required for accurate measurement of electrical power quantities. The impact of non-linear loads in electrical power systems has been increasing during the last decades. Such electrical loads, which introduce non-sinusoidal current consumption patterns (current harmonics), can be found in rectification front-ends in motor drives, electronic ballasts for discharge lamps, personal computers or electrical appliances. Harmonics in power systems mean the existence of signals, superimposed on the fundamental signal, whose frequencies are integer numbers of the fundamental frequency. The electric utility companies should supply their customers with a supply having a constant frequency equal to the fundamental frequency, 50/60 Hz, and having a constant magnitude. The presence of harmonics in the voltage or current waveform leads to a distorted signal for voltage or current, and the signal becomes non-sinusoidal signal which it should not be. Thus the study of power system harmonics is an important subject for power engineers. The power system harmonics problem is not a new problem; it has been noticed since the establishment of the ac generators, where distorted voltage and current waveforms were observed in the thirtieth of 20th century [2]. Concern for waveform distortion should be shared by all electrical engineers in order to establish the right balance between exercising control by distortion and keeping distortion under control. There is a need for early co-ordination of decisions between the interested parties, in order to achieve acceptable economical solutions and should be discussed between manufacturers, power supply and communication authorities [1]. Electricity supply authorities normally abrogate responsibility on harmonic matters by introducing standards or recommendations for the limitation of voltage harmonic levels at the points of common coupling between consumers.


Introduction
The presence of non-linear loads and the increasing number of distributed generation power systems (DGPS) in electrical grids contribute to change the characteristics of voltage and current waveforms in power systems, which differ from pure sinusoidal constant amplitude signals. Under these conditions advanced signal processing techniques are required for accurate measurement of electrical power quantities. The impact of non-linear loads in electrical power systems has been increasing during the last decades. Such electrical loads, which introduce non-sinusoidal current consumption patterns (current harmonics), can be found in rectification front-ends in motor drives, electronic ballasts for discharge lamps, personal computers or electrical appliances. Harmonics in power systems mean the existence of signals, superimposed on the fundamental signal, whose frequencies are integer numbers of the fundamental frequency. The electric utility companies should supply their customers with a supply having a constant frequency equal to the fundamental frequency, 50/60 Hz, and having a constant magnitude. The presence of harmonics in the voltage or current waveform leads to a distorted signal for voltage or current, and the signal becomes non-sinusoidal signal which it should not be. Thus the study of power system harmonics is an important subject for power engineers. The power system harmonics problem is not a new problem; it has been noticed since the establishment of the ac generators, where distorted voltage and current waveforms were observed in the thirtieth of 20 th century [2]. Concern for waveform distortion should be shared by all electrical engineers in order to establish the right balance between exercising control by distortion and keeping distortion under control. There is a need for early co-ordination of decisions between the interested parties, in order to achieve acceptable economical solutions and should be discussed between manufacturers, power supply and communication authorities [1]. Electricity supply authorities normally abrogate responsibility on harmonic matters by introducing standards or recommendations for the limitation of voltage harmonic levels at the points of common coupling between consumers.
1. Capacitor bank failure from dielectric breakdown or reactive power overload. 2. Interference with ripple control and power line carrier systems, causing mis-operation of systems which accomplish remote switching, load control, and metering. 3. Excessive losses in -and heating of -induction and synchronous machines. 4. Over voltages and excessive currents on the system from resonance to harmonic voltages or currents on the network. 5. Dielectric breakdown of insulated cables resulting from harmonic over voltages on the system. 6. Inductive interference with telecommunications systems. 7. Errors in induction kWh meters. 8. Signal interference and relay malfunction, particularly in solid-state and microprocessor-controlled systems. 9. Interference with large motor controllers and power plant excitation systems. (Reported to cause motor problems as well as non-uniform output.) 10. Mechanical oscillations of induction and synchronous machines. 11. Unstable operation of firing circuits based on zero voltage crossing detection or latching. These effects depend, of course, on the harmonic source, its location on the power system, and the network characteristics that promote propagation of harmonics.

Time domain model [3]
In this model, it is assumed that the waveform under consideration consists of a fundamental frequency component and harmonic components with order of integral multiples of the fundamental frequency. It is also assumed that the frequency is known and constant during the estimation period. Consider a non-sinusoidal voltage given by a If the voltage signal v(t) is sampled at a pre-selected rate, say t, then m samples would be obtained at t 1 , t 2 = t 1 + t, t 3 = t 1 + 2t, …, t m = t 1 + (m -1)t. Then, after expanding equation (4) where the elements of the A matrix are the sine and cosine expansion of equation (4). In the a's vector form, equation (5) can be written as where Z v (t) is m  1 vector of sampled voltage measurement, A(t) is m  (2N + 1) matrix of measurement coefficients,  v is (2N +1) vector to be estimated,  v (t) is m  1 error vector to be minimized. The order of the matrix A(t) depends n the number of harmonics to be estimated. Furthermore, the elements of the matrix A(t) depend on the initial sampling time t 1 the sampling rate t and the data window size used in the estimation process. The matrix A (t) can be calculated on off-line and stored. At least (2N + 1) samples are required to solve the problem formulated in (6). Using 2N + 1 samples may produce a poor estimate, since we force  v (t) to be zero. We assume that m > 2N +1, so that equation (4) represents over determined set of equations.

Time domain estimation; least error squares estimation (LES)
The solution to the over determined set of equations of (6) in the LES sense is given by www.intechopen.com The above estimation procedures are simple and straight forward if the voltage and/or current waveforms under investigation are stationary and in steady state, but if there is a sudden variation in the power system operation, transient operation, such as fault, lighting and sudden loading to the system or sudden switching off a large load, the voltage signal waveform may contain, for a few cycles, a dc component, which if it is neglected, will affect the harmonics estimation content in the waveform. To overcome this problem, the voltage signal in equation (1) If the voltage v(t) is samples at a pre-selected rate t, then m sample would be obtained at t 1 , t 2 = t 1 + t, …, t m = 1 + (m -1)t, in this case equation (13) becomes where is m  (2N +2) measurement matrix whose elements depend on the initial and sampling times and its order depends on the number of harmonics and the number of terms chosen from Taylor series expansion for the exponential term. Y is (2N +2)  1 parameters vector to be estimated containing x 11 , x 12 and xn, yn, is m  1 error vector to be minimized. If m > (2N +2), we obtain over determined set of equation and the non-recursive least error square algorithm can be used to solve this system of equation as

 
   Figure 1 gives actual recorded data for a three-phase dynamic load. The load is a variable frequency drive controlling a 3000 HP induction motor connected to an oil pipeline compressor [5]. Examining this curve reveals the following: (a) the waveform of the phase currents are not periodical; (b) there are low-frequency transients, which have frequencies not an integer number of the fundamental, we call them sub-harmonics, contaminating these waveforms, especially in the tips of the wave; and (c) the phase currents are not symmetrical. It can be concluded from these remarks that this waveform is contaminated with harmonics, as well as low frequency transients, this is due to the power electronic devices associated with the load.

Modeling of sub-harmonics in time domain
The sub-harmonics is a noise contaminated with a signal and having frequency which is not a multiple from the fundamental frequency (50/60 Hz), as given in equation (19). To measure these sub-harmonics, an accurate model is needed to present the voltage and current waves: Assume the voltage or current waveform is contaminated with both harmonics and subharmonics. Then, the waveform can be written as are the sub-harmonic frequencies, assumed to be identified in the frequency domain w k ; k = 1, …, M are the harmonic frequencies assumed to be identified also in the frequency domain.
The first bracket in Equation (19) presents the possible low or high frequency sinusoidal with a combination of exponential terms, while the second bracket presents the harmonics, whose frequencies, w k , k = 1, …, M, are greater than 50/60 c/s, that contaminated the voltage or current waveforms. If these harmonics are identified to a certain degree of accuracy, i.e. a large number of harmonics are chosen, and then the first bracket presents the error in the voltage or current waveforms. Now, assume that these harmonics are identified, then the error e(t) can be written as where the Taylor series expansion is given by: Making the following substitutions in equation (23), equation (26)  It is clear that this set of equations is similar to the set of equations given by equation (5). Thus an equation similar to (6) can be written as: where z(t) is the vector of sampled measurements, H(t) is an m  6, in this simple case, matrix of measurement coefficients, (t) is a 6  1 parameter vector to be estimated, and  (t) is an m  1 noise vector to be minimized. The dimensions of the previous matrices depend on the number of modes considered, as well as, the number of terms truncated from the Taylor series.

Least error squares estimation
The solution to equation (28)

Recursive least error squares estimates
In the least error squares estimates explained in the previous section, the estimated parameters, in the three cases, take the form of  where the superscript "m" represents the new estimate at time t = t 1 + mt. It is possible to express the new estimates obtained from equation (34) in terms of older estimates (obtained from equation (33)) and the latest sample Z m as follows

Least absolute value estimates (LAV) algorithm (Soliman & Christensen algorithm) [3]
The LAV estimation algorithm can be used to estimate the parameters vectors. For the reader's convenience, we explain here the steps behind this algorithm. Given the observation equation in the form of that given in (28) as The steps in this algorithm are: Step 1 Step 4. Reject the measurements having residuals greater than the standard deviation, and recalculate the LES solution Step 5. Recalculated the least error squares residuals generated from this new solution Step 6. Rank the residual and select n measurements corresponding to the smallest residuals Step 7. Solve for the LAV estimates  as    Figure 2 shows the A.C. voltage waveform at the converter terminal. The degree of the distortion depends on the order of the harmonics considered as well as the system characteristics. Figure 3 shows the spectrum of the converter bus bar voltage. The variables to be estimated are the magnitudes of each voltage harmonic from the fundamental to the 13 th harmonic. The estimation is performed by the three techniques while several parameters are changed and varied. These parameters are the standard deviation of the noise, the number of samples, and the sampling frequency. A Gaussiandistributed noise of zero mean was used. www.intechopen.com Figure 4 shows the effects of number of samples on the fundamental component magnitude using the three techniques at a sampling frequency = 1620 Hz and the measurement set is corrupted with a noise having standard deviation of 0.1 Gaussian distribution. It can be noticed from this figure that the DFT algorithm gives an essentially exact estimate of the fundamental voltage magnitude. The LAV algorithm requires a minimum number of samples to give a good estimate, while the LES gives reasonable estimates over a wide range of numbers of samples. However, the performance of the LAV and LES algorithms is improved when the sampling frequency is increased to 1800 Hz as shown in Figure 5. Figure 6 -9 gives the same estimates at the same conditions for the 5 th , 7 th , 11 th and 13 th harmonic magnitudes. Examining these figures reveals the following remarks.  For all harmonics components, the DFT gives bad estimates for the magnitudes. This bad estimate is attributed to the phenomenon known as "spectral leakage" and is due to the fact that the number of samples per number of cycles is not an integer.  As the number of samples increases, the LES method gives a relatively good performance. The LAV method gives better estimates for most of the number of samples.  At a low number of samples, the LES produces poor estimates. However, as the sampling frequency increased to 1800 Hz, no appreciable effects have changed, and the estimates of the harmonics magnitude are still the same for the three techniques.
www.intechopen.com     The CPU time is computed for each of the three algorithms, at a sampling frequency of 1620 Hz. Figure 10 gives the variation of CPU.

www.intechopen.com
The CPU time for the DFT and LES algorithms are essentially the same, and that of the LAV algorithm is larger. As the number of samples increases, the difference in CPU time between the LAV and LS/DFT algorithm increases. Other interesting studies have been carried out on the performance of the three algorithms when 10% of the data is missed, taken uniformly at equal intervals starting from the first data point, for the noise free signal and 0.1 standard deviation added white noise Gaussian, and the sampling frequency used is 1620 Hz. Figure 11 gives the estimates of the three algorithms at the two cases. Examining this figure we can notice the following remarks: For the no noise estimates, the LS and DFT produce bad estimates for the fundamental harmonic magnitude, even at a higher number of samples The LAV algorithm produces good estimates, at large number of samples.  12 -15 give the three algorithms estimates, for 10% missing data with no noise and with 0.1 standard deviation Gaussian white noise, when the sampling frequency is 1620 Hz for the harmonics magnitudes and the same discussions hold true.

Remarks
Three signal estimation algorithms were used to estimate the harmonic components of the AC voltage of a three-phase six-pulse AC-DC converter. The algorithms are the LS, LAV, and DFT. The simulation of the ideal noise-free case data revealed that all three methods give exact estimates of all the harmonics for a sufficiently high sampling rate. For the noisy case, the results are completely different. In general, the LS method worked well for a high number of samples. The DFT failed completely. The LAV gives better estimates for a large range of samples and is clearly superior for the case of missing data.

Estimation of harmonics; the dynamic case
In the previous section static-state estimation algorithms are implemented for identifying and measuring power system harmonics. The techniques used in that section was the least error squares (LES), least absolute value (LAV) and the recursive least error squares algorithms. These techniques assume that harmonic magnitudes are constant during the data window size used in the estimation process. In real time, due to the switching on-off of power electronic equipments (devices) used in electric derives and power system transmission (AC/DC transmission), the situation is different, where the harmonic magnitudes are not stationary during the data window size. As such a dynamic state estimation technique is required to identifying (tracking) the harmonic magnitudes as well as the phase angles of each harmonics component. In this section, we introduce the Kalman filtering algorithm as well as the dynamic least absolute value algorithm (DLAV) for identifying (tracking) the power systems harmonics and sub-harmonics (inter-harmonics). The Kalman filtering approach provides a mean for optimally estimating phasors and the ability to track-time-varying parameters. The state variable representation of a signal that includes n harmonics for a noise-free current or voltage signal s(t) may be represented by [7] is the amplitude of the phasor quantity representing the ith harmonic at time t These state variables represent the in-phase and quadrate phase components of the harmonics with respect to a rotting reference, respectively. This may be referred to as model 1. Thus, the state variable equations may be expressed as: is a 2n  1 noise vector associated with the transition of a sate from k to k + 1 instant The measurement equation for the voltage or current signal, in this case, can be rewritten as, equation (37 where the sub-matrices M i are given as cos sin sin cos Equation (46) can be rewritten as while equation (45) This model has constant state transition and measurement matrices. However, it assumes a stationary reference. Thus, the in-phase and quadrature phase components represent the instantaneous values of con-sinusoidal and sinusoidal waveforms, respectively. www.intechopen.com

Testing the kalman filter algorithm
The two Kalman filter models described in the preceding section were tested using a waveform with known harmonic contents. The waveform consists of the fundamental, the third, the fifth, the ninth, the eleventh, the thirteenth, and the nineteenth harmonics. The waveform is described as The sampling frequency was selected to be 64  60 Hz. i. Initial process vector As the Kalman filter model started with no past measurement, the initial process vector was selected to be zero. Thus, the first half cycle (8 milliseconds) is considered to be the initialization period. ii. Initial covariance matrix The initial covariance matrix was selected to be a diagonal matrix with the diagonal values equal to 10 p.u. iii. Noise variance (R) The noise variance was selected to be constant at a value of 0.05 p.u. 2 . This was passed on the background noise variance at field measurement. iv. State variable covariance matrix (Q) The matrix Q was also selected to be 0.05 p.u. Testing results of model 1, which is a 14-state model described by equations (40) and (42) are given in the following figures. Figure 14 shows the initialization period and the recursive estimation of the magnitude of the fundamental and third harmonic. Figure 15 shows the Kalman gain for the fundamental component. Figure 16 shows the first and second diagonal element of P k .    Figure 26 shows the first two components of Kalman gain vector. Figure 27 shows the first and second diagonal elements of P k . The estimation of the magnitude of and third harmonic were exactly the same as those shown in Figure 23.  The Kalman gain vector K k and the covariance matrix P k reach steady-state in about half a cycle, when model 1 is used, 1/60 seconds. Its variations include harmonics of 60 Hz. The covariance matrix in the steady-state consists of a constant plus a periodic component. These time variations are due to the time-varying vector in the measurement equation. Thus, after initialization of the model, the Kalman gain vector of the third cycle can be repeated for successive cycles. When model 2 is selected, the components of the Kalman gain vector and the covariance matrix become constants. In both models, the Kalman gain vector is independent of the measurements and can be computed off-line. As the state transition matrix is a full matrix, it requires more computation than model 1 to update the state vector.
Kalman filter algorithm is also tested for actual recorded data. Two cases of actual recorded data are reported here. The first case represents a large industrial load served by two parallel transformers totaling 7500 KVA [5]. The load consists of four production lines of induction heating with two single-phase furnaces per line. The induction furnaces operate at 8500 Hz and are used to heat 40-ft steel rods which are cut into railroad spikes. Diodes are used in the rectifier for converting the 60 Hz power into dc and SCRs are used in the inverter for converting the dc into single-phase 8500 Hz power. The waveforms were originally sampled at 20 kHz. A program was written to use a reduced sampling rate in the analysis. A careful examination of the current and voltage waveforms indicated that the waveforms consist of (1) harmonics of 60 Hz and (2) a decaying periodic high-frequency transients. The high-frequency transients were measured independently for another purpose [6]. The rest of the waveform was then analyzed for harmonic analysis. Using a sampling frequency that is a multiple of 2 kHz, the DFT was then applied for a period of 3 cycles. The DFT results were as follows:  Figures 19 and 20 show the three-phase current and voltage waveforms recorded at the industrial load. Figures 21 -23 show the recursive estimation of the magnitude of the fundamental, fifth, and seventh harmonics; the eleventh and thirteenth harmonics; and the seventeenth and nineteenth harmonics, respectively, for phase A current. The same harmonic analysis was also applied to the actual recorded voltage waveforms. Figure 24 shows the recursive estimation of the magnitude of the fundamental and fifth harmonic for phase A voltage. No other voltage harmonics are shown here due tot he negligible small value.   The second case represents a continuous dynamic load. The load consists of two six-phase drives for two 200 HP dc motors. The current waveform of one phase is shown in Figure 25. The harmonic analysis using the Kalman filter algorithm is shown in Figure 35. It should be noted that the current waveform was continuously varying in magnitude due to the dynamic nature of the load. Thus, the magnitude of the fundamental and harmonics were continuously varying. The total harmonic distortion experienced similar variation. There is no doubt that the Kalman filtering algorithm is more accurate and is not sensitive to a certain sampling frequency. As the Kalman filter gain vector is time0varying, the estimator can track harmonics with the time varying magnitudes. Two models are described in this section to show the flexibility in the Kalman filtering scheme. There are many applications, where the results of FFT algorithms are as accurate as a Kalman filter model. However, there are other applications where a Kalman filter becomes superior to other algorithms. Implementing linear Kalman filter models is relatively a simple task. However, state equations, measurement equations, and covariance matrices need to be correctly defined.
Kalman filter used in the previous section assumes that the digital samples for the voltage and current signal waveforms are known in advance, or at least, when it is applied on-line, good estimates for the signals parameters are assumed with a certain degree of accuracy, so that the filter converges to the optimal estimates in few samples later. Also, it assumes that an accurate model is presented for the signals; otherwise inaccurate estimates would be obtained. Ref. 8 uses the Kalman filter algorithm to obtain the optimal estimate of the power system harmonic content. The measurements used in this reference are the power system voltage and line flows at different harmonics obtained from a harmonic load flow program (HARMFLO). The effect of load variation over a one day cycle on the power system harmonics and standard are presented. The optimal estimates, in this reference, are the power system bus voltage magnitudes and phase angles at different harmonic level.  Figure 34 using the Kalman filtering approach.

Linear dynamic weighted least absolute estimates [11]
This section presents the application of the linear dynamic weighted least absolute value dynamic filter for power system harmonics identification and measurements. The two models developed earlier, model 1 and model 2, are used with this filter. As we explained earlier, this filter can deal easily with the outlier, unusual events, in the voltage or current waveforms.

Software implementation
A software package has been developed to analyze digitized current and voltage waveforms. This package has been tested on simulated data sets, as well as on an actual recorded data set. and computes the voltage and current harmonics magnitude, the voltage and current harmonics phase angles, and the fundamental power and harmonics power.

Initialization of the filter
To initialize the recursive process of the proposed filter, with an initial process vector and covariance matrix P, a simple deterministic procedure uses the static least squares error estimate of previous measurements. Thus, the initial process vector may be computed as: and the corresponding covariance error matrix is: where H is an m  m matrix of measurements, and z is an m  1 vector of previous measurements, the initial process vector may be selected to be zero, and the first few milliseconds are considered to be the initialization period.

Testing the algorithm using simulated data
The proposed algorithm and the two models were tested using a voltage signal waveform of known harmonic contents described as: The data window size is two cycles, with sampling frequency of 64 samples/cycle. That is, the total number of samples used is 128 samples, and the sampling frequency is 3840 Hz. For this simulated example we have the following results. Using the two models, the proposed filtering algorithm estimates exactly the harmonic content of the voltage waveform both magnitudes and phase angles and the two proposed models produce the same results. The steady-state gain of the proposed filter is periodic with a period of 1/60 s. This time variation is due to the time varying nature of the vector states in the measurement equation. Figure 54 give the proposed filter gain for X 1 and Y 1 . The gain of the proposed filter reaches the steady-state value in a very short time, since the initialization of the recursive process, as explained in the preceding section, was sufficiently accurate.
The effects of frequency drift on the estimate are also considered. We assume small and large values for the frequency drift: f = -0.10 Hz and f = -1.0 Hz, respectively. In this study the elements of the matrix H(k) are calculated at 60 Hz, and the voltage signal is sampled at ( = 2f, f = 60 + f). Figs. 24 and 29 give the results obtained for these two frequency deviations for the fundamental and the third harmonic. Fig. 55 gives the estimated magnitude, and Fig. 29 gives the estimated phase angles. Examination of these two curves reveals the following: Fig. 27. Gain of the proposed filter for X 1 and Y 1 using models 1 and 2.  For a small frequency drift, f = -0.10 Hz, the fundamental magnitude and the third harmonic magnitude do not change appreciably; whereas for a large frequency drift, f = -1.0 Hz, they exhibit large relative errors, ranging from 7% for the fundamental to 25% for the third harmonics.  On the other hand, for the small frequency drift the fundamental phase angle and the third harmonic phase angle do not change appreciably, whereas for the large frequency drift both phase angles have large changes and the estimates produced are of bad quality. Fig. 29. Estimated phase angles for frequency drifts using models 1 and 2 To overcome this drawback, it has been found through extensive runs that if the elements of the matrix H(k) are calculated at the same frequency of the voltage signal waveform, good estimates are produced and the frequency drift has in this case no effect. Indeed, to perform this modification the proposed algorithm needs a frequency-measurement algorithm before the estimation process is begun. It has been found, through extensive runs that the filter gains for the fundamental voltage components, as a case study, do not change with the frequency drifts. Indeed, that is true since the filter gain K(k) does not depend on the measurements (eqn. 8).
As the state transition matrix for model 2 is a full matrix, it requires more computation than model 1 to update the state vector. Therefore in the rest of this study, only model 1 is used.

Testing on actual recorded data
The proposed algorithm is implemented to identify and measure the harmonics content for a practical system of operation. The system under study consists of a variable-frequency drive that controls a 3000 HP, 23 kV induction motor connected to an oil pipeline compressor. The waveforms of the three phase currents are given in Fig. 31. It has been found for this system that the waveforms of the phase voltages are nearly pure sinusoidal waveforms. A careful examination of the current waveforms revealed that the waveforms consist of: harmonics of 60 Hz, decaying period high-frequency transients, and harmonics of less than 60 Hz (sub-harmonics). The waveform was originally sampled at a 118 ms time www.intechopen.com interval and a sampling frequency of 8.5 kHz. A computer program was written to change this sampling rate in the analysis. Figs. 31 and 32 show the recursive estimation of the magnitude of the fundamental, second, third and fourth harmonics for the voltage of phase A. Examination of these curves reveals that the highest-energy harmonic is the fundamental, 60 Hz, and the magnitude of the second, third and fourth harmonics are very small. However, Fig. 33 shows the recursive estimation of the fundamental, and Fig. 34 shows the recursive estimation of the second, fourth and sixth harmonics for the current of phase A at different data window sizes. Indeed, we can note that the magnitudes of the harmonics are time-varying since their magnitudes change from one data window to another, and the highest energy harmonics are the fourth and sixth. On the other hand, Fig. 35 shows the estimate of the phase angles of the second, fourth and sixth harmonics, at different data window sizes. It can be noted from this figure that the phase angles are also time0varing because their magnitudes vary from one data window to another.     Furthermore, Figs. 36 -38 show the recursive estimation of the fundamental, fourth and the sixth harmonics power, respectively, for the system under study (the factor 2 in these figures is due to the fact that the maximum values for the voltage and current are used to calculate this power). Examination of these curves reveals the following results. The fundamental power and the fourth and sixth harmonics are time-varying.
For this system the highest-energy harmonic component is the fundamental power, the power due to the fundamental voltage and current.   The fundamental powers, in the three phases, are unequal; i.e. the system is unbalanced. The fourth harmonic of phase C, and later after 1.5 cycles of phase A, are absorbing power from the supply, whereas those for phase B and the earlier phase A are supplying power to the network. The sixth harmonic of phase B is absorbing power from the network, whereas the six harmonics of phases A and C are supplying power to the network; but the total power is still the sum of the three-phase power. The fundamental power and the fourth and sixth harmonics power are changing from one data window to another.

Comparison with Kalman Filter (KF) algorithm
The proposed algorithm is compared with KF algorithm. Fig 39 gives the results obtained when both filters are implemented to estimate the second harmonic components of the current in phase A, at different data window sizes and when the considered number of harmonics is 15. Examination of the Figure reveals the following; both filters produce almost the same estimate for the second harmonic magnitude; and the magnitude of the estimated harmonic varies from one data window to another. Fig. 39. Estimated second harmonic magnitude using KF and WLAV.

Effects of outliers
In this Section the effects of outliers (unusual events on the system waveforms) are studied, and we compare the new proposed filter and the well-known Kalman filtering algorithm. In the first Subsection we compare the results obtained using the simulated data set of Section 2, and in the second Subsection the actual recorded data set is used.

Simulated data
The simulated data set of Section 4.3 has been used in this Section, where we assume (randomly) that the data set is contaminated with gross error, we change the sign for some measurements or we put these measurements equal to zero. Fig. 40 shows the recursive estimate of the fundamental voltage magnitude using the proposed filter and the wellknown Kalman filtering algorithm. Careful examination of this curve reveals the following results. The proposed dynamic filter and the Kalman filter produce an optimal estimate to the fundamental voltage magnitude, depending on the data considered. In other words, the voltage waveform magnitude in the presence of outliers is considered as a time-varying magnitude instead of a constant magnitude. The proposed filter and the Kalman filter take approximately two cycles to reach the exact value of the fundamental voltage magnitude. However, if such outliers are corrected, the discrete least absolute value dynamic filter almost produces the exact value of the fundamental voltage during the recursive process, and the effects of the outliers are greatly reduced Figure 41.

Actual recorded data
In this Section the actual recorded data set that is available is tested for outliers' contamination. Fig. 42 shows the recursive estimate of the fundamental current of phase A using the proposed filter, as well as Kalman filter algorithms. Indeed, both filters produce an optimal estimate according to the data available. However, if we compare this figure with Fig. 42, we can note that both filters produce an estimate different from what it should be. Fig. 42 shows the recursive estimates using both algorithms when the outliers are corrected. Indeed, the proposed filter produces an optimal estimate similar to what it should be, which is given in Fig. 43.

Remarks 
The discrete least absolute dynamic filter (DLAV) can easily handle the parameters of the harmonics with time-varying magnitudes.  The DLAV and KF produce the same estimates if the measurement set is not contaminated with bad data.  The DLAV is able to identify and correct bad data, whereas the KF algorithm needs prefiltering to identify and eliminate this bad data. It has been shown that if the waveform is non-stationary, the estimated parameters are affected by the size of the data window.
It has been pointed out in the simulated results that the harmonic filter is sensitive to the deviations of frequency of the fundamental component. An algorithm to measure the power system frequency should precede the harmonics filter.

Power system sub-harmonics (interharmonics); dynamic case
As we said in the beginning of this chapter, the off-on switching of the power electronics equipment in power system control may produce damped transients of high and/or low frequency on the voltage and/or current waveforms. Equation (20) gives the model for such voltage waveform. The first term in this equation presents the damping inter-harmonics model, while the second term presents the harmonics that contaminated the voltage waveform including the fundamental. In this section, we explain the application of the linear dynamic Kalman filtering algorithm for measuring and identifying these interharmonics. As we said before, the identification process is split into two sub-problems. In the first problem, the harmonic contents of the waveform are identified. Once the harmonic contents of the waveform are identified, the reconstructed waveform can be obtained and the error in the waveform, which is the difference between the actual and the reconstructed waveform, can be obtained. In the second problem, this error is analyzed to identify the subharmonics. Finally, the final error is obtained by subtracting the combination of the harmonic and the sub-harmonic contents, the total reconstructed, from the actual waveform. It has been shown that by identifying these sub-harmonics, the final error is reduced greatly.

Modeling of the system sub-harmonics
For Kalman filter application, equation (28)

s t a t e v e c t o r t o b e e s t i m a t e d . I t c o u l d b e h a r m o n i c o r s u b -h a r m o n i c parameters depending on both H(k) and z(k) H(k)
is m  n matrix giving the ideal connection between z(kt) and (k) in the absence of noise w(k). If the elements of H(kt) are given by equation (25), it is clear that is an m noise vector to be minimized and is assumed to be random white noise with known covariance construction. Equation (52) is n  n state transition matrix and it is an identity matrix w(k) is n  1 plant noise vector Together equation (52) and (54) form the system dynamic model. It is worthwhile to state here that in this state space representation the time reference was chosen as a rotating time reference which caused the state transition matrix to be the identity matrix and the H matrix to be a time varying matrix. Having estimated the parameter vector, the amplitude, damping constant, and the phase angle can be determined using equations (30) to (32), at any step

Testing kalman filter algorithm 5.2.1 Description of the load
The proposed algorithm is tested on an actual recorded data to obtain the damped subharmonics which contaminated the three phase current waveforms of a dynamic load. The load is a variable frequency drive controlling a 3000 HP induction motor connected to an oil pipe line compressor. The solid state drive is of 12 pulses designed with harmonic filter. The data given is the three phase currents at different motor speed, and is given in per unit. The three phase currents are given in Figure 42. This figure shows high harmonics in each phase current as well as sub-harmonics. It is clear that the currents have variable magnitudes from one cycle to another (non-stationary waveforms).

Sub-harmonic estimation
After the harmonic contents of the waveforms had been estimated, the waveform was reconstructed to get the error in this estimation. Figure 71 gives the real current and the reconstructed current for phase A as well as the error in this estimation. It has been found that the error has a maximum value of about 10%. The error signal is analyzed again to find if there are any sub-harmonics in this signal. The Kalman filtering algorithm is used here to find the amplitude and the phase angle of each sub-harmonic frequency. It was found that the signal has sub-harmonic frequencies of 15 and 30 Hz. The sub-harmonic amplitudes are given in Figure 43 while the phase angle of the 30 Hz component is given in Figure 44. The sub-harmonic magnitudes were found to be time varying, without any exponential decay, as seen clearly in Figure 43.  Once the sub-harmonic parameters are estimated, the total reconstructed current can be obtained by adding the harmonic contents to the sub-harmonic contents. Figure 45 gives the total resultant error which now is very small, less than 3%. www.intechopen.com

Remarks 
Kalman filter algorithm is implemented, in this section, for identification of subharmonics parameters that contaminated the power system signals.  By identifying the harmonics and sub-harmonics of the signal under investigation, the total error in the reconstructed waveform is reduced greatly.

SUb-harmonics indentification with DLAV algorithm (Soliman and Christensen algorithm)
In this section, the application of discrete dynamic least absolute value algorithm for identification and measurement of sub-harmonics is discussed. The model used with Kalman filter algorithm and explained earlier, will be used in this section, a comparison with Kalman filter is offered at the end of this section. No needs to report here, the dynamic equations for the DLAV filter, since they are already given in the previous chapters, in the place, where we need them. The steps used with Kalman filter in the previous section, will be followed here. Hence, we discuss the testing of the algorithm. As we said earlier, the algorithm first estimates the harmonics that contaminated one of the phases current waveforms, say phase A; in this estimation, we assumed a large number of harmonics. The reconstructed waveform and the error for this estimation, which is the difference between the actual recorded data and the reconstructed waveform, are then obtained. Figure 46 gives the real current and the reconstructed current for phase A, as well as the resultant error. The maximum error in this estimation was found to be about 13%. This error signal is then analyzed to identify the sub-harmonic parameters. Figure 47 gives the sub-harmonic amplitudes for sub-harmonic frequencies for 15 and 30 Hz, while Fig. 48 gives the phase angle estimate for the 30 Hz sub-harmonic. Note that in the sub-harmonic estimation process we assume that the frequencies of these sub-harmonics are known in advance, and hence the matrix H can easily be formulated in an off-line mode. Fig. 46. Actual (full curve) and reconstructed (dotted curve) current for phase A using the WLAVF algorithm.
www.intechopen.com   Finally, the total error is found by subtracting the combination of the harmonic and subharmonic contents, the total reconstructed waveform, from the actual waveform. This error is given in Fig. 49. It is clear from this Figure that the final error is very small, with a maximum value of about 3%.

Comparison between DLAV and KF algorithm
The proposed WLAVF algorithm was compared with the well-known linear KF algorithm.
It can be shown that if there is no gross error contaminating the data, both filters produce very close results. However, some points may be mentioned here.  1. The estimate obtained via the WLAVF algorithm is damped more than that obtained via the KF algorithm. This is probably due to the fact that the WLAVF gain is more damped and reaches a steady state faster than the KF gain, as shown in Fig. 50. 2. The overall error in the estimate was found to be very close in both cases, with a maximum value of about 3%. The overall error for both cases is given in Fig. 51. 3. Both algorithms were found to act similarly when the effects of the data window size, sampling frequency and the number of harmonics were studied

Park's transformation
Park's transformation is well known in the analysis of electric machines, where the three rotating phases abc are transferred to three equivalent stationary dq0 phases (d-q reference frame). This section presents the application of Park's transformation in identifying and measuring power system harmonics. The technique does not need a harmonics model, as well as number of harmonics expected to be in the voltage or current signal. The algorithm uses the digitized samples of the three phases of voltage or current to identify and measure the harmonics content in their signals. Sampling frequency is tied to the harmonic in question to verify the sampling theorem. The identification process is very simple and easy to apply.

Identification processes
In the following steps we assume that m samples of the three phase currents or voltage are available at the preselected sampling frequency that satisfying the sampling theorem. i.e. the sampling frequency will change according to the order of harmonic in question, for example if we like to identify the 9 th harmonics in the signal. In this case the sampling frequency must be greater than 2*50*90=900 Hz and so on.
The forward transformation matrix at harmonic order n; n=1,2,.., N, N is the total expected harmonics in the signal, resulting from the multiplication of the modulating matrix to the signal and the transformation matrix is given as ( The matrix of equation (69) can be computed off line if the frequencies of the voltage or current signal as well as the order of harmonic to be identified are known in advance as well as the sampling frequency and the number of samples used. If this matrix is multiplied digitally by the samples of the three-phase voltage and current signals sampled at the same sampling frequency of matrix (55), a new set of three -phase samples are obtained, we call this set a dq0 set (reference frame). This set of new three phase samples contains the ac component of the three-phase voltage or current signals as well as the dc offset. The dc off set components can be calculated as; If these dc components are eliminated from the new pqo set, a new ac harmonic set is produced. We call this set as V d (ac), V q (ac) and V 0 (ac). If we multiply this set by the inverse of the matrix of equation (56), which is given as: P -1 = 2 3 1 sin cosn 2 1 sin(n 240n) cos(n 240n) 2 1 sin(n 120n) cos(n 120n) 2 www.intechopen.com Then, the resulting samples represent the samples of the harmonic components in each phase of the three phases. The following are the identification steps.
1. Decide what the order of harmonic you would like to identify, and then adjust the sampling frequency to satisfy the sampling theory. Obtain m digital samples of harmonics polluted three-phase voltage or current samples, sampled at the specified sampling frequency F s . Or you can obtain these m samples at one sampling frequency that satisfies the sampling theorem and cover the entire range of harmonic frequency y o u e x p e c t t o b e i n t h e v o l t a g e o r c u r r e n t s i g n a l s . S i m p l y c h o o s e t h e s a m p l i n g frequency to be greater than double the highest frequency you expect in the signal 2. Calculate the matrices, given in equations (55) and (57) at m samples and the order of harmonics you identify. Here, we assume that the signal frequency is constant and equal the nominal frequency 50 or 60 Hz. 3. Multiplying the samples of the three-phase signal by the transformation matrix given by equation (57) 4. Remove the dc offset from the original samples; simply by subtracting the average of the new samples generated in step 2 using equation (56) from the original samples. The generated samples in this step are the samples of the ac samples of dqo signal. 5. Multiplying the resulting samples of step 3 by the inverse matrix given by equation (57). The resulting samples are the samples of harmonics that contaminate the three phase signals except for the fundamental components. 6. Subtract these samples from the original samples; we obtain m samples for the harmonic component in question 7. Use the least error squares algorithm explained in the preceding section to estimate the amplitude and phase angle of the component. If the harmonics are balanced in the three phases, the identified component will be the positive sequence for the 1 st , 4 th , 7 th ,etc and no negative or zero sequence components. Also, it will be the negative sequence for the 2 nd , 5 th , 8 th etc component, and will be the zero sequence for the 3 rd 6 th , 9 th etc components. But if the expected harmonics in the three phases are not balanced go to step 8. 8. Replace  by - in the transformation matrix of equation (55) and the inverse transformation matrix of equation (57). Repeat steps 1 to 7 to obtain the negative sequence components.

Testing the algorithm using simulated data
The proposed algorithm is tested using a highly harmonic contaminated signal for the threephase voltage as: The harmonics in other two phases are displaced backward and forward from phase a by 120 o and equal in magnitudes, balanced harmonics contamination. The sampling frequency is chosen to be F s =4. * f o * n, f o = 50 Hz, where n is the order of harmonic to be identified, n = 1,..,..,N, N is the largest order of harmonics to be expected in the waveform. In this example N=8. A number of sample equals 50 is chosen to estimate the parameters of each harmonic components. Table 3 gives the results obtained when n take the values of 1,3,5,7 for the three phases.
Harmonic 1 st harmonic 3 rd harmonic 5 th harmonic 7 th harmonic The sampling frequency used in this case is 1000Hz, using 50 samples. Table 4 gives the results obtained for the positive sequence of each harmonics component including the fundamental component.

Fuzzy harmonic components identification
In this section, we present a fuzzy Kalman filter to identify the fuzzy parameters of a general non-sinusoidal voltage or current waveform. The waveform is expressed as a Fourier series of sines and cosines terms that contain a fundamental harmonic and other harmonics to be measured. The rest of the series is considered as additive noise and unmeasured distortion. The noise is filtered out and the unmeasured distortion contributes to the fuzziness of the measured parameters. The problem is formulated as one of linear fuzzy problems. The n th harmonic component to be identified, in the waveform, is expressed as a linear equation: A n1 sin(n 0 t) + A n2 cos(n 0 t). The A n1 and A n2 are fuzzy parameters that are used to determine the fuzzy values of the amplitude and phase of the n th harmonic. Each fuzzy parameter belongs to a symmetrical triangular membership function with a middle and spread values. For example A n1 = (p n1 , c n1 ), where p n1 is the center and c n1 is the spread. Kalman filtering is used to identify fuzzy parameters p n1 , c n1 , p n2 , and c n2 for each harmonic required to be identified. An overview of the necessary linear fuzzy model and harmonic waveform modeling is presented in the next section.

Fuzzy function and fuzzy linear modeling
The fuzzy sets were first introduced by Zadeh [20]. Modeling fuzzy linear systems has been addressed in [8,9]. In this section an overview of fuzzy linear models is presented. A fuzzy linear model is given by: where Y is the dependent fuzzy variable (output), {x 1 , x 2 , …, x n } set of crisp (not fuzzy) independent variables, and {A 0 , A 1 , …, A n } is a set of symmetric fuzzy numbers. The membership function of A i is symmetrical triangular defined by center and spread values, p i and c i , respectively and can be expressed as Therefore, the function Y can be expressed as: Where A i = (p i , c i ) and the membership function of Y is given by:  (ac, ad, bc, bd), max(ac, ad, bc, bd)] In the next section, waveform harmonics will be modeled as a linear fuzzy model.

Modeling of harmonics as a fuzzy model
A voltage or current waveform in a power system beside the fundamental one can be contaminated with noise and transient harmonics. For simplicity and without loss of generality consider a non-sinusoidal waveform given by where v 1 (t) contains harmonics to be identified, and v 2 (t) contains other harmonics and transient that will not be identified. Consider v 1 (t) as Fourier series: Where V n and  n are the amplitude and phase angle of the n th harmonic, respectively. N is the number of harmonics to be identified in the waveform. Using trigonometric identity v 1 (t) can be written as: In the next section, Kalman filtering technique is used to identify the fuzzy parameters.
Once the fuzzy parameters are identified then fuzzy values of amplitude and phase angle of each harmonic can be calculated using mathematical operations on fuzzy numbers. If crisp values of the amplitudes and phase angles of the harmonics are required, the defuzzefication is used. The fuzziness in the parameters gives the possible extreme variation that the parameter can take. This variation is due to the distortion in the waveform because of contamination with harmonic components, v 2 (t), that have not been identified. If all harmonics are identified, v 2 (t)=0, then the spread values would be zeros and identified parameters would be crisp rather than fuzzy ones. Having identified the fuzzy parameters, the n th harmonic amplitude and phase can be calculated as: The detailed derivation of Kalman filtering can be found in [23,24]. In this section, only the necessary equation for the development of the basic recursive discrete Kalman filter will be addressed. Given the discrete state equations: x(k +1) = A(k) x(k) + w(k)

No time correlation: E[w(i) w T (j)] = E[v(i) v T (j)] = 0, for i = j.
Known covariance matrices (noise levels): where Q 1 and Q 2 are positive semi-definite and positive definite matrices, respectively. The basic discrete-time Kalman filter algorithm given by the following set of recursive equations. Given as priori estimates of the state vector x^(0) = x^0 and its error covariance matrix, P(0)= P 0 , set k=0 then recursively computer: Kalman gain:

P(k+1) = [A(k) -K(k) C(k)] p(k) [A(k) -K(k) C(k)] T + K(k) Q 2 K T (k)
An intelligent choice of the priori estimate of the state x^0 and its covariance error P 0 enhances the convergence characteristics of the Kalman filter. Few samples of the output waveform z(k) can be used to get a weighted least squares as an initial values for x^0 and P 0 : Where x n1 , x n2 , n=1, 2, …, N are defined in Eq.(73) with sampling at time instant tTk, T is the signal period and k = 1, 2, … . The first row of C(k) is used to identify the center of the fuzzy parameters, while the second row is used to identify the spread parameters. The third raw is used to identify the magnitude of the error produced by the unidentified harmonics and noise. The observation vector z(k) consists of three values. v(k) is the value of the measured waveform signal at sampling instant k., k) and (k) depends on v(k) and the state vector at time instant k-1.
They are defined below.
Start with (k), it is defined as the square of the error:

One harmonic identification
As a first example consider identification of one harmonic only, N=1. Consider a voltage waveform that consists of two harmonics, one fundamental at 50Hz and a sub-harmonic at 150Hz which is considered as undesired distortion contaminating the first harmonic.
( ) 1.414sin(100 / 6) 0.3sin(300 / 5) vt t t     For parameter estimation using Kalman filter, the voltage signal is sampled at frequency 1250Hz and used as measurement samples. Converting Eq (88) to discrete time, t  0.08k, where k is the sampling time, and using the notation of Eq. (71), v 1 (k) and v 2 (k) are defined as:    Figure (87) shows v(t) together with maximum and minimum possible variation (fuzzy) v(t) can take. It can be observed that the measured v(t) is within the estimated fuzziness and that the extreme fuzzy variations is shaped up according to the measured v(t).

Conclusion and remarks
In this paper, the harmonics of a non-sinusoidal waveform is identified. The approach is based on fuzzy Kalman filtering. The basic idea is to identify fuzzy parameters rather than crisp parameters. The waveform is written as a linear model with fuzzy parameters from which the amplitude and phase of the harmonics are measured. Kalman filter is used to identify the fuzzy parameters. Each fuzzy parameter belongs to a triangular symmetric membership function consisting of center and spread values. Obtaining fuzzy parameters rather than crisp ones yields all possible extreme variations the parameters can take. This is useful in designing filters to filter out undesired harmonics that cause distortion.