Modeling and T es t ing ofa Digit al Dis t anc e Relay Us ing
MAT LAB/SIMULINK
Li C h eng W u , C h ih  W en Liu , Senior
Mem b er , j E E E ,
C h ing Sh an C h en, Mem b er , IE E E
Dep ar t m ent ofE lec t r ic al E ngineer ing, Nat ional T aiw an Univ er s it y, T aip ei, T aiw an
Ab s t r ac t T h is p ap er des c r ib es m odelling and t es t ing of a
digit al dis t anc e r elay for t r ans m is s ion line p r ot ec t ion u s ing
M
Modelingand
Testing
of
a
igital
Distance
Relay
Using
MATLAB/SIMULINK
LiCheng
Wu,
ChihWen
Liu,Senior
Member,jEEE,
ChingShan
Chen,Member,IEEE
Department
of
Electrical
Engineering,
National
Taiwan
University,Taipei,
Taiwan
Abstract
This
paper
describes
modellingand
testing
of
a
digital
distancerelay
for
transmission
line
protection
using
MATLAB/SIMULINK.
SIMULINK's
Power
System
Blockset
(PSB)
is
used
fordetailed
modelling
of
a
power
system
network
and
fault
simulation.
MATLAB
is
used
to
implement
programs
of
digital
distance
relaying
algorithms
and
to
serve
as
main
software
environment.
The
technique
is
an
interactive
simulation
environment
for
relaying
algorithm
design
and
evaluation.
The
basic
principles
of
a
digital
distance
relay
and
some
relatedfiltering
techniques
are
also
described
inthis
paper.
A
345
kV,
100
km
transmission
line
and
a
MHO
type
distance
relay
are
selected
as
examples
forfault
simulation
and
relay
testing.
Some
simulation
results
are
given.
Index
TermsDigital
relay
Digital
distance
relay
Electromagnetic
Transient
Program
(EMTP)
Automatic
test
analysis
tool
[4].
This
tool
was
modelled
by
using
a
graphically
ObjectOriented
environmentapproach
integrated
with
the
digital
calculate
technology
that
gives
more
flexibility
to
create
simulation
system;
therefore,
we
can
quickly
develop
a
program
of
protectiverelayalgorithms,
and
a
model
of
protection
relays.
Because
they
commonly
exist
in
the
same
environment
that
involves
communication
ability,
it
is
veryeasy
to
develop
a
convenient
graphical
toolfor
building
interactive
relay
test
system.
The
abovementioned
excellent
advantages
that
MATLAB/SIMULINK
has
make
MATLAB/SIMULINK
a
convenient
and
interactive
tool
for
both
numerous
analysis
and
direct
communications
with
relay's
test
program.
This
paper
describes
how
to
use
MATLAB/SIMULINK
for
automatic,
interactive,
and
high
performance
testing
relay
system.
Some
examplesand
simulation
results
are
also
provided
in
the
paper.
I.
INTRODUCTION
For
transmission
lines
protection,
choosing
a
suitable
relay
type
orrelay's
setting
is
essential.
Generally
speaking,
we
may
make
the
fault
analysis
and
the
test
by
the
simulation
software,
and
according
to
the
actual
system
requirement,
choose
the
suitable
protective
relay,
but
forreliability
and
security
considerations,
the
massive
simulations
tests
are
usually
undertaken.
This
is
a
quite
numerousand
diverse
job;
therefore,
having
a
superior
simulated
environment
is
important.
The
EMTP
[1](Electromagnetic
Transient
Program)
is
the
simulation
toolthat
is
used
to
simulate
the
electromagnetic
transient
phenomenon,
and
power
system
faults
analysis,
and
it
is
oneof
the
most
widely
used
programs
in
the
electric
utility
since
1970.
Generallyspeaking,
Protective
relay
performance
has
been
tested
with
the
waveform
signals
generated
by
the
non
realtime
simulator
like
EMTP.
This
approach
has
the
disadvantage
that
it s
difficult
to
provide
realtime
test
forthe
relay
algorithmdynamically.
In
addition,
we
can't
finished
most
test
tasks
at
the
same
time
with
the
tool.
In
school
and
industry,
simulation
tools
based
on
MATLAB/SIMULINK
[2]
are
becoming
popular
for
engineering
applications.
The
MATLAB
involves
many
high
instructions
and
tools
for
some
systems
designing
applications
and
developing
algorithms
and
the
SIMULINK
provides
excellent
GUI
(Graphical
User
Interface)
interface
and
block
module
that
will
allow
theusers
to
rapidly
and
easily
build
and
simulate
system
models
and
executive
massive
simulation
tests
at
the
same
time.
Furthermore,
since
the
MATLAB/SIMULINK
contain
Power
System
Block
Set
Toolbox
[3],
the
software
tum
into
a
powerful
power
systems
simulation
and
II.
ALGORITHM
OFDIGITAL
DISTANCE
RELAY
Digitaldistanceprotection
is
a
universal
shortcircuit
protection.
It s
mode
of
operation
is
based
on
the
measurement
and
evaluation
of
the
shortcircuit
impedance,
which
is
named
by
the
algorithm
of
digital
distance
relay.
Thisalgorithm
is
used
to
inputsignals
to
DSP
by
discrete
voltage
and
discretecurrent
to
judge
whether
faults
occur
or
not.
However,
this
method
is
just
a
program.
MATLAB
has
the
advantage
ofconducting
massive
calculationfunctions
and
its
program
can
be
easily
developed.
Therefore,
it
is
a
very
suitabletool
of
protective
relay
designs
and
applications
for
protection
engineers.
It
can't
be
denied
that
graphics
reach
out
to
people
better
than
texts
do.
In
addition,
we
focus
not
only
on
the
correction
of
relayoperations,
but
also
on
the
dynamic
characteristics
of
relay.
Therefore,
if
we
can
use
graphics
to
show
the
variance
of
impedances
trace,
then
the
software
of
interfacewill
become
more
userfriendly
and
convenient.
MATLAB
includes
excellent
graphics
capacity
and
multidimension
of
graphic
function,
and
can
change
graphics
parameters
at
the
same
time.
Therefore,
many
graphs
can
be
shown
on
the
same
window
to
make
comparison
with
one
another.
This
paper
focuses
on
the
model
and
test
of
digital
distance
relay.
Therefore,
the
principles
and
relating
techniques
of
the
distance
relay
will
be
discussed
first,
followed
by
the
description
of
the
distancerelaypractice
by
MATLAB.
Distance
relays
are
also
named
impedance
relays.
They
are
used
to
calculate
line
impedancebymeasurement
of
voltages
and
currents
onone
single
end.
For
example,
for
MHO
type
distance
relays,the
relays
compare
the
0780392558/05/ 20.00
2005
IEEE
253
Authorized licensed use limited to: Kansas State University. Downloaded on April 24,2010 at 09:35:09 UTC from IEEE Xplore. Restrictions apply.
setting
impedance
with
the
measurement
impedance
to
determine
if
the
fault
is
inside
or
outsidethe
protected
zone.
They
immediately
release
a
trip
signal
when
the
impedance
value
is
insidethe
zone
1
impedance
circle
of
distance
relay.
For
security
protection
consideration,
the
confirmation
of
a
fault
occurrence
will
not
be
made
until
successive
trip
signals
are
released
in
one
season.
Different
formulas
should
be
adopted
when
calculating
the
fault
impedance
due
to
different
fault
types.
Table
1
indicates
calculation
formula
for
all
of
the
fault
types
[5].
Any
threephase
faults
can
be
detected
from
every
formula
in
Table
1.
In
order
to
reduce
calculation
burden,
we
design
afault
detector
and
fault
type
selector.
The
fault
detector
can
judge
which
fault
type
it
is
and
then
calculate
fault
impedance
by
selecting
a
suitable
formula
from
Table
1.
If
we
don't
use
fault
type
judgment
first,
then
the
distancerelay
ofprograms
must
be
calculated
by
all
the
six
formulas
in
table
1
at
the
same
time,
which
causes
much
calculation
burden.
'Iable
I
fault
impedance
calculation
formula
oni
diffieren1ce
faults
Fault
Type
Formula
AG
VA/(1A+3k]o)
BG
VB/(IB+3kIo)
CG
Vc/(Ic+3kIo)
AB
or
ABG
(VAVB)/
(IAIB)
BC
or
BCG
(VBVc)/
(IBIC)
CA
or
CAG
(VcVA)/
(ICIA)
Where
A

