Coordination of EVs Participation for Load Frequency Control in Isolated Microgrids

: Increasing the penetration levels of renewable energy sources (RESs) in microgrids (MGs) may lead to frequency instability issues due to intermittent nature of RESs and low inertia of MG generating units. On the other hand, presence of electric vehicles (EVs), as new high-electricity-consuming appliances, can be a good opportunity to contribute in mitigating the frequency deviations and help the system stability. This paper proposes an optimal charging/discharging scheduling of EVs with the goal of improving frequency stability of MG during autonomous operating condition. To this end, an efﬁcient approach is applied to reschedule the generating units considering the EVs owners’ behaviors. An EV power controller (EVPC) is also designed to determine charge and discharge process of EVs based on the forecasted day-ahead load and renewable generation proﬁles. The performance of the proposed strategy is tested in different operating scenarios and compared to those from non-optimized methodologies. Numerical simulations indicate that the MG performance improves considerably in terms of economy and stability using the proposed strategy.


Introduction
Microgrids (MGs) are a part of distribution systems that include several means of distributed generation (DG), renewable energy sources (RESs), storage devices and controllable loads and have the capability to operate either in connected or isolated mode [1,2].During islanded operation, due to low inertia of MG and intermittent nature of RESs such as wind and solar, there might be some frequency deviations beyond the acceptable range.Thus, an islanded MG requires specific primary and secondary frequency control schemes, in order to maintain power balance between generation and load and restore frequency to the nominal value [3].Moreover, MG requires sufficient spinning reserve provided by DG units or energy storage systems (ESSs) to keep power balance during islanded operation [4].With increasing penetration level of EVs and considering that they are available most of the times in a day, they can play the role of ESSs in a way to alter their energy consumption/production level under the vehicle-to-grid (V2G) concept and exchange the power with the grid [5].Thus, with V2G capability, EVs can provide ancillary services for the grid, such as frequency regulation [5], load levelling [6,7] and spinning reserve [8].With the application of a well-designed energy management system (EMS), EVs can act as an effective solution to compensate the uncertain behaviour of RESs.On the other hand, EVs without any proper management strategy could cause a number of issues such as energy losses, overloads, and voltage and frequency fluctuations [9].Different methods have been used in recent literature to manage EVs' charging and discharging process to facilitate ancillary services in the presence of RESs [10,11].The role of EVs in primary frequency response and in the presence of renewable energies was investigated in [5] for the Great Britain power system.By considering three EV charging strategies, it was shown that a proper EV charging strategy is effective in primary frequency response and can stabilize the grid frequency when is needed.In [12], with regard to the randomness of renewable energy generation, the operation of EVs in the MG was scheduled to minimize cost of charging.Moreover, economic incentives for EV owners to compensate the wind forecast uncertainties were provided in [13].Coordination of EVs and minimization of the penalty cost associated with wind power imbalances was studied in [14].Authors in [15] presented an aggregated primary frequency control model, where a participation factor, based on the state-of-charge (SOC), was used to determine the droop characteristic.It was investigated that EVs can effectively improve the system frequency response due to their ability to participate in primary reserves.The work in [16] performed a comparative study in order to evaluate benefits of EVs providing primary frequency control in an islanded system with high penetration of RESs.A control strategy was also presented in [17] in order to provide active participation of EVs for load frequency response purposes.In the same study, the SOC of EVs was managed by using a smart charging strategy in order to obtain a scheduled charging level requested by an EV owner.In a similar manner, Ref. [18] provided frequency regulation to the power grid using EVs with an effective pricing policy, and Ref. [19] presented a frequency control method considering both EVs and controllable loads.
When an MG enters an isolated mode due to loss of the main grid or a blackout/fault, it necessitates appropriate control and management schemes such that both the economical and stability targets are achieved.In this regard, this paper proposes an EV energy management scheme for MG autonomous operation based on local frequency measurements such that EVs will contribute.The participation of EVs will contribute to the frequency stability of the MG in off-grid times.The proposed control strategy is intended to manage EVs' charging and discharging process considering cost signal and the demand not supplied by renewable resources (DNS Ren ) in order to keep the power balance within the MG.The major contributions of this paper are summarized as follows:

•
Developing a stability margin index considering variability of load and renewable resources generation to attain the electricity cost signal to manage EVs' charging and discharging process.

•
Application of a new EV power controlling (EVPC) scheme to improve frequency stability of an islanded MG.

•
Maximize the MG operator's profit and minimize total emission of generating units.
The remainder of this paper is organized as follows.The EV power controlling (EVPC) scheme is discussed in Section 2. The problem of techno-economic optimization of the MG is formulated in Section 3. The simulation results and discussion are expressed in Section 4 and the conclusion is drawn in Section 5.

