# Differential Evolution and Fuzzy-Logic-Based Predictive Algorithm for V2G Charging Stations
## 1 Introduction
In [16], a hybrid electric vehicle was considered, and an evolutionary algorithm was proposed capable of making short-term predictions for charging and discharging, resulting in a greater autonomy and fuel economy. Ref. [17] presented a two-step algorithm, working both with the grid information and with information from the client itself. Although the results were satisfactory, the authors made it clear that the interaction of the grid with the batteries needed further improvement so that the charging and discharging could be better planned. In [18], a new approach was taken, which prepared the system so that it could offer to the users of the charging station different charging speeds, presenting them the possibility of utilizing the V2G technology, developed for obtaining data and testing its robustness. After the energy flow in the system occurred, the overall system was priced based on the resulting energy exchanged between the vehicle and the grid. Finally, the papers [19; 20; 21] had a similar focus, analyzing the energy flow in the distribution grid, with multiple charging strategies adopted, which were developed with smart algorithms as their bases. The proposals sought to mitigate grid losses as well as to verify whether the grid could deal with multiple charging stations at the same time at multiple points. These works showed that there were many ways to approach the problems imposed by the V2G and energy management concepts, noticing its expansion around the world. It is possible to work with basic or more complex systems, with multiple vehicles connecting to the grid. Observing the before-mentioned works and the necessity of improvements in the energy management systems of electrical charging stations, this work proposes a predictive control algorithm based on the differential evolution method, utilizing generation and cost data as inputs for a fuzzy controller. The algorithm coordinated with a fuzzy logic aims to optimize the charging of the batteries of an electric vehicle connected to a charging station with its local generation and connected to the grid. The V2G concept is exploited, allowing the electric vehicle to charge itself and to feed electricity back into the grid to supply demands. The process optimization was conceived to reduce the cost of charging, prioritizing periods when the energy produced is sufficient to carry out the charging or when the energy cost purchased from the grid is as low as possible. The optimization also seeks to sell the stored energy to the electricity grid at a time when energy demand is high, optimizing the financial performance and ensuring a state of charge greater than 50%. The main novelty of this work lies in the utilization of two inputs to run the algorithm seeking a compromise between the SoC of the vehicle battery and the profit that can be obtained by selling energy from the battery to the grid. This approach guarantees a greater flexibility of the cost function, automatically adapting it to the scenario at hand and, finally, achieving a better operation in a range of different situations. The remaining of the manuscript is organized as follows: in Section 2, the optimization algorithm is described whereas in Section 3, the results under different profiles of photovoltaic generation and energy costs are presented and subsequently discussed in Section 4. Section 5 concludes the manuscript by summarizing the main features of the proposed algorithm.