B
and
C
indicates
number
of
phase,
G
is
ground
fault
,V
and
I
are
phasorof
voltage
and
current,
k=(ZoZ1)/Z1
Zo
and
Z1
are
line
of
impedance
zerosequence,
positive
sequence
respectively.
lo
is
zerosequence
current.
When
the
distance
relays
receive
discrete
voltage
and
current
signal,
it
has
to
convert
them
to
phasor.
The
DiscreteFourier
Transform
(DFT)
is
the
most
popular
method
to
estimate
fundamental
phasors
for
digital
relaying.
The
fullcycle
DFT
is
described
as
following
equation
1):
N1
X
Xke
ij2(1)
N
k
Where
X
is
complex
phasor,
Xk
is
the
sample
discrete
data
of
thesignal,
and
N
is
the
number
ofsamples
per
cycle.
Equation
(1)
is
the
formula
of
fullcycle
DFT.
When
a
signal
is
sampled
with
32samples
per
cycle,
as
an
example,
then
MATLAB
DFT
program
can
be
written
as
follows:
In
addition,
when
a
fault
occurs
on
transmission
lines,
the
voltage
and
current
signals
are
severely
distorted.
These
signals
may
contain
decaying
dc
components,
subsystem
frequency
transients,
high
frequency
oscillationquantities,
and
etc.
The
higher
frequency
components
can
be
eliminated
using
low
pass
antialiasing
filters
with
appropriate
cutoff
frequency,
but
the
antialiasing
filters
cannot
remove
decaying
dc
components
and
reject
low
frequency
components.
This
makes
the
phasors
very
difficult
to
be
quickly
estimated
and
affects
the
performance
of
digital
relaying.
Therefore,
we
usually
use
the
mimic
filter
to
removed
thedcoffset
components
[6].
The
mimic
filter
can
be
developed
by
digital
method.
Here,
we
want
to
pass
the
fundamental
frequency
signal
(60Hz)
by
the
filter.
Then,
assuming
the
gain
K
equals
I
and
the
samplesfrequency
is
f5
(f5
=
I
I
T
),
finally,
we
obtain
a
formula
(2)
K(1
JTf5)
KlTf
cos
T,
+
jKtfs
sin
T=1
(2)
Where
o
=
2*
n
*60
,
T
is
time
constant
for
user
definition.
To
solve
equation
(2)
can
get
the
gain
KK
=
sqrt(
I
Where
M
=1
+
Tf5

tfs
cos(
)
fs
2
*n*60
N=cf
sin(
)
.fs
(3)
41) 42)
When
we
use
mimic
filter
to
remove
the
dcoffset
components,
MATLAB
program
is
described
as
follows:
t=2*1/60;
assumed
time
constant
=
2
cycles
fs
=
32
*
60;
samplingfrequency
M=1
+t*fst*fs
*cos(2*pi
*60/fs);
N=t*fs
*sin(2
*pi*60/fs);
K=sqrt(l/(M^2+N^2));
b=[K*(l+t*fs)
K*t*fs];
a=[]];
ia
mf=filter(b,a,
ia);
As
shown
in
the
above
equation,
thecurrent
ia
is
through
the
mimic
filter
in
order
to
remove
the
dcoffset
components.
Finally,
we
geta
fundamental
frequency
wave
ia
mf.
From
the
above
discussion,
we
know
that
MATLAB
can
easily
finish
all
of
algorithms
for
protective
relays.
With
the
advantage
that
SIMULINK
can
easily
simulate
power
system
faults,
the
design
and
the
test
of
protectiverelays
canbe
achievedwith
ease.
Its
major
characteristic
of
integrating
system
fault
simulation
and
protection
relay
algorithms
in
asoftware
system
can
enhance
the
efficiency
of
protection
relay
test.
III.
POWER
SYSTEM
ESTABLISHMENT
AND
SIMULATION
In
order
to
get
exact
simulation
results,
we
must
establish
accurate
networkmodel.
SIMULINK/Power
System
Blockset
(PSB)
is
used
to
create
power
system
model
for
simulation.
With
the
updated
versions
of
MATLAB/SIMULINK,
the
model
development
of
power
system
components
is
onward
to
perfection.
Due
to
the
254
N
=
32;
X=
0;
for
k
I:N
X
=
X
+
x(k)*exp(j
*2*pi/32*(k1));
end
X
=
X*2/N;
Authorized licensed use limited to: Kansas State University. Downloaded on April 24,2010 at 09:35:09 UTC from IEEE Xplore. Restrictions apply.
fast
development
of
new
technologies,
which
improve
the
power
transfer
efficiency
and
the
optimum
utilization
ofsystem
capability,
power
electronic
equipment
like
TCSC
UPFC
STATCOM...
and
so
on
may
be
widelyused
in
power
systems
In
the
future.
Thus,
theselection
and
the
setting
of
protectiverelay
should
be
evaluated
and
tested
thoroughly
[7].
Here,
SIMULINK
includes
variantbasic
power
components,
which
can
beused
alone
or
in
combinative
use
to
finish
all
kinds
of
power
system
network
simulations.
Itis
veryeasy
to
create
power
system
in
SIMULINK
environment,
which
allows
users
to
build
a
modelby
simple
click
and
drag
procedures.
Because
all
of
the
electrical
parts
of
the
simulation
interact
with
the
SIMLLINK S
extensive
modelling
library,
it
is
not
just
possible
to
easily
draw
the
power
system
network,
but
also
to
include
its
interactions
with
every
electrical
component.
In
addition,
the
simulation
systemof
block
component
can
set
relation
electrical
parameters
from
MATLAB
commands.
One
thing
should
be
noted
is
that
SIMULINK
is
more
suitablefor
a
small
system
for
simulated
tests.
Execution
speed
of
the
simulation
system
will
become
slow
when
simulating
system
is
large.
Luckily,
the
protective
relays
are
for
protection
of
one
article
of
electrical
equipment,
so
we
just
focus
on
protected
equipment.
Other
components
can
be
made
in
equivalent
value.
Therefore,
by
reducing
the
complexity
of
the
simulationsystem,
the
simulation
system
resultwill
be
in
high
performance.
Zs
ZR
s
relay
Fig.
1.
Oneline
diagram
of
simulation
system
Fig.
2.
SIMULINK/Power
System
Block
constructs
the
simulation
systemsdiagram
255
vs_
Authorized licensed use limited to: Kansas State University. Downloaded on April 24,2010 at 09:35:09 UTC from IEEE Xplore. Restrictions apply.
Subsybm
Imesk)
Pa
disle
130
fat_lt_m
13160
l
II
_m
fig
i6o
;
Fig.
3.
Main
window
and
parameter
interface
for
simulation
systems
This
section
describes
the
performance
test
and
verification
of
transmission
line
protection
of
distance
relays
using
MATLAB/SIMULINK.How
to
use
SIMULINK
of
the
PSB
to
buildtransmission
lines
systems
model
will
be
discussed
as
follows.
With
reference
to
Fig.
I
Oneline
diagram
of
simulation
system,
we
can
establishthe
simulation
system
diagram
in
Fig.
2.
The
simulation
system
ofeach
end
source
can
be
replaced
by
the
The venin
equivalent
circuits.
However,
we
can
completely
finish
all
of
the
test
circuits
with
the
use
of
the
source
and
the
model
ofcoupling
component.
Each
element
value
of
the
test
system
can
be
set
by
power
flow
data
and
shortcircuit
capacity
data.
Generally
speaking,
we
need
to
get
voltages
and
current
signal
data
by
current
transformer
(CT)
and
voltage
transformer
(VT)
as
shown
in
Fig.2
CTS
and
VTS
respectively
because
distance
relays
need
threephase
voltages
and
threephase
currents
for
the
impedance
calculation.
The
design
of
digital
distance
relays
of
algorithm
is
based
on
the
component
offundamentalfrequency
(60Hz).
When
power
systems
fault
occurs,
the
signals
may
contain
highfrequency
components.
These
higher
frequency
components
must
be
eliminated,
so
we
adoptanalogue
low
pass
filters
ofblock
in
the
simulation
systems
in
SIMULINK.
Thisblock
can
be
defined
as
filter
of
types
(Low
pass,
Band
pass,
and
High
pass),order,
and
cutoff
frequency
etc.
by
user.
These
are
excellent
characteristics.
In
addition,
SIMULINK
provides
some
options
like
realtime
display,
storing
data
in
WORKSPACE
and
hard
disk
after
the
signals
data
is
released
by
filter.
As
shown
in
Fig.2,
we
capture
signals
and
store
them
in
WORKSPACE
from
the
simulation
systems,
which
is
provided
for
using
input
of
distance
relay
algorithm.
About
transmission
lines
model,
SIMULINK
provides
Pi
and
distribution
model,
which
can
sets
parameters
as
numbers
of
phase,
frequency,
resistance,
inductance,
capacitor,
and
line
length
etc.
This
paper
uses
distribution
model
for
transmission
line
model
of
the
power
systems
simulation.In
Fig.
2,
the
block
for
fault
type
selection
and
fault
resistances
setting
are
located
below
two
distribution
model
blocks.
Here,
we
have
finishedthe
power
system
simulation
model
as
shown
in
Fig.2,
but
the
graphic
shown
in
window
is
a
bit
messy.
Thus
the
SUBSYSTEM
block
is
used
by
covering
all
of
blocks
to
produce
a
single
block,
as
shown
in
Fig.
3.
Fault
simulation
block.
If
we
double
clickthe
block,
the
interactiveinterface
window
on
rightside
of
Fig.
3.
will
be
shown
again,
in
which
the
interface
window
can
renew
some
parameters
for
next
time
simulation
when
the
simulation
is
finished.In
addition,
we
can
simulate
many
cases
at
the
same
time.
As
discussedabove,
the
protective
relay
simulation
system
has
become
a
systemof
easy
use
and
with
efficiency.
437
MATLAB
WORKSPACE
I
Fig.
4.
Protective
relay
test
systems
based
on
MATLAB/SIMULINK
Here,
when
we
compare
MATLAB/SIMULINK
with
EMTP/ATP,
we
will
see
which
one
is
better
for
theprotectiverelay
simulation
systems.
The
followingitems
summarize
their
most
important
differences
in
protection
systems
simulation:
1.
The
EMTP/
ATP
is
specific
software
to
simulate
power
system
transient
problem,
whereas
the
MATLAB/SIMULINK
can
be
used
to
simulate
power
system
faults
and
protective
relay
algorithm
at
the
same
time.
2.
ATP/EMTP
is
designed
to
simulate
the
physical
processes
of
transmission
lines
and
transformers
quickly
and
in
a
convenient
way
but
256
MATLAB
Power
Systems
of
Fault
Simulationof
Main
Programs
SIMUJLINKBased
Simulation
Systems
. n
=
Authorized licensed use limited to: Kansas State University. Downloaded on April 24,2010 at 09:35:09 UTC from IEEE Xplore. Restrictions apply.