MG Energy Management and Control
The stochastic behavior of RESs might cause inevitable concerns for the reliable operation of an islanded-MG.Any power fluctuation in such energy resources may lead to imbalance between load and generation, and, as a result, the frequency may deviate from its nominal value.On the other hand, an appropriate EV energy management strategy can respond to system frequency deviation and thus provide primary frequency regulation.EVs can supply (absorb) energy to (from) the network considering two possible operating modes: grid to vehicle (G2V) mode (charge and absorb power) and V2G mode (discharge and inject power to the network).Thus, from the MG operator's point of view, EVs can act both as load and generation.EVs participate in frequency control to charge in low load or high generation hours and discharge during high load or low renewable generation hours.In order to measure the power mismatch between demand and renewable resources generation, an indicator is introduced here as demand not supplied by renewable sources (DNS Ren ) and defined as below: where D(t) and P Ren (t) are total demand and generation of renewable resources in period t, respectively.In an isolated MG without energy storage, DNS Ren should be supplied by dispatchable generators (DGs).The difference between the maximum installed capacity of DG units and DNS Ren stands for the spinning reserve capacity of MG.Here, the normalized value of this capacity is defined as stability margin index (SMI): The SMI index value at each time period depends on the installed capacity of DG units, output power of renewable resources and customers' demand.As an illustrative example, the variation of SMI during 24 h of a given day is shown in Figure 1.When the total demand is supplied by renewable resources, SMI value is 1 and it is zero if DNS Ren is equal to the total installed capacity of DGs.If the generated power of RESs is more than the total demand, then SMI will be more than 1 (e.g., point P 1 in Figure 1).In this case, as it can be observed, the system frequency is unstable, and, in order to keep frequency within its nominal value, dump load (DL), which is comprised of a set of three-phase resistors connected in series, is used in order to be activated to absorb that excess power.Moreover, if a portion of load is supplied by RESs, the SMI index takes a value between 0 and 1.In this case, the system frequency remains within its nominal values, but its variation differs in various points of SMI.For example, as it can be observed from Figure 1, the frequency at points P 2 and P 3 has different variations but is still in the accepted range.Furthermore, when SMI value is less than zero (i.e., point P 4 in the system frequency drops, thus it is required to inject power to the network (for example, by discharging of EVs)).In the next step, SMI is applied to obtain electricity buying and selling prices for EVs' energy management.
The cost signal should follow the SMI index in such a way to encourage EV owners to charge or discharge their vehicles for keeping the power balance of the system and improving the frequency.Thus, cost signal should track the SMI trend with considering the range of electricity buying price (EBP) and electricity selling price (ESP) obtained from electricity market.On the other hand, the maximum (minimum) value of electricity price represents the highest (lowest) value of SMI.Other prices are fitted between these two limitations based on the values of SMI with the application of numerical analysis.generation hours.In order to measure the power mismatch between demand and renewable resources generation, an indicator is introduced here as demand not supplied by renewable sources ( n DNS Re ) and defined as below: stands for the spinning reserve capacity of MG.Here, the normalized value of this capacity is defined as stability margin index (SMI): The SMI index value at each time period depends on the installed capacity of DG units, output power of renewable resources and customers' demand.As an illustrative example, the variation of SMI during 24 h of a given day is shown in Figure 1.When the total demand is supplied by renewable resources, SMI value is 1 and it is zero if n DNS Re is equal to the total installed capacity of DGs.If the generated power of RESs is more than the total demand, then SMI will be more than 1 (e.g., point 1 P in Figure 1).In this case, as it can be observed, the system frequency is unstable, and, in order to keep frequency within its nominal value, dump load (DL), which is comprised of a set of three-phase resistors connected in series, is used in order to be activated to absorb that excess power.Moreover, if a portion of load is supplied by RESs, the SMI index takes a value between 0 and 1.
In this case, the system frequency remains within its nominal values, but its variation differs in various points of SMI.For example, as it can be observed from Figure 1, the frequency at points 2 P and 3 P has different variations but is still in the accepted range.Furthermore, when SMI value is less than zero (i.e., point 4 P in the system frequency drops, thus it is required to inject power to the network (for example, by discharging of EVs)).In the next step, SMI is applied to obtain electricity buying and selling prices for EVs' energy management.
The cost signal should follow the SMI index in such a way to encourage EV owners to charge or discharge their vehicles for keeping the power balance of the system and improving the frequency.Thus, cost signal should track the SMI trend with considering the range of electricity buying price (EBP) and electricity selling price (ESP) obtained from electricity market.On the other hand, the maximum (minimum) value of electricity price represents the highest (lowest) value of SMI.Other prices are fitted between these two limitations based on the values of SMI with the application of numerical analysis.

EVPC Structure
In calculating the payments to (by from) the MG operator when EVs are charged (discharged), EBP (ESP) value is introduced to reflect both the wholesale electricity prices and domestic tariffs [20].Generally, once an EV is connected to the MG, it will be charged and thus has to pay for the consumed energy based on the EBP.However, when it discharges, it receives payments based on the ESP for providing the service.The high level of ESP is considered as a high electricity selling price (HESP), and, here, it is set at 85% of the maximal ESP.Moreover, the high level of EBP is considered as high electricity buying price (HEBP), and it is set at 60% of the maximal EBP.In the islanding operation mode of MG, the major goal is to keep the system power balance and, consequently, to limit frequency variations within the allowed range.Considering the same objective, this paper presents an EVPC scheme as an energy management strategy in order to manage the participation of EVs in charging/discharging process with considering the intermittent behavior of renewable resources.Figure 2 shows the algorithm of an EVPC scheme for optimal scheduling of the MG, and it includes three stages.In the first stage, the difference between day-ahead load and the forecasted power of renewable resources would be calculated to obtain stability margin index and the electricity cost signal that are utilized for managing the power of EVs.This stage includes the following parts:

•
Forecasted load and output powers of RESs (wind and solar); it is assumed that the day-ahead load demand and renewable generations are determined.

