Micro-Grids: A Cost-Efficient Controller for Isolated Ones in Remote Areas

### **Chapter 1**

## Design and Simulation of Low-Cost Microgrid Controller in Off-Grid Remote Areas

*Tapparit Bangtit*

### **Abstract**

This study presents the microgrid controller with an energy management strategy for an off-grid microgrid, consisting of an energy storage system (ESS), photovoltaic system (PV), micro-hydro, and diesel generator. The aim is to investigate the improved electrical distribution and off-grid operation in remote areas. The off-grid microgrid model and the control algorithms developed using MATLAB Simulink and State flow. The energy management system is focusing on the state of charge of the energy storage system. The microgrid controller controls the operation mode and power generation from the distributed generations' local controller, i.e., PV, micro-hydro, and diesel. It also controls the smart meters of the loads to be connected or disconnected to the microgrid. The simulation results show that the proposed microgrid control can control the target off-grid microgrid in given possible scenarios. The off-grid microgrid managed to meet the energy demand with the lowest power outage and the diesel generator operation's lowest cost.

**Keywords:** Microgrid, Microgrid Control, Microgrid Controller, Off-grid Microgrid, Islanded Microgrid, Remote Microgrid. Low-cost microgrid controller. Renewable energy, Energy Management

### **1. Introduction**

In remote areas of some countries worldwide, an approaching the electricity is sometimes unable for the communities located away from the central utility system. In Thailand, most of the villages without electricity located in remote jungle areas, which difficult to access and on the sea island. Therefore, expanding the service areas by planting power poles and cables is challenging because several problems and procedures for permitting the areas could take a long time. Additionally, The Ministry of Interior supports the monetary fund for distributing the Solar Home System (SHS) to around two hundred thousand households in Thailand's rural areas, which inaccessible to the primary utility grid [1]. Integrating the local electricity generation, i.e., micro-hydro plants and photovoltaic systems with battery energy storage controlled with a microgrid controller, might be the practical and optimal solution. The power generation and consumption in the off-grid microgrid could be managed intelligently by the microgrid controller. The proper microgrid controller algorithm could improve the efficiency and reliability of the microgrid. Besides, the proposed microgrid controller could apply in other areas, such as

islands and the area between Thailand and Myanmar's burden. Therefore, this project aims to study and develop microgrid control algorithms for a low-cost offgrid microgrid controller. The controller would have required low maintenance and improved its operation conveniently to be implemented in PEA projects in Thailand and reduce importing the microgrid controller from other countries.

### **2. Literature review**

### **2.1 Microgrids**

A microgrid is a subsystem of the primary electrical grid, which generally comprises generation capabilities, storage devices or energy storage systems (ESS), and controllable loads. Additionally, a microgrid may operate either connected to the primary electrical grid, grid-connected/on-grid mode, or operated independently from the primary electrical grid, islanded/off-grid mode [2, 3]. The U.S. Department of Energy also defines the microgrid as "a group of interconnected loads and distributed energy resources (DERs) with clearly defined electrical boundaries that acts as a single controllable entity for the grid and can connect and disconnect from the grid to enable it to operate in both grid-connected or islanded modes" [4]. The basic concept of a microgrid is illustrated in **Figure 1**.

Microgrids have crucial advantages, including (1) There is no disruption to the loads within the microgrid systems due to abilities to separate itself when disturbances occur in the primary grid. (2) The optimization of the system operation is contributed. (3) Grid failure during peak load periods is prevented by reducing the load on the grid. (4) Zero or low emission electricity generation provides benefits to the environment [5].

### **2.2 Off-grid microgrid**

When the electricity from the primary utility grid is inaccessible and costly to expand the system to remote areas, off-grid microgrids or standalone microgrids are commonly be the solution [6].

In recent years, research on the off-grid or standalone microgrid has become interesting for researchers and electric utilities worldwide. Many studies have shown that an islanded microgrid operation is feasible and has many economic and

### **Figure 1.**

*Basic concept of a microgrid (adapted from [2]).*

*Design and Simulation of Low-Cost Microgrid Controller in Off-Grid Remote Areas DOI: http://dx.doi.org/10.5772/intechopen.98551*

technical benefits of the pilot project in different countries in the world [7]. In south Asia, solar photovoltaic (PV) and mini/micro hydro systems technologies are usually used for off-grid electrification. Solar Home Systems (SHSs) and mini-grid are typically included 20–100 Wp (peak watt) PV panels, batteries for energy storage, and high-efficiency lamps, e.g., LED. The systems typically supply AC electricity in the range of 2–150 kWp, mainly used for lighting. The mini/micro hydro systems (typically range 50 kW – 3 MW) also have been used to form mini/microgrids to provide AC electricity locally. The rural electrification in detail and renewable energy resources in South Asia, particularly in India, Bangladesh, and Nepal, is mentioned in [6].

In [8], the current development state of major off-grid microgrids worldwide has been presented. In China, 50% of the population are living in rural areas. By 2013, the capacity of grid-connected and off-grid microgrids comprised of solar PV, hydro, and diesel was increased. China also aims to install PV off-grid microgrids to provide 1.19 million people who without electricity in 2015. In India, one-quarter of India's population still without electricity. EV batteries are promoted to be used as a grid source by the Indian government. They have biomass gasifiers, solar PV, small wind turbines, small hydro plants, and biogas systems to supply the electricity in rural off-grid and industrial applications. In the Philippines, there are 375 MW in the total capacity of diesel off-grid microgrids that have less than 500 kW operating capacity to supply electricity to rural areas. These microgrids are running around 6– 8 hours per day. In Africa, two-third of the population still unable to access electricity. Solar home systems (SHSs) Off-grid microgrids are rapidly being developed, especially in Sub-Saharan. On-grid microgrids in Sal Island and Santiago have a mix of various generations, including solar PV, wind turbine, and diesel. In this country, PV and diesel generators are being funded to scaling up continuously [8]. **Figure 2** illustrates an example of the off-grid microgrid system.

**Figure 2.** *An example of off-grid microgrid system [9].*

### **2.3 Distributed generations**

The definition of the distributed generation has a wide range of generation schemes. Some countries focus on large-scale generation connected to the grid. On the other hand, some other countries focus on small-scale generation units connected to the grid. According to [10], distributed generation has been defined as 'an electric power generation source connected directly to the distribution network of on the customer side of the meter'. Implementing distributed generations in the distribution system has many benefits, including:

1.Support load increase locally.

2. It can be installed easily.

3.Flexible for location and voltage level.

4.Well sized for small required load.


7. Increase the systems' equipment lifetime.


13.Eliminate or reduce the emission to the environment [11].

The example of distributed generation technologies including reciprocating engines, gas turbines, microturbines, small/micro-hydro, fuel cells, photovoltaics, solar thermal, wind turbine, geothermal, ocean energy, Stirling engine, and battery storage [10, 12]. The distributed generation technologies are illustrated in **Figure 3**.

### *2.3.1 Photovoltaic*

Photovoltaics (PVs) are commonly known as solar panels. They comprise the multiple semi-conductor cells connected either parallel or series to generate direct current (DC) electricity using the sunlight radiation through the photovoltaic effect. Direct current electricity is converted to alternating current (AC) by typically using inverters in order to supply electricity to the AC loads or to connect to the utility grid [14, 15]. The output power is proportional to the surface area of the cells. The output current and voltage are functions of solar radiation and temperature, respectively. A maximum power point tracking (MPPT) system inside the inverter has a crucial role in obtaining the maximum power output [14]. **Figure 4**

*Design and Simulation of Low-Cost Microgrid Controller in Off-Grid Remote Areas DOI: http://dx.doi.org/10.5772/intechopen.98551*

**Figure 3.** *Distributed generation technologies (adapted from [13]).*

**Figure 4.** *Typical V-I characteristic of a PV module [14].*

illustrates the typical V-I characteristics of the PV module. However, there are two significant challenges for solar PV to be connected to the electricity grid. (1). Solar PV systems lack inertia affecting the grid stability due to the lack of rotating machines, unlike other conventional rotating machines [16]. (2). Power generated from solar PVs depends on the availability and intensity of sunlight and temperature. Grid instability could occur when under or over-generation [17]. Solar PV connected to the AC grid schematic diagram is shown in **Figure 5**.

