Sie sind auf Seite 1von 47

Automa'c

 Genera'on  Control  
Using  Ar'ficial  Neural  Networks  

By-­‐  Harkirat  Singh  Choong  


Introduc'on  
What  is  Automa'c  Genera'on  Control  
(AGC)?  
•  There  is  mismatch  between  generated  power  and  load  demand.  
•  Imbalance  in  Real  power  à  frequency  devia'ons  
 and  Reac've  powerà  voltage  devia'ons  
•  Load  frequency  and  excita'on  voltage  control  are  non    interac've  
and  can  be  modeled  independently.  
•  Excita'on  voltage  control  is  fast  ac'ng  ('me  constant  is  of  
generator  field  only)  while  frequency  control  is  slow  ac'ng  ('me  
constant  is  of  turbine  and  generator  moment  of  iner'a).  
•  AGC  operates  to  balance  the  genera'on  and  
load  in  power  systems  at  minimum  cost.  
•  Performance  of  AGC  depends  on  how  quickly  
and  effec'vely  genera'ng  units  respond  to  its  
commands.  
•  Since  frequency  ∝  speed  of  generator,  
problem  of  frequency  control  can  be  
converted  to  speed  control  problem  of  the  
generator.  (governing  mechanism  in  fig.)  
Block  diagram  
Propor'onal  plus  Integral  Control      
Func'onal  diagram  of  a  typical  AGC  
system  
Neural  Networks  
●  Ar'ficial   neural   network   (ANN)   is   a   machine   learning  
approach  that  models  human  brain  and  consists  of  a  number  
of  ar'ficial  neurons.  
●  Neuron   in   ANNs   tend   to   have   fewer   connec'ons   than  
biological  neurons.  
●  Each  neuron  in  ANN  receives  a  number  of  inputs.    
●  An   ac'va'on   func'on   is   applied   to   these   inputs   which   results  
in  ac'va'on  level  of  neuron  (output  value  of  the  neuron).  
●  Knowledge   about   the   learning   task   is   given   in   the   form   of  
examples  called  training  examples.  
●  An  Ar'ficial  Neural  Network  is  specified  by:  
−  neuron  model:  the  informa'on  processing  unit  of  the  NN,  
−  an   architecture:   a   set   of   neurons   and   links   connec'ng  
neurons.  Each  link  has  a  weight,  
−  a   learning   algorithm:   used   for   training   the   NN   by  
modifying   the   weights   in   order   to   model   a   par'cular  
learning  task  correctly  on  the  training  examples.  
●  The  aim  is  to  obtain  a  NN  that  is  trained  and  generalizes  well.  
●  It   should   behaves   correctly   on   new   instances   of   the   learning  
task.  
Neuron  
●  The  neuron  is  the  basic  informa'on  processing  unit  of  a  
NN.  It  consists  of:  
1  A  set  of  links,  describing  the  neuron  inputs,  with  
weights    W1,  W2,  …,  Wm  
2  An  adder  func'on  (linear  combiner)  for  compu'ng  the  
weighted  sum  of  the  inputs:    u  =  ∑    wj  xj  
3  Ac'va'on  func'on  φ for  limi'ng  the  amplitude  of  the  
neuron  output.          y=  φ(u+b)  ,  ‘b’  is  the  bias.  
The  Neuron  Diagram  
Bias
b
x1 w1
Activation
Induced function
Field
Output

Input
x2 w2
∑ v
ϕ (−) y
values

  Summing
function

xm wm
weights
Bias  of  a  Neuron    

●  The   bias   b   has   the   effect   of   applying   a   transforma'on   to  


the  weighted  sum  u  
v  =  u  +  b  
●  The   bias   is   an   external   parameter   of   the   neuron.   It   can   be  
modeled  by  adding  an  extra  input.  
●  v  is  called  induced  field  of  the  neuron    

v= ∑    wj  xj,    ,  Jà  0  ….  M  


   wo    =  b  
Neuron  Models  
●  The  choice  of  ac'va'on  func'on      ϕ
         determines  the  