EVPC Structure
In calculating the payments to (by from) the MG operator when EVs are charged (discharged), EBP (ESP) value is introduced to reflect both the wholesale electricity prices and domestic tariffs [20].Generally, once an EV is connected to the MG, it will be charged and thus has to pay for the consumed energy based on the EBP.However, when it discharges, it receives payments based on the ESP for providing the service.The high level of ESP is considered as a high electricity selling price (HESP), and, here, it is set at 85% of the maximal ESP.Moreover, the high level of EBP is considered as high electricity buying price (HEBP), and it is set at 60% of the maximal EBP.In the islanding operation mode of MG, the major goal is to keep the system power balance and, consequently, to limit frequency variations within the allowed range.Considering the same objective, this paper presents an EVPC scheme as an energy management strategy in order to manage the participation of EVs in charging/discharging process with considering the intermittent behavior of renewable resources.Figure 2 shows the algorithm of an EVPC scheme for optimal scheduling of the MG, and it includes three stages.In the first stage, the difference between day-ahead load and the forecasted power of renewable resources would be calculated to obtain stability margin index and the electricity cost signal that are utilized for managing the power of EVs.This stage includes the following parts: • Forecasted load and output powers of RESs (wind and solar); it is assumed that the day-ahead load demand and renewable generations are determined.
• Index calculation part; in this block, SMI is calculated using Labels (1) and (2).In the second stage, an optimal scheduling of the generating units is done to match the demand for the scheduling horizon properly through a unit commitment algorithm and optimal power flow procedure by considering system's objectives and constraints (technical and security).
In the third stage, the MG emergency operation is determined and the frequency behavior is evaluated.Since, the MG is operating in islanded mode, the power unbalance (P dist t ) will result from the changes in loads or generation.The emergency active power of unit i at the certain time t (dP i,t ), is defined as: where R i,t is the reserve capacity of unit i at time period t, and R t is the total available generation reserve at time period t.
The demand load, EV power and the generation emergency dispatch are applied as inputs to the MG dynamic model, in order to evaluate the energy balance within the MG for a given period and the expected frequency deviation in the event of a disturbance.Based on the dynamic model results, if the MG does not have enough reserve capacity, it is necessary to exploit emergency load curtailment (LC).Moreover, DL is applied when RESs' generated power is high and a portion of it is not consumed.

Coordination of EVs Operation with EVPC
Different types of charge and discharge of EVs are considered based on electricity cost signal and their SOC when plugged in: charging with high current (I H ), charging/discharging with medium current (I M ) and low current (I L ).The flowchart of delivered power of EV k is depicted in Figure 3.The transacted power of each EV would be obtained based on its initial conditions such as SOC and the calculated EBP and ESP based on SMI index.The relationship between SOC of EV k and the charge/discharge current is obtained from (4) [9]: where I k,t , ∆t plug and C a k are the current, plugged-in time (in seconds) and the available capacity of the battery.Since most EV companies use lead acid batteries for their vehicles, here, this kind of technology is also adopted.The voltage against released capacity at different discharge/charge currents for a lead-acid battery is extracted from [20].
In addition, in idle or driving mode, there is no power transaction between EV and the MG, but the stored energy might decrease depending on the length of its daily travel (L k ) and its energy consumption per km (r k ).Each EV comes back to the parking lot after driving L k km and its SOC at the entrance of parking lot (SOC ent k ) is obtained as following: where SOC int k is the SOC at the start of a day trip.The value of EV SOC at time t is obtained with respect to the amount of its initial SOC, charge/discharge energy (when it is connected to the grid) and the energy decreased due to its travelling.On the other hand, SMI index at time t would be calculated from the previously-mentioned equations.With considering both SOC and SMI indexes, the charge/discharge process would be determined.In other words, if EV is connected, the value of current that EV absorbs (injects) from (to) the network would be found.Then, the voltage would be obtained based on the voltage-current characteristic of the battery.Thus, with the obtained voltage and current, the transacted power between EV and the network would be captured.This process repeats at each time t.characteristic of the battery.Thus, with the obtained voltage and current, the transacted power between EV and the network would be captured.This process repeats at each time t.

Problem Formulation
In order to investigate techno-economic valuation and optimization of the proposed strategy in the MG, a multi-objective optimization problem is formulated with several objectives.

Objective Function
In the proposed multi-objective problem, three objectives are considered as the MG operator's profit ( 1 F ) maximization, and minimization of the total emission ( 2 F ) as well as the cost corresponding to frequency deviation of the MG ( 3 F ).The total MG operator's profit is formulated as: The first line of Label (6) represents the MG operator's revenue from selling energy to the consumers.The second line stands for the fuel cost of generation units and the start-up/shut-down costs.The third line denotes the costs associated with energy provided from the wind turbine (WT) and photovoltaic (PV) units.Here, it is assumed that the MG operator is not the owner of the renewable resources and is only responsible for the scheduling of the renewable units in the MG, so he should pay for energy provided by WT and PV.Finally, the last line expresses the costs associated with charge and discharge of EVs.

Problem Formulation
In order to investigate techno-economic valuation and optimization of the proposed strategy in the MG, a multi-objective optimization problem is formulated with several objectives.

Objective Function
In the proposed multi-objective problem, three objectives are considered as the MG operator's profit (F 1 ) maximization, and minimization of the total emission (F 2 ) as well as the cost corresponding to frequency deviation of the MG (F 3 ).The total MG operator's profit is formulated as: The first line of Label (6) represents the MG operator's revenue from selling energy to the consumers.The second line stands for the fuel cost of generation units and the start-up/shut-down costs.The third line denotes the costs associated with energy provided from the wind turbine (WT) and photovoltaic (PV) units.Here, it is assumed that the MG operator is not the owner of the renewable resources and is only responsible for the scheduling of the renewable units in the MG, so he should pay for energy provided by WT and PV.Finally, the last line expresses the costs associated with charge and discharge of EVs.
The second objective is to minimize the MG pollutants' emissions generated by DG units that consist of CO 2 , NO x and SO 2 : The cost corresponding to MG frequency deviation should be minimized during scheduling horizon, which can be considered as a quadratic function of SMI as shown in Figure 4.The second objective is to minimize the MG pollutants' emissions generated by DG units that consist of CO2, NOx and SO2: . (7) The cost corresponding to MG frequency deviation should be minimized during scheduling horizon, which can be considered as a quadratic function of SMI as shown in Figure 4.The piecewise linear model for one period is represented as the following: where vm,t is the slope of segment m in linearized total penalty cost and NS(i) is the number of segments.In addition, ut is a binary variable, equal to 0 if SMI has its expected limitation value (system stability is not at risk); otherwise, it is 1.

