You are on page 1of 24

Power quality improvement in asd

systems using genetic algorithm


group members :
g.Ohmkumar -81507121030
m.rajalingam- 81507121039
m.Santhosh perumal-81507121043
c.Sathish - 81507121045
GUIDE NAME:

T.PARITHIMAR KALAIGNAN
ABSTRACT
 In traditional Adjustable Speed Drives (ASDs) voltage controller low power
factor and high-energy are some of the major drawbacks. These can be
eliminated using Genetic Algorithm based PWM optimization. This Genetic
Algorithm optimization eliminates the harmonics in theInduction motor output
and provides power factor close to unity. The increased use of power
electronics-based loads, (adjustable speed drives, switch mode power
supplies (SMPS), etc.) for improving system efficiency and controllability
results in increase in the harmonic distortion levels in end use facilities and
overall power system. In this paper, the harmonic contents and distortion
factor are less in the output of Genetic Algorithm optimized pulse width
Modulated impedance source when compared to standard PWM . It is the
most economic methodology to improve the power quality of induction
motors.
CONCEPT AND HISTORY OF GENETIC ALGORITHM

genetic programming (GP) is an evolutionary algorithm-


based methodology inspired by biological evolution to find
computer programs that perform a user-defined task. It is a
specialization of genetic algorithms (GA) where each
individual is a computer program. It is a machine learning
technique used to optimize a population of computer
programs according to a fitness landscape determined by a
program's ability to perform a given computational task.
. History
In 1954, GP began with the evolutionary algorithms first used by Nils
Aall Barricelli applied to evolutionary simulations. In the 1960s and
early 1970s, evolutionary algorithms became widely recognized as
optimization methods
Ingo Rechenberg and his group were able to solve complex engineering
problems through evolution strategies as documented in his 1971 PhD
thesis and the resulting 1973 book. John Holland was highly
influential during the 1970s.
In 1964, Lawrence J. Fogel, one of the earliest practitioners of the GP
methodology, applied evolutionary algorithms to the problem of
discovering finite-state automata. Later GP-related work grew out of
the learning classifier system community, which developed sets of
sparse rules describing optimal policies for
Markov decision processes. The first statement of modern "tree-
based" Genetic Programming (that is, procedural languages organized
in tree-based structures and operated on by suitably defined GA-
operators) was given by Nichael L. Cramer (1985). This work was
 In the 1990s, GP was mainly used to solve relatively simple
problems because it is very computationally intensive.
Recently GP has produced many novel and outstanding
results in areas such as quantum computing, electronic
design, game playing, sorting, and searching, due to
improvements in GP technology and the
exponential growth in CPU power. These results include
the replication or development of several post-year-2000
inventions. GP has also been applied to evolvable hardware
as well as computer programs.
 Developing a theory for GP has been very difficult and so in
the 1990s GP was considered a sort of outcast among search
techniques. But after a series of breakthroughs in the early
2000s, the theory of GP has had a formidable and rapid
development. So much so that it has been possible to build
Genetic operators

 The main operators used in evolutionary algorithms such as GP are


crossover and mutation.
 Crossover
 Crossover is applied on an individual by simply switching one of its nodes
with another node from another individual in the population. With a tree-
based representation, replacing a node means replacing the whole branch.
This adds greater effectiveness to the crossover operator. The expressions
resulting from crossover are very much different from their initial parents.
 The following code suggests a simple implementation of individual
deformation using crossover:

individual.Children[randomChildIndex]=
otherIndividual.Children[randomChildIndex];

 
Mutation:
 Mutation affects an individual in the population. It can
replace a whole node in the selected individual, or it can
replace just the node's information. To maintain integrity,
operations must be fail-safe or the type of information
the node holds must be taken into account. For example,
mutation must be aware of binary operation nodes, or
the operator must be able to handle missing values.
A simple piece of code:
individual.Information = randomInformation();
or
individual = generateNewIndividual();
FLOWCHART:
ALGORITHM:
 The existing GAs are founded upon the following main principles:
 Reproduction
 Fitness
 Crossover
 Mutation

There are various flavours of GAs in circulation, varying in implementation of these three
parameters, but in essence the algorithms all follow a standard procedure:
 Start with a randomly generated population of n l-bit strings (candidate solutions to a problem).
(These "solutions" are not to be confused with "answers" to the problem, think of them as
possible characteristics that the system would employ in order to reach the answer (1))
 Calculate the fitness f(x) of each string in the population.
 Repeat the following steps until n new strings have been created:
 Select a pair of parent strings from the current population, the probability of selection being
an increasing function of fitness. Selection is done "with replacement" meaning that the
same string can be selected more than once to become a parent.
 With the crossover probability, cross over the pair at a randomly chosen point to form two
new strings. If no crossover takes place, form two new strings that are exact copies of their
respective parents.
 Mutate the two new strings at each locus with the mutation probability, and place the
resulting strings in the new population.
 Replace the current population with the new population.
 Go to step 2.
CIRCUIT DIAGRAM
CODING:
// GeneACPowerDlg.cpp : implementation file
//

#include "stdafx.h"
#include "GeneACPower.h"
#include "GeneACPowerDlg.h"
#include "Winio.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CGeneACPowerDlg dialog

CGeneACPowerDlg::CGeneACPowerDlg(CWnd* pParent /*=NULL*/)


