1 | P a g e
Page
1
ECE 722: KALMAN FILTERING WITH APPLICATIONS
SPRING 2016
PROJECT REPORT
Title: ANALYSIS ON APPLICATION OF KALMAN FILTERING FOR
CONTINUOUS REAL-TIME TRACKING OF POWER SYSTEM
HARMONICS
Author: VENKATA SASIKIRAN VEERAMACHANENI
Abstract:
The report describes a technique in measurement of harmonics in Power System,
in real-time, by applying a 12 state Kalman Filter to the voltage or current samples. It
also includes the analysis on performance of filter in different scenarios, like sudden
change in particular harmonic level, noise content in measurements etc. Moreover, this
report also discusses filter performance when different state space model of system has
been considered. It also mentions the dependency of filter performance on sampling
frequency. In order to test the technique, a periodic signal of known harmonic content
has been generated in MATLAB and it is sampled with appropriate sampling frequency.
The results in the report are obtained by using the data samples obtained in the above
mentioned way. Even though the data considered is an artificial one, the results can be
easily generalized to real time data.
2 | P a g e
Page
2
1. Introduction
At present time increasing attention is being paid to the electromagnetic
disturbances to which power systems are being subjected. The growing
importance is due to the fact that large proportion of the equipment fed by the
electrical system is sensitive to them. In electrical power system management,
power quality is an essential factor to be taken into account.
Harmonic distortion in voltage or current signals is one of the disturbance
factors. The widespread applications of electronically controlled loads have
increased the harmonic distortion in the power system voltage and current
waveforms. Moreover, many of power system loads, especially industrial loads,
are dynamic in nature. This produces time varying amplitude for the current
waveforms. Accurate measurement of harmonics is essential as it is considered
as the type of disturbance which it is most necessary to control. This means
imposing limitations on the emission levels of the equipment and filtering the
inevitable harmonic components present.
The fast Fourier transform (FFT) and the discrete Fourier transform (DFT)
are the most frequency harmonic analysis algorithms used to obtain the voltage
and current frequency spectra from discrete time samples. However,
misapplication of the FFT and DFT algorithms would lead to an incorrect result.
Basic assumptions embodied in the application of DFT and FFT are: (i) The signal
has a constant magnitude; (ii) The sampling frequency is equal to the number of
samples multiplied by the fundamental frequency assumed by the algorithm; (iii)
The sampling frequency is greater than twice the highest in the signal to be
analyzed. When these assumptions are satisfied, the results of the DFT or FFT
are accurate. There are three major pitfalls in the application of FFT; namely,
aliasing, leakage, and picket-fence effect.
So, the Kalman filtering approach provides an alternative way for optimally
estimating the harmonics in real-time. It provides best estimates of the
magnitudes with the smallest number of samples and in the shortest time period,
allowing variable parameters to be tracked with the time. By representing the
signal in state variable representation and applying Kalman filter recursive
algorithm, harmonics with time varying magnitudes can be tracked.
2. Modeling of a system
Kalman filter can be used to estimate the harmonic components in a power
system’s voltage or current waveforms. But, the algorithm requires a state
variable model for the parameters to be estimated and a measurement equation
that relates the discrete measurement to the state variables. In order to obtain a
state space representation of the system, Fourier series representation of the
signals has been used in the below discussion and a state variable form is
deduced, including all the possible spectral components which may be associated
with the signal to be analyzed.
3 | P a g e
Page
3
Consider a signal with a frequency ω and a magnitude of (). Considering
a reference rotating at ω, the noise-free signal may be expressed as:
(
)
=
(
)
cos
(
+
)
=
(
)
−
(
)
(1)
By seeing the above, let us consider
be
(
)
and
be
(
)
. The
and
represents in-phase and quadrature-phase components respectively
and referred as state variables. Moreover, the square root of sum of squares of
states gives us amplitude {
(
)
} of the signal.
{
(
)
}
+
{
(
)
}
=
(
)
(2)
A noise- free current or voltage signal
(
)
that includes ‘n’ harmonics may
be represented by
(
)
=
()cos ( +
)
(3)
where
(
)
is the amplitude of
harmonic at time ,
is the phase angle of the
harmonic and is the harmonic number. As discussed in the equation (1) each
frequency component requires two state variables, 2 being the total number of
state variables. These state variables are defined as follows:
(
)
=
(
)
(
)
=
(
)
(
)
=
(
)
(
)
=
(
)
(
)
=
(
)
(
)
=
(
)
. .
. .
. .
(
)
=
(
)
(
)
=
(
)
The state variable equation can be expressed in matrix form as
=
+
Where
is a [2n x 1] state vector at instant ( + 1),
is [2n x 1] state vector
at instant ,
is a [2n x 2n] state transition matrix and
represents the
discrete variation of state variables due to an input white noise.
In expanded form, the state variable equation for this model can be
represented as,
…
=
1 0 .
. 0
0 1 .
. 0
.
.
0
.
.
.
.
.
.
.
.
.
.
.
1
…
+
(4)
4 | P a g e
Page
4
The measurement equation can be expressed as
=
+
=
cos (Δ)
−sin (Δ)
….
cos (Δ)
−sin (Δ)
…
+
(5)
where
is the measurement vector at instant ,
is the vector giving the ideal
relation between the measurement and the state vector,
is the noise vector and
Δ is the sampling interval. The above model can be referred as “Model-1”.
As we know that the state space representation is not unique, we can
represent the present system using alternative state space representation. The
below is the alternative state space representation of this system.
Let us consider again the equation (1),
(
)
=
(
)
cos
(
+
)
Now, consider
()
=
(
)
cos
(
+
)
and
()
=
(
)
sin
(
+
)
. At + Δ, the
signal may be expressed as :
(
+ Δ
)
=
(
+ Δ
)
cos
(
+ Δ+
)
=
()
cos
(
Δ
)
−
sin (Δ)
()
=
()
cos
(
Δ
)
−
sin (Δ)
(6)
and also
()
=
()
sin
(
Δ
)
+
cos (Δ)
(7)
Thus, by using the equations (6) and (7), the state variable representation can be
made as
=
cos (Δ) −sin (Δ)
sin (Δ) cos (Δ)
+
(8)
The measurement equation then becomes
=
1 0
+
(9)
By using the above equations (8) and (9), if the signal includes ‘n’ frequencies;
the fundamental plus ‘n-1’ harmonics, the state variable representation can be
expressed as:
…
=
0 .
. 0
0
.
. 0
.
.
0
.
.
.
.
.
.
.
.
.
.
.
…
+
…
(10)
5 | P a g e
Page
5
Where the submatrices
are shown as
=
cos (Δ) −sin (Δ)
sin (Δ) cos (Δ)
(11)
The measurement equation can be expressed as
=
1 0
… 1 0
…
+
(12)
The above model can be referred as “Model-2”. Contrast to Model-1 this has got
constant state transition and measurement matrices. However, this assumes a
stationary reference. Thus, the in-phase and quadrature-phase components
represent the instantaneous values of Cosine and Sine waveforms respectively.
3. Kalman filter application
The Kalman filter is an estimator used to estimate the state of a linear
dynamic system perturbed by white noise using measurements that are linear
functions of the system state but corrupted by additive white noise. Theoretically
it has been called the linear mean squares estimator (LLSME) because it
minimizes the mean-squared estimation error for a linear stochastic system using
noisy linear sensors. It is recursive optimal estimator well suited for the online
application.
The following are the parameters that are required in order to successfully
apply Kalman filter algorithm:
It requires state space represented model of the system. In this case we
deduced two state space models of the system. Model-1 corresponds to
equations (4) & (5). Model-2 corresponds to equations (10) & (12). Using
either of the equations we can clearly obtain the (state transition matrix)
and (state variable and output coupling matrix).
Initial process vector
. In our case as the Kalman filter model started
with no past measurement, the initial process vector was selected to be
zero.
Initial covariance matrix (
). The initial covariance is selected to be a
diagonal matrix with diagonal elements equal to 10
.
Noise variance (R). In this case this is selected as a constant value
equivalent to 0.05
.
State variable covariance matrix (Q). Here we will consider it as a diagonal
matrix with diagonal elements equal to 0.05
.
Measurement vector (). For this project as we don’t have real time data, I
fabricated a periodic signal, having known amount of harmonic content,
by summing cosines of frequencies, which are integral multiples of
fundamental frequency. The below is the mathematical representation of
generated periodic signal.