Mixed-Objective Function
Considering the above-mentioned objectives, the mixed-objective optimization problem can be developed as follows: μ is the emission penalty factor in terms of £/kg.In the proposed weighted-sum model, the weighting factors can be set based on a multiple-criteria decision analysis (MCDA) done by the MG operator.

Constraints
The mentioned optimization problem is solved subject to the constraints as follows: • Demand-supply balance equation: the balance between the total active power production and consumption in both grid-connected and isolated modes of MG is presented as: The left-side of Label (11) corresponds to the total available power in the MG at time period t including the expected WT and PV generation, the scheduled discharged power from EVs, the power of DG units and the exchanged power with the utility.In addition, the right side of Label (11) represents the total load and the power fed to the EVs.The piecewise linear model for one period is represented as the following: where v m,t is the slope of segment m in linearized total penalty cost and NS(i) is the number of segments.
In addition, u t is a binary variable, equal to 0 if SMI has its expected limitation value (system stability is not at risk); otherwise, it is 1.

Mixed-Objective Function
Considering the above-mentioned objectives, the mixed-objective optimization problem can be developed as follows: where W C , W E and W SMI are weighting factors of the objective functions F 1 , F 2 and F 3 , respectively, and µ E is the emission penalty factor in terms of £/kg.In the proposed weighted-sum model, the weighting factors can be set based on a multiple-criteria decision analysis (MCDA) done by the MG operator.

Constraints
The mentioned optimization problem is solved subject to the constraints as follows: • Demand-supply balance equation: the balance between the total active power production and consumption in both grid-connected and isolated modes of MG is presented as: The left-side of Label (11) corresponds to the total available power in the MG at time period t including the expected WT and PV generation, the scheduled discharged power from EVs, the power of DG units and the exchanged power with the utility.In addition, the right side of Label (11) represents the total load and the power fed to the EVs.

•
EVs constraints: Equations ( 12) and ( 13) define the power bounds for both EVs charging and discharging processes: where P ch k,t and P dis k,t are charging and discharging power of kth EV.In addition, P max,ch k and P max,dis k are maximum charging and discharging power of kth EV, respectively.

•
Power generation capacity: Active power output of a generation unit should be bounded within a range as follows:

Case Study
The considered MG test system shown in Figure 5 is used to demonstrate the effectiveness of the proposed strategy.The test system includes a PV plant and a WT unit as renewable resources, a diesel engine as a DG, EVs and loads.Moreover, a dump load bank is considered for dumping the surplus energy produced by the RESs' units in isolated mode operation.Based on an economical assessment performed by HOMER Pro ® , the optimal design of MG's sources (installation capacities of resources) is obtained for a region in the east of Iran (32.8649 • N, 59.2262 • E).With respect to this assessment and considering the technical constraints, the installed capacity of PV, WT and DG are calculated as 300 kW, 375 kVA and 300 kVA, respectively.• EVs constraints: Equations ( 12) and ( 13) define the power bounds for both EVs charging and discharging processes: where ch t k P , and dis t k P , are charging and discharging power of k th EV.In addition, ch k P max, and dis k P max, are maximum charging and discharging power of k th EV, respectively.

•
Power generation capacity: Active power output of a generation unit should be bounded within a range as follows:

Case Study
The considered MG test system shown in Figure 5 is used to demonstrate the effectiveness of the proposed strategy.The test system includes a PV plant and a WT unit as renewable resources, a diesel engine as a DG, EVs and loads.Moreover, a dump load bank is considered for dumping the surplus energy produced by the RESs' units in isolated mode operation.Based on an economical assessment performed by HOMER Pro ® , the optimal design of MG's sources (installation capacities of resources) is obtained for a region in the east of Iran (32.8649°N, 59.2262° E).With respect to this assessment and considering the technical constraints, the installed capacity of PV, WT and DG are calculated as 300 kW, 375 kVA and 300 kVA, respectively.Here, the minimum and maximum limit of SOC are considered as 40% and 90% of the total battery capacity, respectively [22].The connected EVs are assumed to be charged at different current ratings (i.e., 2, 10 or 30 Ampere), and to be discharged either with 2 or 10 Ampere [23].
Moreover, it is assumed that the charge/discharge processes in both parking lots is the same and the number of EVs in each parking lot is evaluated based on the available profiles depicted in Figure 7. Due to EVs travelling, the number of EVs in both parking lots is a percentage of the total number of EVs.

EVs Charge/Discharge Process with/without EVPC
Based on the explanation in Section 2, the n DNS Re and SMI index over the 24-h horizon are achieved in the under study system that are shown in Figures 8 and 9, respectively.To obtain the cost signal based on the SMI index, the minimum and maximum values of SMI correspond with the minimum and maximum values of cost signal in the wholesale market with the application of numerical analysis.The other values of cost signal should remain in this range in such a way to follow the SMI index.It should be noted that this cost signal is applied in the isolated mode by the MG operator, but in the connected mode, the MG operator is a price taker and the cost signal of the wholesale market is used for EV management.Here, the minimum and maximum limit of SOC are considered as 40% and 90% of the total battery capacity, respectively [22].The connected EVs are assumed to be charged at different current ratings (i.e., 2, 10 or 30 Ampere), and to be discharged either with 2 or 10 Ampere [23].
Moreover, it is assumed that the charge/discharge processes in both parking lots is the same and the number of EVs in each parking lot is evaluated based on the available profiles depicted in Figure 7. Due to EVs travelling, the number of EVs in both parking lots is a percentage of the total number of EVs.Here, the minimum and maximum limit of SOC are considered as 40% and 90% of the total battery capacity, respectively [22].The connected EVs are assumed to be charged at different current ratings (i.e., 2, 10 or 30 Ampere), and to be discharged either with 2 or 10 Ampere [23].
Moreover, it is assumed that the charge/discharge processes in both parking lots is the same and the number of EVs in each parking lot is evaluated based on the available profiles depicted in Figure 7. Due to EVs travelling, the number of EVs in both parking lots is a percentage of the total number of EVs.

