You are on page 1of 5

IEEE ISGT Asia 2013 1569813747

Implementation of Arduino-based Multi-Agent System for Rural Indian Microgrids


Dhiwaakar Purusothaman S R R
Research Assistant Solarillion Foundation Chennai, India d.srr.1992@ieee.org
Abstract An implementation of a multi-agent system (MAS) for a rural Indian microgrid (MG) using Arduino has been explained in this paper. The focus is on the DG agents - the distributed energy resources (DERs), load, storage and the grid agents - and the Mu agent which acts as the communication channel between the DG agents to the higher level agents such as the control agent. The design philosophy incorporates the core features of an MAS that are required to monitor and control a rural Indian microgrid. The system has been compacted and design simplified, since only relevant parameters from a rural Indian MG are considered. The Arduino system obtains the inputs from the various DG agents which are then channeled to the D agent after appropriate processing. The implementation of the system has been done using an Arduino microcontroller. Index Terms Arduino, Communication, Control, Microgrid, Multi-Agent System

Ramesh Rajesh, Karan K Bajaj and Vineeth Vijayaraghavan


Solarillion Foundation Chennai, India rajeshramesh90@ieee.org Microgrids implemented with multi-agents can increase the operational efficiency as well as provide a platform for the monitoring and control of distributed energy resources such as solar PV, wind, biogas generators and the utility grid [5]. Individual parameters are mapped with appropriate hardware to enable the realization of the system using open-source Arduino. II. PROBLEM STATEMENT Emergence of microgrids has made electrification of rural India possible where the challenge of energy access persists. The ever declining price and hence the usage of distributed renewable sources has paved a way for these systems to operate independently or augment an otherwise unreliable grid supply. To enhance the performance and operation of these microgrids, a proper control and communication strategy has to be adopted. One such commonly used strategy is the Multi Agent System (MAS) model. The current microgrids implementation in India are typically designed such that an average end user has a fixed load of 30-50 W and the size of the microgrids are approximately 15 KW [6]. Metering solutions are void due to unaffordability and the assumption of fixed loads and duration of operation for an average customer whose cost of consumption is $ 2.2 per month [7]. In this scenario, it becomes extremely challenging to implement a MAS system using the conventional methods such as JADE and Zeus which is used predominantly in military and urban microgrids in developed countries. Hence, the need to design an extremely low cost and efficient system capable of handling such a simple rural microgrid in India, yet at the same time being flexible to provide some of the commonly used features in a MAS system is imperative. III. METHODOLOGY In general, microgrids encompass of DERs, grid supply, storage system and the loads which are planned to be serviced. For an efficient and economic operation, the working of these systems needs to be accurately monitored, controlled and co-ordinated using apposite strategies.

I. INTRODUCTION Renewable energy has been estimated to become cheaper than fossil fuels in the near future which are consolidated by the continuing increase in the number of renewable energy power plants around the world. In 2012, the net renewable energy installed capacities around the globe touched the 500 GW mark with a growth rate of 19% for wind and 42% for solar PV [1]. As a positive outcome of these developments in the field, in countries like India, the numbers of microgrid installations are on the rise. The emergences of low cost smart microgrids are seen as a need and not as a luxury in a country like India [2]. With the declaration of the RestructuredAccelerated Power Development and Reform Program (RARDP), the need for microgrid designs to concentrate on information and communication technology to improve the control and coordination is paramount [3]. This would also lead to the development of microgrid clusters in the future. This further indicates the need for an effective system to enable communication for implementing periodic control of the various components of the microgrid. Present multi-agent systems studied in the United States of America for military and urban applications utilize sophisticated infrastructure [4]. Hence, a framework based around the rural microgrid and in specific, for the Indian context needs to be developed.

A. Multi-Agent Modelling of Microgrids

2)

Agent Collaboration Diagram

Figure 2. Agent Collaboration Diagram

Figure 1. Multi-Agent Collaboration Schematic

