Professional Documents
Culture Documents
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
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
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
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);
}
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.