neuron  model.    
Examples:  
⎧a if v < c
●  step  func'on:   ϕ (v ) = ⎨
⎩b if v > c

⎧a if v < c
●  ramp  func'on:   ⎪
ϕ (v ) = ⎨b if v > d
⎪a + ((v − c )(b − a ) /(d − c )) otherwise
⎩

●  sigmoid  func'on  with  z,x,y  parameters     1


ϕ (v ) = z +
                    1 + exp( − xv + y )
Step  Func'on  

c
Ramp  Func'on  

c d
Sigmoid  func'on  
Network  Architectures    
●  Three  different  classes  of  network  architectures:  
−  single-­‐layer  feed-­‐forward                
−  mul'-­‐layer      feed-­‐forward                      
−  recurrent  

●  The  architecture  of  a  neural  network  is  linked  with  the  


learning  algorithm  used  to  train  
Single  Layer  Feed-­‐forward    

Input  layer   Output  layer  


of   of  
source  nodes   neurons  
Perceptron:  Neuron  Model    
(Special  form  of  single  layer  feed  forward)  

−  The  perceptron  was  first  proposed  by  Rosenblad  (1958)  is  a  simple  
neuron  that  is  used  to  classify  its  input  into  one  of  two  categories.    
−  A  perceptron    uses  a  step  func'on  that  returns  +1  if  weighted  sum  
of  its  input  ≥  0  and  -­‐1  otherwise  

⎧+ 1 if v ≥ 0
ϕ (v ) = ⎨
⎩− 1 if v < 0
Perceptron  for  Classifica'on    
●  The  perceptron  is  used  for  binary  classifica'on.  
●  First  train  a  perceptron  for  a  classifica'on  task.  
−  Find  suitable  weights  in  such  a  way  that  the  training  examples  are  
correctly  classified.  
−  Geometrically  try  to  find  a  hyper-­‐plane  that  separates  the  examples  
of  the  two  classes.  
●  The  perceptron  can  only  model  linearly  separable  classes.      
●  Given  training  examples  of  classes  C1,  C2    train  the  perceptron  in  such  a  
way  that  :  
−  If  the  output  of  the  perceptron  is  +1  then  the  input  is  assigned  to  
class  C1  
−  If  the  output    is  -­‐1  then  the  input  is  assigned  to  C22  
Boolean  func'on  OR  –  Linearly  separable  

X1

1 true true

false true
0 1 X2
Learning  Process  for  Perceptron  

●  Ini'ally  assign  random  weights  to  inputs  between  -­‐0.5  and  +0.5  
●  Training  data  is  presented  to  perceptron  and  its  output  is  observed.  
●  If   output   is   incorrect,   the   weights   are   adjusted   accordingly   using  
following  formula.  
      wi     ←   wi   +   (a*   xi   *e),   where   ‘e’   is   error   produced  
 and  ‘a’  (-­‐1  <  a  <  1)  is  learning  rate  
−  ‘a’   is   defined   as   0   if   output   is   correct,   it   is   +ve,   if   output   is   too   low  
and  –ve,  if  output  is  too  high.  
−  Once  the  modifica'on  to  weights  has  taken  place,  the  next  piece  
of  training  data  is  used  in  the  same  way.  
−  Once   all   the   training   data   have   been   applied,   the   process   starts  
again  un'l  all  the  weights  are  correct  and  all  errors  are  zero.  
−  Each  itera'on  of  this  process  is  known  as  an  epoch.  
Example:  Perceptron  to  learn  OR  
func'on  
●  Ini'ally  consider  w1  =  -­‐0.2  and  w2  =  0.4  
●  Training  data  say,    x1  =  0  and  x2  =  0,    output  is  0.  
●  Compute  y  =  Step(w1*x1  +  w2*x2)  =  0.  Output  is  correct  so  
weights  are  not  changed.  
●  For  training  data  x1=0  and  x2  =  1,  output  is  1  
●  Compute  y  =  Step(w1*x1  +  w2*x2)  =  0.4  =  1.  Output  is  correct  so  
weights  are  not  changed.  
●  Next  training  data  x1=1  and  x2  =  0  and  output  is  1  
●  Compute  y  =  Step(w1*x1  +  w2*x2)  =  -­‐  0.2  =  0.    Output  is  
incorrect,  hence  weights  are  to  be  changed.  
●  Assume  a  =  0.2  and  error    e=1  
   wi    =    wi  +  (a  *  xi  *  e)    gives  w1  =  0  and  w2  =0.4  