### *2.3.2 Micro hydro*

A micro-hydropower system is considered one of the most popular in developing countries. Most of them operate in isolated mode to provide electricity to the small remote or rural areas where the primary utility grid cannot reach or not feasible due to restriction and financial-economic issues [19]. Micro-hydro power plant (MHPPs) technology has recently proven to be a feasible electric generation with good performance and low investment cost [20].

**Figure 5.**

*Block diagram of the PV system connect to the AC grid [18].*

### **Figure 6.** *Small hydro scheme [21].*

Small hydropower plant can be divided by the power capacity:

1.Mini hydro: less than 1,000 kW capacity.

2.Micro-hydro: less than 100 kW capacity [19].

A typically small hydro scheme for medium or high head is shown in **Figure 6**. Water from the river is taken from a weir through an intake then passes through a settling tank or forebay to suspend particles. Then, a penstock, a pressure pipe, conveys the water to the turbine to generate the electricity and then discharges down back to the river.

Hydro-turbines convert water pressure or water speed into mechanical power in the turbine shaft, connected to the generator. The generator converts mechanical power to electrical power. The general output power can be expressed as:

$$\mathbf{P} = \eta \text{pgQH} \tag{1}$$

### *Design and Simulation of Low-Cost Microgrid Controller in Off-Grid Remote Areas DOI: http://dx.doi.org/10.5772/intechopen.98551*

Where, P is the mechanical power produced at the turbine shaft (Watts), η is the hydraulic efficiency of the turbine, ρ is the density of water (kg/m3 ). G is the gravity acceleration (m/s<sup>2</sup> ), Q is the volume flow rate passing through the turbine (m<sup>3</sup> /s), and H is the effective pressure head of water across the turbine (m) [21].

In [20], A design and simulation of the micro hydropower plant (MHPP) connected to the grid with three-phase power electronics control with maximum power point tracking (MPPT) is presented. In [22], The variable speed operation technique of micro-hydropower generation system (MHPGS) using a direct drive Permanent Magnet Synchronous Generator (PMSG) topology has been verified effectiveness by obtaining more power from the hydraulic turbine. The study is using the three-phase grid-connected converter, which can be controlled in gridfeeding mode. This topology can be used in the off-grid microgrid because the required power from the microgrid controller can be set to the power reference in the power management at the grid-side converter. The control architecture of a variable speed MHPGS is shown in **Figure 7**.

### *2.3.3 Diesel generator*

Diesel generators in the hybrid PV diesel systems have been explained in [23]. Diesel Generators and combustion engines are usually used as the backup electrical energy supply when the primary electrical utility grid cannot provide electricity. It is usually used to be the primary source to maintain the standalone system's voltage and frequency. Diesel generators or diesel generator sets can operate individually or connected with other energy resources such as solar PV. A dual diesel generator system including smaller and larger generators is employed for fuel-saving. The small generator operates when light loads. In contrast, the larger operates when the loads increased. Diesel generators have low efficiency at low load due to the nonlinear to load ratio of the fuel consumption. The maintenance period is based on the operational hours. Additionally, electricity generation from the diesel generator sets needs expensive fuel prices, and there are also maintenance and operating costs. In the case of a hybrid system with high penetration of PV, energy storage is needed, and diesel generator sets can be operated in either continuous or intermittent operation.

### **Figure 7.** *Architecture of a variable speed MHPGS and its control design [22].*


A control schematic of the synchronous diesel generators is shown in **Figure 8**. The mechanical power and field current is controlled to regulate the voltage amplitude and frequency, respectively [25].

### **2.4 Energy storage system**

Energy Storage System (ESS) plays an essential role in the microgrids. It has an essential role in balancing the power and energy demand from the loads with power and energy generation from the distributed resources such as solar PV and wind turbine, which rely on weather conditions. Thus, energy storage can allow energy to be stored during high renewable generation or low demand periods and used during low renewable production or high demand periods [26]. The excess generated energy can be stored in the ESS and then supply to the loads during high demand or when the load demand fluctuates. Furthermore, ESS supports intermittent DGs dynamic and seamlessly transitions the microgrid between grid-connected mode and islanded mode. However, expensive devices requiring maintenance and more space for battery banks are the major drawbacks of the ESS [5].

Energy storage is essential for power and voltage smoothing, energy management, frequency regulation, peak shaving, load leveling, seasonal storage, and standby generation during a fault [27]. Energy storage technologies can be summarized as follows:

1.Pumped Hydro Storage (PHS).

2.Compressed Air Energy Storage (CAES).

3.Batteries.

4.Hydrogen Energy Storage (Fuel Cells).

**Figure 8.** *Control of the diesel engine and synchronous generator combination [25].*

*Design and Simulation of Low-Cost Microgrid Controller in Off-Grid Remote Areas DOI: http://dx.doi.org/10.5772/intechopen.98551*


### **2.5 Loads**

Typically, the population resides in the remote, isolated areas are generally small-sized communities, for instance, forests-villages and islands. These communities typically have low income, which unattractive and costly to expend the electricity from the primary utility system to reach those areas [6]. Loads in the microgrid are typically categorized into two types:


### *2.5.1 Load shedding*

Generally, for an islanded or off-grid microgrid with high renewable energy penetration, load shedding is recognized as a necessary way to maintain the power balance and stability in case of emergency conditions or if the total power generation is not enough to meet the total demand [29]. Many studies have focused on finding a suitable load shedding scheme. In [30], two types of load shedding were formed: (1) centralized load shedding and (2) the distributed load shedding.

### **2.6 Microgrid control**

### *2.6.1 Hierarchical control*

Microgrids that combine many different distributed generation and energy storage devices should have capabilities to import/export power to/from the grid and support grid-connected and standalone applications.

Hierarchical Control can be divided into three categories:

1.Primary Control (droop control).

Primary Control has a role in assuring power sharing among the distributed generations. The frequency and voltage magnitude are adjusted. The droop control in each external inverter allows DGs to operate autonomously based on the local measurement. The communication in this control scheme is avoided.

2. Secondary Control (V, F control).

Secondary Control has tasks to restore the frequency and voltage deviation produced by virtual inertia and virtual impedances. Also, perform synchronization between the microgrid and the primary grid.

3.Tertiary Control (P, Q control).

Tertiary Control adjusts the microgrid inverter's set point to control the power flow between the microgrid and the primary grid [5]. The hierarchical architecture of a microgrid is illustrated in **Figure 9**.

### *2.6.2 Outer control loops*

The power converter can be connected to the grid in parallel, and the power between the DGs and the grid can be controlled to meet the desired power. The power converters can be controlled separated into three classes:


**Figure 9.** *Hierarchical architecture of a microgrid [5].*

*Design and Simulation of Low-Cost Microgrid Controller in Off-Grid Remote Areas DOI: http://dx.doi.org/10.5772/intechopen.98551*

Nonetheless, grid-feeding cannot operate independently without an energized grid.

3.Grid-supporting: The converter the voltage amplitude with reactive power and control frequency with active power by emulating the artificial droop control equivalent to the droop control in synchronous generators the in utility grid. It is designed to support the regulation and stability of the microgrid. Grid supporting can operate as a voltage source and current source [5, 31]. **Figure 10** illustrates the converter categories. The classification of grid-connected is presented in **Table 1**.

### **Figure 10.**

*Converter categories; (a) grid-forming; (b) grid-feeding; (c) grid-supporting voltage source; (d) gridsupporting current source (Adapted from [27]).*


#### **Table 1.**

*The classification of grid-connected according to their electrical behavior and their contribution to the grid [5].*

### *2.6.3 Inner control loops*

Different control techniques can be used for the inner control loops for distributed generations to control the voltage source inverter, including (1). Classical PID, (2). Proportional resonant (PR), (3) Predictive control, (4). Dead-beat control, (5). Hysteresis control, (6). LQG/LQR, (7) Sliding mode controls, (8). H∞ controller, (9) Repetitive controller, and (10) Neural networks and fuzzy control methods [5].

### *2.6.4 Microgrid controller*

