MPC Based Energy Management System for Hosting Capacity of PVs and Customer Load with EV in Stand-Alone Microgrids

: This paper presents the improvements of the hosting capacity of photovoltaics (PVs) and electric vehicles (EVs) in a stand-alone microgrid (MG) with an energy storage system (ESS) by consider-ing a model predictive control (MPC) based energy management system. The system is conﬁgured as an MG, including PVs, an ESS, a diesel generator (DG), and several loads with EVs. The DG is controlled to operate at rated power and the MPC algorithm is used in a stand-alone MG, which supplies the energy demanded for several loads with EVs. The hosting capacity of the load in-cluding the EV and PVs can be expanded through the ESS to the terminal node of the microgrid. In this case, the PVs and the load can be connected in excess of the capacity of the diesel genera-tor, and each bus in the feeder complies with the voltage range required by the grid. The effec-tiveness of the proposed algorithm to resolve the hosting capacity is demonstrated by numerical simulations.


Introduction
The goal of reducing greenhouse gas emissions is to shift focus toward more environmentally friendly and sustainable energy sources. Renewable energy is already playing an important role in a society that is not only more energy dependent but also more aware of environmental issues. The adoption of renewable energy sources (RESs) poses several challenges arising from the inherent intermittent, and the requirements to meet uncertain, user demand [1]. A power system with high-RES penetration might cause stability problems with respect to the system frequency and voltage due to low system inertia. In addition, the stable operation of the system becomes more challenging due to the intermittency of distributed energy resources. One way to rectify this problem is to include energy storage systems (ESSs) such as batteries.
One of the most severe cases of high-RES penetration in a distribution system is a stand-alone microgrid (MG) including an RES, an ESS, a diesel generator (DG), and several loads [2,3]. Therefore, the given MG must balance the generation and demand by its own capacities. As a result, the ESSs can contribute the power system by mitigating the uncertainties of variable renewable energy. This is because the ESS can be used for the purpose of renewable integration as well the frequency regulation. Therefore, the hosting capacity of RES penetration can be improved by applying the ESSs in the power system [4].
The electrification of vehicles has a significant impact on the operation of the electrical system. The commercial demand for fast or slow electric vehicle (EV) chargers has been provides more flexibility by storing excess energy and providing it when needed. PVs are particularly attractive for isolated areas, as it provides clean power in isolated areas that cannot be economically served. While PVs reduces the system costs, it poses additional challenges to system control and emphasizes the need for an advanced control strategy due to the intermittent and unpredictability of renewable energies. Adding EVs to the grid in an MG is the current trend, and the EV acts as a load due to their storage capability. Therefore, the development of an EMS for managing EV batteries is a key research area.
An ESS stores and supplies electricity to achieve energy efficiency, quality of electricity and stabilization of the power system [18,19]. However, the ESS in this paper is used for maximizing the PVs and EV hosting capacity in a stand-alone MG and maintaining the grid voltage requirement. Figure 1 shows that an MG has a radial distribution system, and the voltage rises and drops according to the line length. For each bus, the load, EV power consumption and PVs power generation are connected to the same point. At the endpoint of the MG, the ESS is set up, which uses the bidirectional flow of the power, and it enables the optimal operation for the hosting capacity by measuring the voltage and power for each bus. The DG usually operates on a main power source in an isolated area and incurs high operational costs due to the fuel consumption. The addition of an ESS consisting of lithiumion batteries provides more flexibility by storing excess energy and providing it when needed. PVs are particularly attractive for isolated areas, as it provides clean power in isolated areas that cannot be economically served. While PVs reduces the system costs, it poses additional challenges to system control and emphasizes the need for an advanced control strategy due to the intermittent and unpredictability of renewable energies. Adding EVs to the grid in an MG is the current trend, and the EV acts as a load due to their storage capability. Therefore, the development of an EMS for managing EV batteries is a key research area. An ESS stores and supplies electricity to achieve energy efficiency, quality of electricity and stabilization of the power system [18,19]. However, the ESS in this paper is used for maximizing the PVs and EV hosting capacity in a stand-alone MG and maintaining the grid voltage requirement. Figure 1 shows that an MG has a radial distribution system, and the voltage rises and drops according to the line length. For each bus, the load, EV power consumption and PVs power generation are connected to the same point. At the endpoint of the MG, the ESS is set up, which uses the bidirectional flow of the power, and it enables the optimal operation for the hosting capacity by measuring the voltage and power for each bus.
In a conventional LVDS, power flows from the grid to the load and the voltage profile on the feeder shows a tendency of monotonic reduction. However, when renewable energy such as PVs and wind power is connected, the voltage at the connection point increases due to the reverse power flow, and it is not only in the form of monotonic reduction. This reverse power flow causes various problems in power quality and protection coordination within the LVDS [20]. In an LVDS, when the power consumed by the load increases, the voltage drop deepens and may escape the lower limit, and when renewable energy such as the PVs produces excessive power, the voltage rise may intensify and escape the upper limit. Connecting multiple EVs can cause problems such as under voltage and exceeding the limit capacity of the main power source. Figure 2 shows the voltage of LVDSs by the bidirectional power flow, and the power control of ESSs presents that the voltage can be controlled, and acceptance can be expanded. Since an ESS shares the power flowing with the main power source in the feeder, it can reduce the voltage problems and increase the connection capacity of PVs and an EV charger without exceeding the feeder capacity. Therefore, in this paper, when multiple PVs and EV chargers are connected to the stand-alone MG, we propose a power control scheme using an ESS to solve the hosting In a conventional LVDS, power flows from the grid to the load and the voltage profile on the feeder shows a tendency of monotonic reduction. However, when renewable energy such as PVs and wind power is connected, the voltage at the connection point increases due to the reverse power flow, and it is not only in the form of monotonic reduction. This reverse power flow causes various problems in power quality and protection coordination within the LVDS [20]. In an LVDS, when the power consumed by the load increases, the voltage drop deepens and may escape the lower limit, and when renewable energy such as the PVs produces excessive power, the voltage rise may intensify and escape the upper limit. Connecting multiple EVs can cause problems such as under voltage and exceeding the limit capacity of the main power source. Figure 2 shows the voltage of LVDSs by the bidirectional power flow, and the power control of ESSs presents that the voltage can be controlled, and acceptance can be expanded. Since an ESS shares the power flowing with the main power source in the feeder, it can reduce the voltage problems and increase the connection capacity of PVs and an EV charger without exceeding the feeder capacity. Therefore, in this paper, when multiple PVs and EV chargers are connected to the standalone MG, we propose a power control scheme using an ESS to solve the hosting capacity and voltage variation issues for cases where multiple PVs and EV chargers are connected to the stand-alone MG.
In a stand-alone MG, the voltage may depend on the EV charging and the amount of PVs. If PVs supplies a lot of power during the day, overvoltage may occur for the customer, and EV charging in the evening may cause under voltage for the customer. In such scenarios, charging/discharging the ESS at the MG solves the voltage issue and expands the capacity of EV and PVs. A power stabilization method proposed in this paper solves the voltage problems and can connect the load and PVs capacity beyond the rating of the diesel generator with no additional facilities required. The bus voltage changes according to the ESS charging/discharging are shown in Figure 3 [21].
The bus voltages would increase beyond the upper limit caused by PVs, as shown in Figure 3a. Absorbing the PVs produced power by ESS charging will keep the voltage below the allowed limit. The bus voltage would decrease, on the other hand, below the lower limit by multiple EVs, as shown in Figure 3b. Supplying more power by ESS discharge will keep the voltage above the allowed limit.  In a stand-alone MG, the voltage may depend on the EV charging and the amount of PVs. If PVs supplies a lot of power during the day, overvoltage may occur for the customer, and EV charging in the evening may cause under voltage for the customer. In such scenarios, charging/discharging the ESS at the MG solves the voltage issue and expands the capacity of EV and PVs. A power stabilization method proposed in this paper solves the voltage problems and can connect the load and PVs capacity beyond the rating of the diesel generator with no additional facilities required. The bus voltage changes according to the ESS charging/discharging are shown in Figure 3 [21].
The bus voltages would increase beyond the upper limit caused by PVs, as shown in Figure 3a. Absorbing the PVs produced power by ESS charging will keep the voltage below the allowed limit. The bus voltage would decrease, on the other hand, below the lower limit by multiple EVs, as shown in Figure 3b. Supplying more power by ESS discharge will keep the voltage above the allowed limit.     In a stand-alone MG, the voltage may depend on the EV charging and the amount of PVs. If PVs supplies a lot of power during the day, overvoltage may occur for the customer, and EV charging in the evening may cause under voltage for the customer. In such scenarios, charging/discharging the ESS at the MG solves the voltage issue and expands the capacity of EV and PVs. A power stabilization method proposed in this paper solves the voltage problems and can connect the load and PVs capacity beyond the rating of the diesel generator with no additional facilities required. The bus voltage changes according to the ESS charging/discharging are shown in Figure 3 [21].
The bus voltages would increase beyond the upper limit caused by PVs, as shown in Figure 3a. Absorbing the PVs produced power by ESS charging will keep the voltage below the allowed limit. The bus voltage would decrease, on the other hand, below the lower limit by multiple EVs, as shown in Figure 3b. Supplying more power by ESS discharge will keep the voltage above the allowed limit.