EVs Charge/Discharge Process with/without EVPC
Based on the explanation in Section 2, the n DNS Re and SMI index over the 24-h horizon are achieved in the under study system that are shown in Figures 8 and 9, respectively.To obtain the cost signal based on the SMI index, the minimum and maximum values of SMI correspond with the minimum and maximum values of cost signal in the wholesale market with the application of numerical analysis.The other values of cost signal should remain in this range in such a way to follow the SMI index.It should be noted that this cost signal is applied in the isolated mode by the MG operator, but in the connected mode, the MG operator is a price taker and the cost signal of the wholesale market is used for EV management.

EVs Charge/Discharge Process with/without EVPC
Based on the explanation in Section 2, the DNS Ren and SMI index over the 24-h horizon are achieved in the under study system that are shown in Figures 8 and 9, respectively.To obtain the cost signal based on the SMI index, the minimum and maximum values of SMI correspond with the minimum and maximum values of cost signal in the wholesale market with the application of numerical analysis.The other values of cost signal should remain in this range in such a way to follow the SMI index.It should be noted that this cost signal is applied in the isolated mode by the MG operator, but in the connected mode, the MG operator is a price taker and the cost signal of the wholesale market is used for EV management.Here, the minimum and maximum limit of SOC are considered as 40% and 90% of the total battery capacity, respectively [22].The connected EVs are assumed to be charged at different current ratings (i.e., 2, 10 or 30 Ampere), and to be discharged either with 2 or 10 Ampere [23].
Moreover, it is assumed that the charge/discharge processes in both parking lots is the same and the number of EVs in each parking lot is evaluated based on the available profiles depicted in Figure 7. Due to EVs travelling, the number of EVs in both parking lots is a percentage of the total number of EVs.

EVs Charge/Discharge Process with/without EVPC
Based on the explanation in Section 2, the n DNS Re and SMI index over the 24-h horizon are achieved in the under study system that are shown in Figures 8 and 9, respectively.To obtain the cost signal based on the SMI index, the minimum and maximum values of SMI correspond with the minimum and maximum values of cost signal in the wholesale market with the application of numerical analysis.The other values of cost signal should remain in this range in such a way to follow the SMI index.It should be noted that this cost signal is applied in the isolated mode by the MG operator, but in the connected mode, the MG operator is a price taker and the cost signal of the wholesale market is used for EV management.In this case, as shown in Figure 10a, the minimum electricity buying and selling prices are 0.186 and 0.184 (£/kWh), and maximum electricity buying and selling prices are 0.202 and 0.212 (£/kWh), respectively.Figure 10b shows the day-ahead electricity selling and buying prices as adopted from [23].As can be seen, the minimum electricity buying and selling prices are set to 0.169 and 0.149 (£/kWh), while the maximum electricity buying and selling prices are considered as 0.191 and 0.245 (£/kWh), respectively.This cost signal is used to be compared with the numerical results of the proposed signal.The exchanged power between EVs and the MG with/without EVPC in each time interval is shown in Figure 11     In this case, as shown in Figure 10a, the minimum electricity buying and selling prices are 0.186 and 0.184 (£/kWh), and maximum electricity buying and selling prices are 0.202 and 0.212 (£/kWh), respectively.Figure 10b shows the day-ahead electricity selling and buying prices as adopted from [24].As can be seen, the minimum electricity buying and selling prices are set to 0.169 and 0.149 (£/kWh), while the maximum electricity buying and selling prices are considered as 0.191 and 0.245 (£/kWh), respectively.This cost signal is used to be compared with the numerical results of the proposed signal.The exchanged power between EVs and the MG with/without EVPC in each time interval is shown in Figure 11 for a typical day.In this case, as shown in Figure 10a, the minimum electricity buying and selling prices are 0.186 and 0.184 (£/kWh), and maximum electricity buying and selling prices are 0.202 and 0.212 (£/kWh), respectively.Figure 10b shows the day-ahead electricity selling and buying prices as adopted from [23].As can be seen, the minimum electricity buying and selling prices are set to 0.169 and 0.149 (£/kWh), while the maximum electricity buying and selling prices are considered as 0.191 and 0.245 (£/kWh), respectively.This cost signal is used to be compared with the numerical results of the proposed signal.The exchanged power between EVs and the MG with/without EVPC in each time interval is shown in Figure 11

Frequency Stability Analysis with/without EVPC
To investigate the effect of EVPC on the MG frequency stability, it is assumed that at time 1:00, the MG switches into isolated mode and remains in this mode during the scheduling horizon.Due to a fault occurrence in the upstream at time 1:00, the MG switches into the isolated mode.In isolated mode, MG frequency response is studied in two cases.In the first case, EVs do not participate in load frequency control, while, in the second one, EVs contribute in the MG frequency regulation.Figure 12 shows the MG frequency variations in two cases.
Comparison of the two cases shows that the application of EVPC results in a lower frequency deviation.As can be seen in the same figure, with EVPC, frequency varies in the range between 59 and 61.4 Hz; however, without it, the frequency drops to less than 57 Hz when the MG enters the isolated mode.As can be observed from Figure 13, the minimum value of SMI occurs at 6:00.It can be shown that, at this time, the system is in the critical condition without the application of EVPC.During islanded operation, due to low inertia of MG and intermittent nature of RESs and load, there might be some frequency deviations beyond the acceptable range.As depicted in Figure 14, due to a sudden load change of 20 kW at 6:30, the system frequency becomes unstable without EVPC.At this time, EVs are charged 140 kW without EVPC; however, with the application of that, they are discharged at the rate of 68 kW/h.In fact, when the load demand increases suddenly, the amount of reserve reduces.In this condition, generation of RESs is very low (7 kW) and so EVs' high charging leads to frequency drop.However, with the application of EVPC, due to a low amount of