### *2.6.4.1 Dynamic dispatch strategy*

According to [32, 33], the control strategy of the hybrid system is divided into two categories:


### *2.6.4.2 Existing dispatch strategies*

The existing power management strategies reviewed in [33] can be summarized as follows:


### *2.6.4.3 Intelligent-based power management*

Intelligent-based power management uses computational intelligence techniques that utilize technology and computer science to mimic nature and human beings. The example of computational intelligence are:

*Design and Simulation of Low-Cost Microgrid Controller in Off-Grid Remote Areas DOI: http://dx.doi.org/10.5772/intechopen.98551*


In [34], it is concluded that there is no universal optimisation algorithm to be the best in solving optimisation problems. Hybrid optimisation techniques can utilize the strong advantages of each optimisation algorithm to reach an optimal solution.

### **3. Methodology**

In this study, software MATLAB R2020a with Simulink toolbox is used to develop the microgrid system model, including energy storage system, distributed generations, loads. The MATLAB Stateflow toolbox is used to develop the algorithm for the microgrid controller. All of the simulations in this study are conducted in the Phasor mode with the frequency at 50 Hz., Solver: ode23tb (stiff/TR-BDF2) with type: variable-step.

### **3.1 System layout**

In this study, The off-grid microgrid model using this study consists of the distributed generations (DGs), i.e., photovoltaics (PVs), micro-hydro, diesel

**Figure 11.** *Block diagram of the off-grid microgrid.*

Genset. The loads can be divided into two groups; (1) Essential-loads, i.e., a hospital, a school, and agriculture pumps. (2) Non-essential loads, i.e., houses (residential loads). The off-grid microgrid has an energy storage system (ESS) connected to the system.

**Figure 11** shows the block diagram of off-grid microgrid with microgrid controller, which consists of (1) energy storage system, which is batteries connected to the inverter. (2) Various distributed generation, i.e., photovoltaic arrays (PV), micro-hydro, diesel generator, has inverter as a local controller. (3) Essential and Non-Essential Loads connected to the smart meters. All elements are connected to the AC bus. The inverters, local controllers, and smart meters are monitored and controlled by the microgrid controller or microgrid central controller (MGCC) through the communication channel.

### **3.2 Model of simulation**

### *3.2.1 Off-grid microgrid model*

The off-grid microgrid system using in this study is shown in **Figure 12**. The energy storage system (ESS), photovoltaic (PV), micro-hydro, and the diesel generator are connected in three-phase at the 400 V bus. The V-I measurement tools measure the voltages and the currents of each distributed generation and ESS. Three-phase transformer 0.4/22 kV is connected to step up the system voltage to the medium voltage system (22 kV). The voltage and current of the bus 22 kV are also measured. The transformer, 22/0.4 kV, tr1, and tr2, are connected to step-down the voltage from 22 kV to 400Vline-line (230Vphase-neutral) to supply the loads single-phase 230Vphase-neutral. The unbalance voltage and the loss in the transmission line are neglected in this study.

### *3.2.2 System operation*

The off-grid microgrid needs at least one voltage source to be operated in the microgrid. In this study, the energy storage system (ESS) has a responsibility as a

**Figure 12.** *Microgrid model system layout.*

*Design and Simulation of Low-Cost Microgrid Controller in Off-Grid Remote Areas DOI: http://dx.doi.org/10.5772/intechopen.98551*

central component of the off-grid microgrid. The ESS always operates in the voltage and frequency (v, f) mode to be the main components that generate the reference frequency of the microgrid and maintain the microgrid's voltage and frequency. The distributed generation, i.e., PV, micro-hydro, and diesel generator, is connected to the microgrid. The inverter controlled the operating mode and power reference from the microgrid controller as a balanced three-phase supply. The microgrid central controller (MGCC) controls the local controller of each DG and loads by the proposed algorithms to meet the load demand and maintain the microgrid's voltage and frequency.

### **3.3 PV model**

Power generated from photovoltaic arrays (PVs) is dependent on the light intensity and temperature of the PV surface. In this study, the PV model uses the Simple Inverter block in MATLAB Simulink to imitate that the PV arrays are connected to the 3-phase inverter, which can be switched the operation mode between Maximum power point tracking (MPPT) and power reference mode. The inverter is a local controller which acts as a slave to the microgrid controller. In **Figure 13**, the power generated from PV depends on the power profile (P), which can be selected to be maximum or minimum sunlight day. The microgrid controller can control the inverter's operation mode by the control signal from the microgrid controller (Ctrl\_PV). When the inverter is controlled in the power reference mode, the power generated from the PV to the microgrid can be controlled by the reference power value sending from the microgrid controller (Pref\_PV).

### *3.3.1 PV profile*

In this study, the power generated from the PV model to the grid depends on the daily power profile. **Figure 14** shows the four selected power profiles from daily 365 days of power generated from real PV power generated profiles in Thailand, i.e., minimum, maximum, clear, and cloudy. The maximum is the profile from the day that the PV generated the highest power. The minimum is the profile from the day that the PV generated lowest power. The clear day is the profile from the average clear day. The cloudy day is the profile from the average cloudy day.

**Figure 13.** *PV with inverter model.*

**Figure 14.** *Daily power profile of PV.*

**Figure 15.**

*Stream flow rate and power output of the micro-hydro (adapted from [35]).*

### **3.4 Micro-hydro model**

In this study, the hydro plant uses the real profile of power generation from the hydropower plant in Khunpae village, Chiangmai, Thailand. The hydropower plant has a maximum power of 55.57 kW and 36.35 kW on average [35]. The output power of the hydropower is less than 100 kW. Thus, the hydro plant in this study can be categorized to be a 'micro-hydro. The power generated from the microhydro depends on the water level in the weir. The micro-hydro generates maximum power output during the rainy season (Jun-Nov). In the dry season, the microhydro cannot generate power due to a water shortage, as shown in **Figure 15**.

The micro-hydro's local control system in this study is assumed that the microhydro is connected to the microgrid with a 3-phase inverter. The power injected into the microgrid is controlled by the microgrid controller. The control architecture of the micro-hydro is shown in **Figure 16**.

In this study, the micro-hydro model uses the Simple Inverter block in MATLAB Simulink to imitate the 3-phase inverter, which can be switched the operation mode between Maximum power point tracking (MPPT) and power reference mode.

*Design and Simulation of Low-Cost Microgrid Controller in Off-Grid Remote Areas DOI: http://dx.doi.org/10.5772/intechopen.98551*

### **Figure 16.** *Control architecture in the micro-hydro [22].*

The inverter is a local controller which acts as a slave to the microgrid controller. In **Figure 17**, the power generated from the micro-hydro is set to the rated power (Prated\_Hydro). The microgrid controller can control the operation mode of the inverter of the micro-hydro by the control signal from the microgrid controller (Ctrl\_Hydro). When the inverter is controlled in the power reference mode, the power generated from the micro-hydro to the microgrid can be controlled by the reference power value sending from the microgrid controller (Pref\_Hydro).

### **3.5 Diesel Genset model**

The diesel generator in this study is used to be a backup system of the off-grid microgrid. In a normal situation, the diesel generator should not be operated due to the cost of fuel. The diesel generator is modeled in MATLAB Simulink assumed that the diesel generator is connected to the microgrid with a 3-phase inverter. In **Figure 18**, 'Preated\_Diesel' is set the rated power of the diesel generator. The power reference (Pref\_Hydro) for the diesel generator is set to be zero. The microgrid controller can control the diesel generator's operation to be ON or OFF by the control signal from the microgrid controller (Ctrl\_Diesel). The power generated

from the diesel generator can be either set to the rated power (Prated\_Diesel) if Ctrl\_Diesel is '1' or set to be zero (OFF) if the Ctrl\_Diesel is '0'.

### **3.6 Energy storage system model**

The energy storage system (ESS) model uses the 3-phase simple battery inverter model in MATLAB Simulink connected with the Power Measures block. Active power (P) and reactive power (Q) are measured in order to calculate the state of charge (%SOC) in the Stored Energy Calculation block. **Figure 19** shows MATLAB Simulink blocks inside the energy storage system model.