Among the various control strategies that are available, the one that is most effectual and frequently used is the MAS model. An ideal agent is defined to be a reactive, proactive and flexible software and/or hardware. Typically, the components of a microgrid are hierarchically grouped into three classes of agents: DG agents, agents and D agent. All the DERs, grid supply, storage and loads are individual DG agents and the computations required for control and coordination are carried out by the D-agent which is normally a cloud or a computer. The agent channels the data from the DG agents to the D agent and vice versa thus acting as the communication link in an MAS. The above mentioned system of agents is depicted in figure 1. 1) Java based Systems Modelling - Tradeoffs

The agent collaboration diagram, depicted in figure 2, exhibits the various stages of information flow from the lowest (DG agents) to the highest (D agents) levels in the hierarchy. As shown in figure, the DER, grid, storage and load agents form the DG agents. The intermediate block represents the communication channel where statuses on operation and connectivity of the individual components to the system are exclusively handled. The data from each of the DG agents is also pre-processed and relayed to the control agent where necessary computations are effected and system commands are returned. B. Realization of MAS Functionality using Arduino 1) Design Keeping in mind the economic constraints and the simplicity of the rural microgrid, Arduino Uno has been used which abates the programming complexity. The DG agents and the agent are implemented using the Arduino. The data logging and computations are carried out by the D-agent which has been assumed to reside in a system outside the Arduino. With regard to the cost and the limitation over the number of analog and digital pins, multiplexers have been incorporated. The select signals to the multiplexers are generated by the Arduino digital output pins.
TABLE 1. ANALOG PIN MAPPING Analog Pins - Input Description Solar Parameter 1 Solar Parameter 2 Wind Parameter 1 Wind Parameter 2 Biogas Parameter 1 Biogas Parameter 2 Storage Parameter Grid Parameter 1 Grid Parameter 2 Override Switch

There are several existing multi agent-modelling softwares available both as open-source and proprietary tools, with a majority of them based on the Java platform [8]. It is evident that an attempt to develop an open-source microcontroller based multi-agent system coded using Embedded C for microgrid control and communication applications, is near to none. The reason for simplification lies in the fact that these systems need to be easily configured for usage in rural areas and the number of functions required are far lesser compared to those required by an urban microgrid. Several standards have been established by the Foundation of Intelligent Physical Agents (FIPA) [9]. Some of the modern data standards such as the Common Information Model for Energy Management Systems are designated for complex power systems which would otherwise be not required here [10]. Fabio et al and Magid et al have described the design of agent systems using the Javabased JADE platform [11,12]. This platform is used to realize multifarious agent architectures. Such a platform would be too complex for the system proposed and the implementation of a large number of functions that are not required by the system is prohibitive to the cost of implementation of the proposed system and hence its realization is simplified using Arduino IDE. Furthermore, the number of system components and functions are now reduced to enable an application specific design.

Pin label SP1 SP2 WP1 WP2 BP1 BP2 StP GP1 GP2 OS

a) Analog Pin Mapping: The Arduino Uno has six analog pins, namely A0 A5, which are used to sense the analog inputs from the DERs (Solar, Wind and Biogas), Grid, Storage device and Load. The built-in Analog to Digital converter of the Arduino is capable of sensing values of input voltage in the range of 0 5V and converting them to equivalent digital values ranging from 0 to 1023. Hence, the input given to the analog pin has to be scaled to the voltage

Figure 3. Arduino-based Implementation Schematic