Frequency Stability Analysis with/without EVPC
To investigate the effect of EVPC on the MG frequency stability, it is assumed that at time 1:00, the MG switches into isolated mode and remains in this mode during the scheduling horizon.Due to a fault occurrence in the upstream at time 1:00, the MG switches into the isolated mode.In isolated mode, MG frequency response is studied in two cases.In the first case, EVs do not participate in load frequency control, while, in the second one, EVs contribute in the MG frequency regulation.Figure 12 shows the MG frequency variations in two cases.
Comparison of the two cases shows that the application of EVPC results in a lower frequency deviation.As can be seen in the same figure, with EVPC, frequency varies in the range between 59 and 61.4 Hz; however, without it, the frequency drops to less than 57 Hz when the MG enters the isolated mode.As can be observed from Figure 13, the minimum value of SMI occurs at 6:00.It can be shown that, at this time, the system is in the critical condition without the application of EVPC.

Frequency Stability Analysis with/without EVPC
To investigate the effect of EVPC on the MG frequency stability, it is assumed that at time 1:00, the MG switches into isolated mode and remains in this mode during the scheduling horizon.Due to a fault occurrence in the upstream at time 1:00, the MG switches into the isolated mode.In isolated mode, MG frequency response is studied in two cases.In the first case, EVs do not participate in load frequency control, while, in the second one, EVs contribute in the MG frequency regulation.Figure 12 shows the MG frequency variations in two cases.
Comparison of the two cases shows that the application of EVPC results in a lower frequency deviation.As can be seen in the same figure, with EVPC, frequency varies in the range between 59 and 61.4 Hz; however, without it, the frequency drops to less than 57 Hz when the MG enters the isolated mode.As can be observed from Figure 13, the minimum value of SMI occurs at 6:00.It can be shown that, at this time, the system is in the critical condition without the application of EVPC.During islanded operation, due to low inertia of MG and intermittent nature of RESs and load, there might be some frequency deviations beyond the acceptable range.As depicted in Figure 14, due to a sudden load change of 20 kW at 6:30, the system frequency becomes unstable without EVPC.At this time, EVs are charged 140 kW without EVPC; however, with the application of that, they are discharged at the rate of 68 kW/h.In fact, when the load demand increases suddenly, the amount of reserve reduces.In this condition, generation of RESs is very low (7 kW) and so EVs' high charging leads to frequency drop.However, with the application of EVPC, due to a low amount of