### *3.6.1 State of charge calculation*

State of Charge (SOC) is the level of the energy storage system relative to its capacity. It can be calculated from the active power (P) and reactive power (Q), which are imported or exported from the energy storage system. The state of charge of the energy storage system can be calculated as follow:

$$\text{SOC}(t) = \text{SOC}(t-1) + \int\_{0}^{t} \frac{\mathcal{S}}{\mathcal{C}\_{\text{ESS}}} \cdot \eta \cdot dt \tag{2}$$

Where SOC(t) is the state of charge of energy storage at time t (%), SOC(t-1) is the initial battery state of charge (%), S is apparent charge/discharge power (kW), is the energy storage capacity (kWh), η is the efficiency of the energy storage system (%). t is time (h). **Figure 20** shows the MATLAB Simulink blocks for calculating the state of charge of the energy storage system.

*Design and Simulation of Low-Cost Microgrid Controller in Off-Grid Remote Areas DOI: http://dx.doi.org/10.5772/intechopen.98551*

**Figure 20.** *State of charge of the ESS calculation model.*

**Figure 21.** *Internal Simulink blocks model for each load.*

### **3.7 Loads model**

In this study, there are six loads in the off-grid microgrid. They can be categorized into two groups: (1). Non-essential loads and (2). Essential loads. Each load model consists of a current control source controlled by the current calculated from the power consumption profile imported from the MATLAB workspace. **Figure 21** shows the internal MATLAB Simulink blocks of each load.

Each load model is a single-phase load connected to the smart meter and transformer, respectively. The smart meter is a single-phase meter controlled by the microgrid controller to be connected or disconnected to the microgrid. The smart meter is also used to monitor the load's power flow by measuring the voltage and the current of the load in real-time. The inside of the smart meter model is shown in **Figure 22**. The transformer is a step-down transformer, Dyn11, which converts voltage from 22 kV on the primary side to 400 V/230 V on the secondary side, as shown in **Figure 23**.

### *3.7.1 Non-essential loads model*

The non-essential loads are the group of residential loads. This study consists of houses1, houses2, and houses3, which are connected to the phase-a, b, and c of the secondary side of the first transformer (Tr1), respectively. Each model has its power consumption profile. The non-essential loads have lower priority than the essential loads. If load shedding is needed in the microgrid, the non-essential loads will be shed by the lowest priority from houses1, houses2, and houses3, respectively. In contrast, if load-restoration is required, the non-essential loads will be

**Figure 22.** *Inside the smart meter model.*

**Figure 23.** *Inside the load transformer model.*

restored by the highest priority from houses3, houses2, and houses1, respectively. **Figure 24** shows the MATLAB Simulink model of the non-essential loads connected to the smart meter and the first transformer's secondary side.

### *3.7.2 Essential loads model*

The essential loads have higher priority than the non-essential loads. They consist of office&school, hospital, and agriculture pumps connected to the phase-a, b, and c of the secondary side of the second transformer (Tr2), respectively. Each model has its power consumption profile. Suppose load shedding is needed in the microgrid, and all non-essential loads are already shed. In that case, the essential loads will be shed by the lowest priority from agriculture-pumps, office&school, and hospital, respectively. In contrast, if the load-restoration is required, the essential loads will be restored before the non-essential loads by the highest priority from the hospital, office&school, and agriculture pumps, respectively. **Figure 25** shows the MATLAB Simulink model of the essential loads connected to the smart meter and the second transformer's secondary side.

*Design and Simulation of Low-Cost Microgrid Controller in Off-Grid Remote Areas DOI: http://dx.doi.org/10.5772/intechopen.98551*

### **Figure 24.** *Non-essential loads model.*

### *3.7.3 Load profiles*

Each load model is corresponding to the load consumption profile imported from the MATLAB workspace. The six load profiles are used in the simulation. All load profiles are selected from the accurate load profile from Thailand. **Figure 26** shows the daily load profile of the six loads.

### **3.8 Power flow measurements**

The power flow among the distributed generations, energy storage system, and loads in the microgrid are calculated from the voltage and current, which are measured from each component. **Figures 27** and **28** show the power flow calculation blocks. The voltage and the current measured from the microgrid components are converted to active power (kW) to illustrate the simulation's power flow result.

**Figure 26.** *Daily load profile of the 6 loads.*

**Figure 27.** *Power flow calculation blocks for ESS and DGs.*

### **3.9 Simulation result measurements**

In this study, to find the optimal size of the components in the microgrid, i.e., energy storage system rated capacity, the rated power of photovoltaic,

*Design and Simulation of Low-Cost Microgrid Controller in Off-Grid Remote Areas DOI: http://dx.doi.org/10.5772/intechopen.98551*

**Figure 28.** *Power flow calculation blocks for the loads.*

### **Figure 29.**

*(a) The blocks for calculation the duration of the power outage and ON time of the diesel generator in the microgrid simulation (b) the blocks for indication and calculation of the energy flow in the microgrid simulation.*

micro-hydro, diesel generator, and the initial %SOC of the energy storage system. The power outage duration of the loads and ON time of the diesel generator are considered. The experiments for each case with different parameters will be conducted. The case in which the result has the lowest power outage and ON time of diesel generator will be considered the optimal case. MATLAB Simulink blocks for measuring and counting the power outage duration and ON time of the diesel generator have been built as shown in **Figure 29(a)**. Additionally, the energy consumed for each load and the energy supplied by each DG, the energy import/ export from each simulation result's energy storage system, can be calculated and shown in the display blocks, as shown in **Figure 29(b)**.

### **4. Microgrid control**

In this section, the concept of microgrid control is explained. The constraints of the off-grid microgrid are discussed. The structure, model, and algorithm of the Microgrid controller are shown.

### **4.1 Constraints**

The microgrid control has the main objective to satisfy the constraints of the off-grid microgrid as follows.

Power balance constraint:

$$P\_{totalload}(t) = P\_{ESS}(t) + P\_{PV}(t) + P\_{micro-hydro}(t) + P\_{diesl}(t) \tag{3}$$

Where *Ptotalload*ð Þ*t* is the total power consumption of the loads, *PESS*ð Þ*t* is the power import/export to the microgrid from the energy storage system, *PPV*ð Þ*t* is the power injecting to the microgrid from the photovoltaic system (PV), *Pmicro*�*hydro*ð Þ*t* is the power injecting to the microgrid from the micro-hydro, *Pdiesel*ð Þ*t* is the power injecting to the microgrid from the diesel generator.

Energy Storage System constraints:

ESS state of charge constraint:

$$\text{SOC}\_{\text{min}} \le \text{SOC}(t) \le \text{SOC}\_{\text{max}} \tag{4}$$

ESS power output:

$$P\_{\rm ESS}^{\rm min} \le P\_{\rm ESS}(t) \le P\_{\rm ESS}^{\rm max} \tag{5}$$

Where SOC(t) is the state of charge of the energy storage system, *SOCmin* is the lowest state of charge of the energy storage system, *SOCmax* is the maximum state of charge of the energy storage system. In this study, assuming the *SOCmax* is 90%, and the *SOCmin* is 20%.

### **4.2 Microgrid controller**

The microgrid controller is the central controller for the off-grid microgrid. The control of microgrids is centralized. In this study, MATLAB R2020a with Simulink and Stateflow toolbox has been used to develop the microgrid controller's model and algorithm. The microgrid controller is assumed to communicate in real-time with the distributed generations' local controller, i.e., PV, micro-hydropower, diesel generator, and smart meters for the loads. **Figure 30** shows the block of the

microgrid controller developed in MATLAB Simulink. The microgrid controller has five inputs and 11 outputs. The inputs are (1) state of charge of the energy storage system (SOC), real-time power supplied by (2) PV (Pread\_PV), (3) microhydropower (Pread\_Hydro), (4) diesel generator (Pread\_Diesel), and (5) real-time

**Figure 30.** *Microgrid controller.*

**Figure 31.** *Inside of the microgrid controller block.*

