# Energy Management Scheme for an EV Smart
## 4 EMS for a Smart Charger
### Proposed Power Allocation Method to EVs  
As multiple EVs are connected to the grid near each other, the approach of creating EV fleets by aggregating the capacities of the EV batteries for ancillary services has come forth. However, the previous component-modeling level studies, which consider multiple EVs connected to a common DC-bus of the smart charger, have ignored this concept [15; 16; 20]. Previous research has established various methods for EV power allocation based on optimization procedures, which incorporate forecasting and have long time intervals and execution times [21; 22; 23]. These methods are not feasible for renewables with short-term variances, which require a fast and heuristic approach to deal with the EV power allocation objective. We have proposed a method for EV power distribution for V2G/G2V scenarios that serves to aggregate the EVs. The strategy functions within the EMS and updates the power references for individual EVs based on the ongoing status from the grid while also communicating with the EVs. The scheme is executed based on the rated battery capacity and SoC EVs. The EVs participate in V2G/G2V with reference to the calculated on-board energy. During V2G, the EVs discharge to compensate the active power variance, and the power division among EVs is based on the available battery energy on-board. In the case of G2V, when the EVs charge from the surplus renewable output, the power is allotted among the EVs according to the energy required for the full state of charge, thus following a similar logic. A significant advantage of this scheme is that it can serve to aggregate various types of EVs with different sizes of battery banks. Though this scheme is initially proposed for a single fast charging station, it can be extended to multiple chargers by introducing coordination among them. The total rated aggregated battery capacity \(\Psi^{T}\) of \(n\) EVs connected to the DC-bus of the smart charger is given by:  
\[\Psi^{T}=\sum_{i=1}^{n}\left(\Psi^{T}_{EV(i)}\right) \tag{22}\]  
where \(\Psi^{T}_{EV(i)}\) is the rated battery capacity of the \(i\)-th EV. The available energy \(\Psi^{Atl}_{EV(i)}\) of any \(i\)-th EV can be calculated using its current SoC \(SoC_{EV(i)}\) as:  
\[\Psi^{Atl}_{EV(i)}=\Psi^{T}_{EV(i)}\times SoC_{EV(i)} \tag{23}\]  
Therefore, the aggregated available energy \(\Psi^{Atl}_{(n)EVs}\) of \(n\) EVs is:\[\Psi^{A\
u l}_{(n)EVs}=\sum_{i=1}^{n}\left(\Psi^{T}_{EV(i)}\times SoC_{EV(i)}\right) \tag{24}\]  
Based on the available energy of an EV and the total available energy calculated, the individual power reference allocated to an EV for discharging during V2G is given by:  
\[P^{*}_{EV(i)}=\frac{\Psi^{A\
u l}_{EV(i)}}{\Psi^{A\
u l}_{(n)EVs}}P^{*}_{( inv)} \tag{25}\]  
Conversely, the charging power of each EV is estimated using the energy required for a full charge. The required energy \(\Psi^{Req}_{EV(i)}\) of the \(i\)-th EV can be calculated as:  
\[\Psi^{Req}_{EV(i)}=\Psi^{T}_{EV(i)}-\Psi^{A\
u l}_{EV(i)} \tag{26}\]  
and the aggregated required energy \(\Psi^{Req}_{(n)EVs}\) of \(n\) EVs is:  
\[\Psi^{Req}_{(n)EVs}=\sum_{i=1}^{n}\left(\Psi^{T}_{EV(i)}-\Psi^{A\
u l}_{EV(i) }\right) \tag{27}\]  
Thus, for charging the EV during G2V, the individual EV power is:  
\[P^{*}_{EV(i)}=\frac{\Psi^{Req}_{EV(i)}}{\Psi^{Req}_{(n)EVs}}P^{*}_{(inv)} \tag{28}\]  
and the total power from all EVs should satisfy the following condition:  
\[\sum_{i=1}^{n}P^{*}_{EV(i)}=P^{*}_{(inv)} \tag{29}\]  
The \(i\)-th EV's power for the DC side is:  
\[P_{EV(i)}=V_{dc}\times i_{EV(i)}=V_{b(i)}\times i_{b(i)} \tag{30}\]  
where \(i_{EV(i)}\) is the current flowing in or out of the DC-DC converter of the \(i\)-th EV. Based on this power, the EV battery charging/discharging current reference \(i^{*}_{b(i)}\) of the \(i\)-th EV is calculated as follows:  
\[i^{*}_{b(i)}=\frac{P^{*}_{EV(i)}}{V_{b(i)}} \tag{31}\]  
\(P^{*}_{EV(i)}\) is subjected to the SoC to stay within 20% and 80% limits. The functioning of the EV power allocation can be summarized as follows:  
\[P^{*}_{EV(i)}=