MPC Based EMS in Stand-Alone MG
The energy management of MGs is divided into a grid-connected mode and a standalone mode according to different operation requirements. The operation goal of gridconnected MGs is to maximize profits based on distributed generation bids and market prices. On the other hand, the role of the EMS is to effectively balance the power in the stand-alone MG, but additionally, the EMS may try to optimize production for its assigned objectives. Therefore, the main goal is to provide stable power to local loads. The EMS must balance power generation and demand through an ESS, PVs, a DG, and demand management if possible. Additionally, the EMS can optimize the system efficiency and minimize the operational cost. This paper will develop an MPC-based EMS for the stand-alone MG in Figure 1 [11].

Predictive Model of Stand-Alone MG
An MPC-based EMS needs a predictive model of a stand-alone MG. In the power management phase, this control-oriented model is a simplified one that can be incorporated into the optimization procedure. The dynamics of loads, PVs and generators in an EMS is very fast compared to the characteristic sampling time and are negligible. Therefore, the important model to consider is the dynamics of the storage devices that make up the model for use in MPC, including the balance equation of powers in the bus.

Energy Storage System
The battery based ESS is an electrochemical device that stores electrical energies. The state of charge (SOC) is a dynamic state that indicates the power flow at the ESS terminal. The dynamic model of battery ESS model is given by the following: where, T s is the sampling time of one second (T s = 1 s) and C max is the battery capacity. η ch and η dis are the charging/discharging efficiencies and P ess (t) represents the power given or requested by the ESS. The level of energy is given by SOC(t), which also denotes the energy storage in the ESS at time t. The maximum/minimum value of the SOC in ESS is bounded.
where SOC min . and SOC max denote the maximum depth of discharge and the capacity of the battery, respectively. P ess (t) is negative for charging and positive for discharging. The charging/discharging rates of the battery are bounded as follows: where P ess,min < 0 and P ess,max > 0 are the lower and upper bounds of the power supplied or demanded by battery, respectively.