Frequency Stability Analysis with/without EVPC
To investigate the effect of EVPC on the MG frequency stability, it is assumed that at time 1:00, the MG switches into isolated mode and remains in this mode during the scheduling horizon.Due to a fault occurrence in the upstream at time 1:00, the MG switches into the isolated mode.In isolated mode, MG frequency response is studied in two cases.In the first case, EVs do not participate in load frequency control, while, in the second one, EVs contribute in the MG frequency regulation.Figure 12 shows the MG frequency variations in two cases.
Comparison of the two cases shows that the application of EVPC results in a lower frequency deviation.As can be seen in the same figure, with EVPC, frequency varies in the range between 59 and 61.4 Hz; however, without it, the frequency drops to less than 57 Hz when the MG enters the isolated mode.As can be observed from Figure 13, the minimum value of SMI occurs at 6:00.It can be shown that, at this time, the system is in the critical condition without the application of EVPC.During islanded operation, due to low inertia of MG and intermittent nature of RESs and load, there might be some frequency deviations beyond the acceptable range.As depicted in Figure 14, due to a sudden load change of 20 kW at 6:30, the system frequency becomes unstable without EVPC.At this time, EVs are charged 140 kW without EVPC; however, with the application of that, they are discharged at the rate of 68 kW/h.In fact, when the load demand increases suddenly, the amount of reserve reduces.In this condition, generation of RESs is very low (7 kW) and so EVs' high charging leads to frequency drop.However, with the application of EVPC, due to a low amount of During islanded operation, due to low inertia of MG and intermittent nature of RESs and load, there might be some frequency deviations beyond the acceptable range.As depicted in Figure 14, due to a sudden load change of 20 kW at 6:30, the system frequency becomes unstable without EVPC.At this time, EVs are charged 140 kW without EVPC; however, with the application of that, they are discharged at the rate of 68 kW/h.In fact, when the load demand increases suddenly, the amount of reserve reduces.In this condition, generation of RESs is very low (7 kW) and so EVs' high charging leads to frequency drop.However, with the application of EVPC, due to a low amount of reserve and the SMI index, EVs assist in the discharge process and the system obtains a proper margin for its reserve and, consequently, frequency remains within its limitation.It should be mentioned that, without EVPC, the frequency instability occurs at 11:00 due to surplus energy produced by RESs.reserve and the SMI index, EVs assist in the discharge process and the system obtains a proper margin for its reserve and, consequently, frequency remains within its limitation.It should be mentioned that, without EVPC, the frequency instability occurs at 11:00 due to surplus energy produced by RESs.In order to assess fluctuation of frequency accurately, the frequency deviation with and without EVPC is shown in Figure 15.At this time, without the EVPC scheme, EVs are discharged up to 56 kW and with EVPC EVs are charged 142 kW, accordingly.On the other hand, with EVPC, EVs are charged with lower power and frequency variation is less than the other case where there is no EVPC.
Thus, the value of SMI without EVPC is more than 1 and the system is unstable at 11:00.However, with the application of DL, frequency remains within its expected value.In this case, DL consists of a bank of resistive loads each with a consumption level of 1.75 kW (up to 175 kW).As it can be observed from Figure 16, to keep the system power balance at 11:00, 30 kW of DL activated.Thus, with the application of DL in the case without EVPC, the system remains stable at all times.The maximum load demand occurs at 14:00 (368 kW), and frequency variation at this time is shown in Figure 17.At this time, load has its maximum value and the production of RESs is 300 kW.In order to assess fluctuation of frequency accurately, the frequency deviation with and without EVPC is shown in Figure 15.At this time, without the EVPC scheme, EVs are discharged up to 56 kW and with EVPC EVs are charged 142 kW, accordingly.On the other hand, with EVPC, EVs are charged with lower power and frequency variation is less than the other case where there is no EVPC.
Thus, the value of SMI without EVPC is more than 1 and the system is unstable at 11:00.However, with the application of DL, frequency remains within its expected value.In this case, DL consists of a bank of resistive loads each with a consumption level of 1.75 kW (up to 175 kW).As it can be observed from Figure 16, to keep the system power balance at 11:00, 30 kW of DL activated.Thus, with the application of DL in the case without EVPC, the system remains stable at all times.
reserve and the SMI index, EVs assist in the discharge process and the system obtains a proper margin for its reserve and, consequently, frequency remains within its limitation.It should be mentioned that, without EVPC, the frequency instability occurs at 11:00 due to surplus energy produced by RESs.In order to assess fluctuation of frequency accurately, the frequency deviation with and without EVPC is shown in Figure 15.At this time, without the EVPC scheme, EVs are discharged up to 56 kW and with EVPC EVs are charged 142 kW, accordingly.On the other hand, with EVPC, EVs are charged with lower power and frequency variation is less than the other case where there is no EVPC.
Thus, the value of SMI without EVPC is more than 1 and the system is unstable at 11:00.However, with the application of DL, frequency remains within its expected value.In this case, DL consists of a bank of resistive loads each with a consumption level of 1.75 kW (up to 175 kW).As it can be observed from Figure 16, to keep the system power balance at 11:00, 30 kW of DL activated.Thus, with the application of DL in the case without EVPC, the system remains stable at all times.The maximum load demand occurs at 14:00 (368 kW), and frequency variation at this time is shown in Figure 17.At this time, load has its maximum value and the production of RESs is 300 kW.reserve and the SMI index, EVs assist in the discharge process and the system obtains a proper margin for its reserve and, consequently, frequency remains within its limitation.It should be mentioned that, without EVPC, the frequency instability occurs at 11:00 due to surplus energy produced by RESs.In order to assess fluctuation of frequency accurately, the frequency deviation with and without EVPC is shown in Figure 15.At this time, without the EVPC scheme, EVs are discharged up to 56 kW and with EVPC EVs are charged 142 kW, accordingly.On the other hand, with EVPC, EVs are charged with lower power and frequency variation is less than the other case where there is no EVPC.
Thus, the value of SMI without EVPC is more than 1 and the system is unstable at 11:00.However, with the application of DL, frequency remains within its expected value.In this case, DL consists of a bank of resistive loads each with a consumption level of 1.75 kW (up to 175 kW).As it can be observed from Figure 16, to keep the system power balance at 11:00, 30 kW of DL activated.Thus, with the application of DL in the case without EVPC, the system remains stable at all times.The maximum load demand occurs at 14:00 (368 kW), and frequency variation at this time is shown in Figure 17.At this time, load has its maximum value and the production of RESs is 300 kW.The maximum load demand occurs at 14:00 (368 kW), and frequency variation at this time is shown in Figure 17.At this time, load has its maximum value and the production of RESs is 300 kW.Based on both cost signals, EVs are charged 152 kW and 168 kW in cases with and without EVPC, respectively, and the frequency is kept in its limitations in both cases.
As can be observed in Figure 12, frequency has an overshoot at 8:00 and 18:00 that is zoomed in on in Figure 18.At these times, since SMI is higher in conditions without EVPC than that of in circumstances with EVPC; hence, frequency deviation is further in the former conditions than the latter ones.Based on both cost signals, EVs are charged 152 kW and 168 kW in cases with and without EVPC, respectively, and the frequency is kept in its limitations in both cases.As can be observed in Figure 12, frequency has an overshoot at 8:00 and 18:00 that is zoomed in on in Figure 18.At these times, since SMI is higher in conditions without EVPC than that of in circumstances with EVPC; hence, frequency deviation is further in the former conditions than the latter ones.The optimization results of the under-study system with and without the application of EVPC are presented in Table 1.As it can be seen, the implementation of EVPC achieves better economic results as compared to the case without it.The results reveal that the MG operator's profit (F1) is 324.2 £, which is 30.1 £ more than the case without EVPC.Moreover, MG emission is decreased about 205.849 kg with the proposed strategy.Furthermore, since the frequency deviations in the case with EVPC remain in the allowable range, the cost corresponding with load frequency control is zero.However, in the case without EVPC, cost of frequency control (F3) raises up to 11.7 £.Finally, the objective function that is equal to the total MG operator's profits with and without the implementation of EVPC are obtained as 282.1 The optimization results of the under-study system with and without the application of EVPC are presented in Table 1.As it can be seen, the implementation of EVPC achieves better economic results as compared to the case without it.The results reveal that the MG operator's profit (F 1 ) is 324.2 £, which is 30.1 £ more than the case without EVPC.Moreover, MG emission is decreased about 205.849 kg with the proposed strategy.Based on both cost signals, EVs are charged 152 kW and 168 kW in cases with and without EVPC, respectively, and the frequency is kept in its limitations in both cases.As can be observed in Figure 12, frequency has an overshoot at 8:00 and 18:00 that is zoomed in on in Figure 18.At these times, since SMI is higher in conditions without EVPC than that of in circumstances with EVPC; hence, frequency deviation is further in the former conditions than the latter ones.The optimization results of the under-study system with and without the application of EVPC are presented in Table 1.As it can be seen, the implementation of EVPC achieves better economic results as compared to the case without it.The results reveal that the MG operator's profit (F1) is 324.2 £, which is 30.1 £ more than the case without EVPC.Moreover, MG emission is decreased about 205.849 kg with the proposed strategy.Furthermore, since the frequency deviations in the case with EVPC remain in the allowable range, the cost corresponding with load frequency control is zero.However, in the case without EVPC, cost of frequency control (F3) raises up to 11.7 £.Finally, the objective function that is equal to the total MG operator's profits with and without the implementation of EVPC are obtained as 282.1  Furthermore, since the frequency deviations in the case with EVPC remain in the allowable range, the cost corresponding with load frequency control is zero.However, in the case without EVPC, cost of frequency control (F 3 ) raises up to 11.7 £.Finally, the objective function that is equal to the total MG operator's profits with and without the implementation of EVPC are obtained as 282.1 and 237.6 £, respectively.Thus, the assessment of the results shows that, with the application of EVPC, the total MG operator's profit is increased considerably.

