Comparing Charging Management Strategies for a Charging Station in a Parking Area in North Italy

: Via the analysis of a set of parking and journey information for vehicles traveling to the parking site at the University of Brescia (Italy), we evaluated the possibility of managing the electric recharging of these vehicles, which are hypothesized to be electric. The paper investigates charging optimization techniques that can limit the charge power peaks and distribute the energy demand throughout the day. A cost assessment for an auxiliary system consisting of a photovoltaic energy source (PV) and battery stationary storage (BSS) is also carried out. Optimal power management at the station with PV and BSS is introduced, and the performance of two feedback controllers based on the optimized results is compared with that of a real-time management algorithm in the presence of randomness in charging requests and insolation. The results show that the BSS degradation cost plays a primary role in determining the strategy to adopt to minimize the operating expenditure of a charging station.


Introduction
Electric mobility represents a sustainable solution in urban areas thanks to the absence of harmful emissions and noise. It is capable of making the city environment more livable thanks to the reduction in smog, which represents a critical element for health protection [1]. Its sustainability becomes even more evident when we consider the benefits of the lower greenhouse gas emissions that electric vehicles (EVs) have the potential to offer [2], which are linked to the carbon footprint of the electricity production used to charge EVs. Green electricity production represents the optimal solution, and the European Commission proposes the ambitious goal of climate neutrality by 2050 [3]. The greater application of renewable electricity sources (RES) and volatile charging requests will require a transformation of the electricity grid to compensate for the variability of the RES via the greater flexibility of the grid [4], the use of energy storage [5], and different kinds of energy management by the user [6].
The development of the charging infrastructure impacts the electricity grid, posing the problem of the ability to respond to power requests [7]. One way to limit the adverse effects is to integrate the charging infrastructure with storage systems and renewable energy sources [8] that are capable of containing power peaks and withdrawals from the grid via on-site energy production [9]. The presence of energy storage can be beneficial, especially for fast-charge infrastructures [10]. The factors that influence the size of the auxiliary systems and their possible implementation are various, including the available space, the additional cost, the entity of the reduction in the withdrawal from the grid, and the diversity of the storage. The implementation of smart charging strategies is also envisaged as a possible mitigation action [11]. In the present work, we evaluate the problem of dimensioning a charging station at a parking lot of the University of Brescia (Italy) and the optimization of the daily operation on an economic basis. The charging station is equipped with a photovoltaic system (PV) and a battery storage system (BSS). A PV is a good solution for the local production of energy for charging infrastructures in urban areas [12,13]. In addition to the benefits of providing clean energy for recharging electric cars, the coupling between a PV and a charging station equipped with a fixed battery can represent a business model [14].
Charging stations at the workplace are spreading rapidly and represent a valuable charging opportunity [13,15]. The extended parking period allows slow charges and the management of energy flows. The smart management of the charging demand can reduce the impact on the electricity grid, optimize the use of the renewable energy generated [16], and is of fundamental importance in cases in which the recharging infrastructure, possibly equipped with storage, is part of a microgrid [17]. Indeed, although the intermittent photovoltaic production and the uncertainty of the charging demand of electric vehicles can negatively affect the grid stability, the coordinated operation can overcome these problems, potentially reducing energy costs and improving the carbon footprint [18]. In fact, the uncertainty of demand and photovoltaic production are aspects of the charging infrastructure management on which research is focused. As an example, in [19], the authors proposed an offline particle swarm optimization for a prediction layer, and dynamic programming for the online reactive management layer, for fast charging stations. The problem of the dynamic variability of loads in the presence of PV and a BSS and for a distributed network of charging stations has been addressed in [20] using a multi-agent deep reinforcement learning method to avoid the need for a centralized optimal charging management.
Uncertainty about PV production is another element to consider when planning the use of resources. In [21], a charging and discharging power planning algorithm is applied to the case of large charging stations and solved by a chance-constrained programming method. The reported results show that a good level of confidence in insolation predictions allows a considerable reduction in the cost of charging electric vehicles compared to an uncoordinated method. In [22], a real-time energy management algorithm was developed for a charging system in a grid-connected car park equipped with PV based on a fuzzy controller. However, the system does not consider the presence of a BSS.
The present work focuses on the management of power flows in the presence of uncertainty in loads and insolation predictions. The main novelties of the study with respect to the state of the art are as follows: • The use of floating car data to determine parking attendance, as well as to estimate consumption.

•
The use of numerical weather prediction (NWP) models for insolation forecasts.

•
The quantification of the economic advantage deriving from optimized management for the forecasts of the previous day compared to real-time management according to the variations between forecasted and actual values for load and insolation.
A schematic representation of the research steps is illustrated in Figure 1. The paper is organized as follows: Section 2 analyses the data relating to the cars' journeys that end up at the Brescia University parking lot and the management of requests to the charging infrastructure. An evaluation of the cost-effectiveness of the investment is made for a PV source equipped with a BSS. In Section 3, the daily power flows to the station are studied with the aim of optimizing the use of the BSS based on the forecasts of user influx and insolation, according to an economy criterion. The impact of input variability is studied by comparing the performances of two automatic feedback controllers and a real-time power flow management system. Section 4 presents the conclusions. Appendix A presents an insight into the methodology for weather forecasts. The paper is organized as follows: Section 2 analyses the data relating to the cars' journeys that end up at the Brescia University parking lot and the management of requests to the charging infrastructure. An evaluation of the cost-effectiveness of the investment is made for a PV source equipped with a BSS. In Section 3, the daily power flows to the station are studied with the aim of optimizing the use of the BSS based on the forecasts of user influx and insolation, according to an economy criterion. The impact of input variability is studied by comparing the performances of two automatic feedback controllers and a real-time power flow management system. Section 4 presents the conclusions. Appendix A presents an insight into the methodology for weather forecasts.