Diesel Generator
Small capacity DGs are one of the nonrenewable power sources operating on fossil fuels in distributed power generation. The main advantages of DGs are controllability and autonomy, but the role of DGs will be reduced in the future due to environmental issues. Since DGs are more cost-effective than the ESSs, DGs are used as a main power source in isolated areas. Furthermore, the advantage of using a DG as a dispatchable generator is that it can be operated at any time whenever the SOC of the ESS reaches its minimum. In this paper, two diesel generators, DG1 and DG2, are used for suitable operation in a stand-alone MG. The DG1 continues to operate as the main power source at normal times and stops only when the SOC of the ESS reaches its maximum value. Dispatchable generator DG2 does not operate normally and starts operation only when the SOC reaches the minimum value. To minimize fuel consumption and maximize lifetime in the DG, it is recommended that the DG operate at the nominal power and limit the number of on/off cycles. Therefore, the DG runs at its nominal output in all operating modes regardless of load changes, as follows: where P dg,nom denotes the nominal power of the DG, α 1 (t) = 1 when SOC min < SOC(t) < SOC max and α 1 (t) = 0 when the SOC reaches its maximum SOC max . Similarly, β(t) = 1 when the SOC reaches its minimum SOC min and β(t) = 0 when the SOC reaches the set value by the EMS. A detailed modelling of DGs is neglected as DGs are fast acting systems that run with minimum delay. The power fluctuations created due to the small operation delay in transition are compensated according to the control action [22].

EV System
When EVs are parked for a certain period of time, the charging process can be optimized by taking into account the SOC of the ESS in the stand-alone MG. When charging an EV with a constant power, it can be optimized by calculating the optimal charging interval during the parking period. If the EV's charging can be performed by the load shifting, its charging power P ev (t) can be determined by the EMS. Given the parking time interval and additional constraints, the EMS supplies the values of δ ev (t), indicating the best connection interval [11]. In this case, when the EV is connected at time t, δ ev (t) takes value 1 and 0 otherwise. Therefore, the EV charging power is given by the following: where P ev,ch denotes the desired constant power. The EMS can be modified in order to consider load curtailment and shifting using EV charging algorithms. If under voltage in the distribution line may occur when the EV charging is utilized, the EV charging power is curtailed to a constant power value. The EV charging power P ev (t) is given by the following: where P ev,curr is the amount of power to be curtailed by the EV charging system. The amount of P ev,curr can be decided by the energy scheduling system. For the sake of simplicity, the EV battery is considered to have the same charging/discharging efficiency and is modelled in the same way as the ESS. The EV charging and the physical connection between the EV and the charging station should be considered. The battery SOC of i-th EV, SOC evi (t), is given by the following: where C ev,max is the EV battery capacity and P evi (t) represents the power given by the i-th EV battery. Note that the maximum/minimum value of the battery SOC in i-th EV is bounded, as follows: and the charging rate of the EV battery is also bounded, and the following restriction should be given by the following: where P ev,max > 0 is the upper bounds of the power demanded by the EV battery. In this paper, the dynamic model of a stand-alone MG is given by Equations (1) and (8). The physical constraints are given by the upper/lower limits of the ESS and EV battery in Equations (2) and (9), which can absorb or supply energy storage within the maximum/minimum rates in Equations (3) and (10)  instances, as a static system using power balance equation and the power of ESS can be expressed as follows: where P load (t) is the power consumed by the loads.
In short distribution lines, we assume that it is a small power loss in the cable and ignore the power loss in Equation (11). If the ESS is connected to the end of the feeder and many EVs are charged at one time, the grid voltage v grid (t) will deviate from the allowable limits. The EMS must maintain the grid voltage to satisfy the following condition: where v grid,min and v grid,max denote the lower limit and the upper limit of the allowable limits, respectively. In order to calculate the control action using MPC, the controller needs information about PVs generation, the customer's load and EV charging patterns 24 h in advance. The key factors in the MPC algorithm are the predictive model that computes the prediction, the cost function to minimize and the system constraints. The optimal scheduling of DG2 and ESS for 24 hours is obtained by the MPC algorithm, and if the total bus voltage can drop to the lower limit, the EV charging schedule is adjusted to increase the voltage.

