Design and Implementation of Real-time Intelligent Control and Structure Based on Multi-agent Systems in Microgrids

By consulting various worldwide definitions of microgrids and distributed energy, this study presents a microgrid-structured multi-agent system and uses Matlab/Simulink to construct a circuit with microgrid features, which enables the changes in each electrical source and load in the microgrid to be monitored and controlled. This multi-agent system adheres to the Java Agent Development Framework (JADE) platform specifications of the Foundation for Intelligent Physical Agents (FIPA), facilitating communication, information transfers, and the receipt of real-time information regarding the microgrid and each component in the microgrid. Furthermore, the real-time state in the microgrid can be correspondingly controlled, achieving the most efficient real-time monitoring and control for electrical sources and load management in the microgrid.


Introduction
The World is currently facing an energy crisis because of the gradual rise in energy demands and carbon dioxide emissions.Concern has spread across the globe and issues of renewable energy and environmental protection have been examined in various research fields.With regards to power systems, numerous countries are actively developing renewable energy and highly efficient green power generation components, such as solar power generation, wind power generation, micro-turbines, and fuel cells.Zheng et al. [1][2][3] present microgrids as an effective policy option to resolve energy issues and decrease carbon dioxide emissions.Microgrid operations can be divided into the following two modes [4]: 1. Grid-connected mode that operates when connected to the utility power source; 2. Islanded mode that generates power independently from the utility power source.
There are also operation methods that were designed specifically to protect critical loads [5].Microgrids differ from traditional power system control regarding control and management.Although traditional power systems are primarily controlled by central units and large-scale power systems are managed, microgrids are comprised of multiple distributed energy sources with varying capacities and features and that have low-voltage compact power.Thus, effectively planning microgrid power sources and load management is a vital issue for power supply [6,7].
A multi-agent system is a type of smart management system comprising multiple agents that can communicate and interact, possess a high degree of autonomy, and make judgments independently or cooperate to complete objectives.These systems are adaptable to various system environments and designed with significant elastic space.Therefore, numerous studies have focused on the use of multi-agent systems in microgrid management [8][9][10].
Traditionally, monitoring agents are installed on each component when microgrids and multi-agent systems operate together for supervision and control.Logenthiran et al. [8][9][10] unify management by using an agent to exclusively manage the load and power source; judgments are then reconsidered once all information regarding power sources and loads are received.In other words, the state of the microgrid can be determined from a single management agent.In this study, in addition to installing an agent at the power source and load, an agent was installed at each circuit breaker.After receiving information regarding the power source and load for the entire system, each breaker agent makes judgments to control the closing and cutting off functions of the component.Therefore, control is relatively simple and convenient, and decisions can be made rapidly to manage the microgrid power source and load.
Kim et al. [11] focused to study a multi-agent system of islanded microgrids based on a power market environment and Kim et al. [12] implemented the multi-agent system by using the Agent-based Architecture of Distributed Information Processing Systems (ADIPS)/Distributed Agent System based on Hybrid Architecture (DASH) framework.This study used the Java Agent Development Framework (JADE) multi-agent system to perform real-time monitoring for the management of microgrid power sources and loads.Because the primary objective of this study was to explore methods for protecting critical loads, the mechanism and emphasis of protection differ from those in [11,12].Microgrid operations were primarily powered by distributed energy, and the microgrid was also connected to the utility power source to provide auxiliary power when distributed energy alone was unable to provide sufficient power to the microgrid.The utility power source continued to provide power to the microgrid until distributed energy regained the capacity to fully power the microgrid.Empirical and simulated results demonstrated that the multi-agent system designed could satisfy demand while effectively providing real-time power source and load management in the microgrid.