power required by loads (Pread\_TotalLoad). The output is control signals to the smart meters of the loads, i.e., (1) agriculture-pump (Ctrl\_Agri), (2) hospital (Ctrl\_hospital), (3) residential loads1 (Ctrl\_House1), (4) residential loads2 (Ctrl\_House2), (5) residential loads3 (Ctrl\_House3), (6) office&school (Ctrl\_School), the local controller of DGs i.e. (7) PV (Ctrl\_PV), (8) micro-hydro (Ctrl\_Hydro), (9) diesel generator (Ctrl\_Diesel), and the power reference value for the (10) PV (Pref\_PV), and (11) micro-hydro (Pref\_Hydro).

### **4.3 Energy management system**

The microgrid controller block consists of the energy management system block and blocks of load following PV and micro-hydro blocks. **Figure 31** shows the inside of the microgrid controller. The energy management system block has two inputs, i.e. SOC and Pread\_PV. Also, 9 outputs for control the ON/OFF operation of the loads and DGs'smart meter. The load following block receives the measuring value of real-time power generation of PV, micro-hydro, diesel, and total real-time power required by loads to control the reference power of the local controller of PV and micro-hydro.

### *4.3.1 Energy management system model*

The energy management system has been developed in the MATLAB Stateflow toolbox. **Figure 32** shows the energy management system function block using MATLAB Stateflow.

### *4.3.2 Load following models*

Load following blocks are a part of the microgrid controller. The load following has the primary function to provide power reference value to the local controller, i.e., inverter of PV and the micro-hydro's inverter. The mismatch of the power demand of the loads and power generated from micro-hydro and diesel is calculated to provide a power reference value for PV inverter to inject the specific power to the microgrid. Similarly, The mismatch of the power demand of the loads and power generated from PV and diesel is calculated to provide the power reference for the

**Figure 32.** *The energy management system using MATLAB Stateflow.*

*Design and Simulation of Low-Cost Microgrid Controller in Off-Grid Remote Areas DOI: http://dx.doi.org/10.5772/intechopen.98551*

local controller (inverter) of the micro-hydro in order to inject the specific power from the micro-hydro to the microgrid. **Figures 33** and **34** show the load following block of power reference for PV and micro-hydro, respectively.

### *4.3.3 Algorithm and flowchart*

The algorithm for the microgrid controller in this study is the SOC-based algorithm that controls the microgrid operation related to the level of state of charge (% SOC) of the energy storage system (ESS).


**Figure 33.** *Load following block of power reference for PV.*

**Figure 34.** *Load following block of power reference for micro-hydro.*


### **Table 2.**

*State of charge levels of the energy storage system.*

	- If %SOC <sup>&</sup>gt; SOC\_UltraHigh ➔ Switch the control mode in the local controller of the PV and micro-hydro to be the power reference mode.
	- If %SOC <sup>&</sup>lt; SOC\_UltraHigh and <sup>&</sup>gt; SOC\_High ➔ The controller will try maintaining the SOC level by switching the control mode of the PV to the load-following mode in which the PV is supplying the power to the microgrid as power demand from the loads. However, suppose the power generated from PV is already zero. In that case, the microgrid will switch the control mode of the micro-hydro to the load following mode instead to maintain the state of charge at this level.
	- If %SOC <sup>&</sup>lt; SOC\_High and <sup>&</sup>gt; SOC\_Discharge ➔ The microgrid controller will switch the micro-hydro control mode back to maximum power mode.
	- If %SOC <sup>&</sup>lt; SOC\_Discharge <sup>&</sup>gt; SOC\_Treshold ➔ The controller will turn the diesel generator OFF and switch the control mode of both microhydro and PV back to the maximum power mode. Then, if the SOC is increasing, all the loads will be gradually restored.
	- If %SOC <sup>&</sup>lt; SOC\_Threshold and <sup>&</sup>gt; SOC\_Low ➔ Nothing change in the signal from the microgrid central controller to the local controller.
	- If %SOC <sup>&</sup>lt; SOC\_Low and <sup>&</sup>gt; SOC\_UltraLow ➔ The controller will check whether the SOC is increasing or decreasing. If the SOC is increasing, the essential loads will be restored. If the SOC is decreasing, the Non-essential loads will be shed. Finally, if all non-essential loads are shed but the SOC is still decreasing, the diesel generator will be turned ON.
	- If %SOC <sup>&</sup>lt; UltraLow ➔ The microgrid controller will keep the diesel generator inject the power to the microgrid. If the SOC is still decreasing, the essential loads will be shed until the is no load in the system. The diesel generator will charge the ESS until the %SOC is changed to another level.

*Design and Simulation of Low-Cost Microgrid Controller in Off-Grid Remote Areas DOI: http://dx.doi.org/10.5772/intechopen.98551*

**Figure 35.** *Flowchart of the microgrid control algorithm.*

The flowchart of the energy management system in the microgrid controller can be shown in **Figure 35**.

### **5. Results and discussions**

### **5.1 Optimal sizing for the microgrid based on the proposed controller**

To find the optimal size for the microgrid distributed generations and Energy storage capacity. The microgrid is simulated in various sizes of each element. The microgrid's optimal size based on the proposed control algorithm is evaluated by the duration of the power outage and diesel operation (ON) in hours, as shown in **Figure 36**. The simulation is conducted for 72 hours (3 days), and the initial SOC for the first day is fixed at 55%. The simulation can be separated into 24 cases for each test. To find the suitable power rating of the diesel generator, whether 25 kW or 50 kW and the low-level of state of charge (SOC\_Low) of the energy storage system, the test can be separated into four tests:


The simulation results will be illustrated in the four graphs, as shown in **Figure 36**.

a. Power flow.

The power flow graph shows the power flow in kilowatt (kW) of the energy storage system (ESS), all of the distributed generation (DGs) in the microgrid, i.e., photovoltaic (PV), micro-hydro plant, diesel generator, and loads. The positive results mean the power is injected from the ESS, DGs to the microgrid. In contrast, the negative results mean that the power is imported to the ESS.

b. Energy storage system state of charge.

Shows the state of charge (SOC) in percentage (%) of the energy storage system in the microgrid.

**Figure 36.** *The duration of power outage and diesel generator in turned on are counted in each simulation case.*

*Design and Simulation of Low-Cost Microgrid Controller in Off-Grid Remote Areas DOI: http://dx.doi.org/10.5772/intechopen.98551*

c. Load Consumption.

Shows the load profile of the total load and also for each load i.e. Houses1, Houses2, Houses3, Offices&School, Hospital, Agriculture Pump.


For each test, the power rating of micro-hydro is varied from 0, 25, 50 kW. The maximum power rating of photovoltaic (PV) is varied from 100 and 200 kWp. The daily PV power generation profile is varied from Maximum sunlight profile (Max) and Minimum sunlight profile (Min). The energy storage system rated capacity is varied from 1000 to 2000 kWh. **Table 3** shows the duration of the power outage and diesel generator ON in hours simulated in 72 hours in the MATLAB Simulink off-grid microgrid model using the proposed control algorithm in the microgrid controller. It can be considered that there is no power outage, and the diesel generator is turned OFF all the time when micro-hydro generates the maximum power at 50 kW. For the worst-case scenario, there are 8 cases, i.e., case 1, 2, 7, 8, 13, 14, 19, 20 which the micro-hydro is unavailable (micro-hydro is zero). It can be seen that the shortest duration of the power outage and the diesel generator is ON is occur in case 19 with test 2 as shown in the red rectangle in **Figure 37(a)** and **(b)**.

Therefore, it can be summarized that the optimal parameter for the off-grid microgrid using the proposed algorithm to have the shortest duration of power outage and duration of the diesel generator is turned ON is as follows:


### **5.2 Response of the microgrid controller**

In this section, the microgrid model is simulated in 24 hours using the proposed microgrid controller algorithm. In order to see the microgrid controller's response for each situation, the eight scenarios can be shown in **Table 4**. According to the results from 5.1, the optimal parameter of the microgrid has been investigated. The energy storage system rated capacity is fixed to 2000 kWh, 100 kW. The photovoltaic (PV) rated power is fixed to 200 kWp. The Diesel generator-rated power is fixed to 50 kW. In order to see the response of the proposed microgrid controller, the initial SOC will be varied from 80 to 25%, the PV generation profile will be varied from Max and Min, the micro-hydro will be varied from 50 kW (max) and 0 kW (min).