MPC Based Energy Management Strategy
When the main grid is not available, the highest priority is to provide customers with a reliable power supply instead of economic benefits [11]. The isolated grid usually consists of the PVs, diesel generator, ESS, EV charger and loads in Figure 1. Therefore, the operational goal for the energy management phase is to maximize the satisfaction of the customer load and EV charging with the minimum operating cost in the stand-alone MG. It means that PVs must be used entirely to make up for the electricity shortage and, if necessary, part of the EV charging load could be cutoff to balance power. The power flow and voltage in the power management phase are also considered simultaneously at the distribution line. The input to the MPC is a sampled state of the ESS, PVs, DG, EV and load demand at time t. The forecast of PVs, EV and load demand for the prediction window will also be provided as input. The output of the MPC becomes the set points for the ESS converters, the DG and the EV charging curtailment value [23].
The cost function of the battery ESS J bat (h i ) is given by the following: where the sequence h i for 24 h per day means that the sampling period for the energy management phase is one hour (T s = 1 h), and the weighting factors α SOC = 1 and α bat = 1 are adopted in this paper. The battery degradation rate should be minimized as much as possible during the operation. Battery degradation arises from calendar and cycling ageing. The former is a result of the increased dwell times at high SOC levels in the battery. Penalizing the SOC in Equation (13) will limit high SOC dwell times whenever possible and reduces calendar ageing. The second term in Equation (13) penalizes the battery cycling. Excessive charge/discharge cycles have been found to accelerate cycling ageing mechanism in a Lithium-ion battery.
The cost function of the DG2 J dg2 (h i ) is given by the following: where J dg2, f uel (h i ), J dg2,om (h i ) and J dg2,start (h i ) denote the fuel consumption cost, the operating and maintenance cost and the start-up cost of DG2, respectively. Firstly, the fuel consumption of the DG depends on the instantaneous active power and the running time. The fuel consumption model of DG is developed as a quadratic function and is given by [10] the following: where P dg2 (h i ) is the DG2 active power output and C f uel denotes the total fuel cost at time h i , and the generator coefficients a f , b f , c f are obtained from the manufacturer's data. Secondly, the operating and maintenance cost of DG2 is assumed to be proportional to the active power output and the following equation is given by the following: where C om denotes the total maintenance cost of DG at time h i . Finally, the start-up cost of DG2 is assumed to be proportional to the active power output and the following equation is given by the following: where a st and b st denote the hot start-up cost and the cold start-up cost, respectively, c st is the cooling time constant and T st,o f f represents the time each device was turned off. In addition, the active power output of DG2 is also bounded, and the following restriction should be given by the following: where P dg,max is the upper bounds of the power supplied by DG2.
In this paper, MPC is tasked with maximizing operating efficiency, PVs utilization, DG1 and DG2 utilizations and minimizing ESS degradation. The cost function considered in MPC can be formulated as a sum of the cost function of ESS and DG2, as follows: Subject to ESS model (1) and EV model (8), power balance Equation (11) and constraints (2), (3), (9), (10), (12) and (18).
By piecewise linearizing the fuel cost of a dispatchable DG unit, the energy management problem will be formulated as a mixed-integer linear problem (MILP). In addition, a deterministic MPC, where the future generation and load demand is certainly known, will be used.

Optimal Power Control of ESS for Hosting Capacity of EV and PVs
The EMS of the stand-alone MG is operated based on the data collected at each point. The charging/discharging operation of ESS by bidirectional power flow and EV charging power control stabilizes all bus voltages within the allowable limit and minimizes each feeder current for the hosting capacity of load with PVs and EVs.
In general, the line impedance used in large-scale power systems has a large X/R ratio in the transmission line. Therefore, a method of adjusting the voltage using reactive power is applied. However, the impedance of cables used in small-scale MGs has the characteristic that the resistance, R, is greater than the reactance, X. For this reason, active power is more effective by adjusting voltage than reactive power [13]. Therefore, in this Energies 2021, 14, 4041 9 of 20 paper, the charging/discharging operation of ESS and charging power control of EV are used as a way to adjust voltage.
The EMS determines the charging/discharging mode, operating time and operating capacity of the ESS, EV power control and DG2 on/off control through the bus data. The EMS sends commands to the ESS operating in the SOC range. The EMS also controls the MG to be stable based on three signals. The signals are used for (i) the charging/discharging mode of ESS, (ii) the on/off control of diesel generator DG2, and (iii) the power control of an EV charger.
The proposed operation procedure of EMS is as follows.
Step 1. Charging/discharging mode of ESS The signal α(t) determines the charge or discharge of the ESS. The signal is determined by the sum of the measured active power in each BUS. The plus or the negative sign of the power indicates the direction of power flows from the grid to the load or from the load to the grid. In Equation (11), the negative sign of P ess (t) means that the power generated by PVs and a DG is greater than the power consumed by the loads with EVs. In this case, the signal α(t) becomes 1 in Equation (20) and the ESS operates in charging mode. If the sign of P ess (t) is positive, the signal α(t) becomes 0 and the ESS operates in discharging mode, as follows: Step 2. On/Off control of diesel generator DG2 A signal β(t) is the on/off control signal of DG2. When the SOC of ESS is smaller than the value of SOC s1 in the discharging mode of ESS, β(t) becomes 1 and the DG2 turns on. On the contrary, when the SOC of ESS is greater than SOC s2 in the charging mode of ESS, β(t) becomes 0 and the DG2 stops, as follows: Step 3. Power control of EV charger Since the ESS is connected to the end of the feeder, there is a possibility that the grid voltage will deviate from the allowable limit if many EVs are charging at once. The EMS can be modified in order to consider load curtailment and shifting using EV charging algorithms. In Equation (7), the curtailment power P ev,curr = 0.5γ(t)P ev,ch is used by the EMS. Signal γ(t) is a value that enables the EMS by grid voltage to keep the voltage within the allowable limit. In Equation (22), when the lowest voltage (V min ) among bus voltages is lower than the value of V s1 , γ(t) becomes 1, and the EMS reduces the charging power value of the EV charger to 50%. In addition, when the minimum voltage, V min , is greater than V s2 , γ(t) becomes 0, and the charging power value of the EV charger becomes 100% again, as follows: Table 1 shows the classification of three alarm signals for EMS operation to stably operate a stand-alone MG.