Microgrid System
A microgrid system is a power supply system composed of distributed energy sources; it primarily includes biomass energy, fuel cells, geothermal power, solar power, wind power, gas turbines, and compound internal combustion engines [13].Microgrids are often used for an entire region, combining local distributed energy sources and connecting with the utility power source network to supply power.Operationally, microgrids can be divided into the grid-connected mode and the islanded mode.Loads can be differentiated as critical loads that cannot be cut off and non-critical loads that can be cut off.
Microgrids have one unique characteristic, that is, all power sources and loads in the network can be cut off or closed at any time [14].Therefore, plans and adjustments can immediately respond to power supply and load demand, significantly increasing power consumption efficiency.The plug and play function in the microgrid's power supply and load is primarily because of the breakers installed on each component in the microgrid.By controlling the breaker's power using external signals, each component can adjust to and compensate for the state of the overall network.
In addition to using renewable energy as the primary source of power generation and the ability to cut off or integrate with the utility power source system at any time, microgrids can also add smart meters in the future, allowing users to obtain information regarding power consumption at any time to instantly manage their power efficiency.Furthermore, multiple microgrid systems can communicate and interact, achieving even more comprehensive applications.Figure 1 presents the structural diagram of the microgrid system.

Multi Agent System
Multi-agent systems use a decentralized framework, including two or more agents; they design agents with specific functions for various demands, and these agents communicate and transmit messages between each other.Therefore, when a multi-agent system executes a task, each agent fulfills its responsibility, discussing problems, requesting assistance, and coordinating with other agents to complete the task together.For example, multi-agent systems monitor the components in a small power system shown in Figure 2. Because agents can communicate and discuss with other agents, multi-agent systems are particularly suitable for large-scale distributed energy networks.However, multi-agent systems include numerous agents, and each agent must be able to coordinate and communicate with every other agent; therefore, designing multi-agent systems is complicated.Although multi-agent systems can manage the operations of can large scale systems, because of a multitude of agents in the system, starting with a poorly designed system inhibits an agent's ability to receive a response to a sent message, causing the entire system to shut down.Therefore, problems in each agent's settings must be noted early in the design process.JADE is one type of multi-agent system that can be designed according to user-specified system environments.Once activated, JADE first builds a main container in the host, from which other subsidiary containers can be established.Each container can then build its own respective agents, creating an agent system operational platform where each container in the system is built on top of a computer host (Figure 3).In the middle is the host on which the main container is built, on each side is the general container host, and A1, A2, A3, and A4 are agents.Once JADE constructs an agent system operational platform, all agents in the system can communicate and send messages within the platform.Additionally, various agent platforms can also communicate and send messages through network transfers (Figure 4).However, if agents' containers or platforms differ, their method of communication also differs.If one agent wishes to transmit a message to another agent in the same container (such as A2 and A3 in Container 1, Figure 4), the message content is only required to be transmitted as a java object.If one agent wishes to communicate with another agent in the same platform but a different container (such as A3 in Container 2 and A4 in Container 3, Figure 4) a java remote call can be used to transmit the message.Finally, if the two agents wishing to communicate are in different platforms (such as any container in Platform 1 and the main container in Platform 2, Figure 4) the message can be transmitted by the Foundation for Intelligent Physical Agents (FIPA) standard.

Micro Grid Multi Agent Management System
The power source side of the microgrid structure in this study included a utility power source (AC source), solar power cell (DC source), storage battery/battery bank (battery), and fuel cell; both critical and non-critical loads were used, and an agent was installed in each of these components, including a source agent for the power source side, a load agent for the load side, and a breaker agent and a switch agent to receive messages and make decisions and control situations (Figure 5).In addition, Figure 6 shows the relationship between microgrid network and each agent described as follows.

Source Agent
Source agents include AC source agents, DC source agents, battery source agents, and fuel cell source agents.Source agents primarily monitor and control the status of each source, sending information regarding the status of these sources to breaker agents and switch agents.

Load Agent
Load agents include critical load agents and non-critical load agents.Load agents primarily monitor and control load demand and status, sending the load status and demand to breaker agents and switch agents.

Breaker Agent
Breaker agents primarily receive information from source and load agents and make immediate decisions, controlling the close or cut off functions for any of the breakers in the circuit.

Switch Agent
Switch agents primarily receive information from source and load agents and make decisions regarding the role of solar energy in powering the microgrid or charging batteries.