The details of the simulation for each scenario can be explained as follows:


### **Table 3.**

*The number of hours of power outage and diesel generator ON in 72 hours for 4 tests in 24 cases.*

### *5.2.1 Scenario 1*

Scenario 1 illustrates the day's microgrid operation with high initial SOC and maximum power generated from PV. At the beginning of the day (00:00), the energy storage system has 80% of SOC, and the PV generates power using maximum sunlight profile. The micro-hydro is fully generating power at 50 kW constantly throughout the day. All the essential and non-essential loads are ON. PV and micro-hydro are operating in maximum power mode (MPPT). The diesel generator is OFF, as shown in **Figure 38(d)**.

In **Figure 38**, the simulation result shows that the total demand from the loads is a little bit less than the total power generation, which mainly from the micro-hydro. ESS is charging slowly from 00:00 until the sunlight comes at around 06:00. The excess energy generated from PV and micro-hydro supplied to the loads is charged to ESS.

*Design and Simulation of Low-Cost Microgrid Controller in Off-Grid Remote Areas DOI: http://dx.doi.org/10.5772/intechopen.98551*

### **Figure 37.**

*The result comparison only the case when micro-hydro is unavailable (a) power outage duration (hours), (b) diesel generator ON (hours).*

ESS is charged until the %SOC is reached SOC\_high, which is 90%. The microgrid controller changes the logic signal from '1' to '0' to tell the local controller of the PV to change the operation mode from 'MPPT mode' to 'power reference mode' at around 09:30, as shown in **Figure 38(a)**.

In the power reference mode, to maintain the %SOC of ESS, the microgrid controller calculates the power reference value to the PV to meet the loads' exceeding demand. The PV injects the power according to the power reference sending from the microgrid controller to the microgrid to supply the loads demand. The % SOC of the energy storage system is maintained at 90% (SOC\_High) throughout the day, as shown in **Figure 38(b)**.


**Table 4.**

*The parameters for the microgrid simulation for each scenario.*

**Figure 38.** *The simulation result for scenario 1 (a) power flow, (b) ESS SOC, (c) load consumption, (d) control signal.*

### *5.2.2 Scenario 2*

Scenario 2 illustrates the microgrid operation in the day with high initial SOC and minimum sunlight. At the beginning of the day (00:00), the energy storage system has 80% of SOC. The PV generates power using a minimum sunlight profile. The micro-hydro is fully generating power at 50 kW constantly throughout the day. All the essential and non-essential loads are ON. PV and micro-hydro are operating

*Design and Simulation of Low-Cost Microgrid Controller in Off-Grid Remote Areas DOI: http://dx.doi.org/10.5772/intechopen.98551*

in maximum power mode (MPPT). The diesel generator is OFF, as shown in **Figure 39(d)**.

In **Figure 39**, the simulation result shows that the power generation from the PV and micro-hydro is nearly met the total demand throughout the day. Thus, the % SOC of the energy storage system is constantly maintained at around 80% throughout the day. There is no changing signal from the microgrid controller, as shown in **Figure 39(b)** and **(d)**, respectively. However, The SOC of ESS has not reached the maximum level as compared to Scenario 1.

### *5.2.3 Scenario 3*

Scenario 3 illustrates the microgrid operation in the day with low initial SOC and maximum sunlight. At the beginning of the day (00:00), the energy storage system has 35% SOC. The PV generates power using a maximum sunlight profile. The micro-hydro is fully generating power at 50 kW constantly throughout the day. All the essential and non-essential loads are ON. PV and micro-hydro are operating in maximum power mode (MPPT). The diesel generator is OFF, as shown in **Figure 40(d)**.

In **Figure 40**, the simulation result shows that the total demand from the loads is a little bit less than the total power generation, mainly from the micro-hydro. ESS is charging slowly from the beginning of the day. The PV is generating the power to

**Figure 39.** *The simulation result for scenario 2 (a) power flow, (b) ESS SOC, (c) load consumption, (d) control signal.*

the microgrid, and ESS is also charging from 06:00 to 20:00. The state of charge (%SOC) of ESS is rising from 35–70% until the end of the day, as shown in **Figure 40(a)** and **(b)**, respectively. However, The SOC of ESS has not reached the maximum level as compared to Scenario 1.

### *5.2.4 Scenario 4*

Scenario 4 illustrates the microgrid operation in the day with low initial SOC and minimum sunlight. At the beginning of the day (00:00), the energy storage system has 35% SOC. The PV generates power using a minimum sunlight profile. The micro-hydro is fully generating power at 50 kW constantly throughout the day. All the essential and non-essential loads are ON. PV and micro-hydro are operating in maximum power mode (MPPT). The diesel generator is OFF, as shown in **Figure 41(d)**.

In **Figure 41**, the simulation result shows that the power generation from the PV and micro-hydro is nearly met the total loads demand throughout the day. Thus, the %SOC of the energy storage system is constantly maintained at around 32–35% throughout the day. There is no changing signal from the microgrid controller, as shown in **Figure 41(b)** and **(d)**, respectively. This scenario has a similar operation result with Scenario 2, both Scenario 2 and 4 also maintain the SOC level throughout

**Figure 40.** *The simulation result for scenario 3 (a) power flow, (b) ESS SOC, (c) load consumption, (d) control signal.*

the day, but the SOC level is different. In scenario 2, SOC is maintained at a high level (80%), but in scenario 4, SOC is maintained at a low level (35%).

### *5.2.5 Scenario 5*

Scenario 5 illustrates the microgrid operation in the day with high initial SOC and maximum sunlight, but no power is generated from the micro-hydro. At the beginning of the day (00:00), the energy storage system has 80% of SOC. The PV generates power using a maximum sunlight profile, assuming no power is generated from the micro-hydro due to unavailable season. All the essential and non-essential loads are ON. PV is operating in maximum power mode (MPPT). The diesel generator is OFF, as shown in **Figure 42(d)**.

In **Figure 42**, the simulation result shows that the energy storage is discharged to supplied energy to the microgrid from 00:00 to around 06:00 because there is no power either from PV or micro-hydro. From around 06:00 to 16:30, when sunlight comes, ESS is charged because total power generation is more than total power demand. The ESS is discharged from 16:30 until the end of the day because the power generation is less than the power demand, as shown in **Figure 42(a)** and **(b)**.

There is no change in the control signal from the microgrid controller. The microgrid is very dependent on energy storage for efficient operation but does not require a diesel generator, as shown in **Figure 42(d)**. Additionally, the SOC of ESS is maintained between 60–80% throughout the day.

#### **Figure 42.**

*The simulation result for scenario 5 (a) power flow, (b) ESS SOC, (c) load consumption, (d) control signal.*

### *5.2.6 Scenario 6*

Scenario 6 illustrates the microgrid operation in the day with high initial SOC and minimum sunlight, but there is no power generated from the micro-hydro. At the beginning of the day (00:00), the energy storage system has 80% of SOC. The PV generates power using a minimum sunlight profile, assuming no power is generated from the micro-hydro due to unavailable season. All the essential and non-essential loads are ON. PV is operating in maximum power mode (MPPT). The diesel generator is OFF, as shown in **Figure 43(d)**.

In **Figure 43**, the simulation result shows that when there is no power from the micro-hydro and the power from PV is not enough to meet the energy demand, the ESS is discharged from the beginning of the day to supply the energy microgrid.

The ESS is continuously discharged from the beginning of the day (00:00) until the state of charge of the energy storage system is reaching the SOC\_min (30%) at around 19:00, the microgrid controller gradually sheds the non-essential loads from the microgrid to reduce the total energy demand from the loads as shown in **Figure 43**.

However, after turned off all non-essential loads already, if the %SOC is still decreasing, the microgrid controller sends a signal to turn on the diesel generator to supply the power to the essential loads, as shown in **Figure 43** at 19:00.

*Design and Simulation of Low-Cost Microgrid Controller in Off-Grid Remote Areas DOI: http://dx.doi.org/10.5772/intechopen.98551*

### **Figure 43.**

