IMPLEMENTATIONOFAMULTI-AGENTCONTROLSCHEMEFOR AUTONOMOUSMIGROGRIDS By KhaleelOKhadedah ATHESIS Submittedto MichiganStateUniversity inpartialentoftherequirements forthedegreeof ElectricalEngineering-MasterofScience 2015 ABSTRACT IMPLEMENTATIONOFAMULTI-AGENTCONTROLSCHEMEFOR AUTONOMOUSMIGROGRIDS By KhaleelOKhadedah ThisthesisdescribestheimplementationofaMulti-Agentcontrolschemeforautonomous microgrids.ThisisrealizedbyaMulti-Agentsystem,whichexecutesathree-stagealgorithm tocontrolthevoltageatthenodesandthepowerbalanceofthemicrogrid.Thepowersystem issimulatedbyusingaRealTimeDigitalSimulator(RTDS).TheGaussmethodisused fordistributedcalculationofpowerws.Additionally,usingaMulti-Agentsystemina low-voltagedistributionnetworktolvoltageconstraint,powerbalanceandfrequency droopforlowvoltagearealsodiscussed.InthenextstepascriptfeatureofRSCADand sharingprotocoloverthelocalareanetwork(LAN)isadoptedforestablishingofnecessary communicationbetweentheagentsandtheRTDS.Numeroushardwarefor theinterfacewereexaminedduringtheresearchwork.Thisinterfacingshowsa communicationstructuretoexchangethedata.ThelinkbetweentheagentsandtheRTDS hasbeenexaminedandtheresultsaregiven.Thestagesoftheprojectaninterfaceusing theDAQtoolboxwasinvestigated.Thecommunicationspeedamongtheagents,theRTDS, andthehardwareavailablewereaconstraintthatneededtobeconsideredforconstructing theframework.However,thecommunicationbetweentheagentsandthesystemhasbeen establishedwithregardtothecommunicationspeed. Toeverysoulwhohasfallentingterrorism iii ACKNOWLEDGMENTS IwouldliketoexpressmydeepestgratitudetomyadvisorProfessorJoydeepMitraat MichiganStateUniversityforhisexcellentguidance,caring,patience,andprovidingme withanexcellentatmospherethroughtheworkonmyresearchthesisandgivingme valuableadvices.ThedoortoProfessorMitra'swasalwaysopenwheneverIraninto atroublespotorhadaquestionaboutmyresearchorwriting.Heconsistentlysteered meintherightthedirectionwheneverhethoughtIneededit.Thanksforgivingmethe opportunitytobepartofyourresearchgroup.Iwouldneverhavebeenabletomy thesiswithouttheguidanceofProfessorMitra,helpfromfriends,andsupportfrommy family. IwouldliketothankStefanLang,Dr.NiannianCai,andVenkateswaranLakshmi- naryananwhoasagoodfriends,werealwayswillingtoworkwithmeandgivetheirbest suggestions.Itwouldhavebeenalonelylabwithoutthem. IwouldliketothankmyfellowlabmatesthemembersofProfessorMitra'sresearchgroup, especially,Dr.MohammedBen-Idris,YutingTian,NgaNguyen,andSamerA.Sulaeman whosupportedmeinthevarioussectionsofmywork. Iwouldliketothankmylovedones,speciallymywife,mychildren,andPatriciaWalters whohavesupportedmethroughoutthetimeofmystudy,bothbykeepingmeharmonious andhelpingmeputtingpiecestogether.Iwillbegratefulforeverforyourlove. Finally,andmostimportantly,Iwouldliketoexpressmymostprofoundgratitudeto myparentsfortheirendlesslove,consistentsupportandencouragementthroughoutthis research. iv TABLEOFCONTENTS LISTOFTABLES .................................... vii LISTOFFIGURES ................................... viii Chapter1Introduction ................................ 1 1.1ProblemStatement................................4 1.2ProjectObjective.................................5 Chapter2Background ................................ 6 2.1Microgrid(MG)..................................6 2.2Multi-AgentSystem...............................8 2.3AgentCharacteristics...............................9 2.3.1AgentCommunication..........................11 2.4Hardware.....................................12 2.4.1RaspberryPi...............................13 2.4.1.1Programmableinterface....................13 2.4.2Real-TimeDigitalSimulator:RTDS..................14 2.5InterfacingSoftware................................16 2.5.1OperatingSystem.............................16 2.5.1.1RemoteDesktopConnection..................17 2.5.2RSCAD..................................19 2.5.2.1DraftSheet...........................19 2.5.3RuntimeSheet..............................20 2.5.3.1ScriptFile............................20 Chapter3DistributedPowerBalanceControlandVoltageandFrequency Regulation ................................ 22 3.1DistributionNetworkModelandPowerBalance................24 3.2FrequencyDroopControlinaMicrogrid....................25 3.3VoltageRegulatedDistributionTransformer (VRDT)......................................29 3.3.1CauseoftVoltagePotentials..................34 3.4StepsofVoltageRegulation...........................39 3.4.1CommunicationStructure:........................44 3.4.2AgentBasedPowerFlow.........................48 3.5Five-BusTestSystem...............................51 3.5.1ExampleCalculation:...........................51 3.5.1.1 Y bus Construction:.......................52 3.5.1.2Multi-AgentBasedPowerFlowCalculation.........52 v 3.5.1.3NetPowerCalculation.....................53 Chapter4InterfacingMethods ........................... 55 4.1Method1.....................................55 4.2Method2.....................................56 4.3Method3.....................................57 4.4Method4.....................................60 4.5SimulationandResults..............................62 4.6PowerSystemModels..............................62 4.6.1Runtime..................................66 4.7ScriptfeatureofRSCAD.............................67 Chapter5 ........................................ 71 5.1Conclusion.....................................71 5.2FutureWork....................................72 BIBLIOGRAPHY ................................... 74 vi LISTOFTABLES Table3.1PowerValueatEachBusoftheSystem................42 Table3.2ParentChildRelationshipDiagram..................46 Table3.3BusInputDataforFive-BusSystem..................51 Table3.4LineInputDataforFive-BusSystem.................52 Table3.5Local Y i Vectors.............................52 Table3.6ResultsfortheFirstFiveIteration...................54 vii LISTOFFIGURES Figure2.1RaspberryPiModelB+512MBRAM,2-USB-PortsundEtherne (www.vesalia.de).............................13 Figure2.2a)FullviewoftheRTDSrack;b)3GPCprocessorunits,1WIF ethernetconnectioncard,digitalI/O-port;c)ScreenshotofRTDS software"RSCAD"...........................15 Figure2.3RemoteconnectionfromawindowsoperatingsystemtoUbuntu.The registeredhostnamewasusedtoaddresstherequiredmachine...18 Figure3.1Hierarchicalcontrolstructureofmicrogrids..............25 Figure3.2PowerFlowingthroughaLine.....................26 Figure3.3DroopControlCharacteristicPlots..................28 Figure3.4Exampleforagridandthepositionofagents.............30 Figure3.5MicrogridschemewithVRDT.....................33 Figure3.6Completerepresentationofaline....................34 Figure3.7Processdescribingthedevlopmentofthevector V ........39 Figure3.8Exampleoftheinformationw,whichtransportsthehighestand lowestvoltageofanodetotheagent...............40 Figure3.9ofthegrid........................43 Figure3.10Thediagrammshowstheoftheseveralstepsonthevoltage ateachnode................................44 Figure3.11(a)Tokentransmissionrouteandremovedredundancybetweenagent 3and5.(b)Minimalspanningtreeconstructed.(c)Informationw pathforstage2..............................46 Figure3.12Testede-bussystem.........................51 viii Figure4.1a)AopticcableconnectstheRTDSinternalcommunication systemtoanFPGAboard.Theboardconvertsthedataandbuildsan interfacewiththeEthernetnetwork;b)WiththehelpofanAD/DA convertertheoutputsofseveralchannelscanbeconvertedindigital valuesandsendtoacomputerordirectlyinaEthernetnetwork...56 Figure4.2InterfacingusingthescriptfeatureofRSCADovertheLAN(Method 3).....................................59 Figure4.3InterfacingusingDAQ(Method4)...................62 Figure4.4Systemconsistingthreegeneratingandthreeloadunits.......63 Figure4.5Systemconsistingthreegeneratingandthreeloadunits.......64 Figure4.6Systemwithonewindturbine,onesolarPVunit,oneDGandfour loadunits................................65 Figure4.7Showstheplotsofsimulatedsystemconsistingofsixbuses,fourload units,withthreegeneratingunits...................66 Figure4.8Sliderstoadjustthegenerationandload...............67 Figure4.9MetersshowingvaluesofpowergeneratedandbusvoltageandSlider foradjustthewindturbinegenerationandthepushbuttons....68 Figure4.10ScriptfeatureinRuntimesheetofRSCAD..............68 Figure4.11Flowchartfortheprogrammingofthescript.............69 Figure4.12showsthescript in.csvoutputtedbythesystemwhichistheinput totheagents...............................70 Figure4.13showstheGUIoftheagents......................70 Figure4.14theoutputscript out.csvgivenbytheagentsthenthisissent toRTDS.................................70 ix Chapter1 Introduction Therapidevolutionofelectricitysupplywillhavemajorimplicationsforreliability,trans- mission,distribution,consumerengagement,security,andintegration.Regardlessofthe ultimategenerationmix,theelectricgridwillplayacriticalroleinfutureelectricityinfras- tructure[1]. Theintegrationofrenewableenergysources,andtheliberalizationofenergymarkets, therefore,requireelementaryoperationsinthestillpredominantlyclassicalstructureofthe existingpowergrids.Thepartialautomationofthemiddleandlow-voltagedistribution gridisamajorchallenge.Thisismainlyduetothetoenableenergytobegenerated primarilyfromrenewablesources.Thiscontributeshighlytothereductionof CO 2 emissions oftheenergysector,butitwillnotbeenoughforcompleteelimination.Anincreaseinthe ofenergyapplicationsisalsorequired[2].Thoughtfuldebateandplanningare neededtodayinordertoaddresstomorrow'schallengesandseizetomorrow'sopportunities. Withthisinmind,theconceptofamicrogridwilltheseaspirations. Accordingto[3]\AMicroGridisagroupofinterconnectedloadsandDistributedEnergy Resources(DER)withclearlyelectricalboundariesthatactsasasinglecontrollable entitywithrespecttothegrid[andcan]connectanddisconnectfromthegridtoenableit tooperateinbothgridconnectedorislandmode."Themicrogridisanindependentsection oftheelectricaldistributiongridthatcantransmit,produce,anddistributepowerwithin alocalizedarea.TheprimarycomponentsofamicrogridconsistofDistributedEnergy 1 Resources(DERs),loads,andcontrollableinterconnectiontiesbetweenthemicrogridand externalpowersources,inwhichallthreemustcoordinateelytobehaveasdesigned. Implementationofthemicrogridincreasesthereliabilityandqualityofthepowersupplied tothemicrogridloads.Forareaswherethelossofelectricitymaycausesevereeconomic damageorlossofhumanlife,theimplementationofamicrogridisinvaluable.However,mi- crogridshavebeenhistoricallydevelopedasclosed,tightlycontrolledsystemsforalimited numberofapplications.Moreover,thecontrolstrategiesformicrogridshavetraditionally beendevelopedforsystemsconsistingoffewcontrolvariables,includingthetypesandca- pabilitiesofDERs,themicrogridloads,andthepowerwattheinterconnectionties.The resultisarelativelysimplecontrolstrategywhichcanmanageanticipatedeventsbeforethe microgridisimplemented.Furthermore,astheconceptofthemicrogridexpandstoinclude loadsandDERsbeyondthecapabilitiesofasingle,centralizedcontroller,suchasresidential subdivisionsorseveralblocksinacentralbusinessdistrict,thenumberofcontrolvariables thecontrolstrategyisrequiredtodealwithincreasessubstantially[4,5,6,11,13]. ThisappliedresearchthesisisacontinuationofaresearchdevelopedinEnergyReli- abilityandSecurityResearchLaboratory(ERISE).Theuseofaregulatedtransformerin cooperationwithaMulti-Agentsystemisausefulsolutiontomaintainthevoltagestability inagrid.Severalagentscantakethevoltagemeasurementacrossthegridandinducea controlinterventionoftheagentsinstalledonVoltageRegulatedDistributedTransformer (VRDT)inexcessoftheprescribedlimits,sothecorrectionalgorithmcontrolstepsare shownlaterinchapter3.Asoftwarewhichcurrentlycontrolsthecommunicationwis describedinsection2.3.1.Alsomathematicalalgorithmsandfunctionscanbeintegrated intothesoftwaretotesttheirForthesimulationofreal-timevalues,apossible connectiontoaRealTimePowerSystemsimulator(RTDS)isdescribedinsection2.4.2. 2 Reference[7]usedtheRTDS,andthesignalshadbeentakenoutfromtheoutputports either(analogordigital)throughanopticercabletoaFieldProgrammableGateArray (FPGA)whichactsastheinterfacingmediumbetweentheRTDSandtheagents.This methodwouldbesuitableforlargesystemswheretherearemanyGTAOorGTIO.Due tohardwareconstraintswhereonlyoneGTAOportisavailable,thesignalshadtobesent sequentially.Theagentswereneitherprogrammedtotakeinsignalssequentiallynorto givesignalssequentially.However,thismethodgaveanideatoabetterinterfacewith theagents.Whileworkingwithsendingsignalssequentially,RSCAD'sscriptfeatureswere considered.WhileworkingwiththescriptamethodofinterfacingtheagentswithRTDS usingnoextrahardwarewasfound;theconnectionwasovertheEthernetitself.Thismethod doesnotrequireanyspecialorexternalhardwareandinterfacingcouldbedoneusingthe EthernetovertheLAN.ThescriptinRSCADwasprogrammedforinterfacinginthis method.Thestepsofhowitworksareexplainedinsection4.3. Inchapter3thevoltageandfrequencyregulationinalowvoltagemicrogridis discussedwithmathematicalrepresentationofatypicaltransmissionline. Inlaterchapters,methodsofinterfacingthatdescribethepracticalcontributiontothe projectrunninginERISEarediscussed.Inamicrogrid,integratingandinterfacingsensing andcontroldevicesischallengingbecauseitinvolvestcommunicationprotocols.the stagesoftheprojectaninterfaceusingtheDAQtoolboxwasstartedimplemented. Finally,simulationandresultsaregiveninchapter4.Themainpartofthisproject wasthedevelopmentoftherequiredhardwarestructureandtheestablishmentofoperating systems.Inaddition,thepreviouslymentionedsoftwarewasdevelopedtosimulatethe behaviorofaMulti-Agentsystem. 3 1.1ProblemStatement Theongoingdevelopmentinthegrowthofrenewableenergytechnologyhasbroughtinthe subjectofmicrogrids.Thispresentstateofmicrogridsisvolatile,asitnotonlyinvolvesinef- tpowersources(e.g.wind,solar),butalsohasveryheavydemandwithheatpumps,air conditioners,electricvehicles,etc.Tomaintaintherequiredguidelinesforvoltagestability andfrequencystability,operationandcontrol,ahumanoperatorisrequired.However;itis becausetherearesomerestrictionsrelatedtooperationcostsandprivacyissues.To overcometheserestrictionsandforautonomousoperationofthemicrogrids,anintelligent agentsystemformicrogridsoperationhasbeenstudiedasapotentialsolutionwhichmostly performstherequiredprocesses.InthisprojecttheimplementationofaMulti-Agentcontrol schemeforautonomousmicrogridsisdescribed.Theintelligenceinthesenetworksconsists ofmanytcomponents.Itmustbeequippedwithhardwarecomponentswhichin- cludesensorsandactuators.Thesesystemsareadditionallyconnectedtootheragentsovera communicationmedium.Thecontrolwithinthisinteractivenetworkmustbeimplemented usingspecializedsoftware. Themainaimofthisprojectwastobuildapropercommunicationlinkbetweenthe agentsandthesystem.Thispartisprovedtobeamajorchallengebecauseofthe inthecommunicationspeed.ThesystemsimulatedintheRTDSrunsatrealtimehence thecommunicationspeedwasabout100,000samplespersecond,ontheotherhandthe agentswereestablishedintheRaspberryPiwhichisasmallestmicroprocessorandhada communicationspeedofafewcyclespersecond.Thesecondconstrainthatwasfacedduring thisinterfacingwasthehardwarethatwasavailable. 4 1.2ProjectObjective Itcanbeseeninthissummarythatmanytelementsareapartofthisproject.In thisprojecttheimplementationofaMulti-Agentcontrolschemeforautonomousmigrogrids isdescribed.Withitshelp,theinteractionofseveralagentscanbesimulatedandtested. Thesoftwarethatusedtocontrolsthecommunicationwisdescribedinsection3.4.1. ThewayusingMulti-Agentsystemtocalculatetheindatabetweennodesin themicrogridsistheobjectiveofthisappliedresearch.Theintegrationofmechanismsfor automatingthedistributionnetworkpresentsaparticularchallengebecausetheyhaveto beintegratedintoexistingstructures.Theuseofaregulatedtransformerincooperation withaMulti-Agentsystemis,therefore,ausefulsolutiontomaintainthevoltagestability inagrid.Acasestudywithsimulationandcalculationisshown.Also,thecommunication structureoftheagentsandinformationwpathforthisstructureareexplainedwith andmathematicalrepresentation.Forpowerbalancecontrol,amethodusing aMulti-Agentsysteminalow-voltagedistributionnetworktovoltageconstraints isdiscussedandresultsaregiven.Notablyrenewablegenerationfacilities,suchaswind power,solarandbiomassarefoundinruralareas,incontrasttothelowconsumptionofthe population.Inreturn,theregenerativepowergeneratedincitiesisratherlow,compared tothegridsize.Thus,itistoensureabalanceddecentralizedsystemofproducers andconsumers.Insomeareas,theinstalledrenewableenergysubstantiallyexceedsthe installedconsumerloads.Inordertomaintaingridstability,powerwcontrolandvoltage stabilityarerequired.Thesearealsoneededtoobtaintheprotectionofthenetworkandthe consumerandtopreventtheover-loadofthegrid.BenefromMASincludeaccomplishing attributes,avoidingsinglepointfailures,andrealizingdistributedcontrol. 5 Chapter2 Background Thischapterwillexplainsomeimportantbackgroundinformation;thefollowingsections describethemainideaofmicrogrids.ThisleadstotheconceptofMulti-Agentsystems, whicharebasedonavariablenumberofagents.Themicrogridareconsideredimportant fortheinfrastructureofsmartgrid,howeverandintermittenceresultedfrom unstablemicro-sourcesandnonlinearloadswillexecuteconsiderableimpactsonnormal operationofthemicrogrid.Energystorage(ES)technologypresentsapreferablesolution totheaboveissue. 2.1Microgrid(MG) Duetotheincreasingshortageoffossilfuelsandthecompellingpressuresfromenvironmental protection,newgenerationsourcesofhighsuchasfuelcellandmicrogasturbine, aswellasRenewableEnergySources(RES)suchaswindandsolarpower,arebecoming importantDERs.Thedistributedandrenewableenergysourceswillseearemarkablyin- creasingportioninthewholeelectricpowergeneration.Forexample,inCalifornia,USA, 20%ofenergygeneratedmustbefromRESby2017,while15%willbeachievedinChina by2020,accordingtoagovernmentreport[8].Amigrogridcombinedwithrenewableen- ergysourcesanddistributedgenerationsourcescanbeapreferablesolutiontotheraised energycrisesaswellasacomplementtocentralizedmodernpowergrids.However,dueto 6 relativelysmallcapacity,thenormaloperationofmicrogridsmaybevulnerabletorandom powerexchangebetweenthesupplierandtheloads.Forinstance,whenamicrgridworks attheislandedmode,possiblemalfunctionofsomemicro-sourceorDGwillcauseimme- diateactiveandreactivepowershortage.Thoughitmighteventuallyberemediedbyload shedding,theinterimpowershortfallmustbeinstantlycompensatedfromsomewhereelse, forwhichcaseenergystoragetechnologyiscriticalandnecessary.Moreimportantly,many RESandDGsbehaveintermittently,duetotheirstrongdependencyonclimaticandme- teorologicalconditions.Asaresult,theRESenergyoutputwillEnergystorage ispresentlytheimportantequipmentinamicrogridasthesmartwaytorestrainprobable poweranddealwitharduousimbalancechallengesbetweenthedemandsideand thesupplyside[9].Microgridsaremodern,small-scaleversionsofthecentralizedelectric- itysystem.Theyachievespeclocalgoalsestablishedbythecommunitybeingserved, suchasreliability,carbonemissionreduction,lowergreenhousegasemission,diverscation ofenergysources,reducethestressonthetransmissionanddistributionsystemandcost reduction.Likethebulkpowergrid,smartmicrogridsgenerate,distribute,andregulatethe wofelectricitytoconsumers,butdosolocally.Smartmicrogridsareanidealwayto integraterenewableresourcesonthecommunitylevelandallowforcustomerparticipation intheelectricityenterprise.Amicrogridiscapableofoperatinginparallelwith,orinde- pendentlyfrom,themaingrid.Theprimarypurposeistoensurereliable,bleenergy securityforprivatehouseholds,commercial,industrialandfederalgovernmentconsumers. Thecoreofamicrogridwillbeoneormoresmallconventionalgenerationassets(e.g.en- ginesorturbines)fuelledbynaturalgas,biomassormethane.Whenconnectedto themaingrid,microgridswillrelyonamixofpowergenerationsourcesdependingonthe metrictobeoptimized.Specializedhardwareandsoftwaresystemscontroltheintegration 7 andmanagementofthemicrogridscomponentsandtheconnectiontotheutility. Amicrogridincludesgeneration,adistributionsystem,consumptionandstorage,and managesthemwithadvancedmonitoring,controlandautomationsystems.Thecritical stepofpursuingamicrogridsolutionisapermanentreductioninconsumption(electricity, waterandgas).Thiswillgivetheconsumernear-termcostsavingsdrivenbymeasured andvconservationmeasures.Afully-developedmicrogridhasthecapabilityof automaticallydisconnectingandoperatingindependentlyfromthemaingrid.Forexample, ifastormdisruptsenergyservicefromthemaingrid,automatedcontrolswillreducenon- criticalloads(selectedlighting,HVACsystems,etc.)andthemicrogridwilldistributepower fromon-sitegenerationandstorageforanextendedperiodoftime.Whenthemaingridis backonline,themicrogridwillautomaticallyreconnect,rechargeenergystorage,andramp downon-sitegenerationasappropriate[10],[12]. Toallthesefunctions,veryoftenMulti-AgentSystems(MAS)areproposedforthe autonomouscontrolofmicrogrids.Thesesystemscanusuallyadaptthestructure ofthegrids.Newalgorithmsandmathematicalmodelscanbedevelopedandtestedforthe controlofamicrogrid. 2.2Multi-AgentSystem TheterminologyofMulti-Agentsystem(MAS)wasoriginallymodeledintheinformation technologyandextendedtoautomation.AMulti-Agentsystemisasystemcomprisingtwo ormoreagentsorintelligentagents.Thesystemdesigner'sintentionsforthesystemcan onlyberealizedbyincludingmultipleintelligentagents,withlocalgoalscorrespondingto sub-partsofthatintention.Suchanagentisgenerallyacomputersystemembeddedto 8 thephysicalsystem,whichiscapabletherebytoperformautonomousactionsandtasks toitsconditionitself.Inourcase,theseautomationcapabilitiescanbeusefulfor theenergysector.Theadvantageisthatthedesiredintelligenceareabletocontrolthe powerworthefrequencyandvoltageandshouldbeabletoworkindependently.Thus, theMulti-Agentsystemconsistsofavarietyofdistributedsoftwareandhardwareunits thatfollowagoalinaworkingenvironment.Furthermore,theyshouldbeprovided withacommunicationstructurethatallowsthemcommunicateandcollaboratewitheach other.Theagentcapturesinformationthroughtheuseofvarioussensors,whichmeasure forexample,currentorvoltageatanode.Ahostoftactuatorsarealsorequired toobtainthedesiredresult.Forexample,theseactuatorscouldpowerelectronic devicesorcontrolinvertersorvoltageregulatedtransformers[14,31]. 2.3AgentCharacteristics TounderstandthebehaviorofaMulti-Agentsystem,therefore,thestatusofeachagent mustbeconsidered.Multi-Agentsystemhasfounditswayintoanumberoftechnologiesand hasbeenwidelyused.Forexample,inintelligence,databases,operatingsystems andcomputernetworksliterature.Althoughthereisnosingleofanagent,all agreethatanagentisessentiallyaspecialsoftwarecomponent.Theagenthas autonomythatprovidesaninteroperableinterfacetoanarbitrarysystemand/orbehaveslike ahumanagent,workingforsomeclientsinpursuitofitsownagenda.Inthespecialcaseofa powernetwork,theseinteroperableinterfacesaresensorsandactuatorsorpowerelectronics, aswellascommunicationbindings.Evenifanagentsystemcanbebasedonasolitary agentworkingwithinanenvironmentandifnecessaryinteractingwithitsusers,usually 9 theyconsistofmultipleagents.Theagentsmayinteractwitheachotherbothindirectly (byactingontheenvironment)ordirectly(viacommunicationandnegotiation).Agents maydecidetocooperateformutualbormaycompetetoservetheirowninterests[15]. Someoftherequiredqualitiesoftheagentsare: Autonomous ,becauseitoperateswithoutthedirectinterventionofhumansorothers andhascontroloveritsactionsandinternalstate. Social ,becauseitcooperateswithotheragentsinordertoachieveitstasks. Reactive ,becauseitperceivesitsenvironmentandrespondsinatimelyfashionto changesthatoccurintheenvironment. Proactive ,becauseitdoesnotsimplyactinresponsetoitsenvironmentbutisableto exhibitgoal-directedbehaviorbytakinginitiative. Mobile ,withtheabilitytotravelbetweentnodesinacomputernetwork. Truthful ,providingthecertaintythatitwillnotdeliberatelycommunicatefalseinfor- mation. Benevolent ,alwaystryingtoperformwhatisaskedofit. Rational ,alwaysactinginordertoachieveitsgoalsandnevertopreventitsgoalsfrom beingachieved,and Learning ,adaptingitselftoitsenvironmentandtothedesiresofitsusers[16]. Thepointsautonomousandsocialareanimportantpartofthisproject.Onlywith functioningcommunicationcananagentbehavesociallyandinteractwithotheragentsina 10 system.Eachoftheagentsinthelaboratoryforthisprojectisindependent.Nevertheless,all agentsshouldbeabletocommunicatewitheachother,whilepreservingmaximumibility. Whencreatingthesoftware,theprincipleoftheMinimumSpanningTreewasusedfor thecommunicationbehavior.Thisideawillbeexplainedinchapter3.4.1,initstheory tounderstandthestepsforasuccessfulconnection.Itbecomesclearthatanyagentcan communicatewitheveryotheragent.Aslongasnocommunicationoccursbetweenthe agentsallstayinasimilarstatus.Thereisnoagentwithahigherranking,likeaparentor masteragentwithspecialproperties. 2.3.1AgentCommunication Anagentiscapableofactinginanenvironment,whichmeansthattheagentchangesits environmentwithitsactions.Forexampleapowerfulsolargenerator,byalteringitspro- ductionchangesthesetpointsofotherunits,andchangesthevoltagelevelintheadjacent buses,andinamoreglobalpointofviewchangesthesecuritylevelofthesystem.It thestabilityofthesystemincaseofashortcircuit. Agentscommunicatewitheachotherandthisispartoftheircapabilityforactinginthe environment.Weconsiderasystemthatincludesawindgeneratorandabatterysystem:the batterysystemreceivessomepowerfromthewindturbinetochargeandtoprovideitback tothesystemintimewithnowind.Inordertoachievethisoperation,thetwoagentshave toexchangeseveralmessages.Thisisatypeofactionbecausetheenvironmentisalteredin atwaythanifthetwoagentswereactingwithoutanykindofcoordination. Agentshaveacertainlevelofautonomy,whichmeansthattheycantakedecisions withoutacentralcontrollerorcommanderandtoachievethat,theyaredrivenbyaset oftendencies.Forabatterysystematendencycouldbe:chargethebatterieswhenthe 11 priceforthekWhislowandthestateofchargeislow,too.Thesystemdecideswhen tostartchargingbasedonitsownrulesandgoalsandnotbyanexternalcommand.In addition,theautonomyofeveryagentisrelatedtotheresourcesthatitpossessesanduses. Theseresourcescouldbetheavailablefuelforadieselgenerator,thebandwidthinthe communicationchannelortheprocessortime.Anothertcharacteristicofagentsis thattheyhaveatbestpartialinformationabouttheenvironment.Forexampleinapower systemtheagentofageneratorknowsonlythevoltagelevelatitsownbusandmaybeitcan estimatewhatishappeninginsomecertainbuses,butitdoesnotknowwhatishappening inthewholesystem.ThisisthecoreoftheMAStheory,sincethegoalistocontrolavery complicatedsystemwithminimumdataexchangeandminimumcomputationaldemands. Finally,anothertcharacteristicofanagentisthatithasacertainbehaviorand tendstosatisfycertainobjectivesusingitsresources,skillsandservices.[17]. 2.4Hardware ThehardwareavailableinERISElaboratorywhichisusedintheprojectisdiscussedinthis chapter.Theagentconsistsofspecialsoftwareinteractingwithahardwarestructure.For everyenvironmentsoftwareandhardwarelooktandarespecializedfortheparticular system.Evenintheenergysectorthereisnosolutionorexistinghardwareframework foranagent.Ourfocuswasoninterfacingtheagenttosimulatedpowersystemforthe informationwandtotesttalgorithmsforpowerwcontrol.Forthisreason weselectedcommercialcomputercomponentstobuildupatestbed.Inaddition,aReal TimePowerSystemSimulator(RTDS)isavailableinthelaboratory.Theestablishment oftheagentsandtheirhardwareandsoftwarespareydiscussedinthe 12 furthersections.Thisprojectmainlyfocusesonthemethodofinterfacingtheagentstothe simulatedpowersystem[32]. 2.4.1RaspberryPi TheRaspberryPiisasmallsizedsingleboardcomputer,whichwasdevelopedbytheRasp- berryPiFoundation.Theboardcontainsessentiallyasingle-chipsystemwithaBroadcom BCM2835700MHzprocessorARM1176JZF-S.Memorycards(SDorMMC)canbeused asanon-volatilememoryorexternalharddrivesandUSBdrivesviatheUSBport. TherecommendedLinuxdistributioniscalledRaspbianandisbasedonDebian.Aspecial Ubuntu distributionisnotavailable,because Ubuntu onlysupportstheARMv7architec- ture[33]. Ubuntu , Raspbian agraphicaluserinterface(GUI).Everyfurtherexplained stepcouldberealizedonbothoperatingsystems. Figure2.1RaspberryPiModelB+512MBRAM,2-USB-PortsundEtherne (www.vesalia.de) 2.4.1.1Programmableinterface TheRaspberryPiprovidesaprogrammableinterface(alsoknownasGPIO:GeneralPurpose Input/Output),LEDs,sensors,anddisplays.TherearesixGPIOports,butgenerallyonly theconnectionP1isused.TheGPIOinterfaceP1consistsof26pins.Ofthesepins17are freeprogrammable,whichalotofspecialfunctions: 13 5pinscanbeusedasSPI-interface. 2pinshave1.8pull-upresistorsandcanbeusedasI 2 C-interface. 2pinscanbeconandusedasUART-interface. TocontroltheGPIOsseverallibrariesformanyprogramminglanguagesexist,andevena controlterminalthroughawebinterfaceispossible.Incomparisontocommerciallyavailable computers,easyconnectionswithadditionalhardware,suchassensorsandpowerelectronics wouldbepossible.Inaddition,thiscouldbeasimplewaytorealizealinktoaRTDS.But, atthistimenofurtherstatementcanbemadeaboutthespeedandtheperformanceofsuch a 2.4.2Real-TimeDigitalSimulator:RTDS Forstudiesandresearchbasedonpowersystem,itwouldberecommendedtosimulateand runthesysteminreal-time.SoftwaresuchasMATLAB,PowerWorldSimulator,ETAP, PSCAD,etc.cansimulateapowersystembutcannotruninrealtimespeed.Forthisreason RTDStechnologiescameupwithasolution,andthatistheRealTimeDigitalSimulator (RTDS).Sincethespeedisinreal-timetheRTDSisnotonlyusedforsimulatingapower systemorafullyfunctionalelectricalgridbutalsoisusedforsystemfailurescenariossuch ascontrolsystemcyberintrusionoraphysicaldamageeventsuchasanaturaldisaster[35]. RTDSconsistsofahardwareunitandasoftwareunit.TheRTDSinERISElaboratory, MichiganStateUniversityisgivenbelowinFig.2.2. TheSoftwareUnit: TheRSCADprovidestheuserinterfaceforthesystem.Thesystemcanbesimulated usingtheRSCAD.ItissimilartoPSCAD.ThePSCADwasalsodevelopedbyRTDS 14 Figure2.2a)FullviewoftheRTDSrack;b)3GPCprocessorunits,1WIFethernet connectioncard,digitalI/O-port;c)ScreenshotofRTDSsoftware"RSCAD" technologies.TheadvantagesofRSCADoverthePSCADisthatRSCADcanbeused forsimulationforrealtimesystems,asonetimestepinthesimulationisequaltosame outoftimeintherealworld.TheRSCADcommunicateswiththehardwareunitover theEthernetcard.ForthesystemsimulatedtheVariousfeaturesprovidedbyRSCAD willbeexplainedinchapter2.5.2 TheHardwareUnit: TheGiga-ProcessorCard(GPC)istheprocessorcardusedtosolvetheequations representingthepowersystemandcontrolsystemcomponentsmodelledwithinthe RTDS.TheRTDScontainthreeGPCcardsandalsocontainsthreePCcards. WIF-TheWorkStationInterfacecardhasthefollowingfunctions: a-CommunicationbetweentheRTDSrackandthecomputerworkstationrunning theRSCADsoftware.CommunicationisoveranEthernetbasedLAN. b-Communicationofdatabetweenprocessorsovertherack'sbackplaneiscoordi- natedbytheWIF. c-WIFperformsself-testsandrunsdiagnosticsonothercardsinstalledinitsrack. 15 GTAO-TheGigabitTransceiverAnalogueOutputCard(GTAO)isusedtointerfaceana- loguesignalsfromtheRTDStoexternaldevices.TheGTAOcardincludestwelve,16bit analogueoutputchannelswithanoutputrangeof 10volts.The16bitDACsprovide awidedynamicrange.Awidedynamicrangeisoftenrequiredwhenprovidingmeasured currentsignalstoprotectiondevices.GTDI-TheGigabitTransceiverDigitalInputCard (GTDI)isusedtointerfacedigitalsignalsfromanexternaldevicetotheRTDS.TheGTDI cardincludes64opticallyisolateddigitalinputchannels.TheGTDIcardhasalsobeen designedtoincludeallthefunctionalityofaDITScard.ThereforetheGTDIcanbeused toreadcriticalpulsesfromanexternalcontroller[36].TheGTDIcardwillsendthe requiredtiminginformationtotheRTDSsoftware.17GTFPI-TheGigabitTransceiver FrontPanelInterface(GTFPI)cardformstheinterfacebetweenthedigitalI/Opaneland theGTportontheGPCcard.TheGTFPIalsoactsastheinterfacetotheGPCcard. 2.5InterfacingSoftware Allthesoftwarethatwasrequiredandusedforbuildingthetestbedisdiscussedinthis chapter.Onlysomepartsoftheagentwereusedduringthisprojectandhence onlythosepartsarediscussedintheagent,section2.3.1ofthischapter. 2.5.1OperatingSystem TheoperatingsysteminwhichtheagentswerebuiltwasLinux.Inthiscaseweusethe Linuxdistribution Ubuntu12.04.LTS(64bit) ,aswellasacontinuouslydevelopinghardware support.Withaspecialtool,itwasconvertedtoabootableversionrunningonaUSB drive.Thehandlingoftheinstallationprocessisstraightforwardandcompletedinashort 16 time.Inthemeantimeweassignedtsystemnamesandpasswordsforeverysingle computer.Forconvenience,thesearedesignatedbyPC1,PC2andsoon,toobtaina simpleoverview.Furthermore,oneachmachineashareddirectorywascreatedinwhich therelevantdataforthetestenvironmentcouldbestored.Thesefoldersaresharedinthe network,whichallowsthecomputertoaccessthedesireddatafromeverysupportedPC. Inordertocreateacomfortabletousesystemfortheuser,someadditionaltoolswere installed.Becauseonlytwooftheecomputersareequippedwithinputandoutput devices,aspecialfocuswasonsettinguparemoteconnection.Moreover,thisshouldassure accessfromtheoutsideoftheuniversitycampus.Abriefsummaryofthesetupstepsfurther softwarecomponentscanbefoundinthefollowingsection. 2.5.1.1RemoteDesktopConnection DuetospaceconstraintsnoteveryPCinstalledintheLabhaditsownmonitor,keyboard andmouse.Hence,theinstallationofaremoteconnectionclientistheonlygoodalternative. SincemostusersworkprimarilywithWindowsoperatingsystems,asolutionhadtobefound whichcanestablishaconnectionbetweenthetwooperatingsystems. Creatingastatichostname UsuallytheIPaddressofacomputeristtoestablishaconnectionwith it.ButsincetheseareconnectedtoaDHCPnetwork,whichdynamicallyallocates theseaddresses,thiscouldleadtocomplications.Thus,MichiganStateUniversity aservicethatcanbeusedtocreatestatichostnames.Itcanbefoundat \https://tiny.egr.msu.edu".TheregisteredhostnamecanbeusedinsteadoftheIP addresstoconnecttoanothercomputer. 17 SetupaconnectionfromoutsideoftheUniversitycampus Toconnectfromoutsideoftheuniversitycampuswiththetestbed,asecureconnection totheserversoftheuniversityhastobeinsured.Thiscanbedonewithafreely availabletoolcalled Putty .Afterafewcstepsaconnectiontotheservers fromanyterminalcanbeestablished.Oncethisisdone,thecomputercandialthe testbedwiththesoftware,`remotedesktopconnection'. ToremotelycontrolWindowsmachines,somepeopleprefertouseRemoteDesktop ProtocolasitperformsbetterthanVNC(VirtualNetworkComputing).VNChas thisstreakof\JPEG"qualityandslowbehavior,whereasRemoteDesktopProtocol isfastandcrystalclear.SinceUbuntu12.10,xRDPdoesnotseemtoworkwiththe Ubuntudesktopanymoreunlessweinstallanduseanalternativedesktopmanager. Forinstance,thedesktopmanagerthathasbeenaroundisXFCE,whichislightweight andfast.XfceisalightweightdesktopenvironmentforUNIX-likeoperatingsystems. Itaimstobefastandlowonsystemresources,whilestillbeingvisuallyappealingand userfriendly[35]. Figure2.3RemoteconnectionfromawindowsoperatingsystemtoUbuntu.Theregistered hostnamewasusedtoaddresstherequiredmachine. 18 2.5.2RSCAD TheRTDSsimulatorhasanadvancedandeasytousegraphicaluserinterface-RSCAD. RSCADiscomprisedofseveralmodulesdesignedtoallowtheusertoperformallofthe necessarystepstoprepareandrunsimulationsandtoanalyzesimulationoutput.The powersystemthatincludesthevariousgenerationunitsandtransmissionlinemodelsand controlcomponentscanbesimulatedusingRSCAD.TheRSCADthatisavailableatERISE laboratoryallowstheuserstocreate18nodes3-phasesystemor54nodes1-phasesystem. RSCADprovides IEEE standardizedmodelsforcreatingthewholepowersystem.The RSCADallowstheusertosimulatethepowersystemusingdraftsheetandtheruntime sheetisusedforcheckingthesystemsresponseduringtherun. 2.5.2.1DraftSheet Fig.2.2cshowsthedraftsheetofRSCADwhichconsistsofthefollowingcomponents: Powersystemcomponents:Thistabprovidesallthenecessarypowersystemcompo- nentsthatarenecessarytosimulateasystem.Thepowersystemscomponentstabcon- tainsnodes,Machinemodels,Transmissionlinemodels,breakermodels,transformer models,seriescompensation,instrumenttransformers,sourcemodels,loadmodelsand valvegroupandSVCmodels. Generatorcontrol:Thistabcontainsfortye IEEE excitermodels,sevengeneric stabilizermodelsandtwentye IEEE governor/turbinemodels.Thesemodelsare usedforthecontrolofthegenerationandthiscanbeinterconnectedwithanyofthe machinemodelsforthepowersystem. Controls:Thistabgivesvariouscontroloptionstartingfromabinaryswitchtosignal generators,logicalcontrollers,andI/Ocomponents.ByusingtheI/Ocomponents 19 signalscanbeoutputtedfromorinputtedtothe RTDS usingtheanalogordigital ports. Protectionandautomation:ThisfeatureinRSCADgivesvariousrelayoperations suchasdistance,overcurrent,directional,tial,etc.Sobysimulatingfaults, alltheoperationoftherelayscouldbechecked.Usuallytherelaytestingisdoneas HardwareInLoop(HIL).Forthistestingitmayrequirecontinuousloopoperation. Forthispurposeascriptfeatureisexplainedindetailinalatersection. Small- dt :Thistabprovidesvariouspowerelectroniccomponentsthatarenecessary forsimulatingnetworkscontainingconverters.Itbecomesusefulinthepowersystem whensolarphotovoltaicpanelsareusedasageneratingunit. 2.5.3RuntimeSheet TheruntimesheetinRSCADallowstheusertocheckthesystematruntime.Itallows theusertochangethevaluesofinputsusingsliders,providesswitchesincaseofbreakers; hencethebreakercanbeopenedorclosedanytimewhilethissystemisrunning.Thisalso providesmetersandplotstocheckthesystemsresponse.Itprovidesthesimulationresults andcontainsthescriptThescriptcanbeprogrammedtoruncontinuousloopsof thesimulationinthecaseofrelaytestingandpowersystemautomation. 2.5.3.1ScriptFile ThescriptisbasicallyaprogrammablesimilartotheMATLABcommandwindow. ThesystemoperationcanbecontrolledusingthescriptTheadvantageofusingascript isthatincaseoftestingarelay,theprotectionschemesarechangedeverytimeandrelay istestedforvariousvalues.Thisoperationrequiresanoperatororausertoperformallthese 20 functionswhereitwillbequitetediousandtimeconsuming.Henceinthiscasethescript isprogrammedtorecordalltheoperationnecessaryforthesystemforonetimeandis allowedtoperformtestingforvariousschemesandvariousvaluesbyrunningincontinuous loops.Thiswillmakesurenooperatorassistanceisrequired.Thisisnotonlyincaseof relaytesting,thisscriptwasthemaininterfacingmethodinthisproject.Thedetailsof theprogrammingofthescriptwillbediscussedinchapter4. 21 Chapter3 DistributedPowerBalanceControl andVoltageandFrequency Regulation Traditionalenergysupplygridsarecurrentlysubjecttoamajortransformation.Theinte- grationofrenewableenergysources,andtheliberalizationoftheenergymarkets,therefore, requireelementaryoperationsinthestillpredominantlyclassicalstructureoftheexisting powergridsinmostcountries,theconversionandpartialautomationofthemiddleand low-voltagedistributiongridisamajorchallenge.Itisplannedtoproduceupto80%ofthe energyonthebasisofrenewableenergysourcesinthefuture[13]. Thefutureofenergyisvolatile:itnotonlyinvolveshighperformancepowersources (e.g.wind,solar),butalsomodelconsumers,suchasheatpumps,airconditioners,electric vehicles.Tomaintaintherequiredguidelinesforvoltagestabilityandfrequencystability, itisessentialtoalignproductionandconsumptiontogether.However;duetothevolatile, generationcapacityrequiresagrid,whichhasalevelofautomationthatallowstoobserve thetechnicalregulations.Thereforeanintelligenceisrequired,whichmostlyau- tonomouslyperformstherequiredprocesses.Torealizethis,thereisalreadyawidevariety ofideasandapproaches.InthispaperthepossibilityofusingMulti-Agentsystemswillbe 22 introduced.Reference[21,22]sharesimilarshortcomingsaschapter3.Toovercomethe mentioneddrawbacks,thischaptershowsadistributedMulti-Agentbasedpowerwalgo- rithm,inwhicheachagenthasitslocalpowerwequationandupdatesstateinformation simultaneouslywithlimiteddatafromtheirimmediateneighbors.Reference[38]showsa distributedpowerwalgorithmforMulti-Agentplatform;However,itsalgorithmupdates stateinformationsequentiallyfromoneagenttoanother,whichlimitsitsspeed,especiallyin Multi-Agentframework,wherecommunicationspeedratherthancomputationspeedisthe bottleneckthatrestrictsthespeedofalgorithm.Thedistributedpowerwalgorithmpro- posedinthischapterfullymakesuseofcommunicationtime,andupdatesstateinformation synchronouslyamongagents,whichconsiderablespeedadvantage.Basedonthepro- posedpowerwalgorithm,thischapteralsoshowsthatrealandreactiveunbalancedpower canbecalculatedatslacknode.Thisnetpoweracquisitionisimplementedfullydistributed; therefore,itprovidesapossiblesolutionfordistributedloadsheddingorrestoration. Generalequationsforthree-phasenetworkdevicessuchastransmissionlines,transform- ersandvoltageregulatorscanbefoundin[19].Theseequationscanbecombinedand convertedtocomplexpowerequationsthatrepresentpowerbalanceoneveryphaseatevery businthenetwork.Theaveragepowerbalanceandreactivepowerbalanceequationsfor everyphaseateverybuscanbewrittenasfollows: P m = j V j n X i =1 j Y mn jj V n j cos( \ j V m j \ j V n j \ j V mn j )(3.1) Q m = j V j n X i =1 j Y mn jj V n j sin( \ j V m j \ j V n j \ j V mn j )(3.2) where n isthetotalnumberofbusesinthedistributionsystem m =1 ; 2 ;:::;n; istheindex 23 usedtorepresenteveryphaseateverybus; Pm;Qm aretheaverageandreactivepower, respectively,injectedintoaphaseatabus; j V m j isthephasorrepresentationofthesinusoidal voltageonaphaseatabus; j V mn j istheadmittancebetweenonephaseandanotherphase atthesameoratbus; j : j denotesthemagnitudeofacomplexquantity;and \ denotesthephaseangleofacomplexquantity. 3.1DistributionNetworkModelandPowerBalance Incrementedrenewableenergygenerationandexcludinghydropower,holds23%percentsof thegrowthinelectricitygenerationfrom2009to2035[18].Highpenetrationofrenewable energypresentsachallengetotheconventionalpowersystembyintroducingproblemsas energymanagementandcontrol,frequencyandlocalvoltagevariation.Micro- grids,assystematicorganizationofdistributedgenerators(DG),intermediatestorages,and loads,showmorecapacityandcontrolitytoaccommodatetheserenewablesources aswellasotherdistributedgenerators,intherangeofafewtensofkW,totly improvetheirreliabilityandbetterdeliverpowerclosetocustomerloads. Here,theimplementsofparentandchildcontrolstrategyisshowedtoorganizethe interfaceddistributiongenerators(DGs)inthemicrogrids.ADGwithlargestcapacity servesasavoltagesourceandprovidesvoltagesupportformicrogrids.OtherDGsare controlledascurrentsources.SincethevoltagemagnitudeisdeterminedbyparentDGand microgridation,therealandreactivepoweroutputsofparentDGsareadjustedby controllingtheircurrentoutput. HierarchicalcontrolstructureformicrogridsisdisplayedinFig.3.1.Theupperde- centralizedMulti-Agentlayercouldrealizepowerbalanceandeconomicdispatchcontrol. 24 Localcontrollers,inresponsetothepowercommandsrequiredbyMAS,regulatelocalDGs realandreactivepoweroutput.Thiscontrolstrategybtsfromsimplerealizationand reliableoperationforinterfacedmicrogrids[29]. Figure3.1Hierarchicalcontrolstructureofmicrogrids 3.2FrequencyDroopControlinaMicrogrid Forpowersystemsbasedonrotatinggenerators,frequencyandactivepowerarecloselyin- terconnected.Aloadincreaseimpliesthattheloadtorqueincreaseswithoutacorresponding increaseintheprimemovertorque,whichmeansthattherotationalspeed,anddirectlythe frequency,decreases.Theslowingoffrequencywithincreasedloadiswhatadroopcontrol istryingtoachieveinacontrolledandstablemanner.Thetransmissionlineismodeledin Fig.3.2asan RL circuitwiththevoltagesattheterminalsofthelinebeingheldconstant. 25 Theequivalenttransmissionlinemodelchangesbasedonthephysicallinelength.For ashortline(lessthan50miles),weonlyconsidertheseriesparametersandignorethe shuntparameters.Formediumlengthlines(greaterthan50milesbutlessthan120miles), thecapacitanceofthelinebecomestenoughthatitimpactsthesendingendand receivingendvoltagesandcurrents;therefore,itisincludedasshuntcomponentsinthe equivalentlinemodel.Theequivalent ˇ circuitisgenerallyusedwhenmodelingmedium lengthtransmissionlines.Inlonglines(greaterthan120miles),thedistributedofthe parametersbecomet,andthelinemustberepresentedbytheequivalent ˇ circuit. Alternatively,thelinemayberepresentedbysmallercascadedsections,whereeachsection isrepresentedbyanequivalent ˇ circuit,similartotheoneusedforamediumlengthline. Here,foreaseandtoshowhowthepowerangledependsontherealpowerandthevoltage dependsonthereactivepower,theshuntbranchesdidnotconsider[19]. Figure3.2PowerFlowingthroughaLine Thepowerwingintoapowerlineattheterminalisdescribedbytheequation S = P + jQ = V I = V 1 V 1 V 2 Z ! = V 1 V 1 V 2 e j Ze j ! = V 1 2 Z e j V 1 V 2 Z e j ( + ) (3.3) UsingEuler'sformulatoseparatethetotalpowerintorealandimaginarycomponentsgives 26 therealandreactivepowerwingthroughthelinetobe P = V 1 2 Z cos V 1 V 2 Z cos( + )(3.4) Q = V 1 2 Z sin V 1 V 2 Z sin( + )(3.5) Furtherthelineimpedancetobe Ze j = R + jX ,theequationscanbewrittenas P = V 1 X 2 + R 2 [ RV 1 V 2 cos + V 2 X sin ](3.6) Q = V 1 X 2 + R 2 [ XV 1 V 2 cos RV 2 X sin ](3.7) Typicaltransmissionlinesaremodeledwiththeinductancebeingmuchgreaterthanthe resistancesotheresistanceiscommonlyneglected.Theequationscanthenbewrittenas thewellknownequations P = V 1 V 2 X sin (3.8) Q = V 1 2 X V 1 V 2 X cos (3.9) Ifthepowerangle issmall,thenthesmallangleformulacanbeusedsothatsin = and cos =1.Simplifyingandrewritingtheequationsgives ˘ = XP V 1 V 2 (3.10) V 1 V 2 ˘ = XQ V 1 (3.11) Equations3.10-3.11showthatthepowerangledependsheavilyontherealpowerandthe voltagedependsonthereactivepower.Statedtly,iftherealpowercanbe 27 controlled,thensocanthepowerangle,andifthereactivepowercanberegulated,thenthe voltage V 1 willbecontrollableaswell.Inthedroopmethod,eachunitusesthefrequency, insteadofthepowerangleorphaseangle,tocontroltheactivepowerwssincetheunitsdo notknowtheinitialphasevaluesoftheotherunitsinthestandalonesystem.Byregulating therealandreactivepowerowsthroughapowersystem,thevoltageandfrequencycanbe determined.Thisobservationleadstothecommondroopcontrolequations f = f 0 k p P P 0 (3.12) V 1 = V 0 k v Q Q 0 (3.13) where f 0 and V 0 arethebasefrequencyandvoltagerespectively,and P 0 and Q 0 arethe temporarysetpointsfortherealandreactivepowerofthemachine.Thetypicaldroop controlcharacteristicplotsareshowninFig.3.3.Fromthedroopequationsandhighlighted Figure3.3DroopControlCharacteristicPlots byFig.3.3,astherealpowerloadonthesystemincreases,thedroopcontrolschemewill allowthesystemfrequencytodecrease.Inthedroopcontrol,itshouldbenotedthatthe droopmethodhastheinherentbetweentheactivepowersharingandthefrequency 28 accuracy,resultinginthefrequencydeviatingfromthenominalfrequency[27].Ifanactive powercontrollerisbuilttoincludeafrequencyrestorationloop,thecontrollerisanalogousto anenginegovernor.Enginesareequippedwithgovernorstolimittheenginetoamaximum safespeedwhenunloadedandtomaintainarelativelyconstantspeeddespitechangesin loading.Astheloadvaries,thespeedmaydroopbutoveraperiodoftimewillreturntoits nominalspeed. 3.3VoltageRegulatedDistributionTransformer (VRDT) Theintegrationofmechanismsforautomatingthedistributionnetworkpresentsaparticular challengebecausetheyhavetobeintegratedintoexistingstructures.Theuseofaregulated transformerincooperationwithaMulti-Agentsystemis,therefore,ausefulsolutionto maintainthevoltagestabilityinagrid.WiththelocalVoltageRegulatedDistribution TransformerVRDTalargervoltagebandwidthcanbeutilized.Itadjuststhesecondary voltageofasysteminseveralsteps.Thesestagescanforexamplebeamountedto2.5%of thesecondaryvoltage.With9steps,upto-10%ofthevoltagecanbecompensated. Fortheregulationofthevoltagerangeandtoincreasethesupplyofpower,connectingaMAS openscompletelynewpossibilities[28].Severalagentscantakethevoltagemeasurement acrossthegridandinduceacontrolinterventionoftheagentsinstalledonVRDTinexcess oftheprescribedlimits,sothecorrectionalgorithmstepscontrolareshownlaterinthis chapter. InFig.3.4apossibleexamplegridispresented.Allagentsmonitorthevoltagelevels ontheirnodes.Agent6isconnectedtoaVoltageRegulatedDistributionTransformer 29 (VRDT)andcanthesecondaryvoltage.Theagents1,3and4areconnectedto thepowerelectronicoftrenewablegenerators.Theycanadjusttherealandreactive powerofthegenerators.IftheMASdetectsacriticalpowerstate,thenarecommendation forcorrectionofthesystemstatecanbecalculated.Thecorrectionisperformedbyan algorithmwhichusesathree-stepcontrolmethodinforce:AttheVRDTsandother voltageregulators,likeseriesregulators,areinvolved.Inthesecondstage,theactuators ofrenewablegenerationsystemsarecontrolledfortargetedcontrolofreactivepower.For this,thepowerfactor cos' oftheplantcouldbeadjusted,whichhasanonthe localvoltageandcantheresult.Thethirdstageshouldbetheshortestperiod possible.Asalastresorttherealpowercouldbereduced,however,foreconomicreasons itisnotadvisable[20].Duringdisturbances,thegenerationandcorrespondingloadscan Figure3.4Exampleforagridandthepositionofagents autonomouslydisconnectfromthedistributionsystemtoisolatetheloadofthemicrogrid 30 fromthedisturbancewithoutdamagingtheintegrityofthetransmissiongrid.Thismode iscalledislandingmode.Fromthepointofviewofthecustomer,itcanbeseenasa lowvoltagedistributionservicewithadditionalfeatureslikeanincreaseinlocalreliability, theimprovementofvoltageandpowerquality,thereductionofemissions,adecreasein thecostofenergysupply,etc.Amicrogridusuallyconnectedtothedistributionnetwork throughasinglePointofCommonCoupling(PCC)andappearsasasingleunittothe powertransmissionnetwork.Powerelectronicswillbeacrucialfeatureformicrogridssince mostofthepowermicro-sourcesmustbeelectronicallycontrolledtogainthecharacteristics requiredofthesystem.Themicrogridisthereforenotonlyamoreorlessautonomouspart ofthepowersystem,butalsohastobeasmartsystemitself.Ithastobeabletocopewith multipleissues,asdescribedbelow. Asmentionedbefore,inthelastyears,thetermsmartgridhasbecomewidespreadinthe (renewable)energysector.Theintroductionofsmartgridsinvolvesachangefrommanual operationstowardsanintelligent,informationandcommunicationstechnology(ICT)-based andcontrollednetwork.Thesechangeswillespeciallythedistributiongrid,andinthis way,microgrids[23].Becauseofthechallengesfacingtheimplementationsofmicrogrids, theyhavetobeseenimplicitlyassmartgrids. 1)Microgridarchitecture:First,thettypesofmicrogridswillbedescribed.In [24],fourclassesofmicrogridsareidenintermsoftheirarchitecture. Singlefacilitymicrogrids:Thesemicrogridsincludeinstallationssuchasindustrialand commercial,residentialbuildingsandhospitals,withloadstypicallyunder2MW. Multiplefacilitymicrogrids:Thiscategoryincludesmicrogridsspanningmultiple buildingsorstructures,withloadstypicallyrangingbetween2and5MW.Exam- 31 plesincludecampuses(medical,academic,municipal,etc),militarybases,industrial andcommercialcomplexesandbuildingresidentialdevelopments. Feedermicrogrids:Thefeedermicrogridmanagesthegenerationand/orloadofall entitieswithinadistributionfeeder,whichcanencompass5-10MW.Thesemicrogrids mayincorporatesmallermicrogridssingleormultiplefacilitywithinthem. Substationmicrogrids:Thesubstationmicrogridmanagesthegenerationand/orload ofallentitiesconnectedtoadistributionsubstation,whichcanencompass5-10+ MW.Fig.3.5showsaMicrogridsystemwithitfeeders.Thepowerofeachfeeder whichwsfrommicrogridintoPCChasrelationtotheoutputsofDGandfeatures ofloadsinmicrogrid.Forexample,theoutputofPV(photovoltaicgeneration)is bysunshineintensityandseasonalvariation.Therefore,itisafunctionof timeandindirectproportionwithsunshineintensity.Whereas,theoutputofwind powergenerationchangesovertimeduetotherandomnessofthewind. 2)Microgridcontrol:Concerningthecontrolofmicrogrids,directcontroloverlocaldis- tributionandtransmissionofelectricityfromtheinterconnectpointacrossafacilityis averycommonpractice.Electricitygridsareevolvingtowardsintelligent,truecomplex computersystems,withcontrolledpowerwssupportedbyadvancedinforma- tiontechnology[25,26].Underthenewsmartgridparadigmthatemergedinthelast decade,newcapabilitiesformeasurement,controlandcommunication,withatwo-way wofenergyandinformationbetweencustomerandsupplier,areneeded,inorderto increaseandachievecleanerelectricitygeneration. Someofthenewoperationalmeasurementandcontrolcapabilitiesthatareneededto managesmartgridsare: 32 Figure3.5MicrogridschemewithVRDT 1)network-basedcommunicationandcontrol2)monitoringofenergygenerationand consumption3)optimizationofproductionandconsumption4)generationandload dispatching5)energyproductionandconsumptioncontrol6)tielinecontrol7)micro- gridactiveandreactivepowercontrol8)microgridconnectionandislandingcontrol9) securitystandards10)user-basedbilling. Someofthekeytechnicalissuesnotentirelysolvedatpresentare: 1)real-timepowerwbalancing2)voltagecontrolandsecurityduringdisconnection (islanding)fromthePCC3)failureprotocolresponseprotectionandstabilityaspects 4)dynamicshort-andlong-termresponse5)activeandreactivepowercontrol6)com- municationtechnologyadaptation7)tielinecontrol. 33 3.3.1CauseoftVoltagePotentials Electricpotentialisalocation-dependentquantitythatexpressestheamountofpotential energyatasplocation.ThisrelationisshowninFig.3.6,thecompleterepresentation ofaline. Figure3.6Completerepresentationofaline I m isthecurrentwingthroughthesupplyend. I n isthecurrentwingthroughthereceivingendofthecircuit. I qm and I qn arethevaluesofcurrentswingthroughtheadmittances. ByapplyingKVLtothecircuit,weget V m = V n + Z mn :I qn + Z mn : ( I n )(3.14) ( I n ) :Z mn = V m V n Z mn :I qn (3.15) I n = V m V n Z mn :I qn Z mn ! (3.16) I n = V m V n Z mn I qn ! (3.17) 34 I n = V m + V n Z mn + I qn ! (3.18) Hencefor3-phasetheequation3.18willbe: I n = S n 3 :V n (3.19) = ) S n =3 :V n :I n (3.20) = ) V m = V n + Z mn :I qn + Z mn 3 :V n : ( P n ) j: Z mn 3 :V n : ( Q n )(3.21) Equation(3.21)istheresultof(3.14)through(3.20). Wecanseethatforrealandreactivepowerchanges,ithasaninonthevoltage. Whenfeedingreactiveorrealpower,thismeansthatthevoltageincreases.Thisoccurs everywhereinthegrid,wherewehaveapowerw.Thismeans,thattheconsumersand producersinangridhaveanonthevoltagesattheseveralnodesinthegrid.Though, criticalstatescanappear.Thus,inFig.3.6,itcanbeseenthatthetransmissionsystemin additiontotheresistivepowerlossesalsothepowerfactor,whichcausesto thevoltage.Adistributiongridismadeupofseveraloftheseequivalentcircuits.Between eachnodeinthenetworkyoucananconstellationasshowninFig.3.6.Therefore,the respectivevoltagevariesfromnodetonode.Thiscanappearespeciallyatnodestowhich e.g.largeamountsofenergyarefedbyaphotovoltaicsystem,leadingtoexcessivestresses. Thesecriticalpointsneedtobemonitored,forwhichanagentcanbeused.also,weknow alocalpowerwequationforagentmis(3.22) S m = V m I m = V m 2 4 N X n =1 Y mn V n 3 5 (3.22) 35 where S m isthecomplexpowerinputtonodem; V m isthevoltagevectoratnode m ; I m isthecurrentinputintonode m . Y mn isbuiltfollowingprinciplesofsection3.3.1.Rewrite thisequation: V m = 1 Y mm 2 6 6 4 S m V m N X n =1 n 6 = m Y mn V n 3 7 7 5 (3.23) where,m=2,3,...,N From(3.23), Y mn =0,ifagentnisnotaneighborofagent m .Thenweobtain: V m = 1 Y mm 2 4 S m V m X n 2 N ( m ) Y mn V n 3 5 (3.24) where, N ( m )isasetofagentsthatareneighborsofagent m . Tosolvepowerw,Gaussmethodisadopted.fromtraditionalGauss-based powerw,inthisMulti-Agentframework,eachagentsolvesitsownnodalpowerw locallybyexchangingtherequireddatawithitsneighbors.Writingthelocalpowerw equationusingtheiterativeformofGaussmethod,weget: V ( k +1) m = 1 Y mm 2 4 S ( k ) m V ( k ) m X n 2 N ( m ) Y mn V ( k ) n 3 5 (3.25) where, k istheiterationnumber. Thelocalpowerwequation(3.25)showsthateachagentonlyneedstoexchangewith itsneighborsthevoltagevaluesfromthelastiterationinordertoupdatevoltagedatain itslocalcalculation.Itdoesnotneedsystemglobalinformationorinformationbeyondits neighborstocalculateitslocalpowerw. Now,ifnode m isaPVnode,thenithastoestimate Q m : 36 Q ( k +1) m =Im 2 4 V ( k ) m X n 2 N ( m ) Y mn V ( k ) n + V ( k ) m Y mm V ( k ) m 3 5 (3.26) where Q ( k +1) m isthereactivepowerneededtomaintainpre-spcvoltagemagnitudeinthe ( k +1) th iteration.Thenitupdatesthevoltage: V ( k +1) 0 m = 1 Y mm 2 4 P m jQ ( k +1) m V ( k ) m X n 2 N ( m ) Y mn V ( k ) n 3 5 (3.27) V ( k +1) m = V ( k +1) 0 m 2 6 6 4 V m V ( k +1) 0 m 3 7 7 5 (3.28) If Q ( k +1) m Q max m ,then Q ( k +1) m = Q max m .If Q ( k +1) m Q min m ,then Q ( k +1) m = Q min m . Thismeansthegeneratordoesnothaveenoughreactivepowercapacitytofurthermaintain voltagemagnitude.SothenodechangestoaPQnode,andvoltagemagnitudewillvary. Voltageupdateisnowupdatedby(3.29). V ( k +1) m = 1 Y mm 2 4 P m jQ ( k +1) m V ( k ) m X n 2 N ( m ) Y mn V ( k ) n 3 5 (3.29) DistributedConstructionof Y bus Conventionally,toperformpowerw,weneedtobuildthebusadmittance matrix, Y bus ,whichcontainssystemstructureandadmittanceinformation.InMulti- Agentbasedpowerw,westillneedsysteminformationforpowerwcalculation. However,thisapproachfromtraditionalcentrallycomputationalmethod,inthis distributedbasedframework, Y bus isconstructedlocally.Eachagentonlyobtainpart of Y bus information.Theconstructionprincipleisshownbelow: 37 Foragenti,itconstructs i th rowof Y bus matrix: Y i =[ Y i 1 Y i 2 :::Y iN ] (3.30) Y ii = N X n =1 y in (3.31) Y in = y in when( n 6 = i ) (3.32) where, Y i isthesystemparametersconstructedbyagentiforpowerwcalculation; Y ii isthe i th elementof Y i ; Y in isthe n th elementof Y i ,whenn 6 =i. y ii representsequivalent admittancebetweenbusiandground. y in whenn 6 =i,isequivalentadmittancebetween busiandbusn. Recallthatin Y bus matrix,ifbusiandbusnarenotconnected, Y in = y in =0.Since neighborhoodisdeterminedbyelectricalconnection,italsomeansifagentiandagent narenotneighbors,then Y in =0,expressedin(3.33). Y in =0if( n= 2 N ( i )) (3.33) where, N ( i )isasetofagentsthatareneighborsofagent i . Constructionprinciplesbasedonequation(3.30)-(3.33)showsthatalltheinformation requiredtobuildsystemparametersbyagentiare y in ,where n =1 ; 2 ;:::;N .Agent i canobtaintheseparameterslocallywithoutglobalinformation. 38 3.4StepsofVoltageRegulation Asdescribedin3.3.1,therearethreelevelsofescalation,toregulatethevoltageonthe network.Eachagentknowsitsownlocalthusitcanmakeacontributionto oneofthestepsexplainedbelow.Thisiscalledacodeword,whichistransmittedthrough theinformationchanneltoeachagent: Step1: VC (voltagecontrol) Step2: QC (reactivepowercontrol) step3: RC (realpowercontrol) Forexample,theagentconnectedtotheVRDTcanbeusedforvoltagecontrol(VC). Figure3.7Processdescribingthedevlopmentofthevector V 39 Anotheragentconnectedtoaninvertedofaphotovoltaicsystemcouldthe powerelectronicoftheinverterandadjusttherealandreactivepower(RC,QC).Inthis case,agent1,whichhasdetectedthecriticalvoltage,calculatestherequiredvoltage adjustment:WithaVRDT,whichcanadjustthesecondaryvoltage-10%,thesecondary voltageofthetransformercanberegulatedasfollows: V VRDT ;max =1 : 1p.u V VRDT ;min =0 : 9p.u V corr isthebetweenthehighestandthelowestvalueofanodeinthegrid.The valueistransmittedwithacommandtoadjustthevoltage.Dependingonthevoltageat thenodeofthestartingagent,whichhasdetectedthecriticalvoltage,itcanbepositiveor negative.Ifthevoltageistoohigh, V corr < 0,otherwise V corr > 0. If V agent > 1 then V corr = V ;min V ;max else V corr = V ;max V ;min Figure3.8Exampleoftheinformationw,whichtransportsthehighestandlowestvoltage ofanodetotheagent 40 A-Step1:VoltageControl Nowagent1sendsthecommand VC [ V corr ]totheotherchildagents.Theysenditto theirchildagentsasshownintheinformationw.Thiscommandisnowprocessed bytheagentsthatcanmakeavoltagecontrolovertheirconnectedactuator.Thisis generallyonlytheagentwhichiscoupledtotheVRDT.Thisoneprocessestherequest. Dependingon VC [ V corr ]thevoltagewillbechanged.Thentheprocessbeginsagainto detectthevoltagelevelinthenetwork.Agent1receivesanewviewofthesituation. B-Step2:ReactivePowerControl Agent1cannowrecalculate V corr basedonthenewinformation.Afterthis,itsendsthe QC [ V corr ]commandtoallchildagents,whichinturnpassiton.Allchild-agents,which areabletoreactivepower,dosonowaspartoftheirlocalconditions.They trytoadjustthelocalvoltagebyabsorptionorinjectionofreactivepower.Forthis, theyconsiderthevalue V corr andpossibilitiesoftheirownsystem.Thentheprocess beginsagaintodetectthevoltagelevelinthenetwork.Agent1receivesanewviewof thesituation. C-Step3:RealPowerControl Step3isanalogoustostep2.However,inthiscase,thecallforrealpowercontrolby agent1isstartedwiththecommand RC [ V corr ].Thisisconsideredasalastresort,so thelastpossibilitywhichcanbeusedispossibleonlyinexceptionalcircumstancesand forshortperiodsoftime.Considering3.4withsixconsumersandthreegenerators forrenewableenergy,wecanmakesomecalculationsanddothesimulation.Theseare photovoltaicsystems.Eachofthesesystemshasthepossibilitytoproduceinductiveor capacitivereactivepower.Thepowerfactorofthegeneratorsisatmostcos( ' )=0 : 9. 41 Table3.1PowerValueatEachBusoftheSystem Node Load Generator P(KW) Q(KVar) P(KW) Q(KVar) 2 10 0 0 0 3 10 0 150 max 73 4 10 0 0 0 5 10 0 200 max 97 6 100 50 0 0 7 5 0 300 max 145 ThepowervaluesofthetconsumersandgeneratorsareinTable3.1. Parametersforsimulation: R =0 : 202 = km ;X =0085 = km TheusedVRDTcanadjustthesecondaryvoltage-10%: V VRDT =0 : 9 :::; 1 : 1p.u:ThedistancesbetweentheseveralnodesareshowninFig. 3.9,togetherwiththeassumedloadsandgeneratorpowers.Inthiscase,itcouldbeasmall sub-areaofalow-voltagenetworkinaruralarea.Veryoftenlargephotovoltaicsystems andindustrialunitscanbefoundontheoutskirtsofvillages.Inthiscaseitservesonlyas anexampletopresentthemainideaandtoshowtheofeachregulationstep. RegulationProcess: Afteragent1hasdetectedaviolationofthepermissiblevoltage,theinformationw describedinchapter3.4.1takesplace.InFig.3.9theunregulatedvoltageisgivenforevery node,beforetheintervention.Tomaintainthestabilityofthegridandtokeeptherequired voltagebandwidth,allofthe3stepswillbeperformed. 42 Figure3.9gurationofthegrid 1)Step1:VoltageControl: V agent 1 > 1 : 2 p:u ) V corr = V ;min V ;max ) V corr < 0 : 2 pu InthiscasetheVRDTallowsamaximumvoltagereductionof0 : 1 p:u . ) V VRDT =0 : 9 pu TheresultcanbelookedupinFig.3.10Theremainingcanonlybecompen- satedbythesteps2and3. 2)Step2:ReactivePowerControl:Alloftheshowngeneratorscanadjustthereactive power.Aftertheinjectionofmaximumreactivepowertheycanhandle,thevoltagein thegridisreducedagain. G 1=73kVAR, G 2=97kVAR, G 3=145kVAR, 43 Figure3.10Thediagrammshowstheoftheseveralstepsonthevoltageateach node. 3)Step3:RealPowerControl:Inthiscaseweshowaworstcasescenario.Thus,the realpowerofthegeneratoratnode7isscaleddown: P =250kW Becauseofthis,thereactivepowerofthisgeneratordecreasesalittle: Q =121kVAR 3.4.1CommunicationStructure: Toexplainthetheorypresentedhere,itisnecessarytoprovidesomeThe agentthatisprocessingsysteminformationatagivenpointoftimeiscalledthecurrent agent.Ifagent1transmitsinformationtoagent2,thenagent1iscalledagent2'sparent agent,andagent2iscalledagent1'schildagent[29]. 1)DiscoveryofaMinimalSpanningTree: Theagentsthatwereestablishedweredevelopedwithaworkingcommunicationstruc- tureforannumberofagents.InthissectiontheDiscoveryofaMinimal SpanningTreeisexplained.Thisapproachformedthetheoryforthefurtherstepsinthis project.Thedevelopedsoftwareeverystepwhichisdescribedinthissection. 44 View,eitherlocalorglobal,isanagent'sknowledgeofsysteminformation.Thisin- formationconsistsofmaximumrealandreactivepowergenerationcapacity P G , Q G , dispatchablerealandreactivepowergenerationcapacity P DG , Q DG ,vitalrealandreac- tiveloaddemand P v , Q v ,andnon-vitalrealandreactiveloaddemand P nv , Q nv . View ismathematicallyasa vectoru . u =[ u 1 ;u 2 ;u 3 ;u 4 ;u 5 ;u 6 ;u 7 ;u 8 ]=[ P G ;Q G ;P SG ;Q SG ;P v ;Q v ;P nv ;Q nv ](3.34) ThisprocessisintendedtoorganizethedecentralizedMulti-Agentsystemandsteerthe wofinformation.Intheproposedmethod,therearethreebasicrequirementsthat mustbemetinordertotlyachievethediscoveryofpowerinformationinthe decentralizedmicrogrid.First,acommunicationprotocolshouldbedetoconduct informationwinamannerthatallthenodesinthesystemarespanned.Second, thisprotocolshouldbedesignedtoroutetheinformationwthateverynodereceives andprocessesinformationonlyonce.Finally,realtimecontrolofaMulti-Agentsystem requiresthisprotocoltobeabletodiscoversysteminformationinparallel,sothatitcan quicklyreacttothedisturbanceinthesystem.Towardmeetingtheaboverequirements, aminimalspanningtreeisconstructedThisprocessisexecutedasfollows: (a)Atokenisgeneratedbyastartingagent. (b)Everyagentwhichreceivesthetoken,memorizesitsparentagentID,thenittransmits thetokentoallofitsotherneighbors,andstoresitschildagentsIDs. (c)Anyagent,whoreceivesmultipletokenssimultaneously,keepsoneanddiscardsothers. Atthesametime,itremoveschild-parentrelationshipswiththosewhosetokensare discarded. 45 Figure3.11(a)Tokentransmissionrouteandremovedredundancybetweenagent3and5. (b)Minimalspanningtreeconstructed.(c)Informationwpathforstage2. Table3.2ParentChildRelationshipDiagram Agent 1 2 3 4 5 6 7 8 9 10 ParentID - 1 2 2 4 5 3 7 8 9 ChildID 2 3,4 7 5 6 - 8 9 10 - Todemonstratethisalgorithm,considertheexampleshowninFig.3.11.Sinceallagents areidentical,thestartingagentcanbeselectedrandomly.Inthiscase,letussimply chooseoneagentasastartingagent.Initially,agent1generatesatokenandtransmits ittoagent2.Thenagent2receivesthetokenandsendsittoitsneighbors,agent3and agent4,andagent6whichwilldiscardthistoken.Afterthat,agent3sendsthetoken toitsneighbors,agent7,thenagent7willsendtokentoagent8andagent6whichnow discardoneofthetoken,agent8willsendthetokentoitneighborsagent9andagent 10.Inparallel,agent4willsendthetokentoagent5,theagent5willsendthetoken toagent6andagent10whichwilldiscardanyextratokensandsoon.Letusassumeit discardsthetokencomingfromagent5,therebyremovingaredundancyininformation w.Finally,thetokenwillwfromagent5toagent6.Atthispoint,alloftheagents inthesystemhavebeendiscovered.Duringthisprocess,allagentswanttostoretheir 46 parentagentandchildagentIDs.TheirrelationshipsareshowninTable3.2.Fig.3.11 (a)and(b)depictthetransmissionpathofthetokenandtheminimalspanningtree establishedbystage1[29,30]. 2)InformationandFeedbackProcess:WheninformationwpathisestablishedinStruc- tureConstructionProcess,thisstepisintendedtocollectsystemgenerationandload data.Itsalgorithmcouldbestatedasfollows: (a)Agentswhohavenootherneighborsorreceiveallrefuseinformationfromother neighbors,respondtheirparentagentswithlocalviewofthesystem. (b)Agentswhoreceivesystemviewinformationfromalltheirchildagents,processthese databasedon(3.35)andtransmitupdatedviewinformationtotheirparentagents. S t = S local t + X i 2 ˚ S i t ;t 2f G;DG;v;nv g (3.35) where S t iscurrentagent'supdatedview; S local t iscurrentagent'slocalview; ˚ istheset ofchildIDs; S i t ischildagents'updatedview. InformationFeedbackProcessensuresthateachlocalnodeviewinformationwsback fromchildagenttoitsparentagent.Atlast,thestartingagentcouldobtainsystemglobal viewandcalculatesnetpowerbasedon(3.36).Fig.3.11(c)showstheinformationw pathofInformationFeedbackProcess. S net = S G + S DG S v S nv (3.36) where S net issystemnetpower; S G , S DG , S v , S nv areelementsofstartingagent's 47 updatedview.Oncetheinformationwpathisestablishedinstage1,thenextstep isdesignedtocollectthetsystemvoltages.Ifnootheragentsarediscovered,all childagentssendthefollowinginformationtotheirparentagents.Thedirectionofthe informationwisshowninFig.3.11(c) V agent :voltageatthenodeoftheagent V =[ V max ;V min ]:vectorofthehighestandlowestvoltagereceivedbyunit.Fig.3.7 describesthedevelopmentofthevector V .Itisshownthattherespondingagent sendsthevector V =[ V agent ;V agent ],becauseitdidnotreceiveanyotherinformation. Fig.3.8showsthe7agentsarelisted,whichhaveestablishedacommunicationstructure. Startingfromthelasttwochildagents,informationaboutthevoltage(inperunit p:u: ) ispassedtotherespectiveparentagent.Thus,theinformationaboutthehighestand lowestvoltageatthenodesoftheagentsaredeliveredtothestartingagent1. 3.4.2AgentBasedPowerFlow PowerCalculationbyGaussMethod: Tosolvepowerw,Gaussmethodisadopted.fromtraditionalGauss-based powerw,inthismultiagentframework,eachagentsolvesitsownnodalpowerwlocally byexchangingtherequireddatawithitsneighbors.Assumeineachbusofthemicrogrid, thereisanodeagent.Ithasinformationaboutlocalgeneration,suchasrealpowercapacity, reactivepowercapacity,voltagemagnitudethatisgoingtobemaintained;meanwhile,it alsohaslocalloadinformation,suchasrealandreactivepowerdemandsbytheload.Iftwo nodesareconnectedelectrically,thenthecorrespondingagentsaremarkedasneighbors. Agentswithneighborhoodcancommunicatewitheachother;thosewithoutneighborhood relationshipcannotcommunicate. 48 AssumeNnodesinthesystem,withnetpowerinput P n , Q n .Ifitisaloadnode,then P n and Q n arenegative;ifitisageneratornode,then P n and Q n arepositive. Letusselectnode1asslacknode.Whencalculatingthepowerw,itsvoltagemagnitude andanglearemaintainedconstant.Othernodesusetheiroriginalrealandreactivepower inputs(PQnode)orrealpowerinputandvoltagemagnituderequirement(PVnode)to calculatevoltagemagnitude(PQnode),voltageangle(PQorPVnode)orreactivepower demand(PVnode). Afteragent-basedGausspowerwcalculationmethod,eachagentcouldobtainlocal voltagemagnitudeandangle,andtheysatisfythefollowingequation: P m + j Q m = P m + jQ m = V m 2 4 N X n =1 Y mn V n 3 5 (3.37) where P m and Q m arecalculatedrealandreactivepower; P m and Q m areoriginalplanned realandreactivepowerinput. Alsowecouldcalculaterealandreactivepowerinputatnode1: P 1 + j Q 1 = V 1 2 4 N X n =1 Y 1 n V n 3 5 (3.38) where P 1 and Q 1 arecalculatedrealandreactivepoweratnode1. Lossesoflinesarecategorizedbyrelationshipwithnodes.Ifalineconnectsbothnode m andnode n ,thenwehalfofthatlinelossiscontributedtonode m ,theotherhalf ofthatlinelossiscontributedtonode n .Ifalineconnectsnode m andground,thenwesay thatallofthelinelossiscontributedtonode m .Thenlocallossesrelatedtonode m can becalculatedbyequation(3.39). 49 P loss m + jQ loss m = y mm V m V m + 1 2 N X n =1 n 6 = m y mn [ V m V m + V n V n V m V n V n V m ] (3.39) where P loss m and Q loss m standforrealandreactivepowerlossesrelatedtonode m respectively. Sothetotallossesinthesystemcanbeexpressedas: P loss + jQ loss = N X m =1 " N X n =1 Y mn V m V n # (3.40) where P loss and Q loss aretotalsystemrealandreactivepowerlosses. Therefore,totalsystemgenerationorsurpluscanbecalculated: P + j Q = P 1 P 1 + jQ 1 j Q 1 (3.41) where P and Q aregenerationyorsurplusforthesystem,comparedwithload demandstakinglinelossesintoconsideration.Notethatif Q 0,thereactivepower isautomaticallybalanced,becausevoltageregulatoratslackbuswillcontrolthereactive poweroutputofthegeneratortobalancereactivepower.However,if Q 0,loaddispatch isrequiredtomaintainreactivepowerbalance. Fromequation(3.41),itshowsthatthepowerconsideringlinelossesinthe systemcanbecalculatedatslacknode.Agentatnode1knowsgeneratorcapacityorload demand P 1 and Q 1 ,alsoitcancalculate P 1 and Q 1 fromvoltageandangledatainpower wcalculation.Thenitcanobtainpowershortageinthesystem[29]. 50 3.5Five-BusTestSystem InordertotesttheMulti-Agentsystem,aebussystemfrom[37]isappliedanditis testedasfollow: 3.5.1ExampleCalculation: OriginalsystemwithagentsconnectedtoisshowninFig.3.12.Also,bus inputdataandlineinputdataaremoanddisplayedinTable(3.3)and(3.4).Allthe datahavebeentransformedintoperunit. Figure3.12Testede-bussystem Table3.3BusInputDataforFive-BusSystem Bus Type V ( P G ;Q G ) ( P L ;Q L ) Q G + Q G 1 slack 1 : 0 0 (2 ; 1) (0 ; 0) - - 2 PQ - - (0 ; 0) (5 ; 2 : 8) - - 3 PV 1 : 05 0 (5 : 4 ; -) (3 ; 0 : 4) 4 : 0 2 : 8 4 PQ - - (0 ; 0) (3 ; 1) - - 5 PQ - - (0 ; 0) (1 : 8 ; 1 : 0) - - 51 Table3.4LineInputDataforFive-BusSystem FromBus toBus R' X' G' B' 1 5 0 : 0015 0 : 02 0 0 2 4 0 : 009 0 : 1 0 1 : 72 2 5 0 : 0045 0 : 05 0 0 : 88 3 4 0 : 00075 0 : 01 0 0 4 5 0 : 00225 0 : 025 0 0 3.5.1.1 Y bus Construction: Basedontheconstructionprinciplesexpressedas(3.30)-(3.33),rowof Y bus builtby agent1is: Y 12 = Y 13 = Y 14 =0 Y 15 = 1 0 : 0015+ j 0 : 02 = 3 : 73+ j 49 : 72= ) Y 11 =3 : 73 j 49 : 72 Allthedataneededtocomputelocal Y 1 canbeobtainedlocallybyAgent A 1 .Similarly, otheragentsestablishtheir Y i vectors.Resultsof Y bus matrixisshowninTable(3.5). Table3.5Local Y i Vectors Y i A 1 [3 : 73 j 49 : 72000 3 : 73+ j 49 : 72] A 2 [02 : 68 j 28 : 460 0 : 89+ j 9 : 92 1 : 79+ j 19 : 84] A 3 [007 : 46 j 99 : 44 7 : 46+ j 99 : 740] A 4 [0 0 : 89+ j 9 : 92 7 : 46+ j 99 : 4411 : 92 j 147 : 96 3 : 57+ j 39 : 68] A 5 [ 3 : 73+ j 49 : 72 1 : 79+ j 19 : 840 3 : 57+ j 39 : 689 : 09 j 108 : 58] 3.5.1.2Multi-AgentBasedPowerFlowCalculation Assumestart, V (0) 2 =1 : 0, V (0) 3 =1 : 05, V (0) 4 =1 : 0, V (0) 5 =1 : 0.Theiterationof GaussmethodforMulti-Agentsystemisasfollows: 52 agent2: V (1) 2 = 1 Y 22 2 4 S (0) 2 V (0) 2 X n 2 N (2) Y 2 n V (0) n 3 5 =0 : 947 \ 10 : 30 agent3: Q (1) 3 =Im 2 4 V (0) 3 X n 2 N (3) Y 3 n V (0) n + V (0) 3 Y 33 V (0) 3 3 5 =4 : 91 Q (1) 3 >Q max 3 Q 3 L =4 : 0 0 : 4=3 : 6= ) Q (1) 3 =3 : 6 V (1) 3 = 1 Y 33 2 4 P 3 jQ (1) 3 V (0) 3 X n 2 N (3) Y 3 n V (0) n 3 5 =1 : 039 \ 1 : 11 agent4: V (1) 4 = 1 Y 44 2 4 S (0) 4 V (0) 4 X n 2 N (4) Y 4 n V (0) n 3 5 =1 : 033 \ 1 : 13 agent5: V (1) 5 = 1 Y 55 2 4 S (0) 5 V (0) 5 X n 2 N (5) Y 5 n V (0) n 3 5 =0 : 996 \ 0 : 93 Ifweconvergencecriterionasavoltagetoleranceof0.001 p:u shownin(3.42),it needs39iterationstoconverge.TheeiterationresultsaregivenatTable(3.6). V ( k ) i V ( k +1) i 0 : 001 8 i (3.42) 3.5.1.3NetPowerCalculation Aftersystemnodevoltagesareobtained,totalnetpowercanbecomputedatslackagent: 53 Table3.6ResultsfortheFirstFiveIteration No. agent2: V 2 agent3: V 3 agent4: V 4 agent5: V 5 1 0 : 947 \ 10 : 30 1 : 039 \ 1 : 11 1 : 033 \ 1 : 13 0 : 996 \ 0 : 93 2 0 : 920 \ 10 : 81 1 : 05 \ 0 : 13 1 : 019 \ 1 : 22 0 : 996 \ 3 : 14 3 0 : 916 \ 12 : 79 1 : 05 \ 0 : 06 1 : 026 \ 2 : 48 0 : 986 \ 3 : 21 4 0 : 905 \ 13 : 18 1 : 05 \ 1 : 28 1 : 022 \ 2 : 74 0 : 987 \ 4 : 02 5 0 : 904 \ 13 : 97 1 : 05 \ 1 : 56 1 : 022 \ 3 : 81 0 : 983 \ 4 : 16 agent1: P 1 + j Q 1 = V 1 2 4 N X n =1 Y 1 n V n 3 5 =7 : 34+ j 1 : 36 P s + jQ s = P 1 P 1 + Q 1 Q 1 = 5 : 34 j 0 : 36 Therefore,consideringgeneratorsandtransmissionnetworkcharacteristics(PV,PQ, powerw),linelosses,theofgenerationinthesystemis 5 : 34 j 0 : 36.Ifsimply neglectingthesefactors,netpoweriscalculatedas: P s + jQ s = X ( P G P L )+ j ( X Q G Q L )= 5 : 4 j 0 : 2 Becauseofthevoltagemagnituderequirementsatnode3,generatorsatnode3will notsimplyprovidemaximumreactivepower,eventhoughreactivepowerinthesystemis t.Therefore,neglectingsystemoperationprinciplesandgenerationcharacters,the netreactivepowerestimationarenotaccurate.Inthiscase,itserrorisabove44%.Real powerbetweenthistwomethodsmainlyresultedfromsystenlosses.Inmicrogirds, withlowvoltagelevelandmainlyresistantnetwork,thislosssometimescouldnotbeomitted. 54 Chapter4 InterfacingMethods Inamicrogrid,integratingandinterfacingsensingandcontroldevicesischallengingbecause itinvolvestcommunicationprotocolssuchasStandardnumber(RS232)serialcom- municationand(RS422/485)modbuscommunication.Toovercomethischallenge,weneed toconverttheinformationintoonestandardprotocol-Ethernet.Wecaneconomicallymade theconversionbyusingacommunicationprotocolconverter. 4.1Method1 SinceRTDSandtheagentshadatcommunicationspeed.Anideaofusingthesame speeddevicelikePCforsimulatingapowersystemwasdealt.Henceaplanwithoutusing theRTDSwasconsidered.HereinthismethodwedecidedtoprogramtheMPI(Message PassingInterface)cluster,i.e.theePCsinsuchawaythattheycouldactasthepower system.TheMPIwastobeprogrammedusingC.TheplanwastomakeeachPCtodothe functionsofageneratingmachine,atransformerandaload.Sowhentheyareinterconnected therewouldbeegeneratingmachines,transformersandloads.Thiswouldbeaprimitive powersystemmodel.Theinterfacingcouldbeeasybecausethesocketconnectiontechnique canbeusedandcanbeprogrammedastheagentsarebuiltinjavaplatform.Butthis methodwassoondroppedasthemodelingofthemachinesandtransformersusingaC codingbecametedious.Alsothetimeconstrainwasanissuewiththismethod.Moreover 55 themainideaofthisprojectistocreatearealtimetestbedforthecontrolofthemicro grid,butthismethodwouldgiveasystemwhichwouldnotworkatrealtimesystem. Figure4.1a)AopticcableconnectstheRTDSinternalcommunicationsystemto anFPGAboard.TheboardconvertsthedataandbuildsaninterfacewiththeEthernet network;b)WiththehelpofanAD/DAconvertertheoutputsofseveralchannelscanbe convertedindigitalvaluesandsendtoacomputerordirectlyinaEthernetnetwork. 4.2Method2 ThismethodwasdevelopedbasedontheinterfacingtechniqueadoptedbyFloridaState University.ThismethodusedtheRTDSandthesignalshavebeentakenoutfromtheoutput portseither(analogordigital)throughanopticercabletoaFieldProgrammableGate Array27(FPGA)whichactsastheinterfacingmediumbetweentheRTDSandtheagents. ThismethodwouldsuitforquitelargesystemwheretherearemanyGTAOorGTDO. AsalreadymentionedduetohardwareconstrainwhereonlyoneGTAOportisavailable 56 andsothesignalshadtobesentsequentially.Theagentswereneitherprogrammedto takeinsignalssequentiallynortogivesignalssequentially.Hencethismethodcouldnot beimplemented.Fig.4.1showsthediagrammaticrepresentationoftheinterface.Butthis methodpavedawaytoabetterinterfacewiththeagents.Whileworkingwithsending signalssequentially,RSCAD'sscriptfeatureprovedhandy.Whileworkingwiththescript amethodofinterfacingtheagentswithRTDSusingnoextrahardwarewasfound.The connectionwasovertheEthernetitself.Thisisexplainedindetailinthenextsectionofthis chapter. 4.3Method3 Assaidinprevioussectionthismethoddoesnotrequireanyspecialorexternalhardware andinterfacingcouldbedoneusingtheEthernetovertheLAN.ThescriptinRSCAD wasprogrammedforinterfacinginthismethod.Thestepsareasfollows: ThepowersystemissimulatedusingtheRSCADsoftware.Twosystemswhichare showninFig.4.4andFig.4.6.wassimulatedinwhichtheonlyforsystemshown inFig.4.4aninterfacewasdone.ThissystemrunsinrealtimeontheRTDS.The simulatedsystemresultsareshownintheFig.4.7. RTDSimitatesormimicsthecharacteristicsofarealpowersystemandhencewhena controlleroragentisinterfacedtoit,itprovidesareal-timeworkingenvironment. TheruntimesheetoftheRSCADallowsafeaturecalledscript.Theexplanation aboutthescriptwasgiveninsection2.5.3.1.Thescriptwasprogrammedtoconvert thevaluesofthesystemlikevoltage,frequency,realpowergenerated,reactivepower 57 generatedandvitalandnon-vitalpowerdemandtoacommaseparatedvalue(.csv) Thealgorithmandprogrammingofthescriptwillbeexplainedindetailinthe nextchapter. Theagentsprogrammedtoacceptthecommaseparatedvalueastheinput. ThisgeneratedfromtheRSCADistheinputtotheagents. UsingsharingprotocolsovertheLAN,theissenttoagents. SincetheRSCADwasonthewindowsplatformandtheagentswereontheLinux platform,applicationslikeSamba,SMB4KwereinstalledontheLinuxtoallowthe sharing.TheremotedesktopconnectionwasusedforaccessingthePCsandtheagents forprogrammingandthesharingprotocolthroughthewindowssystem. RSCADforLinuxwasavailableonlyfor32bitsystemandalltheupdatesforthe LinuxbasedRSCADwassupportedbytheRTDStechnologiesandsothesharing protocolbetweenthewindowsandLinuxwasanecessary. Inidealcasetheagentswouldperformtherequiredtaskaspertheirprogram,for exampleiftheagentsareprogrammedtodothepowerbalanceandeconomicdispatch. Thenfromthemomenttheygettheinputsignalstheagentswouldstarttheprocess ofthepowerbalanceandeconomicdispatchforthesystemandwouldoutput newvaluesofpowergeneratedandloaddistributionintnodes.Thiswould besentbacktothesystem.Buttheagentsthatwereestablishedinthelabhadbeen programmedtocommunicateamongthemwhichweresupposedtobethemainwork oftheagents.Hencecommunicationpartwasgivenmoreimportancewhiletheagents werebuilt.Thereforeinthiscasetheywouldoutputthecommunicationpathbetween 58 theagentsandwouldoutputthesamevaluesofthethatisbeinginputtedtothem. Theagentswillbefurtherprogrammedfortheeconomicdispatchandpowerbalance whichisthefutureworks. Thisoutputagentsthatwouldbesenttothesystemwouldmodifythesystemandthe newsystemvalueswillbeagaincheckedforthesame.Thiskeepsonrepeatinguntil economicdispatchandpowerbalanceisobtained. Theadvantageofthismethodisthattherealtimespeedandtheautomation. Theslightdisadvantageofthissystemisthatthevaluesofthesystemcannotbe changedattheruntime.Inordertoovercomethisdisadvantageanothermethodis proposed. Fig.4.2showstheinterfacingusingmethod4.3. Figure4.2InterfacingusingthescriptfeatureofRSCADovertheLAN(Method3) 59 4.4Method4 Thismethodovercomesthedisadvantageofthepreviousmethod.Thisisafuturemethod andisyettoaccomplished.Thismethodusesexternalhardwarei.e.aDataAcquisition Toolbox(DAQ).Thestepsforthismethodaregivenbelow: ThepowersystemissimulatedusingtheRSCADsoftwareandrunsinrealtimeon theRealTimeDigitalSimulatorRTDS. RTDSimitatesormimicsthecharacteristicsofarealpowersystemandhencewhena controlleroragentisinterfacedtoit,itprovidesareal-timeworkingenvironment. Thevaluesofthevoltage,frequency,powergenerated,powerdemandofthepower systemaretakenoutfromtheGTAO(analogoutputport)oftheRTDS.Asmentioned inchapter2.4.2theRTDSinthelabconsistsof1GTAOcard.Therefore12ports areavailable.Foronenodeis8signalsaretobesentoutthenfora6nodesystemit wouldbe48signalsatatime.Unfortunatelysincethereisonly12portsavailable,we havetosendsignalssequentially.Weuse8portsforeveryinstance. TheentireanalogsignalsthatareoutputtedfromtheGTAOcardwillbeproperly scaledona5 V level(thesignalsarealreadytestedusingtheoscilloscopeandthe scalingwasusingamultimeter). (NationalInstrument)NI's LabVIEW isconsideredasversatiledataacquisitionsoft- ware.EvenMATLABcanalsobeused.Forthe LabVIEW toreceiveinsignalswe havetouseahardwarei.e.theDataAcquisitionToolbox(DAQ)providedbyNI. Uponreceivingthesevaluesthe LabVIEW canbeprogrammedtodoaloopingaction 60 andhencethesesequentialsignalssentfromtheRTDScanbeobtained.Thesesignals canalsobeprogrammedtobestoredascommaseparatedvalue(.csv Thiswillagainusethesamesharingprotocoltosharethetotheagents. Asmentionedalreadytheagentsareprogrammedtoacceptthe.csvasaninput. Theagentswillprocesstheinputsaspertheirprogramandoutputin.csvformat. ThiswillbeacquiredbythelabVIEWusingthesharingprotocol.Thesevalues willbeconvertedtodigitalsignalsinordertobesenttotheRTDS. TheRTDSavailableinlabhas1GTDIcard.Andhencenotmorethanfoursignalscan bereceivedintothesystematthesametime.Hencethereshouldbeanunderstanding betweentheRTDSandtheLabVIEWinordertoreceivethesignals.Henceaftereach fourvaluestheportisreset.SooncetheportisresettheRTDSwillunderstandthat thenext4signalswouldbeanotherset. ThecontrolactionwillbeprogrammedintheRSCADtocheckiftheportisresetor not.Oncethesignalsarereceiveditwouldbere-scaledtotheoriginalvaluesandsent totherespectivenodes. Thusthenewsystemvalueswillbeinputtedtothesystem. Theadvantageofthissystemisthatitrunsatrealtimeandthevaluesofthesystem canbemoduringtheruntime. AnotheradvantageofthisistheRTDScanbeusedtoperformHILwheretheLabVIEW cansendthecontrolsignal. 61 Fig.4.3showsthemethodofinterfacingtheRTDStotheagentsusingtheDAQtool box. Figure4.3InterfacingusingDAQ(Method4) 4.5SimulationandResults Thischaptergivesthedetailedconstructionofthetestbed.Assaidinpreviouschaptersthe interfacingwasgiventhemainimportance.Inthischapterwediscussthealgorithmforthe methodusingthescriptfeatureofRSCADasdescribedasmethod3in4.3. 4.6PowerSystemModels RSCADgivestheuserawidevarietyofoptiontoconstructthepowersystem.Twosystems weresimulatedoneconsistingofthreeDGandfourloadunitsforasixbussystemsshown inFig.4.4forwhichtheinterfacewasdone.Andthesecondsystemwasanadvancementof 62 thesystemwith1windturbine,onesolarPVunitandoneDGasgeneratingunitsand fourloadunitsasshowninFig.4.6.Thenumberofprocessorsavailableinourlablimits thenumberofunitsto400andsoonlyonewindturbinecouldbeusedinthesystem.Also themodonetothebasesystemcameuptoelevennodeshencenodeselection forsequentiallysendingthesignalswasnotpossibleasthelimitwasonlysix(excluding EmbeddedBus).Hencethesecondsystemwasjustsimulatedforwhichtheinterfacewas notperformed.Theideaofusingsamesimulatedsystemthatcanusedforbothmethod threeandmethodfourwhicharedescribedinsection4.3andsection4.4respectivelywas consideredforverifyingtheresults.Unfortunatelymethodfourcouldnotbecompleted.Fig. 4.4andFig.4.6showtheonelinediagramofthesystemthatwassimulated.Fig.4.5shows RSCAD'sonelinediagram. Figure4.4Systemconsistingthreegeneratingandthreeloadunits RSCADDraftsheetisusedforcreatingthesystem.Thepowersystemcomponents explainedinsection2.5.2.1wereusedforcreatingthenodes.Thebusesone,ve,andnine 63 Figure4.5Systemconsistingthreegeneratingandthreeloadunits 64 Figure4.6Systemwithonewindturbine,onesolarPVunit,oneDGandfourloadunits inthesystemshowninFig.4.4andbusesone,eforthesystemshowinFig.4.6are embeddedbuses.RSCADprovidesfourtypesofbuses. Explicitbuses:buseswhichparticipateinthelargetimestepnetworksolution Embedbuses:observablebutdonotparticipateinthelargetimestepnetworksolution Smalltimestepbuses:RTDShasasmalltimestepsolutionthatcanbeembedded insidealargetimestepsolution FDNEBuses:Inadditiontotheabovethreecategoriesofelectromagnetictransient ( emt )buses,wecouldembedseveralfrequencydependentnetworkequivalents(FDNE) withinanetworksolution. Sincethebuseswhichareembeddedbussesi.e.thesebussesformsthedefaultintercon- 65 nectingnodebetweengeneratorandtransformer,thesebussesdoesn'tparticipateinthe simulation.Thesimulationhenceisreducedtosixnode/bussystemforthesystemwith threegeneratingandloadunitandasninenode/busforthesecondsystem. 4.6.1Runtime TheRuntimesheetofRSCADprovidestheresponseofthesystem.Thecomponentsavailable inthisfeaturearealreadyexplainedinsection2.5.3.Thesimulatedthreegeneratingunit andthreeloadsystemanditsresponseinruntimeisshownintheFig.4.7.Thesystemwith windturbine,solarpanelandDGwithfourloadanditsresponseduringtheruntimeunit isshownintheFig.4.6 Figure4.7Showstheplotsofsimulatedsystemconsistingofsixbuses,fourloadunits,with threegeneratingunits 66 Thesliders PG1 , PG2 , PG3 , QG1 , QG2 , QG3 areusedforrealandreactivepowergen- erationcontrol.Thesliders PL1 , PL2 , PL3 , PL4 , QL1 , QL2 , QL3 , QL4 ,areusedforad- justingtherealandreactiveload.Fig.4.8showsthesliders.MetersPMACH1,PMACH2, PMACH3,QMACH1,QMACH2,QMACH3givesthevaluesofrealandreactivepowergener- ated.Metersbus1,bus2,bus3,bus4,bus5,bus6givestheRMSvaluesofthenodes/busses. Fig.4.9showsthepowergeneratedmetersandshowsthebusvoltagesmeters. Theextracomponentsinthissystemarethepushbuttonfortripandrecloseofthewind turbinetothegridanditisshownin4.9.Theotherisadditionalsliderstocontrolthewind andsolargeneration. Figure4.8Sliderstoadjustthegenerationandload Theplotsthegivesthevaluesofthebuses.Theseplotsneedtobeupdatedmanually. 4.7ScriptfeatureofRSCAD ThisfeatureisfoundintheruntimesheetofRSCAD.Fig.4.10showsthescripfeaturein runtimesheet.ThisfeatureofRSCADwasusedforinterfacingtheagentstotheRTDS.This 67 Figure4.9MetersshowingvaluesofpowergeneratedandbusvoltageandSliderforadjust thewindturbinegenerationandthepushbuttons methodhasbeenexplainedinchapter4.3.Scriptisbasicallyusedforloopoperation andautomation.Themainideaofusingscriptistoeliminatethepresencetotheuser.Here Figure4.10ScriptfeatureinRuntimesheetofRSCAD inthismethodweareconvertingthevaluesofthegeneration,voltage,frequency,demand, intoacommaseparatedvaluewhichissenttotheagents.Thealgorithmusedfor programmingthescriptisshowninFig.4.11. Thiswchartgivestheoverviewforthecodingdoneinthescript.Firstofallscript out.csv istheoutputformtheagentsandscript in.csvistheinputgiventotheagents.Since theagentswereestablishedthewholeprocedureisbasedontheagents.Andhence script out.csvistheinputtothesystemwhilethescript in.csvistheoutputfromthesys- tem.Forthetimeforrunningthesystemadummyscript out.csviscreatedwithvalues thatarenecessarytorunthesystemandoncethesystemstartrunningthenitwillgive theoutputwhichwillgottoagents.Theagentsnowwillworkontheinputandgivenew script out.csvastheoutput.Sincealltheseareinasharedbetweenthewindowsand 68 Figure4.11Flowchartfortheprogrammingofthescript 69 Linuxthenewscript out.csvwilloverwritetheoldoneandsothisloopcontinues.However; westillneedadevicesuchasDAQtomakethewofinformationbetweenouragentsand thesystemwhichtheRTDS,here.Fig.4.12showstheoutputgivenbythenagents. Figure4.12showsthescript in.csvoutputtedbythesystemwhichistheinputtotheagents Figure4.13showstheGUIoftheagents Figure4.14theoutputscript out.csvgivenbytheagentsthenthisissenttoRTDS 70 Chapter5 5.1Conclusion UsingaMulti-Agentsystemforthemicrogridcontrolisadvantageousbecauseoftheparallel communicationandequalityamongalltheagentsandthatmeansthereisnoagentwhichhas higherprioritythanotheragents.Beforethestartofthisprojecttheagentswereestablished whichwereprogrammedtocommunicatebasedontheminimumspanningtreeandtoken transmissiontechnique.Theagentsaredesignedtoallowthestartofanynumberofagents onanynumberofcomputerssimultaneouslyforincreasingtheusability. TheMPIclustercanbeusedforanykindofcomplexmathematicalcalculation.Itispos- sibletodistributethecomputingpowertoecomputers,whichincreasestheperformance immensely. Inthisproject,themainideaofinterfacingthepowersystemtotheagentwasperformed isdescribed.Variousmethodswereinitiatedfortheinterfacingduringthisproject.The agentswhichwereavailablefromthestartoftheprojectwasalteredalittleinordertomake theinterface.Thecommunicationspeedandthehardwareavailablewerethechallenges whileaccomplishingtherequiredtask. ThismethodofinterfaceusingthescriptfeatureoftheRSCADcanbeusedformuch otherpurpose.Thescriptcanbeprogrammedtotakeinvaluesfromapulecontroller oroperatearelaythatisconnectasHIL.Theadvantageofthisusingthismethodisthat thevaluesatthetimeofstableoperationcanberecordedinacommaseparatedvalue whichcanbeusedasareferencetoislandamicrogridfromtheutilitygridforamicrogrid 71 controller. InterfacingusingtheDAQtoolboxexplainedinmethod4inchapter4.4wasstarted shortlybeforetheendoftheproject.Sincethehardwarethatwasavailabletooutputwas 1GTAOcardsignalshavetobesentsequentially,henceadialwasdesignedalongwiththe signalselectortosendthesignals.Laterthiswasmotosendsignalsautomatically usingacounter.Butthislimitationforthismethodisthenumberofnodesthatcanbeused is6.Forreceivingthesignalssequentiallyassaidinchapter4.4acontrollerwasdesigned usinglogicalcomponents.Forthestoringthesignalsinacommaseparatedvalueand viceversasimultaneouslyLabVIEWisbeingprogrammedforperformingtheloop.Once thispartisaccomplishedtherequiredhardwarewillbepurchasedfortheinterface. BecauseoftheextensionofthetestbedwithseveralRaspberryPis,itisnowpossible totesttheagentbehaviorwithtentmachines.Thetechnologyofthesemachines probablyhavearealisticbehavior.TheprocessorsoftheRaspberryPi'sarebasedonthe ARMtechnology,andthusitisusedmainlyinmobilephonesormicrocomputers.Itislikely thatthisprocessortechnologywillbeusedforthedevelopmentoffutureagentsystems.This iswhytestingonthisbasisisveryimportantandinteresting. 5.2FutureWork Thesolutionforfutureworkis,usingNILabVIEWsoftwareandNIdataacquisition(DAQ) hardwaretodevelopalow-costmicrogridenergymanagementsystem(MEMS)thatincludes informationandcommunicationstechnology(ICT),smartmeters,advancedoptimization applications,andinterfacingcommunicationtomanagedistributionsystemsthatserveasa platformforincorporatingrenewableenergyresources.Withtheinterfacebeingdone,this 72 frameworkisnowgivingalotofoptionstoperformvariouscontrolactionsforamicrogrid. Thus,veryinterestingsimulationscanbedriven.Theagentscannowbeprogrammedtodo economicdispatchandpowerbalanceforthesystemshowninFig.4.3.Oncetheinterface throughDAQtoolboxisdoneitwon'tbeaproblemtotransferdataoveraTCP/IP connection.Thismethodcouldalsobeusedtosenddatafromtheclustertotheagents. Therangeofthedevelopedsoftwareforthetestbedisverylarge,butsofarnotevery buganderrorcouldbeeliminated.Therefore,itneedsadditionalchangesandessential improvementsforthefuture.AnotherinterestingpossibilitywouldbetoconnecttheRTDS viatheinterfacesdescribedinthethesisinsection2.4.2;hence,theimplementationofreal- timevalueswouldbepossible.Therangeofthedevelopedsoftwareforthetestbedisvery large,butsofarnoteverybuganderrorcouldbeeliminated.Therefore,itneedsadditional changesandessentialimprovementsforthefuture. Thetestbedcreatedinthisprojectalotofinterestingpossibilitiesforfurther developmentsandprojectsintheofMulti-Agentsystems.WiththeMPIsystem,large computationsforpowerconsumingcalculationsarenowpossible.Inaddition,uptoten agentscanbesimulatedonindividualcomputers.Becauseoftheinteroperability,itiseasy toincreasethenumberofconnectedcomputersandagents.Thus,thetestbedisapowerful systemthatisavailableforfutureprojects. 73 BIBLIOGRAPHY 74 BIBLIOGRAPHY [1]GridWideAlliance,DepartmentofEnergyTheFutureoftheGrid:EvolvingtoMeet America'sNeeds-NortheastRegionWorkshopSummary,NY.May2013 [2]B.Metz,O.R.Davidson,P.R.Bosch,R.Dave,L.A.Meyer,\MitigationofClimate Change,ContributionofWorkingGroupIIItotheFourthAssessmentReportofthe IntergovernmentalPanelonClimateChange,"CambridgeUniversityPress,Cambridge, UnitedKingdomandNewYork,NY,USA.2007 [3]UnitedStatesDepartmentofEnergy,ofaMicroGrid," http://energy.gov/searc [4]Ng,E.J.El-Shatshat,R.A.\Multi-microgridcontrolsystems(MMCS)", IEEEPower andEnergySocietyGeneralMeeting, vol.,no.,pp.1,6,25-29July2010 [5]J.Jayadev,\Harnessingthewind," IEEESpectrum ,vol.32,no.11,pp.78-83,Nov. 1995. [6]S.-J.Ahn,J.-W.Park,I.-Y.Chung,S.-I.Moon,S.-H.Kang,andS.-RNam\Power- sharingmethodofmultipledistributedgeneratorsconsideringcontrolmodesandcon- ofamicrogrid," IEEETrans.PowerDel. ,vol.25,no.3,pp.2007{2016,Jul. 2010. [7]M.J.Stanovich,I.Leonard,S.K.Srivastava,M.Steurer,T.P.Roth,S.Jackson,B.M. McMillin,\DevelopmentofaSmart-GridCyber-PhysicalSystemsTestbed,Innovative SmartGridTechnologies(ISGT)," IEEEPES ,2013 [8]U.S.DepartmentofCommerce,http://www.trade.gov,(July2008) [9]A.Allen,C.Brown,J.Hickey,V.Le,andR.Safuto,\EnergyStorageintheNewYork ElectricityMarkets",ANewYorkISOWhitePaper,Mar.2010,pp.1-14. [10]H.-MKim,Y.Lim,T.Kinoshita,AnIntelligentMultiagentSystemforAutonomousMi- crogridOperation, Energies 2012,http://www.mdpi.com/journal/energies(10/02/13) [11]S.Lang,\AMulti-agentSystemTestbedforMicrogridControl"MasterThesis,MSU, 2013 75 [12]R.L.Dohn,\Thebusinesscaseformicrogrids,"SiemensAG,2011, http://www.usa.siemens.com/infrastructure-cities/us/en/(10/02/13) [13]Bundesnetzagentur,\SmartGrid"and\SmartMarket"-SummaryoftheBNetzA PositionPaper,December2011 [14]G.Weiss, \MultiagentSystems-AmodernApproachtoDistributedAIntelli- gence" ,TheMITPress,1999,ISBN0-262-23203-0 [15]S.D.J.McArthur,E.M.Davidson,V.M.Catterson,A.L.Dimeas,N.D.Hatziargyriou, F.Ponci,andT.Funabashi\Multi-AgentSystemsforPowerEngineeringApplications, PartI:Concepts,Approaches,andTechnicalChallenges", IEEETransactionsonPower Systems ,Vol.22,NO.4,November2007 [16]F.Bellifemine,G.Carie,D.Greenwood, DevelopingMulti-AgentSystemswithJADE , WILEY,2007,ISBN:978-0-470-05747-6 [17]A.Dimeas,N.Hatziargyriou,\AMulti-AgentSystemforMicrogrids," IEEEPower EngineeringSocietyGeneralMeeting ,2004 [18]U.S.DepartmentofEnergy,EnergyInformationAdministration-IndependentStatistics andAnalysis,\AnnualEnergyOutlookEarlyReleaseOverview,"Report#DOE/EIA- 0383,2010.[Online].Availableat:http://www.eia.doe.gov/oiaf/aeo/overview.html. [19]W.H.Kersting, DistributionSystemModelingandAnalysis, 2nded.CRCPress,2006 [20]N.N.Lange,C.Oerter,M.Zdrallek,\Firstpracticalexperiencewithsmartlowvolt- agegrids," SmartGridTechnology,EconomicsandPolicies(SG-TEP),International Conference on,vol.,no.,pp.1,4,3-4Dec.2012 [21]Y.XuandW.Liu,\Novelmultiagentbasedloadrestorationalgorithmsformicrogrids," IEEETrans.SmartGrid, vol.2,no.1,pp.152-161,Mar.2011. [22]Y.XuandW.Liu,\Stablemulti-agent-basedloadsheddingalgorithmforpowersys- tems," IEEETrans.PowerSyst., vol.26,no.4,pp.2006-2014,Mar.2011. [23]F.JyuanandS.Borlase,\Theevolutionofdistribution", IEEEPowerandEnergy Magazine, vol.7no.2,pp.63-68,2009. [24] MicrogridsResearchAssessment:Phase2FinalReport. PreparedforDOE'sof ElectricityDeliveryandEnergyReliability.California,May2006. 76 [25] \EuropeanSmartGridsTechnologyPlatform:VisionsandStrategyforEu- rope'sElectricityNetworksoftheFuture." EuropeanCommission:Directorate- GeneralforResearch.EUR22040,2006[Online].Available:http: == ec.europa.eu/research/energy/pdf/smartgridsen.pdf [26]N.Hatziargyriou,H.Asano,R.IravaniandC.Marnay,\Microgrids-Anoverview ofOngoingResearch,Development,andDemonstrationProjects", IEEEPowerand EnergyMagazine, vol.5no.4,pp.78-94,2007. [27]A.EnglerandN.Soultanis,\DroopcontrolinLV-grids," in2005InternationalCon- ferenceonFuturePowerSystems ,2005,pp.6-11. [28]M.Rheinhausen,\GRIDCONTransformer-TheVoltageregulatedDistributionTrans- former,"[Online].Availableat.http://www.reinhausen.com [29]N.Cai\LinearizedandDistributedMethodsforPowerFlowAnalysisandControlin SmartGridandMicrogrids"MSU,PhDDisertation,2014 [30]N.CaiandJ.Mitra,\Adecentralizedcontrolarchitectureforamicrogridwithpower electronicinterfaces" PowerSymposium,Proc.ofthe42thAnnualNorthAmerican, Arlington,TX,Sep.2010 [31]N.CaiandJ.Mitra,\AMulti-LevelControlArchitectureforMaster-SlaveOrganized MicrogridswithPowerElectronicInterfaces," ElectricPowerSystemResearch ,Vol109, pp8-19,Apr2014. [32]MPICH,http://www.mpich.org/(10/10/13) [33]TheRaspberryPiFoundation,http://www.raspberrypi.org(10/05/13) [34]JaySorg,http://www.xrdp.org(08/13/13) [35]RTDSTechnologiesInc.,www.rtds.com(07/04/13) [36]M.J.Stanovich,I.Leonard,S.K.Srivastava,M.Steurer,T.P.Roth,S.Jackson,B.M. McMillin,\DevelopmentofaSmart-GridCyber-PhysicalSystemsTestbed," Innovative SmartGridTechnologies(ISGT) ,2013IEEEPES [37]J.D.Glover,M.S.SarmaandT.J.Overbye, \PowerSystemAnalysisandDesign," FourthEdition:Thompson,2007. 77 [38]M.Wolter,H.GuerckeandT.Isermann,\Multi-agentBasedDistributedPowerFlow Calculation", IEEEPowerandEnergySocietyGeneralMeeting, Minneapolis,MN,July, 2010,pp.1-6. 78