Simulation and Analysis
The simulation software adopted for this study was Matlab/Simulink (MathWorks, Natick, MA, USA).The circuit architecture primarily comprised power and load sides.Four power sources were involved on the power side, namely, mains electricity, photovoltaic cells, storage batteries, and fuel cells.The load settings varied according to differing conditions.The load was switched to normal when the circuit was operated in the grid-connected mode.In the islanded mode or if failures occur, the load can be switched to critical or non-critical.Along the path between the power and the load, each power source was connected to a circuit breaker and transformer.An additional inverter was connected to the DC source.As shown in Figure 7, one circuit breaker was connected to each load between the power and the load side.The important components with red highlight in Figure 7 can compare with the components in Figure 5 in order to see the relationship between the Simulink circuit and the agent system.These important components are installed with agents so the component status of Matlab/Simulink can be sent to the JADE agent system.If the breaker needs to switch after judgment, the JADE agent system will send a signal to the corresponding breaker in Matlab/Simulink.The circuit models in Figure 7 were created by the SimPowerSystems toolbox in Matlab/Simulink.Four scenarios regarding the power and load management of microgrids were analyzed in this study: (1) distributed energy sources as the primary power supply mode; (2) mains electricity as the primary power supply mode; (3) distributed energy sources integrated with mains electricity as the primary power supply mode; and (4) failure of all power sources (tripping).As shown in Figure 8, the multi-agent system begins by searching for information on the power source and load when simulating these four scenarios.

Distributed Energy as the Primary Power Supply Mode
The power source side in this mode included AC sources and distributed energy sources, and both critical and non-critical loads were used.As the primary power source, distributed energy sources directly supply the load to the power network.However, when the distributed energy sources were unable to supply sufficient loads to the microgrid, the multi-agent system integrated the AC source into the microgrid for auxiliary power until the distributed energy sources regained the ability to provide power as normal, at which point the AC source was cut off.The operational procedures are shown in Figure 9.In the beginning, power is primarily supplied by distributed energy sources from 0.0 to 0.2 s; power from these sources decreases between 0.2 and 0.5 s, leading to insufficient power supply for loads.Here, the multi-agent system integrates the AC source with the power grid for auxiliary power to maintain the normal load state (Figure 7).After 0.5 s, distributed energy sources regain power at which they can stably supply power to the loads, cutting off supply from the AC source and allowing distributed energy sources to once again become the primary power source.The power supply and load demand settings are presented in Table 1.
Table 1.The setting of each power and load.Circuits were simulated for 1 s.Between 0.0 and 0.2 s, distributed energy sources could satisfy load demand; therefore, the multi-agent system determined that distributed energy sources and all load breakers should be closed.Transmitting a signal "1" closes distributed energy sources and load breakers.The AC source breaker received a "0", which indicated that it should remain disconnected; the switch received a "1", transferring the DC source output to the microgrid power supply.Between 0.2 and 0.5 s, distributed energy begins to decrease below the load demand.Here, the multi-agent system transmits a signal "1" to the AC source breaker to integrate the AC source with the microgrid and supply power.Once the distributed energy can provide sufficient power for the loads at 0.5 s, the multi-agent system resends a "0" to the AC source breaker to disconnect the AC source from the microgrid.The switch condition for each circuit component is presented in Table 2.The switch status wave form, voltage, and power for each component are shown in Figures 10-13.
All loads can be supplied in this state, but the decrease in distributed energy at 0.2 s causes a slight decline in power and voltage.However, the multi-agent system immediately integrates the grid with the AC source for power supply, rapidly restoring power.The AC source was disconnected at 0.5 s because the required power from the load side was satisfied.The final measured load side voltage was 240 V and the power was 50 kW Table 2.The condition of each breaker.