*The simulation result for scenario 6 (a) power flow, (b) ESS SOC, (c) load consumption, (d) control signal.*

From 19:00 to the end of the day, the diesel generator runs to generate the maximum power to supply the microgrid's essential loads. The exceed energy is charging the energy storage system.

### *5.2.7 Scenario 7*

Scenario 7 illustrates the microgrid operation in the day with low initial SOC and maximum sunlight, but no power is generated from the micro-hydro. At the beginning of the day (00:00), the energy storage system has 35% SOC. The PV generates power using a maximum sunlight profile, assuming no power is generated from the micro-hydro due to unavailable season. All the essential and non-essential loads are ON. PV is operating in maximum power mode (MPPT). The diesel generator is OFF, as shown in **Figure 44(d)**.

In **Figure 44**, the simulation result shows that the energy storage system is discharged to supply the energy to the microgrid. There is no energy generated from PV and micro-hydro at the beginning of the day (00:00). The ESS is discharged until the %SOC is below the SOC\_Low (30%) at 02:20, the microgrid controller gradually sheds all the non-essential loads. Finally, the diesel generator is turned on to supply the power to the essential loads in the microgrid, as shown in **Figure 44**.

At 02:30, the ESS is charging by the diesel generator's excess energy until %SOC reaches the SOC\_Threshold level (50%) at 10:00. The microgrid controller turns off the diesel generator, and then %SOC continues to increase. The microgrid controller restores the non-essential loads to the microgrid. PV starts to generate the power to the microgrid when the sunlight comes at 06:00. The energy generated from PV is higher than the energy demand from the loads. Thus, the ESS is continuing charging.

At around 16:30, the power generated from PV is decreased. The power demand from the loads is higher than total power generation in the microgrid. Thus, the ESS is discharged until the end of the day, as shown in **Figure 44(a)** and **(b)**.

### *5.2.8 Scenario 8*

Scenario 8 illustrates the microgrid operation in the day with low initial SOC and minimum sunlight, and also, there is no power generated from the micro-hydro. At the beginning of the day (00:00), the energy storage system has 35% SOC. The PV generates power using a minimum sunlight profile, assuming no power is generated from the micro-hydro due to unavailable season. All the essential and non-essential loads are ON. PV is operating in maximum power mode (MPPT). The diesel generator is OFF, as shown in **Figure 45(d)**.

**Figure 44.** *The simulation result for scenario 7 (a) power flow, (b) ESS SOC, (c) load consumption, (d) control signal.*

*Design and Simulation of Low-Cost Microgrid Controller in Off-Grid Remote Areas DOI: http://dx.doi.org/10.5772/intechopen.98551*

In **Figure 45**, the simulation result shows that the energy storage system is discharged to supply the energy to the microgrid due to there is no energy generated from PV and micro-hydro at the beginning of the day (00:00). The ESS is discharging until the %SOC is below the SOC\_Low (30%), the microgrid controller sheds the non-essential loads. Finally, the diesel generator is turned on to supply the power to the essential loads in the microgrid at 02:20, as shown in **Figure 45**.

The ESS is charged by the diesel generator's energy and the PV until %SOC reaches SOC\_Threshold level (50%). The microgrid controller turns off the diesel generator, but after the diesel generator is turned off, the %SOC is not increasing. Thus, the non-essential loads are not restored. After that, the ESS is discharging to supply the power to the essential loads from 16:30 until the end of the day, as shown in **Figure 45(b)**.

It can be considered that this scenario is the weakest mode of operation for the microgrid as both load shedding and diesel operation are required. The nonessential loads are disconnected from the microgrid from 02:20 until the end of the day. It is almost the day that the non-essential load has the blackout. Furthermore, the diesel generator must be operated for up to 14 hours to maintain the microgrid and supply power to the essential loads.

**Figure 45.** *The simulation result for scenario 8 (a) power flow, (b) ESS SOC, (c) load consumption, (d) control signal.*

### *5.2.9 Summary*

From the results of the simulation in scenario 1–8, it can be summarized as follows:


### **6. Conclusions**

### **6.1 Main outcomes**

This study has attempted to investigate the operation of the microgrid controller and the responses in various scenarios of the off-grid microgrid components, i.e., the state of charge of the energy storage system, the power generation from the distributed generations, and the essential and non-essential loads. From the results of the study, it can be concluded as follows:


power balance in the microgrid. However, the increase in operating cost due to the fuel cost needed to be considered.

• Load shedding function in the proposed microgrid controller can be used to manage the demand by curtailing the low priority loads from the microgrid to maintain the microgrid operation if the power generation very low compared to the demand. However, the disadvantages resulting from the outage of the curtailed loads are needed to be carefully considered.

### **6.2 Future work**

The limit of the rule-based microgrid controller is that it is sometimes not flexible in the general case of the microgrid. The algorithm and program are needed to be adjusted and tested by the experts. When the microgrid is connected with new components such as renewable energy resources, the program and algorithm need to be updated. Other techniques to control the off-grid microgrid, such as Artificial Intelligence and Machine Learning Techniques, are required to be studied and implemented. Furthermore, the other microgrid control scheme that can provide a flexible 'plug-and-play' control scheme to the microgrid, such as a multi-agent system (MAS), is needed to study and implement off-grid microgrid as well.

### **Acknowledgements**

I would like to acknowledge and thank the following people who have supported me, not only during the project but throughout my master degree.

Firstly, I would like to express my sincere gratitude to my supervisor, Professor Mark Sumner, for his unwavering support, guidance, ideas, and feedback throughout this project.

I would also like to special thank Provincial Electricity Authority (PEA), Thailand, for supporting a full scholarship. Also, thank PEA colleagues who support the valuable information and essential data for this project.

Finally, I would like to thank all my friends and family, especially my wife. You have all encouraged and believed in me. You have all helped me to focus on what has been a hugely rewarding and enriching process.

### **Conflict of interest**

The authors declare no conflict of interest.

*Electric Power Conversion and Micro-Grids*

### **Author details**

Tapparit Bangtit University of Nottingham, Nottingham, United Kingdom

\*Address all correspondence to: tapparitb@gmail.com

© 2021 The Author(s). Licensee IntechOpen. This chapter is distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/ by/3.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

*Design and Simulation of Low-Cost Microgrid Controller in Off-Grid Remote Areas DOI: http://dx.doi.org/10.5772/intechopen.98551*

### **References**

[1] J. Yaungket and T. Tezuka, "A survey of remote household energy use in rural Thailand," Energy Procedia, vol. 34, no. May 2019, pp. 64–72, 2013, doi: 10.1016/ j.egypro.2013.06.734.

[2] A. A. Zaidi and F. Kupzog, "Microgrid automation - A selfconfiguring approach," IEEE INMIC 2008 12th IEEE Int. Multitopic Conf. - Conf. Proc., pp. 565–570, 2008, doi: 10.1109/INMIC.2008.4777802.

[3] A. Parisio, E. Rikos, and L. Glielmo, "A model predictive control approach to microgrid operation optimization," IEEE Trans. Control Syst. Technol., vol. 22, no. 5, pp. 1813–1827, 2014, doi: 10.1109/TCST.2013.2295737.

[4] S. Parhizi, H. Lotfi, A. Khodaei, and S. Bahramirad, "State of the art in research on microgrids: A review," IEEE Access, vol. 3, pp. 890–925, 2015, doi: 10.1109/ACCESS.2015.2443119.

[5] A. M. Bouzid, J. M. Guerrero, A. Cheriti, M. Bouhamida, P. Sicard, and M. Benghanem, "A survey on control of electric power distributed generation systems for microgrid applications," Renew. Sustain. Energy Rev., vol. 44, pp. 751–766, 2015, doi: 10.1016/j. rser.2015.01.016.

[6] D. Palit and A. Chaurey, "Off-grid rural electrification experiences from South Asia: Status and best practices," Energy Sustain. Dev., vol. 15, no. 3, pp. 266–276, 2011, doi: 10.1016/j. esd.2011.07.004.

[7] S. Ximena, C. Quintero, and J. D. Mar, "Planning for Operation of MicroGrids Considering Small Hydro Power Plants : Transient Stability," Ieee, pp. 3–8, 2013.