: CDialog(CGeneACPowerDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CGeneACPowerDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
void CGeneACPowerDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CGeneACPowerDlg)
DDX_Control(pDX, IDC_SLCD, m_lcd);
//}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CGeneACPowerDlg, CDialog)
//{{AFX_MSG_MAP(CGeneACPowerDlg)
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_WM_TIMER()
ON_BN_CLICKED(IDC_BBR, OnBbr)
ON_BN_CLICKED(IDC_BRUNGA, OnBrunga)
ON_BN_CLICKED(IDC_BINC, OnBinc)
ON_BN_CLICKED(IDC_BDEC, OnBdec)
ON_BN_CLICKED(IDC_BREMO, OnBremo)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CGeneACPowerDlg message handlers

BOOL CGeneACPowerDlg::OnInitDialog()
{
CDialog::OnInitDialog();

// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
ac.release=1;
ac.RegisterInf("geneacp.inf","TS130220110831");
ac.SetHandle(m_hWnd);
lcd.Initialize(ac.CreateDynamicHandle());
lcd.AssignVariable(&m_lcd);
lcd.CreateWDC();
lcd.LoadDefaults();
SetTimer(1,500,0);
MessageBox("Please ensure security switch is in off state","ALERT",0);
gene.Initialize(ac.CreateDynamicHandle());
if(!gene.InitializeESP())
{ MessageBox("Unable to Initialize ESP","Terminated",0);
EndDialog(0);
}
if(!gene.DetectDeviceStatus())
{ status("Device not connected...");
MessageBox("Device not connected","Connect device now",0);
//EndDialog(0);
}
else status("Device Ready");
// TODO: Add extra initialization here

return TRUE; // return TRUE unless you set the focus to a control
}

// If you add a minimize button to your dialog, you will need the code below
// to draw the icon. For MFC applications using the document/view model,
// this is automatically done for you by the framework.

void CGeneACPowerDlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting

SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);


// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;

// Draw the icon


dc.DrawIcon(x, y, m_hIcon);
}

else
{
CDialog::OnPaint();
}
}
// The system calls this to obtain the cursor to display while the user drags
// the minimized window.
HCURSOR CGeneACPowerDlg::OnQueryDragIcon()
{
return (HCURSOR) m_hIcon;
}
void CGeneACPowerDlg::status(char m[])
{ strcpy(gm,m);
lcd.Disp(5,5,gm);
}

void CGeneACPowerDlg::OnTimer(UINT nIDEvent)


{ if(nIDEvent==1)
{ lcd.Disp(5,5,gm);
}

CDialog::OnTimer(nIDEvent);
}

void CGeneACPowerDlg::OnBbr()
{ CFileDialog cf(0,0,0,0,0,0);
if(cf.DoModal()==IDOK)SetDlgItemText(IDC_EREP,cf.GetPathName());
}

void CGeneACPowerDlg::OnBrunga()
{ unsigned long co;
int mu;
bool res;
char fn[700];
GetDlgItemText(IDC_EREP,fn,700);
SYSTEMTIME st1,st2;
status("Running Training Set....");
FILE *f;
f=fopen(fn,"a");
if(f)
{ co=GetDlgItemInt(IDC_ECO,0,0);
mu=GetDlgItemInt(IDC_EMU);
if(!gene.SetNumberofCrossovers(co))
{ status("Crossovers out of range");
fclose(f);
return;
}
if(!gene.SetNumberofMutations(mu))
{ status("Mutations out of range");
fclose(f);
return;
}
gene.SelectThershold(0);
GetLocalTime(&st1);
res=gene.RunGeneticTraining();
GetLocalTime(&st2);
GetLocalTime(&st2);
if(!res)
{ status("Genetic Training Failed...");
fclose(f);
return;
}
else
{ long du=ac.TimeDifference(st2,st1);
sprintf(gm,"Process Completed in %ld mS",du);
status(gm);
fprintf(f,"\n\n\nGenetic Training Report");
fprintf(f,"\n-----------------------------");
fprintf(f,"\n Number of Crossovers : %lu",gene.GetNumberofCrossovers());
fprintf(f,"\n Number of Mutations Permitted : %d",mu);
fprintf(f,"\n Number of Generated Murations : %lu",gene.GetNumberofActiveMutations());
fprintf(f,"\n Process Start Time : %02d-%02d-%04d :: %02d:%02d:%02d:
%03d",st1.wDay,st1.wMonth,st1.wYear,st1.wHour,st1.wMinute,st1.wSecond,st1.wMilliseconds);
fprintf(f,"\n Process End Time : %02d-%02d-%04d :: %02d:%02d:%02d:
%03d",st2.wDay,st2.wMonth,st2.wYear,st2.wHour,st2.wMinute,st2.wSecond,st2.wMilliseconds);
fprintf(f,"\n Time Taken : %ld mS",du);
fclose(f);
status("Genetic Training Completed");
MessageBox("It is now safe to turn on the security switch","Info",0);
}
}
}
void CGeneACPowerDlg::OnBinc()
{ gene.OptimizeQuality();
}

void CGeneACPowerDlg::OnBdec()
{ gene.OptimizeQuality(0);
}

void CGeneACPowerDlg::OnBremo()
{ gene.RemoveDevice();
}
Conclusion:
 Thus the power quality of the ASD system such as
voltage,frequency, power factor are improved using
genetic algorithm based pwm optimization and voltage
controller.Then the harmonic distortion in the inverter
ouput is also minimized.

You might also like