Materials and Methods
The study is based on the analysis of floating car data (FCD) related to a large fleet of private vehicles that are equipped with devices for acquiring GPS positions with a sampling period of about 30 s. FCD were collected over an area covering the province of Brescia (Italy) in March and November 2019 and provided by VEM solution [23]. The top left corner of the FCD extraction rectangle has coordinates (46.63, 9.69) while the bottom right is (45. 13, 11.30), and correspond roughly to the area reported in Figure 2.The GPS records include several aspects including an anonymous vehicle identifier, longitude and latitude, a timestamp, the distance between two consecutive traces, the state of the engine, the instantaneous speed, and the quality level of the GPS signal.

Materials and Methods
The study is based on the analysis of floating car data (FCD) related to a large fleet of private vehicles that are equipped with devices for acquiring GPS positions with a sampling period of about 30 s. FCD were collected over an area covering the province of Brescia (Italy) in March and November 2019 and provided by VEM solution [23]. The top left corner of the FCD extraction rectangle has coordinates (46.63, 9.69) while the bottom right is (45. 13, 11.30), and correspond roughly to the area reported in Figure 2.The GPS records include several aspects including an anonymous vehicle identifier, longitude and latitude, a timestamp, the distance between two consecutive traces, the state of the engine, the instantaneous speed, and the quality level of the GPS signal. From the data set, the records of the journeys ending at the Brescia University car parking are selected. Charging systems for electric vehicles have been installed in the parking area as part of the MoSoRe@Unibs project [24]. The extracted dataset consists of 147 records. Journeys are concentrated on working days, while the number of events over the weekend is scarce (4 arrivals referring to 3 cars). Given the small number of events From the data set, the records of the journeys ending at the Brescia University car parking are selected. Charging systems for electric vehicles have been installed in the parking area as part of the MoSoRe@Unibs project [24]. The extracted dataset consists of 147 records. Journeys are concentrated on working days, while the number of events over the weekend is scarce (4 arrivals referring to 3 cars). Given the small number of events over the weekend, we focus the analysis on working days. The average number of arrivals registered on weekdays is three cars per day. Figure 3a shows the hourly distribution of the frequency of arrivals. These were gathered from the 7 a.m.-8 a.m. and 1 p.m. time slots, with about 82% of the events occurring within the 1 pm slot. No events are recorded in the 7 p.m.-7 a.m. time slot. Figure 3b shows the average duration of parking events based on the arrival time for working days. Figure 2. Province of Brescia and metropolitan area (in red) where GPS data have been collected by VEM solution [23].
From the data set, the records of the journeys ending at the Brescia University car parking are selected. Charging systems for electric vehicles have been installed in the parking area as part of the MoSoRe@Unibs project [24]. The extracted dataset consists of 147 records. Journeys are concentrated on working days, while the number of events over the weekend is scarce (4 arrivals referring to 3 cars). Given the small number of events over the weekend, we focus the analysis on working days. The average number of arrivals registered on weekdays is three cars per day. Figure 3a shows the hourly distribution of the frequency of arrivals. These were gathered from the 7 a.m.-8 a.m. and 1 p.m. time slots, with about 82% of the events occurring within the 1 pm slot. No events are recorded in the 7 p.m.-7 a.m. time slot. Figure 3b shows the average duration of parking events based on the arrival time for working days.  The average duration of the daily stops is 3.9 h. More than 57% of parking events last less than 4 h, with about 81% ending within 7 h. Less than 5% of layovers last 10 h or more. The average duration of the stops is rather limited for the afternoon arrivals (12 a.m.-5 p.m.), while the longest layovers are recorded for the evening hours (6 and 7 p.m.).
The hourly distribution of the average distances traveled, as reported in Figure 4a, shows that these are generally higher for arrivals occurring in the morning than in the afternoon and evening. The distribution of occurrences by journey distances, as reported in Figure 4b, shows that most journeys are cover short distances. Approximately 69% of the trips are within 20 km, and almost 90% are within 40 km.
To evaluate the charging demand of an electric car fleet, and the impact on the charging facility, we suppose that the recorded traces belong to purely electric vehicles (BV). To estimate the consumption of these BVs, we assume that the amount of charge required is proportional to the distance traveled to arrive at the workplace. The routes have been reconstructed from GPS data using a map-matching technique that allows an accurate evaluation of the distances traveled [25]. An estimation of the average consumption for electric cars [26] indicates that the average consumption is 15 kWh/100 km for batteries smaller than 50 kWh and 17 kWh/100 km for larger ones. For the records in the database, we assume that vehicles with average distances traveled equal to or less than 30 km are equipped with smaller batteries and that those with greater average distances are vehicles with batteries larger than 50 kWh. In this way, it is possible to roughly estimate the energy demand at the station as the product of the distance traveled and the average consumption for that battery size.
The average duration of the stops is rather limited for the afternoon arrivals (12 a p.m.), while the longest layovers are recorded for the evening hours (6 and 7 p.m.).
The hourly distribution of the average distances traveled, as reported in Figu shows that these are generally higher for arrivals occurring in the morning than afternoon and evening. The distribution of occurrences by journey distances, as rep in Figure 4b, shows that most journeys are cover short distances. Approximately 6 the trips are within 20 km, and almost 90% are within 40 km. To evaluate the charging demand of an electric car fleet, and the impact on the c ing facility, we suppose that the recorded traces belong to purely electric vehicles (B estimate the consumption of these BVs, we assume that the amount of charge requi proportional to the distance traveled to arrive at the workplace. The routes have be constructed from GPS data using a map-matching technique that allows an accurate uation of the distances traveled [25]. An estimation of the average consumption for e cars [26] indicates that the average consumption is 15 kWh/100 km for batteries sm than 50 kWh and 17 kWh/100 km for larger ones. For the records in the database, w sume that vehicles with average distances traveled equal to or less than 30 km equipped with smaller batteries and that those with greater average distances are ve with batteries larger than 50 kWh. In this way, it is possible to roughly estimate the e demand at the station as the product of the distance traveled and the average consum for that battery size.

Load Profiles and Demand Management
The station installed in the car park consists of two 22 kW charging points, wi possibility of using each of them as two 11 kW chargers. The charging station canno more than 2 points of 22 kW, 4 of 11 kW, or 1 of 22 kW and 2 of 11 kW occupied sim neously. We chose to assign 22 kW to large cars that are unable to fully charge the e used to arrive using the lowest power. Conversely, other users, including all smal were assigned 11 kW charging. Not all users may be able to fully recharge the energy on the journey. A hypothetical charge request to the station is generated from the an of the traffic data. The specific power profile depends on the demand management p In the following, we compare two possible approaches: (a) First-in first-out (FIFO), in which users are served on a first-come first-served There are no constraints on the charging power used in the station.

Load Profiles and Demand Management
The station installed in the car park consists of two 22 kW charging points, with the possibility of using each of them as two 11 kW chargers. The charging station cannot have more than 2 points of 22 kW, 4 of 11 kW, or 1 of 22 kW and 2 of 11 kW occupied simultaneously. We chose to assign 22 kW to large cars that are unable to fully charge the energy used to arrive using the lowest power. Conversely, other users, including all small cars, were assigned 11 kW charging. Not all users may be able to fully recharge the energy used on the journey. A hypothetical charge request to the station is generated from the analysis of the traffic data. The specific power profile depends on the demand management policy. In the following, we compare two possible approaches: (a) First-in first-out (FIFO), in which users are served on a first-come first-served basis.
There are no constraints on the charging power used in the station. (b) Linear optimization, in which the algorithm aims to keep the overall power used at the station below a certain threshold, applying a linear optimization method to modulate the individual charge's power.
Approach (a) does not require knowledge of the daily arrival schedule but only of the energy required and the parking duration. Conversely, approach (b) requires prior knowledge of arrivals and the stop lengths.
In the FIFO approach, the charge starts as the car arrives at the station if there is an available charger. Otherwise, the EV enters a queue. Charges take place with the power level chosen according to the criteria illustrated above. If the residual dwell time is insufficient to charge all the energy used in the journey, the battery will only be partially filled.
Approach (b) considers the following information on the charging events foreseen during the day: arrival time, duration, required energy, and maximum charge power. The optimization process aims at keeping the overall power absorbed by the station below a given P lim value, which in principle can vary over time: where N is the number of time intervals into which the analyzed period has been divided, M is the number of vehicles being charged, and x j (t i ) is the power profile for EV j at t i . The constraints are represented by the following system: Inequality (2) represents a constraint on the minimum and maximum power for the charging event. The former is set to zero since we are not considering the possibility of withdrawing energy from the EV's battery, while the latter corresponds to the maximum absorbable power. In (3), n is the number of time slots in which the parking time of the j-th EV is divided, ∆t is the length of the time intervals, and E j req represents the energy that the j-th EV would have charged during the idle time in absence of modulation. Compliance with this constraint could result in the impossibility of finding solutions to the problem. In this case, it is possible to proceed in two distinct ways:

1.
Ignore the violation of the limit power constraint when it is impossible to find a solution to the problem and charge the requested energy.

2.
Admit the possibility of not supplying all the energy needed to comply with the power limits at the station.
In the present study, we chose strategy 1. To solve the system, we used the command "solve" of MatLab [27], which utilizes "linprogr" [28] as solver for the linear optimization problem. From the distribution of arrivals, dwell time, and journey lengths, it is possible to create time series of charge requests at the station for an arbitrary number of users. We assumed that the dwell time and the distances traveled both obey Gaussian distributions, for which average values and variances come from the statistical analysis of the original data. We generated N scenarios, each characterized by a time series of arrivals and related energy consumption. Each scenario corresponds to a daily load profile generated by applying approach (b). We use these load profiles as input to determine the effectiveness of the investment for the PV and BSS systems.

Evaluation of the Cost-Effectiveness of Photovoltaic Sources and Storage
We evaluate the convenience of a charging station integrated with a PV source and a BSS, which represents the most suitable solution for domestic or commercial systems [29,30]. The input data for the evaluation are investment costs of the system components, insolation and average temperature of the installation site, average electricity price, and charge demand.
The net present value (NPV) can be used to determine the optimal size of the PV and the BSS. This method determines the value of future cash flows (positive and negative) generated by a project during its useful life. An investment is profitable when the NPV is positive. The NPV is valued over a time horizon of N years and is a function of the cash flows relating to the investment made, including the interest rate (k). Therefore, it can be expressed as follows: where: • N is the time horizon of the investment in years; • F t is the cash flow in the t-th year, calculated as the difference between the cash flows with and without the PV + BSS system; • I is the initial investment calculated as the sum of PV and BSS capital expenditure (CAPEX); • k is the interest rate fixed at 3%.
From (4), it is possible to establish which size of a system provides the best investment. Finite values for the efficiency of power converters were used in the analysis. The time horizon of the investment is 15 years, which represents a compromise between the expected duration of a PV system, over 20 years [31], and that of a recharging station, approximately 10-12 years [32,33]. In addition, the replacement of BSS after 7.5 years is considered.
For the evaluation of the investment, we have considered that, according to the European Energy Innovation [34], the cost of a residential photovoltaic system without taxes is about EUR 1.2/Wp. Given an expected reduction in the costs by 2025 [35], the price of photovoltaics in 2022 for residential buildings can be estimated around EUR 1.2/Wp turnkey. We have not included any analysis of the influence of COVID-19 on the price of the PV system. The investment cost of the BSS is estimated at EUR 0.35/Wh for the lithium battery [36,37].
Using the daily curves of power demand at the station, considering the annual average insolation over Brescia and the hourly energy price for the year 2022, we obtain that the optimal size for the PV is about 2.7 kWp, with a storage of about 1.2 kWh. The PV size is rather small due to the low number of daily users (3 cars per day on average), which does not allow a convenient exploitation of the charging facility. Therefore, we analyzed a situation with a doubled number of daily arrivals, using the procedure for determining synthetic charging profiles illustrated in the previous section. Using these curves as input for the determination of the NPV, we obtain that the optimal size is 11 kWp for the PV and 7 kW for the BSS. We reiterate that these values were obtained assuming that the price of electricity and the number of average daily users do not vary throughout the investment period.

Optimization of Charging Infrastructure Daily Operation
With a priori knowledge of photovoltaic production, power demand by users, and the hourly price of electricity, it is possible to optimize the use of the BSS in order to minimize the daily cost of the charging infrastructure [38].
In optimizing the daily running costs, the operating costs of the photovoltaic system have not been considered since these are much lower than those of the battery. The degradation of the battery is quantified with reference to a complete cycle, i.e., a cycle with a depth of discharge (DOD) equal to 100% of the capacity, which is given by the total cost of the battery divided by the life span expressed in the number of complete cycles as obtainable from the battery datasheet. Assuming a duration of about 5000 cycles and identifying the operating cost with the average cost of the cells, EUR 0.15/Wh [29], the expenditure for a complete cycle is about EUR 0.03/kWh/cycle. Since the battery usage is not always at DOD = 100%, the cycle cost is "weighted" inversely to its actual DOD.
With this estimate for the battery degradation cost, we can optimize the expected power flows at the charging station based on the forecast for demand and sunshine from the day before. The optimization aims to maximize the exploitation of the photovoltaic production and to optimize the use of the battery, minimizing the following objective function: where:

Results
We apply the optimization procedures described in the previous section to the Brescia use case. In particular, we consider a charging infrastructure located at the University parking area, which is shown in Figure 5.
where: (ℎ) is the price paid for the energy fed into the grid per hour ℎ [EUR / (ℎ) is the excess power compared to the demand produced by the and sold to the grid per hour [W]. We used MatLab linear optimization program to solve the problem [28].

Results
We apply the optimization procedures described in the previous section scia use case. In particular, we consider a charging infrastructure located at the parking area, which is shown in Figure 5.  The charging infrastructure is equipped with an 11 kWp PV and a 7 kWh BSS system. The inputs of the problem are the load curve, generated with the approach described in Section 2.1; the insolation forecast for the incoming day generated by the Weather Research and Forecasting model (WRF); and the day-ahead energy price. The WRF model's ability to represent the daily insolation consisting of Global Horizontal Irradiance (GHI) is described in detail in Appendix A. PV panels convert the solar insolation to electric power.
For the charge management, we compare the results for the FIFO and linear optimization approaches, as presented in Section 2.1. For the linear optimization approach, we chose to satisfy the charge requests, even if this leads to a violation of the power limit constraint. Figure 6 shows the results of applying the two approaches for the months analyzed. In particular, the limit value set for the station in approach (b) is 11 kW. With the FIFO approach, the power reaches 22 kW in some cases. If approach (b) is applied, the power always remains below the 11 kW limit, except in a single case in November. The reduction in the above-threshold power used with or without optimization is 89% for the month of November and 100% for March.
From the distribution of arrivals, dwell time, and journey lengths, it is possible to create time series of charge requests at the station for an arbitrary number of users. We assumed that the dwell time and the distances traveled both obey Gaussian distributions, for which average values and variances come from the statistical analysis of the original data. We generated N scenarios, each characterized by a time series of arrivals and related energy consumption. Each scenario corresponds to a daily load profile generated by applying approach (b). To each scenario we apply the optimization of the charging infrastructure daily operation reported in Section 2.3 to minimize operational costs. constraint. Figure 6 shows the results of applying the two approaches for the months a alyzed. In particular, the limit value set for the station in approach (b) is 11 kW. With t FIFO approach, the power reaches 22 kW in some cases. If approach (b) is applied, t power always remains below the 11 kW limit, except in a single case in November. T reduction in the above-threshold power used with or without optimization is 89% for t month of November and 100% for March. From the distribution of arrivals, dwell time, and journey lengths, it is possible create time series of charge requests at the station for an arbitrary number of users. W assumed that the dwell time and the distances traveled both obey Gaussian distribution for which average values and variances come from the statistical analysis of the origin data. We generated N scenarios, each characterized by a time series of arrivals and relate energy consumption. Each scenario corresponds to a daily load profile generated by a plying approach (b). To each scenario we apply the optimization of the charging infr structure daily operation reported in Section 2.3 to minimize operational costs. Figure 7 shows an example of power flow optimization, considering a forecast of i solation for one day of March. The red bars represent the purchased contribution from t grid, the yellow bars represent the portion of power produced by the PV used to meet t demand, cyan represents the power discharged from the batteries, and magenta repr sents the charged power, while green represents the portion of PV energy sold to the ne work. The black dashed line is the load, and the blue dotted line represents the insolatio The bottom panel shows the battery state of charge (SOC). In the simulation, the efficien of the grid converter, the load inverter, and the photovoltaic panels was set equal to 0 while for the battery, it was assumed to be 0.85 in charge and discharge.  Figure 7 shows an example of power flow optimization, considering a forecast of insolation for one day of March. The red bars represent the purchased contribution from the grid, the yellow bars represent the portion of power produced by the PV used to meet the demand, cyan represents the power discharged from the batteries, and magenta represents the charged power, while green represents the portion of PV energy sold to the network. The black dashed line is the load, and the blue dotted line represents the insolation. The bottom panel shows the battery state of charge (SOC). In the simulation, the efficiency of the grid converter, the load inverter, and the photovoltaic panels was set equal to 0.9, while for the battery, it was assumed to be 0.85 in charge and discharge.
As can be seen, the photovoltaic system can produce more power than is required by demand for some hours of the day. When this happens, the battery participates in the power exchange by storing part of the energy. Any surplus is available for sale to the grid. The ratio between stored and sold energy depends on the battery degradation costs and the energy purchase price from the grid. We have assumed that the purchase price is proportional by a factor of 0.25 to the sale price, so we expect a greater propensity to sell than to store the renewable energy surplus when the grid energy price is high. As can be seen, the photovoltaic system can produce more power than is required demand for some hours of the day. When this happens, the battery participates in power exchange by storing part of the energy. Any surplus is available for sale to the g The ratio between stored and sold energy depends on the battery degradation costs the energy purchase price from the grid. We have assumed that the purchase price is p portional by a factor of 0.25 to the sale price, so we expect a greater propensity to sell t to store the renewable energy surplus when the grid energy price is high.

Fuzzy Controller for Optimal SOC Management
The feedback controller (hereinafter "controller") aims to ensure that the system lows a given behavior, opposing appropriate corrective actions to the deviations du system perturbations. The fuzzy approach is widely used in this type of problem. Fu logic is a multiple values logic capable of dealing with ambiguous, imprecise, and exactly defined contexts. These characteristics make it applicable to a wide range of pr lems. It was introduced in its basic principles in 1965 by Lofti A. Zadeh [39] and formali and systematized in a definitive way in 1973 [40]. This logic is particularly useful w the problem has multi-valued properties in which there are no specific threshold va (for example, as in the case of describing a person, in which it is necessary to estab whether he is 'tall' or 'short', 'fat' or 'thin', and so on). The multi-valued logic is expres by means of a "membership function" (MF), which represents the degree to which a iable belongs to a property of interest. The MFs are associated with a suitably defined of implication rules (if-then), creating a functional correspondence between a given in set (also vectorial) ∈ and an output set (in the general scalar case) . This sys represents a fuzzy logic system (FLS).
We apply the controller to the battery SOC. We consider the optimal profile for SOC, obtained based on forecasts of power demand, sunshine, and electricity price for next day, as illustrated in the previous section. We, therefore, perturb demand and production. The controller tries to maintain or restore the SOC to the expected level,

Fuzzy Controller for Optimal SOC Management
The feedback controller (hereinafter "controller") aims to ensure that the system follows a given behavior, opposing appropriate corrective actions to the deviations due to system perturbations. The fuzzy approach is widely used in this type of problem. Fuzzy logic is a multiple values logic capable of dealing with ambiguous, imprecise, and not exactly defined contexts. These characteristics make it applicable to a wide range of problems. It was introduced in its basic principles in 1965 by Lofti A. Zadeh [39] and formalized and systematized in a definitive way in 1973 [40]. This logic is particularly useful when the problem has multi-valued properties in which there are no specific threshold values (for example, as in the case of describing a person, in which it is necessary to establish whether he is 'tall' or 'short', 'fat' or 'thin', and so on). The multi-valued logic is expressed by means of a "membership function" (MF), which represents the degree to which a variable belongs to a property of interest. The MFs are associated with a suitably defined set of implication rules (if-then), creating a functional correspondence between a given input set (also vectorial) x ∈ R n and an output set (in the general scalar case) y. This system represents a fuzzy logic system (FLS).
We apply the controller to the battery SOC. We consider the optimal profile for the SOC, obtained based on forecasts of power demand, sunshine, and electricity price for the next day, as illustrated in the previous section. We, therefore, perturb demand and PV production. The controller tries to maintain or restore the SOC to the expected level, implementing the appropriate operational policies that account for the variation in demand, the price of electricity, and the deviation from the expected SOC value. The approach has been implemented in MatLab ® , using the Fuzzy Logic Toolbox [41]. Figures 8 and 9 show the three-dimensional curves representing the surface of the rules followed by the model. Figure 8 shows the behavior that considers the variation of the energy demand 'DLOAD' (evaluated as the difference between the external demand and the availability from the photovoltaic, normalized between −1 and 1 to the maximum power of the battery), according to the deviation of the actual SOC from the expected one 'DSOC' (normalized between −1 and 1). Output values ('Score') close to −1 correspond to a greater propensity to recharge the battery; conversely, values close to +1 indicate its propensity to discharge. If the output is zero, no action on the battery is taken, and the corrective actions impact the other components of the system: grid and PV. Figure 9 shows the surface of the rules for the model that regulates charges from the grid. In addition to the deviation of the SOC, 'DSOC', defined as in the previous case, the other input is the value of the price of electricity, 'PUN', normalized between 0 (minimum) and 1 (maximum). The output 'Score' is defined as in the previous case. Figure 10 shows an application of the controller for the SOC management, along with the forecasted trend of insolation and demand used in the previous paragraph (scenario 1) and those perturbed (scenario 2). For comparison, we also report the SOC obtained using an on-off logic controller (crisp). The 'crisp' controller is a simple algorithm that obeys the following instructions:

•
The battery can be discharged below the optimal SOC to compensate for the insufficiency of renewable energy production. • If the energy produced by the PV is greater than the request and the actual SOC is lower than the optimal one, recharge using excess energy until the optimal SOC value is reached.

•
If the actual SOC is lower than the optimal one and there is no PV energy available, recharge until the optimal SOC value is reached if the grid energy price is lower than or equal to the average daily price.
Future Transp. 2023, 3, FOR PEER REVIEW the energy demand 'DLOAD' (evaluated as the difference between the external dem and the availability from the photovoltaic, normalized between −1 and 1 to the maxim power of the battery), according to the deviation of the actual SOC from the expected 'DSOC' (normalized between −1 and 1). Output values ('Score') close to −1 correspon a greater propensity to recharge the battery; conversely, values close to +1 indicate its pensity to discharge. If the output is zero, no action on the battery is taken, and the rective actions impact the other components of the system: grid and PV.     Figure 9 shows the surface of the rules for the model that regulates charges from grid. In addition to the deviation of the SOC, 'DSOC', defined as in the previous case other input is the value of the price of electricity, 'PUN', normalized between 0 (minim and 1 (maximum). The output 'Score' is defined as in the previous case.   Figure 10 shows an application of the controller for the SOC management, along the forecasted trend of insolation and demand used in the previous paragraph (sce 1) and those perturbed (scenario 2). For comparison, we also report the SOC obtaine ing an on-off logic controller (crisp). The 'crisp' controller is a simple algorithm that o the following instructions: • The battery can be discharged below the optimal SOC to compensate for the in ciency of renewable energy production. • If the energy produced by the PV is greater than the request and the actual SO lower than the optimal one, recharge using excess energy until the optimal SOC v is reached.

•
If the actual SOC is lower than the optimal one and there is no PV energy avai recharge until the optimal SOC value is reached if the grid energy price is lower or equal to the average daily price.
The SOC can vary in the range of [10-90%]. The result shows that both controllers can implement corrective actions to follow expected SOC trend, with a higher fidelity for the crisp approach.
To test which is the most cost-effective strategy to adopt, we ran a series of 100 The SOC can vary in the range of [10-90%]. The result shows that both controllers can implement corrective actions to follow the expected SOC trend, with a higher fidelity for the crisp approach.
To test which is the most cost-effective strategy to adopt, we ran a series of 100 simulations on different scenarios for charge demand and PV production. The forecasted load and insolation were perturbed adding a random variation distributed according to a Gaussian distribution with zero mean value. The standard deviation (SD) quantifies the variation amplitude of the variable with respect to its mean value. For the insolation distribution, we set an upper limit equal to the maximum theoretical insolation of the month. Any negative value of the perturbed load is set to zero.
For each simulation run, we calculated the daily costs for the grid energy and battery degradation. We averaged the 100 values obtained and compared the results with the daily expenditure obtained by the optimization algorithm for the expected load and insolation. The difference between optimal and perturbed costs is always positive for two main reasons:

•
The perturbed charging demand is, on average, greater than the expected demand, given that the negative random values are set to zero, which makes the noise distribution skewed toward positive values.

•
The SOC optimized for the forecasted quantities no longer coincides with the optimal trend for the actual situation. Trying to restore its optimal values can be counterproductive.
To quantify the differences of the perturbed and forecasted power profiles, in Table 1, we report the variance percentage between the forecasted and the perturbed energy request, averaged over 10,000 different charging profiles, as a function of the Gaussian deviation of the perturbation. As a comparison, we also report the average percentage difference in PV energy production, which is very close to zero, since, in this case, the corrections to the synthetic profiles only concern violations of the maximum production power and have less of an impact as they are less frequent. As a measure of the skewness of the difference between perturbed and forecasted distributions, we calculated Pearson's skewness coefficients s, defined as: where − x is the mean value of the distribution, ∼ x is the median, and σ is the standard deviation. We averaged the skewness coefficients over all the 10,000 runs, and the results are reported in Table 2. As can be seen, the difference between the perturbed and forecasted loads is rightskewed, indicating that the perturbed load is on average greater than the forecasted one. On the other hand, the skewness of the PV production variations is very close to zero.
In all cases, the fuzzy controller has proven to be the best strategy to keep costs down in the presence of perturbations. The average variance percentage of the daily expenditure, with respect to the non-perturbed case, for the fuzzy controller is reported in Table 3 for some SD values. For comparison, the average operating costs obtained with the crisp controller are always 75% higher than the expected costs in the analyzed scenarios of perturbed inputs. This can be attributed to the fact that the crisp controller is more efficient in restoring the SOC optimal trend calculated on the forecasts, which, however, does not minimize the costs in the presence of perturbations. These results stem from the different management policies for recharging from the grid, which for the crisp controller takes place considering only the presence of a deviation from the ideal SOC and the cost of electricity lower than the average daily price, without considering the extent of these deviations, as occurs in the fuzzy approach.
As noted above, trying to maintain the SOC at an optimal level based on forecasts may not always be the optimal solution in the presence of perturbations. To verify this hypothesis, we compared the result obtained by applying the controllers with that of a 'real-time' strategy, which does not contemplate prior knowledge of either the insolation or the arrivals. The inputs of the real-time management program are the daily irradiation, the demand, and the initial battery SOC. The outputs provide the trend of the SOC over time, the energy requested from the grid, and the unused solar energy. The power flow control system maximizes the exploitation of renewable energy, recharging the battery whenever the PV energy is not used directly for the charging demand, until reaching the maximum SOC (90%). The minimum SOC value is 10%.
When the battery needs to be recharged from the grid, the management is entrusted to a fuzzy model, for which the graphical rules representation is reported in Figure 11. The "SOC" input represents the instantaneous state of charge of the battery (between 0 and 1). The "Grid" input is linked to the price of electricity, appropriately scaled between 0 and 1 according to the following rule: where PUN(t) is the grid energy price at time t, and PUNmin and PUNmax are the minimum and maximum value of the energy price for the day, respectively, as determined on the basis of the reference price of the day-ahead market. Future Transp. 2023, 3, FOR PEER REVIEW 15 Figure 11. Fuzzy model representation of the 13 rules used to charge from the grid. From left to right, membership functions are reported for the SOC input, the Grid input, and the Score output. Bottom right panel: output score.
The "score" represents the output. In the present case, the higher the score (close to or equal to 1), the less the battery draws from the network to be recharged. In Figure 11, each row represents one of the 13 rules. The two left columns report the input membership functions; the panels in the right column report the corresponding output membership function. The bottom panel on the right represents the output value.
The fuzzy model rules that regulate the intervention of the battery in the presence of an energy request are shown in Figure 12. The 'SOC' input is defined as in the previous model. The 'LOAD' is defined as follows: where represents the amount of charging energy that could not be satisfied with PV production. The model tends to keep the SOC around 50%. The "score" represents the output. In the present case, the higher the score (close to or equal to 1), the less the battery draws from the network to be recharged. In Figure 11, each row represents one of the 13 rules. The two left columns report the input membership functions; the panels in the right column report the corresponding output membership function. The bottom panel on the right represents the output value.
The fuzzy model rules that regulate the intervention of the battery in the presence of an energy request are shown in Figure 12. The 'SOC' input is defined as in the previous model. The 'LOAD' is defined as follows: where P L represents the amount of charging energy that could not be satisfied with PV production. The model tends to keep the SOC around 50%. The output 'Source' represents the attitude of the battery to discharge. Figure 12 depicts the rules. The two left columns represent the input membership functions; the panels in the right column represent the corresponding output membership function. The bottom panel on the right represents the output value. The output 'Source' represents the attitude of the battery to discharge. Figure 12 depicts the rules. The two left columns represent the input membership functions; the panels in the right column represent the corresponding output membership function. The bottom panel on the right represents the output value.
To evaluate the performance of the 'real-time' approach, we report in Table 4 the average cost variation in percentages, with respect to the unperturbed case, for the fuzzy approach without forecasts. By comparing the results with Table 3, the management of flows via the optimization program and fuzzy controller is the one that minimizes the daily management costs, as long as the forecast variations are contained below a certain threshold. Management with an algorithm that does not consider the forecasts becomes more convenient as the extent of the disturbances increases.
To verify the influence of battery degradation, we repeated the analysis by doubling the degradation costs of the BSS, i.e., EUR 0.3/kWh. The results reported in Table 5 show that when battery degradation costs increase, the use of a controller becomes less convenient than real-time management. To evaluate the performance of the 'real-time' approach, we report in Table 4 the average cost variation in percentages, with respect to the unperturbed case, for the fuzzy approach without forecasts. By comparing the results with Table 3, the management of flows via the optimization program and fuzzy controller is the one that minimizes the daily management costs, as long as the forecast variations are contained below a certain threshold. Management with an algorithm that does not consider the forecasts becomes more convenient as the extent of the disturbances increases.
To verify the influence of battery degradation, we repeated the analysis by doubling the degradation costs of the BSS, i.e., EUR 0.3/kWh. The results reported in Table 5 show that when battery degradation costs increase, the use of a controller becomes less convenient than real-time management. Furthermore, it is interesting to note that the increase in the daily operating cost compared to the optimal case for the fuzzy controller shows a positive correlation with the increasing variability both for the load and PV production (Tables 6 and 7). For fuzzy real-time management, the correlation between price increase and PV production variability is instead negative, as reported in Table 5, and weaker than the positive correlation with load variation, which is displayed in Table 6. The results indicate that the performance of the real-time fuzzy model without forecasts depends crucially on the temporal distribution of demand, more so than on the percentage of energy produced from the renewable source.

Discussion
In the present work, we have considered a charging station at the Brescia (Italy) University parking lot, and we have verified the economic convenience of coupling with a renewable energy source and a storage system. The charge demand estimation was based on the actual journeys made to reach the car park, detected by a GPS, and recorded in a database. An optimization program manages the charge demand at the station, modulating the power at the single charging points in order to contain the power demand peaks at the station.
Subsequently, the daily power flows at the station equipped with PV and BSS were analyzed. Based on forecasts for demand and solar irradiation, the use of the BSS was optimized based on an economic criterion and maximization of the direct exploitation of the renewable energy produced. By comparing the performance of two feedback controllers, one based on fuzzy logic and the other on crisp logic, we measured the influence that the stochastic variations with respect to the forecasts have on the daily cost of the station. Perturbations always led to an increase in the operational costs. While the crisp controller proved to be more effective in managing SOC correction actions after a perturbation to restore the optimized value, the fuzzy controller gave the best results in terms of cost restraint.
Furthermore, the performances of the controllers have been compared with those of a fuzzy 'real-time' management approach, which does not rely on the use of forecasts on demand and PV production. In this case, the cost related to battery degradation plays a decisive role. This comparison is necessary because, in real situations, it is very difficult to have exact forecasts on charging demand and photovoltaic production. In particular, the temporal distribution of the load is subject to multiple factors, which make it difficult to predict its functional shape in advance [42]. In the authors' opinion, this difficulty will presumably be overcome with the massive diffusion among users of charging station booking apps. The results of the comparison show that as the cost increases it becomes more economical to use a 'real-time' approach rather than using a controller to restore the optimal SOC obtained based on forecasts. It is interesting to note that the variation of the operational expenditure shows a negative correlation with the amplitude of the PV production fluctuations for this approach, while it is always positive for the controller because each SOC variation corresponds to a corrective action with a non-zero cost.
The profitability of investing in renewable sources and static storage for charging stations also depends on the expansion of the electric vehicle market. We have not considered it in our NVP analysis as the high degree of uncertainty on the market penetration of the electric carrier requires a cautious analysis to be used in the cost-benefit evaluation [43]. The inclusion of the benefit deriving from the reduction in externalities of conventional transport can influence the results and should be considered in the decision making processes of policy makers [44]. This consideration goes beyond the scope of this work and deserves future study.
These results are useful for defining the most convenient charging station management depending on technological design choices. The analysis of the actual charging data and power flows at the station will make it possible to verify the degree of correctness of the study outcomes and will be the subject of subsequent studies.

Conflicts of Interest:
The authors declare no conflict of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript; or in the decision to publish the results.

Appendix A. The Weather Research and Forecasting Model (WRF)
The spacious, continuous, and long time series of ground in situ observations are difficult to find. A Numerical Weather Prediction (NWP) model is one of the techniques to obtain continuous and spacious atmospheric data. NWP models use numerical computational techniques to simulate the spatial and temporal differential equations of physical and dynamical interaction between the atmosphere and the ocean onto a desired geographical configuration [45].
These numerical tools, in a good manner, become indispensable for estimating renewable energy. Meteorological forecast models, nowadays, can predict in a good manner the renewable resources for wind farms [46,47], solar power plants (Photovoltaic [48], and Concentrated Solar Power systems [49]). Those models became the governing tool for renewable energy forecasts and the management of the energy systems [50].
In this paper, we used the simulations of the Weather Research and Forecasting model (WRF) [51]. This is a state-of-the-art regional NWP system designed for both atmospheric research and operational forecasting applications. The model is used in a wide range of meteorological applications with different time and horizontal scales from tens of meters to thousands of kilometers. The computational model domain is the entire region of Italy, where grid size is set to 10 × 10 km (151 × 151 grid points) with the center of the computational domain at latitude 41.25 • and longitude 13.5 • . The vertical resolution of models counts 30 sigma atmospheric levels and 4 soil levels. For the input data in the model, we used the NCEP/NCAR Global Forecast System (GFS) [52] (1 • × 1 • grid resolution) with four-time daily input. Forecast simulations are run each day up to 48 h starting from 0:00 UTC, in which first hours are considered as the model spin-up. The run outputs are then compared with ground observation data.

The Skill of WRF Model against the Observation Data
In this section are presented the skill of the WRF model to forecast the Global Horizontal Irradiance (GHI) against observed values at Brescia. The comparative period is from 1 January to 31 March 2022. This period is chosen in consideration of available observation data of Global Horizontal Irradiance being available thanks to the University of Brescia, Department of Information Engineering, eLUX Living Lab.
In Figure A1 are presented the ability of the WRF model to forecast GHI against the observed values for a consecutive 24 h at Brescia. The top panel shows the two days with no cloud conditions (no presence of clouds for the entire sunlight duration), while the bottom panel shows two days with cloudy conditions. The daily cloudy index is defined as the relationship between the sum of the hourly measured GHI against the sum of the hourly extra-atmospheric Global Irradiance, which has values from 0 to 1. Clear sky conditions are considered when the values are higher than 0.65 [53]. It is easy to observe that the model forecasts agree with the GHI values for the clear sky conditions, while for the cloudy conditions, the daily pattern is replicated but the statistics are not representative. The next figures present the scatter plots. Figure A2 shows the scatter plot of the 24 h forecasting of GHI compared to the observed values for the entire period. The model has a root mean square error (RMSE) of 59.1 W/m 2 for the entire period, considering all sky conditions. The next figures present the scatter plots. Figure A2 shows the scatter plot of the 24 h forecasting of GHI compared to the observed values for the entire period. The model has a root mean square error (RMSE) of 59.1 W/m 2 for the entire period, considering all sky conditions. In the next step, an additional analysis is presented in which sky conditions are divided in two stages: clear sky and cloudy conditions. Figure A3 presents the scatter plot for selected days with clear sky conditions with an RMSE of only 29.3 W/m 2 , while on the right are presented the days with cloudy conditions for which the RMSE has an extremely high value of 81.3 W/m 2 . In the next step, an additional analysis is presented in which sky conditions are divided in two stages: clear sky and cloudy conditions. Figure A3 presents the scatter plot for selected days with clear sky conditions with an RMSE of only 29.3 W/m 2 , while on the right are presented the days with cloudy conditions for which the RMSE has an extremely high value of 81.3 W/m 2 . In the next step, an additional analysis is presented in which sky conditions are divided in two stages: clear sky and cloudy conditions. Figure A3 presents the scatter plot for selected days with clear sky conditions with an RMSE of only 29.3 W/m 2 , while on the right are presented the days with cloudy conditions for which the RMSE has an extremely high value of 81.3 W/m 2 .