●  With  these  weights,  test  the  remaining  test  data.  
●  Repeat  the  process  'll  we  get  stable  result.  
Perceptron:  Limita'ons    
●  The   perceptron   can   only   model   linearly   separable  
func'ons,  
−  those   func'ons   which   can   be   drawn   in   2-­‐dim   graph  
and  single  straight  line  separates  values  in  two  part.  
●  Boolean  func'ons  given  below  are  linearly  separable:  
−  AND  
−  OR  
−  COMPLEMENT  
●  It   cannot   model   XOR   func'on   as   it   is   non   linearly  
separable.  
−  When   the   two   classes   are   not   linearly   separable,   it  
may   be   desirable   to   obtain   a   linear   separator   that  
minimizes  the  mean  squared  error.  
XOR  –  Non  linearly  separable  func'on  

●  A   typical   example   of   non-­‐linearly   separable   func'on   is   the  


XOR  that  computes  the  logical  Exclusive  OR.  
●  Here  0  and  1  are  encoding  of  the  truth  values  false  and  true.  
●  The   output   is   true   if   and   only   if   the   two   inputs   have   different  
truth  values.  
●  XOR   is   non   linearly   separable   func'on   which   can   not   be  
modeled  by  perceptron.  
●  For   such   func'ons   we   have   to   use   mul'   layer   feed-­‐forward  
network.    
Input Output
X1 X2 X1 XOR X2
0 0 0
0 1 1
1 0 1
1 1 0

These two classes (true and false) cannot be separated using a


line. Hence XOR is non linearly separable.

X1

1 true false

false true
0 1 X2
Mul'  layer  feed-­‐forward  NN  (FFNN)  
●  FFNN  is  a  more  general  network  architecture,  where  there  
are  hidden  layers  between  input  and  output  layers.    
●  Hidden   nodes   do   not   directly   receive   inputs   nor   send  
outputs  to  the  external  environment.  
●  FFNNs  overcome  the  limita'on  of  single-­‐layer  NN.  
●  They  can  handle  non-­‐linearly  separable  learning  tasks.    

Input Output
layer layer

Hidden Layer
3-4-2 Network
●  The   ANN   for   XOR   has   two   hidden   nodes   that   realizes   this   non-­‐
linear  separa'on  and  uses  the  sign  (step)  ac'va'on  func'on.    
●  Arrows   from   input   nodes   to   two   hidden   nodes   indicate   the  
direc'ons  of  the  weight  vectors    (1,-­‐1)  and    (-­‐1,1).    
●  The   output   node   is   used   to   combine   the   outputs   of   the   two  
hidden  nodes.  
  Input  nodes     Hidden  layer     Output  layer     Output  
                 
          H1                –0.5    
    X1      1        
           –1                    1          
                         Y    
                                           –1        H2        
    X2      1                                                          1  
               
 
Inputs   Output  of  Hidden  Nodes   Output   X1  XOR    X2  
X1   X2   H1   H2   Node  
0   0   0   0   –0.5  à  0   0  
0   1   –1  à  0   1   0.5    à  1   1  
1   0   1   –1  à  0   0.5    à  1   1  
1   1   0   0   –0.5  à  0   0  
 
●  Map   nega've   outputs   (–1,   –0.5)   of   hidden   and   output   layers   to   0   and  
posi've  output  (0.5)  to  1.  
FFNN  Neuron  Model  

●  The   classical   learning   algorithm   of   FFNN   is   based   on   the  