Mains Electricity as the Primary Power Supply Mode
This mode is specific and differs from the operational modes of conventional microgrids.The main purpose of this mode is to protect critical loads in the microgrid, and the primary power source in this mode is mains electricity.The loads comprise critical and non-critical loads.Initially, power provided by mains electricity is used to support these two load types.When mains electricity fails and trips, distributed energy is then connected to the microgrid to support critical loads.This prevents critical loads from losing power because of tripped mains electricity.Because this unique approach was designed to protect critical loads, the distributed energy connected is only sufficient to supply power to critical loads.Therefore, non-critical loads may be cut off from the microgrid if mains electricity fails and trips.The operational procedures are shown in Figure 14.Simulation procedures comparable to those discussed in Section 5.1 can create a similar waveform, which verifies that the mode and procedures are applicable to the microgrid.

Figure 14.
Flowchart of the mains electricity as the primary power supply mode scenario.

Distributed Energy Integrated with Mains Electricity as the Primary Power Supply Mode
This mode supports the loads using both mains electricity and distributed energy.When mains electricity fails and trips, non-critical loads are cut off from the microgrid; thus, the distributed energy supports only critical loads.This design prevents critical loads from losing power because of tripped mains electricity.
When mains electricity is restored to normal status, non-critical loads are reconnected to the microgrid.Consequently, non-critical loads are again supported by both mains electricity and distributed energy.The operational procedures of this mode are shown in Figure 15.Simulation procedures comparable to those mentioned in Section 5.1 can create a similar waveform, which verifies that the mode and procedures are applicable to the microgrid.

Failures
This mode is used to simulate and analyze the power trip scenario.Primarily supported by mains electricity, the loads of this mode can be categorized as critical and non-critical.Initially, both loads are supported by mains electricity.If the power source fails and no alternative source is capable of supplying power within the entire microgrid, the grid experiences power failure.The operational procedures are shown in Figure 16.Simulation procedures comparable to those discussed in Section 5.1 can create a similar waveform, which verifies that the mode and procedures are applicable to the microgrid.

Conclusions
This study successfully constructed a microgrid system, including both a source side and a load side.The source side included an AC source, DC source, batteries, and fuel cells; the load side was designed to meet the supply from the source side, enabling the distributed energy to power all loads.When the distributed energy alone was insufficient, an AC source was used for auxiliary power.
The JADE multi-agent system platform used in this study adhered to FIPA regulations.Therefore, the communication design between multiple components in the system was relatively convenient and a four-agent system (source agent, load agent, breaker agent, and switch agent) was designed to complement the microgrid circuits and employed to monitor and provide real-time management of the entire microgrid system operations.The simulation results gained for the microgrid in various states indicated that if the AC power provided by a general utility power grid can stabilize the load, the distributed DC source destabilizes the load side voltage.Therefore, although a multi-agent system provides real-time management, other auxiliary power electronic components may be required for the plug and play function of the source and load to achieve sustained load side voltage stability after the power is supplied.The following conclusions can be made from the research results described above: (1) A microgrid using a Matlab/Simulink structure can effectively achieve management through JADE, allowing each component in the microgrid to communicate and obtain the status of the entire network at any time.(2) When unexpected situations occur in the microgrid, JADE can immediately respond and manage the situation; for example, it can rapidly disconnect the AC source in island mode and integrate distributed energy into the grid to provide power supply.Once power has been restored to the AC source, it can be reconnected with the system immediately to provide power.(3) The use of multi-agent systems in microgrids is extremely flexible because the monitoring and management can be adjusted to microgrids of various structures and demands.

Figure 1 .
Figure 1.Structure diagram of micro grid.

Figure 4 .
Figure 4.The connection between two different agents.

Figure 5 .
Figure 5. Structure diagram of multi agent system and micro grid circuit.

Figure 6 .
Figure 6.Relationship chart between micro grid and each agent.

Figure 8 .
Figure 8. Power and load information collected by the multi-agent system.

Figure 9 .
Figure 9. Flowchart of the distributed energy as the primary power supply mode scenario.

Figure 11 .
Figure 11.The total load power.

Figure 13 .
Figure 13.Voltage wave of the load.

Figure 15 .
Figure15.Flowchart of the distributed energy integrated with mains electricity as the primary power supply mode scenario.

Figure 16 .
Figure 16.Flowchart of the power failure scenario.