## 2 Supervisory and Control System Based on Real-Time Power Management  
Figure 1 shows the DC microgrid, denoted as IIREVs, and includes PV sources, stationary storage, power grid connection, and EVs as DC loads. Two operation modes exist for the PV sources: maximum power point tracking (MPPT), where maximum power is drawn using a perturb and observe algorithm, and PV power limitation, where PV power is limited in case of a surplus of PV power production [42] because the excess power can no longer be fully injected into the storage and/or into the grid. The stationary storage is a backup source acting as an energy reservoir when there is insufficient PV power to charge the EVs. When there is insufficient PV power to charge the EVs, the grid ensures the security of the system by injecting power to the EVs if the stationary storage has reached its lower limits (empty or minimum discharge power). On the other hand, the DC microgrid can sell power to the grid by injecting it when there is a surplus of PV power production and the stationary storage has reached its higher limits (full or maximum charging power) [43]. Regarding the EVs charging, they can operate in two modes: fully charging as requested by their users and EV shedding when it is not possible to fully supply the EVs. The power flow for IIREVs is shown in Figure 1, where \(p_{PV\ MPPT}\) is the PV MPPT power, \(p_{PV}\) is the PV power, \(p_{PV\_S}\) is the PV shed power, \(p_{G\_I}\) is the grid injection power, \(p_{C\_S}\) is the grid supply power, \(p_{S\_C}\) is the stationary storage charging power, \(p_{S\_D}\) is the stationary storage discharging power, \(p_{IREVs\ D}\) is the IIREVs' total demand power, \(p_{IREVs}\) is the IIREVs' total power, and \(p_{IREVs\ S}\) is the IIREVs' shed power. The components of the IIREVs are coupled through their dedicated converters to the common DC bus. PV sources are connected to the DC bus through the DC/DC converter to draw the MPPT power. The stationary storage is connected through a reversible DC/DC converter. The EVs' batteries, as DC loads, are connected through the DC/DC converter. The grid is connected through a three-phase bidirectional AC/DC converter. It is necessary to ensure power at all times and mitigate the power difference between the power production and the EVs' demand. The supervisory control system for the IIREVs is shown in Figure 2. The supervisory and control system consists of four layers: prediction, energy cost optimization, operation, and HMI. The design and implementation of the IIREVs' control are based on the interaction between the EV users and DC microgrid. Energy cost optimization and operation layers form the control block that should keep the power balanced. Figure 1: Power flow for the intelligent infrastructure for recharging EVs. Figure 2: Supervisory control system for the IIREVs. The prediction layer is based on weather forecasts. The energy cost optimization is based on the production prediction and consumption profile. They are calculated based on data from the prediction layer and the interaction with the HMI. From the prediction layer, messages from the smart grid about energy system limits, grid power limits, and dynamic energy pricing are communicated. From the interaction with the HMI, the EV users choose their charging mode (\(M_{v}\)), desired state of charge of their EV at departure (\(SOC_{EV\_des_{v}}\)) in real-time, and get the state of charge of their EV at arrival (\(SOC_{EV\_an_{tr}}\)). MILP optimization is used for the technical-economic dispatching of the microgrid sources and load. This supervisory control has the advantage of interacting with the EV users to perform the optimization; however, if the choices of the EV users are not feasible, they have to change them in order to perform the optimization [44]. The main challenge lies in dealing with the discrete events coming from the HMI.