Simulation Model
In order to verify the proposed MPC algorithm of the stand-alone MG, the system with an ESS, PVs and the EV charger are modeled using Matlab/Simulink. Figure 4 shows the simulation model of a stand-alone MG consisting of two DGs, a feeder, a load, three EV chargers, three PVs and an ESS. The load, EV charger and PVs are connected to each bus in the feeder, and the ESS is connected to the end of the feeder for grid stabilization and hosting capacity. The feeder model applies a pi circuit model that can write the line impedance and length. In the model, the MPC using the measured information at each point is shown to operate the MG to be stable in this model.

Simulation Model
In order to verify the proposed MPC algorithm of the stand-alone MG, the system with an ESS, PVs and the EV charger are modeled using Matlab/Simulink. Figure 4 shows the simulation model of a stand-alone MG consisting of two DGs, a feeder, a load, three EV chargers, three PVs and an ESS. The load, EV charger and PVs are connected to each bus in the feeder, and the ESS is connected to the end of the feeder for grid stabilization and hosting capacity. The feeder model applies a pi circuit model that can write the line impedance and length. In the model, the MPC using the measured information at each point is shown to operate the MG to be stable in this model. The diesel generators in a stand-alone MG determine the frequency and voltage at the normal mode. The DG consists of one or more diesel-generator systems, each with a diesel engine model, a synchronous generator, excitation system and transformer [24,25].
In Figure 5, a synchronous generator driven by a fuel is initialized to operate at its rated conditions, and the amount of power generated by the turbine is controlled by the governor. The synchronous generator is rated at 20 kVA, the line-to-line voltage is 380 V and the frequency is 60 Hz [24]. The governor is a device that maintains a stable diesel engine speed by automatically adjusting the fuel quantity according to the external load of the diesel engine. In the governor block, the first input is the reference speed, and the second input is the measured speed. The output is the diesel engine's mechanical power. The excitation system implements the DC exciter described in [25], without the exciter's saturation function. The excitation system block consists of the voltage regulator and the exciter. The diesel generators in a stand-alone MG determine the frequency and voltage at the normal mode. The DG consists of one or more diesel-generator systems, each with a diesel engine model, a synchronous generator, excitation system and transformer [24,25].
In Figure 5, a synchronous generator driven by a fuel is initialized to operate at its rated conditions, and the amount of power generated by the turbine is controlled by the governor. The synchronous generator is rated at 20 kVA, the line-to-line voltage is 380 V and the frequency is 60 Hz [24]. The governor is a device that maintains a stable diesel engine speed by automatically adjusting the fuel quantity according to the external load of the diesel engine. In the governor block, the first input is the reference speed, and the second input is the measured speed. The output is the diesel engine's mechanical power. The excitation system implements the DC exciter described in [25], without the exciter's saturation function. The excitation system block consists of the voltage regulator and the exciter.
The load, EV, and PV systems are modelled using the three-phase dynamic load from the Matlab/Simulink library, as shown in Figure 6 [26]. The inputs are active power and reactive power, and the model consumes or generates the power according to the sign of active power and reactive power. Since negative and zero sequence currents are not simulated in this model, the three load currents are balanced even under unbalanced conditions. The load, EV, and PV systems are modelled using the three-phase dynamic load from the Matlab/Simulink library, as shown in Figure 6 [26]. The inputs are active power and reactive power, and the model consumes or generates the power according to the sign of active power and reactive power. Since negative and zero sequence currents are not simulated in this model, the three load currents are balanced even under unbalanced conditions. The system-level ESS models without general power electronics is implemented as shown in Figure 7. The given ESS model is useful for load flow and phasor simulations. The inputs of the ESS are the commanded active and reactive power, and there is a SOC calculation function according to the ESS capacity. For the sake of simplicity, the ESS is considered to have the same charging/discharging efficiency.  The load, EV, and PV systems are modelled using the three-phase dynamic load from the Matlab/Simulink library, as shown in Figure 6 [26]. The inputs are active power and reactive power, and the model consumes or generates the power according to the sign of active power and reactive power. Since negative and zero sequence currents are not simulated in this model, the three load currents are balanced even under unbalanced conditions. The system-level ESS models without general power electronics is implemented as shown in Figure 7. The given ESS model is useful for load flow and phasor simulations. The inputs of the ESS are the commanded active and reactive power, and there is a SOC calculation function according to the ESS capacity. For the sake of simplicity, the ESS is considered to have the same charging/discharging efficiency. The system-level ESS models without general power electronics is implemented as shown in Figure 7. The given ESS model is useful for load flow and phasor simulations. The inputs of the ESS are the commanded active and reactive power, and there is a SOC calculation function according to the ESS capacity. For the sake of simplicity, the ESS is considered to have the same charging/discharging efficiency.  Table 2 shows the model parameter of the stand-alone MG for the simulation. The DG1 and DG2 have a rated output of 20 kVA, and the voltage is 380 V based on line-toline. The feeder uses a cable with a line impedance of 0.73 + j0.085 Ω/km from the diesel generator to BUS4, and the distance between the buses is 130 m. To accommodate more power from BUS4 to BUS5, which is the ESS connection line, we use a cable with 0.549 +  Table 2 shows the model parameter of the stand-alone MG for the simulation. The DG1 and DG2 have a rated output of 20 kVA, and the voltage is 380 V based on line-to-line. The feeder uses a cable with a line impedance of 0.73 + j0.085 Ω/km from the diesel generator to BUS4, and the distance between the buses is 130 m. To accommodate more power from BUS4 to BUS5, which is the ESS connection line, we use a cable with 0.549 + j0.072 Ω/km, and the length between BUS4 and BUS5 is 50 m. The feeder is divided into three parts to ensure that the load, PVs, and EV are evenly distributed, and each feeder connects two 3 kW loads, two 7 kW EV chargers and two 5 kW PVs. The PV generation, customer load and EV charging patterns for 24 h per day are given in Figures 8-10. Figure 8 shows the PVs output pattern during the 24 h in simulation. Additionally, it is assumed that the PVs output capacity of individual customers is 5 kW, and a total of 6 PVs are interconnected to the customer, and all have the same pattern. Therefore, the total output of the PV system ranges from 0 to 30 kW.   Figure 9 shows the customer's power consumption pattern during the 24 h in simulation. The load pattern used represents the typical summer weekdays load in Korea [27]. It is assumed that the individual customer has a capacity of 3 kW and a total of six customers are connected to the feeder, and all have the same pattern. Therefore, the maximum power consumption of the six loads is 18 kW.   Figure 9 shows the customer's power consumption pattern during the 24 h in simulation. The load pattern used represents the typical summer weekdays load in Korea [27]. It is assumed that the individual customer has a capacity of 3 kW and a total of six customers are connected to the feeder, and all have the same pattern. Therefore, the maximum power consumption of the six loads is 18 kW.  Figure 10 shows the charging patterns of EVs connected to each feeder for the 24 h period. The individual capacity of the EV charger is 7 kW, and two EV chargers are connected to each feeder. Assuming that the capacity of the battery installed in the EV is 64 kWh, it takes 9 h from full discharge to full charge. Even if all EV charging is performed in the same pattern, the proper allocation of the diesel generator DG2 and the ESS by the MPC algorithm does not significantly affect the expansion of the proposed acceptability.