range mentioned above by using appropriate voltage conversion circuits. The parameters to be measured are available either at the analog pins or the multiplexed pins of the analog multiplexer CD4051 whose output is connected to A0 of the Arduino. The description of the various parameters sensed is given in table 1. b) Digital Pin Mapping: The digital inputs and outputs of the Arduino are available at the fourteen digital pins, namely D0 D13 as designed in table 2 and 3. The operation and connection status of the microgrid components are assumed to be digital values and are hence assigned different digital pins. The values of these statuses are multiplexed using digital multiplexers HC4067 before they are made available at either of the input and output digital pins of the Arduino. The digital input and output pins of the Arduino are made available using separate multiplexers. The input pins receive the statuses from the DERs and associated microgrid components while the output pins set their connection status based on the command generated by the D-agent.
TABLE 2. DIGITAL INPUT DESCRIPTION Pin label SGS WGS BGS GGS StGS LGS SGCS WGCS BGCS GGCS StGCS LGCS Digital Pins - Input Description solarGetStatus() windGetStatus() biogasGetStatus() gridGetStatus() storageGetStatus() loadGetStatus() solarGetConnectionStatus() windGetConnectionStatus() biogasGetConnectionStatus() gridGetConnectionStatus() storageGetConnectionStatus() loadGetConnectionStatus()

2) Implementation The computation on various parameters and statuses of the microgrid components mentioned in the above section are programmed and implemented using the Arduino IDE. All the functions that are explained below are an indicative representation of the actual implementation and has been extended to all the other components.
TABLE 3. DIGITAL OUTPUT DESCRIPTION Pin label SSCS WSCS BSCS GSCS StSCS LSCS Digital Pins-Output Description solarSetConnectionStatus() windSetConnectionStatus() biogasSetConnectionStatus() gridSetConnectionStatus() storageSetConnectionStatus() loadSetConnectionStatus()

The select signals for the Multiplexer are generated by the digital output pins of the Arduino, for example the select signals for the analog input parameters have been depicted in table 4. These signals select the analog pins based on the command given by the control agent. The select signals for other multiplexers have been implemented in the same way.
TABLE 4. SELECT SIGNALS FOR ANALOG INPUTS
Pin 6 0 0 0 0 1 1 1 Pin 5 0 0 1 1 0 0 1 Select Signals Pin 4 0 1 0 1 0 1 0 Output Pin SP1 SP2 WP1 WP2 BP1 BP2 StP

a) Read Analog Parameters: i) solarGetParameters(): The various analog parameters sensed by the Arduino are listed in table 1. The pseudocode to read one such parameter (Solar Parameter) is given below in table 5. In this code, the function is used to get two parameters of solar PV. These two parameters are analog

values which have been scaled to the range of 0-5V. Since we are using a multiplexer IC CD4051, the select pins are triggered by using digital signals from the Arduino. This is represented by the lines 5-8 of the code. The analogRead() reads the analog parameter i.e. solar parameter in this example, from the pin 0 of the Arduino. The pins corresponding to each parameter is given in the table 1.
TABLE 5. PSEUDOCODE - SOLARGETPARAMETERS()
Call solarGetParameters(int a,int b) Initialize array of size 2 Initialize i to zero Define x,y,z as Integers For I=0 to 2 do x=i%2 y=(i/2)%2 z=(i/4)%2 Write x to pin 6 Write y to pin 5 Write z to pin 4 Read analogpin 0 Store value in array Return a,b End

The solarGetConnectionStatus() in operation resembles the solarGetStatus() except for the signal given to the select pins, which is 0110 in this case. c) Write Digital Outputs The digital outputs available at the output pins of the Arduino are the commands generated by the D-agent by invoking the setConnectionStatus(). Whenever an interrupt is triggered at the interrupt pin of the Arduino, pin 2 in this case, the setConnectionStatus() is invoked. A pseudocode to explain this function is given in table 8.
TABLE 8. PSEUDOCODE - SETCONNECTIONSTATUS()
Call interrupt() Assign interrupt to pin 2 Check for interrupt If interrupt signal available Call emergency() Initialize array x of size 4 Read digital pin 3 Store the value in the array Call SetConnectionStatus() Read array x[4] Write x[0] to pin 19(analog 5) Write x[1] to pin 12 Write x[2] to pin 13 Write x[3] to pin 18(analog 4) End

b) Read Digital Inputs:


TABLE 6. PSEUDOCODE - SOLARGETSTATUS()
Call solarGetStatus(int a) Define a as Integer Write 0 to pin 7 Write 0 to pin 8 Write 0 to pin 9 Write 0 to pin 10 Read pin 11 Store the value in a Return a End

Upon triggering the interrupt, the SetConnectionStatus() is invoked and it receives an integer array of size four from the D-agent. The first three values represent the select signals for the output multiplexer and the last value represents the connection status that needs to be set. This has been implemented for other microgrid components by appropriate changes in the above mentioned program. d) Override Switch The function of the override switch is to turn off all the ongoing operations when there is an emergency situation. This function is invoked by the user agent. Whenever there is an emergency, the user agent triggers a switch which sends a digital value to the Arduino. The sensed value indicates either a normal or an emergency state. If an emergency state is sensed, the system is shut down thus preventing any major damage to the system. The pseudocode for this function is given in table 9.
TABLE 9. PSEUDOCODE - OVERRIDE SWITCH
Override switch() Initialize user=0 Define user as INTEGER Read Digital pin 17 (analog 3) Store the value in user Check if value of user is >0 Stop all processes Else Continue End

i) solarGetStatus(): The solarGetStatus() retrieves the operating status of the solar component, normal-0 or emergency-1. The pseudocode given in table 6 obtains the status of the solar PV which has also been extended to other components. The select signals are given to pins 7-10, all 0 in this example to denote solar, from the Arduino. The digitalRead() reads the binary value available at the input pin, which is the 11th pin for solar PV. ii) solarGetConnectionStatus(): The connection status of the solar component is retrieved by the solarGetConnectionStatus function, shown as 0-disconnected and 1-connected. The pseudocode given in table 7 procures the connection status of solar PV.
TABLE 7. PSEUDOCODE - SOLARGETCONNECTIONSTATUS()
Call solarGetConnectionStatus() Define b as integer Write 0 to pin 7 Write 1 to pin 8 Write 1 to pin 9 Write 0 to pin 10 Read pin 11 Store the value in b Return b End

The status values of the various functions are given in the table 10.

TABLE 10. STATUS TABLE


Status 0 1 Status 0 1 Status 0 1 Status 0 1 solarGetStatus() Description Normal Emergency solarConnectionStatus() Description Connected Disconnected solarSetConnectionStatus() Description Connect Disconnect OverrideSwitch() Description Continue Halt Process [2]

[3]

[4]

[5]

IV. CONCLUSION The DG and agents of an MAS has been implemented to suit the basic functionalities of a rural Indian microgrid. This enables the implementation of a low-cost and application-specific architecture. The use of Arduino microcontroller provides ease of operation and maintenance. The number of input parameters processed by the system is extendable owing to the modularity introduced into the system by the use of multiplexers. A proactive choice of using the Arduino and multiplexers to process the incoming data from the microgrid components has been made in our paper. The net cost of the off-the-shelf components such as Arduino and peripheral circuitry was found to be $33. V. RELATED WORK Hardware implementation of a multi-agent system using the Arduino coupled with a ZigBee device has been discussed by Ranade et al [13]. Here, the agents are connected to the network and focus on capacity discovery within the microgrid system. In our model, we look at implementing a multi-agent based control using an Arduino board capable of taking input parameters from the sensors. Kim et al, propose a multi-agent system for an autonomous microgrid control where the system has been designed using the ADIPS/DASH framework [14]. In our case, the system has been implemented in Arduino taking inputs from the DG agents connected to their respective microgrid components. Individual agent systems have been grouped into agent societies for a simple microgrid [15]. REFERENCES
[1] Alexandra Dawe, Steve Erwood,. Edwin Nichols and Janet Dalziell, "Greenpeace International Annual Report 2012", Greenpeace International, Amsterdam, The Netherlands, 11 April 2013. [Online]. Available :

[6]

[7]

[8]