Conclusions
In this paper, an optimal management strategy was proposed in order to schedule the EVs' charging/discharging process with the goal of improving frequency stability of MG during autonomous operating conditions.In this way, a cost signal including EBP and ESP was proposed based on the variation of SMI index that followed the intermittent nature of RESs and load variation.Based on the proposed strategy, when frequency is at risk, EVs could absorb (inject) the surplus (shortage) of energy and act as energy storage systems.The results also showed, that with the application of this strategy, the frequency variation of MG in isolated mode is less than that without it.Moreover, it is not required to use DL when the EVPC strategy is applied in the MG.Furthermore, it was understood from the results that using EVPC strategy could increase the total MG operator's profit and decrease the emission substantially.

•Figure 2 .
Figure 2. Algorithm of the electric vehicle power controller (EVPC) scheme for optimal scheduling of the microgrid (MG).

Figure 3 .
Figure 3. Flowchart of delivered power of electric vehicle (EV) k.

Figure 3 .
Figure 3. Flowchart of delivered power of electric vehicle (EV) k.

Figure 4 .
Figure 4. Piecewise linear cost curve of frequency deviation for an hour.

Figure 4 .
Figure 4. Piecewise linear cost curve of frequency deviation for an hour.

Figure 5 .
Figure 5. Single line diagram of the examined MG.The forecasted load, output power of WT, PV and the summation power of WT and PV ( n P Re ) in a typical day are depicted in Figure 6.It is also assumed that there are 100 EVs plugged into two different parking lots (in residential and office buildings) and their arrival times are modeled based on a Gaussian distribution with μ = 19 and 2 δ = 10 [21].

Figure 5 .
Figure 5. Single line diagram of the examined MG.

Figure 6 .
Figure 6.Forecasted demand and renewable generations in a typical day on an hourly basis.

Figure 7 .
Figure 7. Number of EVs in the house and office parking lots.

Figure 8 .Figure 6 .
Figure 8.The demand not supplied by renewable resources (

Figure 6 .
Figure 6.Forecasted demand and renewable generations in a typical day on an hourly basis.

Figure 7 .
Figure 7. Number of EVs in the house and office parking lots.

Figure 8 .
Figure 8.The demand not supplied by renewable resources (

Figure 7 .
Figure 7. Number of EVs in the house and office parking lots.

Figure 6 .
Figure 6.Forecasted demand and renewable generations in a typical day on an hourly basis.

Figure 7 .
Figure 7. Number of EVs in the house and office parking lots.

Figure 8 .
Figure 8.The demand not supplied by renewable resources (

Figure 8 .
Figure 8.The demand not supplied by renewable resources (DNS Ren ) of MG over the 24-h horizon.

Figure 10 .
Figure 10.Electricity buying/selling price (a) based on power mismatch between load and 0

Figure 10 .
Figure 10.Electricity buying/selling price (a) based on power mismatch between load and

Figure 10 .
Figure 10.Electricity buying/selling price (a) based on power mismatch between load and P Ren (b) extracted from [23].

Figure 11 .
Figure 11.The exchanged power between EVs and the MG with/without EVPC.

Figure 12 .
Figure 12.Frequency variation in two cases over a 24-h horizon.

Figure 13 .
Figure 13.Variation of SMI with and without EVPC.

Figure 11 .
Figure 11.The exchanged power between EVs and the MG with/without EVPC.

Figure 11 .
Figure 11.The exchanged power between EVs and the MG with/without EVPC.

Figure 12 .
Figure 12.Frequency variation in two cases over a 24-h horizon.

Figure 13 .
Figure 13.Variation of SMI with and without EVPC.

Figure 12 .
Figure 12.Frequency variation in two cases over a 24-h horizon.

Figure 13 .
Figure 13.Variation of SMI with and without EVPC.

Figure 13 .
Figure 13.Variation of SMI with and without EVPC.

Figure 17 .
Figure 17.Frequency variation at the maximum load.

Figure 17 .
Figure 17.Frequency variation at the maximum load.

Figure 17 .
Figure 17.Frequency variation at the maximum load.
Frequency variation.

Table 1 .
The optimization results of microgrid (MG) in scheduling time horizon.