Power Characteristic of Stand-Alone MG with EV Charger and ESS
(1) Operation characteristics of a stand-alone MG with EV charger and ESS The four simulation scenarios for verifying the performance of the MPC based EMS are as follows: -DG1 always supplies rated power (20 kW) to the load as a main power source and stops only when the SOC of the ESS reaches its maximum value ( ). - The ESS operates according to the ( ) value. If the power consumption by the customer load and EV is less than the power generation by DG1 and PVs, ( ) is 1 and the ESS is charged. Conversely, when ( ) is 0, the ESS is discharged. -When the SOC decreases to 35% in the ESS discharging mode, ( ) becomes 1, and DG2 operates. DG2 is a dispatchable generator, and when the SOC reaches 50% in the ESS charging mode, DG2 stops. -EMS always monitors the bus voltage at each feeder, and when the minimum voltage is less than the set value (211 V), ( ) becomes 1 and the EV charging power is reduced to 50%. When the BUS voltage reaches 217 V while the EV is charging, the EV charging power becomes 100%. In order to satisfy the voltage condition in Equation (12), the reduction in EV charging to 50% for a short period of time (within 1 h) can be used to increase the voltage. Figure 11 shows the simulation results in a stand-alone MG using given load, EV and  Figure 9 shows the customer's power consumption pattern during the 24 h in simulation. The load pattern used represents the typical summer weekdays load in Korea [27]. It is assumed that the individual customer has a capacity of 3 kW and a total of six customers are connected to the feeder, and all have the same pattern. Therefore, the maximum power consumption of the six loads is 18 kW. Figure 10 shows the charging patterns of EVs connected to each feeder for the 24 h period. The individual capacity of the EV charger is 7 kW, and two EV chargers are connected to each feeder. Assuming that the capacity of the battery installed in the EV is 64 kWh, it takes 9 h from full discharge to full charge. Even if all EV charging is performed in the same pattern, the proper allocation of the diesel generator DG2 and the ESS by the MPC algorithm does not significantly affect the expansion of the proposed acceptability.