[9] [10] [11]

[12]

[13]

[14]

[15]

http://www.greenpeace.org/international/Global/international/publicatio ns/greenpeace/2013/GPI-AnnualReport2012.pdf Anto Budiardjo, "GridWeek: Collaboration is the Smart Grid Word of the Day", The Energy Collective (www.thenergycollective.com), September 2013. [Online]. Available : http://theenergycollective.com/antobud/65057/gridweek-collaborationsmart-grid-word-day Ministry of Power, Government of India, "Re-Structured Accelerated Power Development and Reforms Programme (APDRP) during XI Plan", 19 September 2008. [Online]. Available : http://www.apdrp.gov.in/OrderSGuidelines/Mop%20Order(19.09.08)% 20-%20Presidential%20approval%20of%20R-APDRP.pdf Saifur Rahman and Manisa Pipattanasomporn, "Modeling and Simulation of a Distributed Generation-Integrated Intelligent Microgrid", SERDP Project SI-1650, February 2010. [Online]. Available : www.serdp.org/content/download/6178/83316/file/SI-1650FR.pdf? Hassan Feroze, "Multi-Agent Systems in Microgrids: Design and Implementation", Master's Thesis, Department of Electrical and Computer Engineering, Virginia Polytechnic Institute and State Univeristy, Blackburg, State of Virginia, USA, 2009. [Online]. Available : http://scholar.lib.vt.edu/theses/available/etd-08212009120733/unrestricted/Feroze_H_T_2009.pdf Yashraj Khaitan, "Prepaid Power Through Smart Microgrids for Sustainable and Intelligent Electrification of India", pp. 8, Gram Power, Jaipur, India, 2012. [Online] Available : http://indiasmartgrid.org/en/Lists/TechnologySessionFiles/Attachments /25/Gram%20Power%20Presentation_MSEDCL.pdf Sanjoy Sanyal and David Ferris, "A New Ventures India Briefing Note : Microgrids in Uttar Pradesh and Bihar", New Ventures India, India, April 2013. [Online]. Available : http://nvindia.biz/documents/NVI_BriefingNote_Micro-Grid-UPBihar_Apr2013.pdf Wikipedia, Comparison of Agent-based Modelling Software [Online]. Available : http://en.wikipedia.org/wiki/Comparison_of_agentbased_modeling_software Foundation for Intelligent Physical Agents (FIPA): http://www.fipa.org Energy Management System Application Program Interface (EMSAPI) Part 301: Common Information Model Base, IEC, Edition 1.0, Nov 2003 Fabio, B ; Agostino, P ; Giovanni, R, Developing Multi-Agent Systems with JADE. Available : http://www.dia.fi.upm.es/~phernan/AgentesInteligentes/referencias/bell ifemine01.pdf Magid, N ; Giovanni, C ; Parisa, A.B., A Methodology for the Analysis and Design of Multi-Agent Systems using JADE. Available : http://jade.tilab.com/doc/tutorials/JADE_methodology_website_version .pdf Gampa, K.; Ranade, S.J.; Jain, P.; Balakrishnan, M.; Yemewar, S., "Performance analysis of capacity discovery algorithm on hardware platform," North American Power Symposium (NAPS), 2010, pp.1,7, 26-28 Sept. 2010 Kim, Hak-Man, Lim, Yujin and Kinoshita, Tetsuo, (2012), An Intelligent Multiagent System for Autonomous Microgrid Operation, Energies, 5, issue 9, p. 3347-3362. Available : http://EconPapers.repec.org/RePEc:gam:jeners:v:5:y:2012:i:9:p:33473362:d:19895 Cossentino, M.; Lodato, C.; Lopes, S.; Pucci, M.; Vitale, G.; Cirrincione, M., "A multi-agent architecture for simulating and managing microgrids," Federated Conference on Computer Science and Information Systems (FedCSIS), 2011, pp.619,622, 18-21 Sept. 2011

You might also like