gradient  descent  method.    
●  For   this   reason   the   ac'va'on   func'on   used   in   FFNN   are  
con'nuous   func'ons   of   the   weights,   differen'able  
everywhere.    
●  The  ac'va'on  func'on  for  node  i  may  be  defined  as  a  
simple  form  of  the  sigmoid  func'on  in  the  following  
manner:   1
ϕ (Vi) =
1 + e( − A*Vi )

   where  A  >  0,      Vi  =  ∑  Wij  *  Yj  ,  such  that  Wij    is  a  weight  of  the  link  
from  node  i  to  node  j    and  Yj  is  the  output  of  node  j.    
Training  Algorithm:  Backpropaga'on        
●  The   Backpropaga'on     algorithm   learns   in   the   same   way   as  
single  perceptron.  
●  It   searches   for   weight   values   that   minimize   the   total   error   of  
the  network  over  the  set  of  training  examples  (training  set).  
●  Backpropaga'on  consists  of  the  repeated  applica'on  of  the  
following  two  passes:  
−  Forward   pass:   In   this   step,   the   network   is   ac'vated   on  
one   example   and   the   error   of   (each   neuron   of)   the  
output  layer  is  computed.  
−  Backward  pass:  in  this  step  the  network  error  is  used  for  
upda'ng   the   weights.   The   error   is   propagated   backwards  
from  the  output  layer  through  the  network  layer  by  layer.  
This   is   done   by   recursively   compu'ng   the   local   gradient  
of  each  neuron.  
Backpropaga'on    

●  Back-­‐propaga'on  training  algorithm  

Network  ac'va'on  
Forward  Step  

Error propagation
Backward Step

●  Backpropaga'on  adjusts  the  weights  of  the  NN  in  order  to  
minimize  the  network  total  mean  squared  error.  
●  Consider  a  network  of  three  layers.    
●  Let   us   use   i   to   represent   nodes   in   input   layer,   j   to   represent  
nodes  in  hidden  layer  and  k  represent  nodes  in  output  layer.  
●  wij  refers  to  weight  of  connec'on  between  a  node  in  input  
layer  and  node  in  hidden  layer.  
●  The   following   equa'on   is   used   to   derive   the   output   value   Yj  
of  node  j    
        1
 
Yj = −X j
1+ e
   
 where,      Xj  =  ∑  xi  .  wij  -­‐  θj  ,  1≤    i  ≤  n;  n  is  the  number  of  inputs  
to  node  j,  and  θj  is  threshold  for  node  j  
 
Total  Mean  Squared  Error  

●  The  error  of  output  neuron  k  aoer  the  ac'va'on  of  the  
network  on  the  n-­‐th  training  example  (x(n),  d(n))  is:          
ek(n)  =  dk(n)  –  yk(n)                                  
●  The  network  error  is  the  sum  of  the  squared  errors  of  the  
output  neurons:    
E(n) = ∑ e2
k (n)

●  The  total  mean  squared  error  is  the  average  of  the  network  
errors  of  the  training  examples.  
N
1
EAV = N ∑ E (n)
      n =1