Power Characteristic of Stand-Alone MG with EV Charger and ESS
(1) Operation characteristics of a stand-alone MG with EV charger and ESS The four simulation scenarios for verifying the performance of the MPC based EMS are as follows: The ESS operates according to the α(t) value. If the power consumption by the customer load and EV is less than the power generation by DG1 and PVs, α(t) is 1 and the ESS is charged. Conversely, when α(t) is 0, the ESS is discharged. -When the SOC decreases to 35% in the ESS discharging mode, β(t) becomes 1, and DG2 operates. DG2 is a dispatchable generator, and when the SOC reaches 50% in the ESS charging mode, DG2 stops. -EMS always monitors the bus voltage at each feeder, and when the minimum voltage is less than the set value (211 V), γ(t) becomes 1 and the EV charging power is reduced to 50%. When the BUS voltage reaches 217 V while the EV is charging, the EV charging power becomes 100%. In order to satisfy the voltage condition in Equation (12), the reduction in EV charging to 50% for a short period of time (within 1 h) can be used to increase the voltage. Figure 11 shows the simulation results in a stand-alone MG using given load, EV and PVs patterns in the ESS connection state. In the simulation, the initial SOC of the ESS is 41% and the rated power of DG1 is 20 kW. Since the power consumption of the load is less than DG1's power, the ESS is charged up to t1 h. After time t1, the power consumption of the EV charger and the load exceeds DG1's output; therefore, the ESS supplies power through ESS discharging. After time t2, the PVs produces power; therefore, the ESS operates in charging mode again. From time t3, the PVs output decreases; therefore, the ESS again supplies power to the load through discharge. After time t4, when the SOC of the ESS is less than 35%, DG2 is turned on, and the generated power is much larger than the power consumption; therefore, the ESS operates in charging mode. When the SOC reaches 50% at time t5, the DG2 stops. At this time, since the ESS is connected to the end of the feeder, the voltage may deviate from the allowable value. In this case, for voltage stabilization, the charging power of EV2, which is operated during this time, is reduced to 50%, and when the voltage reaches 217 V, the EV charging power returns to the original state of 100%.  Figure 12 shows the SOC of the ESS, and it can be seen that the SOC is appropriately changed according to the charging/discharging of the ESS.  Figure 12 shows the SOC of the ESS, and it can be seen that the SOC is appropriately changed according to the charging/discharging of the ESS.  Figure 12 shows the SOC of the ESS, and it can be seen that the SOC is appropriately changed according to the charging/discharging of the ESS.  Figure 13 shows the voltage profiles measured on each bus. The voltage of each BUS is stably maintained within the allowable values specified by the system, and when DG2 is turned on, it drops rapidly after time t4. However, it can be confirmed that it is maintained within the allowable range by controlling the charging power of the EV.  Figure 13 shows the voltage profiles measured on each bus. The voltage of each BUS is stably maintained within the allowable values specified by the system, and when DG2 is turned on, it drops rapidly after time t4. However, it can be confirmed that it is maintained within the allowable range by controlling the charging power of the EV.  Figure 14 shows the charging/discharging operation of the ESS according to the signal ( ) in the MPC algorithm. If ( ) is 1, the ESS operates charging, and when ( ) is 0, the ESS operates discharging.  Figure 14 shows the charging/discharging operation of the ESS according to the signal α(t) in the MPC algorithm. If α(t) is 1, the ESS operates charging, and when α(t) is 0, the ESS operates discharging.
The DG2 operates when β(t) becomes 1, and β(t) is determined according to the SOC of ESS. That is, when the SOC decreases to 35%, β(t) becomes 1, as shown in Figure 15, and when SOC reaches 50%, β(t) becomes 0 again. At this time, the DG2 is operated according to β(t), as shown in Figure 16, and operated at 20 kW, which is the same value as DG1.  Figure 14 shows the charging/discharging operation of the ESS according to the signal ( ) in the MPC algorithm. If ( ) is 1, the ESS operates charging, and when ( ) is 0, the ESS operates discharging. The DG2 operates when ( ) becomes 1, and ( ) is determined according to the SOC of ESS. That is, when the SOC decreases to 35%, ( ) becomes 1, as shown in Figure 15, and when SOC reaches 50%, ( ) becomes 0 again. At this time, the DG2 is operated according to ( ), as shown in Figure 16, and operated at 20 kW, which is the same value as DG1.   Figure 17 shows the signal ( ) according to the BUS voltage. If the lowest voltage among each BUS voltage is less than 211 V, ( ) becomes 1. At this time, the charging power of the EV decreases from 100% to 50%, as shown in Figure 18. It can be seen that when the bus voltage reaches 217 V due to the discharge of ESS, ( ) becomes 0   Figure 17 shows the signal ( ) according to the BUS voltage. If the lowest voltage among each BUS voltage is less than 211 V, ( ) becomes 1. At this time, the charging power of the EV decreases from 100% to 50%, as shown in Figure 18. It can be seen that when the bus voltage reaches 217 V due to the discharge of ESS, ( ) becomes 0  Figure 17 shows the signal γ(t) according to the BUS voltage. If the lowest voltage V min among each BUS voltage is less than 211 V, γ(t) becomes 1. At this time, the charging power of the EV decreases from 100% to 50%, as shown in Figure 18. It can be seen that when the bus voltage reaches 217 V due to the discharge of ESS, γ(t) becomes 0 again, and the charging power of the EV moves from 50 to 100% again. In general, the period for increasing the grid voltage by adjusting the charging capacity of the EV is not long; therefore, the scenario of charging the SOC of the EV to the desired level until the next day is not significantly affected.  (2) Hosting capacity simulation In this paper, the ESS is connected to the end of the line to improve the hosting capacity in the stand-alone MG. That is, if electric power is supplied to consumer loads and EVs in bi-directional using a DG and an ESS, the capacity of the DG can be kept small and the hosting capacity be improved without reinforcing the existing feeders.
In Figure 19, the dotted line shows the lowest bus voltage when customer load and EV charging is performed without an ESS connection. In this case, it can be seen that there is a section where the grid voltage is out of allowable limits. In addition, the maximum power measured on each BUS is 48 kW in Figure 20. The solid line in Figure 19 shows the lowest bus voltage during load and EV operation in the state of connecting ESS, and it can be confirmed that the voltage is always maintained within allowable limits. In Figure 20, the measured maximum power is 28 kW.  (2) Hosting capacity simulation In this paper, the ESS is connected to the end of the line to improve the hosting capacity in the stand-alone MG. That is, if electric power is supplied to consumer loads and EVs in bi-directional using a DG and an ESS, the capacity of the DG can be kept small and the hosting capacity be improved without reinforcing the existing feeders.
In Figure 19, the dotted line shows the lowest bus voltage when customer load and EV charging is performed without an ESS connection. In this case, it can be seen that there is a section where the grid voltage is out of allowable limits. In addition, the maximum power measured on each BUS is 48 kW in Figure 20. The solid line in Figure 19 shows the lowest bus voltage during load and EV operation in the state of connecting ESS, and it can be confirmed that the voltage is always maintained within allowable limits. In Figure 20, the measured maximum power is 28 kW. (2) Hosting capacity simulation In this paper, the ESS is connected to the end of the line to improve the hosting capacity in the stand-alone MG. That is, if electric power is supplied to consumer loads and EVs in bi-directional using a DG and an ESS, the capacity of the DG can be kept small and the hosting capacity be improved without reinforcing the existing feeders.
In Figure 19, the dotted line shows the lowest bus voltage when customer load and EV charging is performed without an ESS connection. In this case, it can be seen that there is a section where the grid voltage is out of allowable limits. In addition, the maximum  Figure 20. The solid line in Figure 19 shows the lowest bus voltage during load and EV operation in the state of connecting ESS, and it can be confirmed that the voltage is always maintained within allowable limits. In Figure 20, the measured maximum power is 28 kW.