[8] M. E. Khodayar, "Rural electrification and expansion planning of off-grid microgrids," Electr. J., vol.

30, no. 4, pp. 68–74, 2017, doi: 10.1016/ j.tej.2017.04.004.

[9] "Off Grid / Island Systems and Hybrid System - Intech Clean Energy, UK." https://www.intechcleanenergy.co. uk/off-grid-hybrid/ (accessed Jul. 26, 2020).

[10] G. Pepermans, J. Driesen, D. Haeseldonckx, R. Belmans, and W. D'haeseleer, "Distributed generation: Definition, benefits and issues," Energy Policy, vol. 33, no. 6, pp. 787–798, 2005, doi: 10.1016/j.enpol.2003.10.004.

[11] W. El-Khattam and M. M. A. Salama, "Distributed generation technologies, definitions and benefits," Electr. Power Syst. Res., vol. 71, no. 2, pp. 119–128, 2004, doi: 10.1016/j.epsr.2004.01.006.

[12] T. Ackermann, G. Andersson, and L. Söder, "Distributed generation: A definition," Electr. Power Syst. Res., vol. 57, no. 3, pp. 195–204, 2001, doi: 10.1016/S0378-7796(01)00101-8.

[13] H. Musa, "A Review of Distributed Generation Resource Types and Their Mathematical Models for Power Flow Analysis," Int. J. Sci. Technol. Soc., vol. 3, no. 4, p. 204, 2015, doi: 10.11648/j. ijsts.20150304.21.

[14] M. F. Akorede, H. Hizam, and E. Pouresmaeil, "Distributed energy resources and benefits to the environment," Renew. Sustain. Energy Rev., vol. 14, no. 2, pp. 724–734, 2010, doi: 10.1016/j.rser.2009.10.025.

[15] K. N. Nwaigwe, P. Mutabilwa, and E. Dintwa, "An overview of solar power (PV systems) integration into electricity grids," Mater. Sci. Energy Technol., vol. 2, no. 3, pp. 629–633, 2019, doi: 10.1016/ j.mset.2019.07.002.

[16] B. Belcher, B. J. Petry, T. Davis, and K. Hatipoglu, "The Effects of Major

Solar Integration on a 21-Bus System," Technol. Rev. PSAT simulations, Conf. Proc. - IEEE SOUTHEASTCON, 2017, [Online]. Available: https://doi.org/ 10.1109/%0ASECON.2017.7925361.

[17] E. Mulenga, "Impacts of integrating solar PV power to an existing grid Case Studies of Mölndal and Orust energy distribution (10/0.4 kV and 130/10 kV) grids," pp. 1–142, 2015, [Online]. Available: http://studentarbeten.chalme rs.se/publication/218826-impactsof-integrating-solar-pv-power-to-an-e xisting-grid-case-studies-of-molndal-a nd-orust-energy-d.

[18] N. H. Saad, A. A. El-Sattar, and A. E. A. M. Mansour, "Improved particle swarm optimization for photovoltaic system connected to the grid with low voltage ride through capability," Renew. Energy, vol. 85, pp. 181–194, 2016, doi: 10.1016/j.renene.2015.06.029.

[19] R. K. Saket, "Design, development and reliability evaluation of micro hydro power generation system based on municipal waste water," 2008 IEEE Electr. Power Energy Conf. - Energy Innov., 2008, doi: 10.1109/ EPC.2008.4763355.

[20] J. L. Márquez, M. G. Molina, and J. M. Pacas, "Dynamic modeling, simulation and control design of an advanced micro-hydro power plant for distributed generation applications," Int. J. Hydrogen Energy, vol. 35, no. 11, pp. 5772–5777, 2010, doi: 10.1016/j. ijhydene.2010.02.100.

[21] O. Paish, "Small hydro power : technology and current status," vol. 6, pp. 537–556, 2002.

[22] B. Guo et al., "Variable speed microhydro power generation system Review and Experimental results," Symp. Genie Electr., 2018.

[23] V. Salas, W. Suponthana, and R. A. Salas, "Overview of the off-grid

photovoltaic diesel batteries systems with AC loads," Appl. Energy, vol. 157, pp. 195–216, 2015, doi: 10.1016/j. apenergy.2015.07.073.

[24] A. Elmitwally and M. Rashed, "Flexible operation strategy for an isolated PV-diesel microgrid without energy storage," IEEE Trans. Energy Convers., vol. 26, no. 1, pp. 235–244, 2011, doi: 10.1109/TEC.2010.2082090.

[25] M. U. Hassan, M. Humayun, R. Ullah, B. Liu, and Z. Fang, "Control strategy of hybrid energy storage system in diesel generator based isolated AC micro-grids," J. Electr. Syst. Inf. Technol., vol. 5, no. 3, pp. 964–976, 2018, doi: 10.1016/j.jesit.2016.12.002.

[26] H. Chen, T. N. Cong, W. Yang, C. Tan, Y. Li, and Y. Ding, "Progress in electrical energy storage system: A critical review," Prog. Nat. Sci., vol. 19, no. 3, pp. 291–312, 2009, doi: 10.1016/j. pnsc.2008.07.014.

[27] O. Ellabban, H. Abu-Rub, and F. Blaabjerg, "Renewable energy resources: Current status, future prospects and their enabling technology," Renew. Sustain. Energy Rev., vol. 39, pp. 748– 764, 2014, doi: 10.1016/j. rser.2014.07.113.

[28] M. C. Argyrou, P. Christodoulides, and S. A. Kalogirou, "Energy storage for electricity generation and related processes: Technologies appraisal and grid scale applications," Renew. Sustain. Energy Rev., vol. 94, no. November 2017, pp. 804–821, 2018, doi: 10.1016/j. rser.2018.06.044.

[29] X. Wu, S. Feng, and P. Jiang, "Distributed Coordination Load Shedding of Islanded Microgrids Based on Sub-Gradient Algorithm," IEEE Access, vol. 5, pp. 27879–27886, 2017, doi: 10.1109/ACCESS.2017.2725901.

[30] M. Giroletti, M. Farina, and R. Scattolini, "A hybrid frequency/power *Design and Simulation of Low-Cost Microgrid Controller in Off-Grid Remote Areas DOI: http://dx.doi.org/10.5772/intechopen.98551*

based method for industrial load shedding," Int. J. Electr. Power Energy Syst., vol. 35, no. 1, pp. 194–200, 2012, doi: 10.1016/j.ijepes.2011.10.013.

[31] P. Monshizadeh, C. De Persis, N. Monshizadeh, and A. Van Der Schaft, "A communication-free master-slave microgrid with power sharing," Proc. Am. Control Conf., vol. 2016-July, pp. 3564–3569, 2016, doi: 10.1109/ ACC.2016.7525466.

[32] C. A. Hernandez-Aramburo, T. C. Green, and N. Mugniot, "Fuel consumption minimization of a microgrid," IEEE Trans. Ind. Appl., vol. 41, no. 3, pp. 673–681, 2005, doi: 10.1109/TIA.2005.847277.

[33] V. Prema, S. Datta, and K. Uma Rao, "An effective dispatch strategy for hybrid power management," IEEE Reg. 10 Annu. Int. Conf. Proceedings/ TENCON, vol. 2016-Janua, 2016, doi: 10.1109/TENCON.2015.7372846.

[34] T. A. Jumani, M. W. Mustafa, A. S. Alghamdi, M. M. Rasid, A. Alamgir, and A. B. Awan, "Computational Intelligence-Based Optimization Methods for Power Quality and Dynamic Response Enhancement of ac Microgrids," IEEE Access, vol. 8, pp. 75986–76001, 2020, doi: 10.1109/ ACCESS.2020.2989133.

[35] T. Kasirawat, P. Boonsiri, and T. Saksornchai, "PEA microgrid design for coexistence with local community and environment: Case study at Khun pae village Thailand," 2017 IEEE Innov. Smart Grid Technol. - Asia Smart Grid Smart Community, ISGT-Asia 2017, pp. 1–5, 2018, doi: 10.1109/ISGT-Asia.2017.8378343.

### Section 2