Weight  Update  Rule  
●  The   Backpropaga'on   weight   update   rule   is   based   on   the  
gradient  descent  method:      
−  It   takes   a   step   in   the   direc'on   yielding   the   maximum  
decrease  of  the  network  error  E.    
−  This  direc'on  is  the  opposite  of  the  gradient  of  E.  
●  Itera'on   of   the   Backpropaga'on   algorithm   is   usually  
terminated   when   the   sum   of   squares   of   errors   of   the  
output  values  for  all  training  data  in  an  epoch  is  less  than  
some  threshold  such  as  0.01  
∂E
wij = wij + Δwij Δw ij = -η
∂w ij
Stopping  criterions  
●  Total  mean  squared  error  change:        
−  Backpropaga'on   is   considered   to   have   converged  
when   the   absolute   rate   of   change   in   the   average  
squared   error   per   epoch   is   sufficiently   small   (in   the  
range  [0.1,  0.01]).  
●  Generaliza'on  based  criterion:        
−  Aoer  each  epoch,  the  NN  is  tested  for  generaliza'on.    
−  If   the   generaliza'on   performance   is   adequate   then  
stop.    
−  If   this   stopping   criterion   is   used   then   the   part   of   the  
training  set  used  for  tes'ng  the  network  generaliza'on  
will  not  used  for  upda'ng  the  weights.  
Neural  Network  Design  Issues  
●  Network  Topology  
●  Network  Parameters  
●  Training    
Network  Topology    
●  The  number  of  layers  and  neurons  depend  on  the  specific  
task.    
●  In  prac'ce  this  issue  is  solved  by  trial  and  error.  
●  Two  types  of  adap've  algorithms  can  be  used:  
−  start  from  a  large  network  and  successively  remove  
some  neurons  and  links  un'l    network  performance  
degrades.  
−  begin  with  a  small  network  and  introduce  new  neurons  
un'l  performance  is  sa'sfactory.  
Network  parameters    

●  How  are  the  weights  ini'alized?  


●  How  is  the  learning  rate  chosen?  
●  How  many  hidden  layers  and  how  many  neurons?  
●  How  many  examples  in  the  training  set?    
Ini'aliza'on  of  weights  
●  In   general,   ini'al   weights   are   randomly   chosen,   with  
typical  values  between  -­‐1.0  and  1.0  or  -­‐0.5  and  0.5.  
●  If   some   inputs   are   much   larger   than   others,   random  
ini'aliza'on   may   bias   the   network   to   give   much   more  
importance  to  larger  inputs.    
●  In  such  a  case,  weights  can  be  ini'alized  as  follows:  

w ij = ± 21N ∑ 1
|x i | For  weights  from  the  input  to  the  first  layer  
i =1,..., N

w jk = ± 21N ∑ 1
For  weights  from  the  first  to  the  second  
i =1,..., N
ϕ( ∑wijx )
i layer  
Choice  of  learning  rate    

●  The  right  value  of  η  depends  on  the  applica'on.    


●  Values  between  0.1  and  0.9  have  been  used  in  many  
applica'ons.  
Training  
●  Rule  of  thumb:    
−  the  number  of  training  examples  should  be  at  least  
five  to  ten  'mes  the  number  of  weights  of  the  
network.  
●  Other  rule:  
|W|
N>
(1- a)
•  |W|=  number  of  weights  
•  a=expected  accuracy  on  test  set  
 
Many  other  models  are  there:  
• RBF-­‐  Radial  Basis  Func'on  Network.  
• Hybrid  Fuzzy  Neural  Network.  
• Hopfield  Network.  

 
Some  of  Results  in  these  papers  
Thank  You  
Papers  and  Reference  books    
[1]  D.  M.  V.  Kumar,  "Intelligent  controllers  for  automa'c  genera'on  
control,"  in  TENCON  '98.  1998  IEEE  Region  10  Interna?onal  
Conference  on  Global  Connec?vity  in  Energy,  Computer,  
Communica?on  and  Control,  1998,  pp.  557-­‐574  vol.2.  
[2]  A.  Sharma,  K.  S.  Parmar,  and  S.  Gupta,  "Automa'c  Genera'on  
Control  of  Mul'  Area  Power  System  using  ANN  Controller,"  
Transfer,  vol.  120,  p.  1.  
[3]  A.  Abdel-­‐Khalik,  A.  Elserougi,  A.  Massoud,  and  S.  Ahmed,  "A  power  
control  strategy  for  flywheel  doubly-­‐fed  induc'on  machine  storage  
system  using  ar'ficial  neural  network,"  Electric  Power  Systems  
Research,  vol.  96,  pp.  267-­‐276,  2013.  
[4]  K.  Warwick,  A.  Ekwue,  R.  Aggarwal,  and  W.  Laycock,  "Ar'ficial  
intelligence  techniques  in  power  systems”  Book.  
 

Das könnte Ihnen auch gefallen