Conclusions
In this paper, we proposed MPC-based energy management strategies that can improve the hosting capacity of PVs and EVs by using the bidirectional power flow of an ESS connected to the end of the feeder in a stand-alone MG. The main results are summarized as follows: (1) In a stand-alone MG, by installing an ESS at the end of the feeder and using the proposed ESS optimal operation algorithm, the capacity of PVs and EV connected to the bus could be extended up to twice the capacity of the main power source. (2) A simulation model for a stand-alone MG consisting of an ESS, a DG, PVs, an EV charger and load using Matlab/Simulink is presented. We verify that the voltage is maintained within the limits, even for the case when the load and EV capacity is larger than the one of the diesel generators. (3) In addition, it was confirmed that when the generation of DG and PVs is greater than the consumption of the load and EV charging, all the BUS voltages are kept within the allowable limit by the ESS.

Conclusions
In this paper, we proposed MPC-based energy management strategies that can improve the hosting capacity of PVs and EVs by using the bidirectional power flow of an ESS connected to the end of the feeder in a stand-alone MG. The main results are summarized as follows: (1) In a stand-alone MG, by installing an ESS at the end of the feeder and using the proposed ESS optimal operation algorithm, the capacity of PVs and EV connected to the bus could be extended up to twice the capacity of the main power source. (2) A simulation model for a stand-alone MG consisting of an ESS, a DG, PVs, an EV charger and load using Matlab/Simulink is presented. We verify that the voltage is maintained within the limits, even for the case when the load and EV capacity is larger than the one of the diesel generators. (3) In addition, it was confirmed that when the generation of DG and PVs is greater than the consumption of the load and EV charging, all the BUS voltages are kept within the allowable limit by the ESS. Therefore, it can be seen that the hosting capacity increases when the ESS is installed at the end of the feeder, and feeder reinforcement is not required while keeping the capacity of DG small.

Conclusions
In this paper, we proposed MPC-based energy management strategies that can improve the hosting capacity of PVs and EVs by using the bidirectional power flow of an ESS connected to the end of the feeder in a stand-alone MG. The main results are summarized as follows: (1) In a stand-alone MG, by installing an ESS at the end of the feeder and using the proposed ESS optimal operation algorithm, the capacity of PVs and EV connected to the bus could be extended up to twice the capacity of the main power source. (2) A simulation model for a stand-alone MG consisting of an ESS, a DG, PVs, an EV charger and load using Matlab/Simulink is presented. We verify that the voltage is maintained within the limits, even for the case when the load and EV capacity is larger than the one of the diesel generators. (3) In addition, it was confirmed that when the generation of DG and PVs is greater than the consumption of the load and EV charging, all the BUS voltages are kept within the allowable limit by the ESS.