**Gabriel Antonio Salvatti, Emerson Giovani Carati \*, Rafael Cardoso and Jean Patric da Costa and Carlos Marcelo de Oliveira Stein**

Universidade Tecnológica Federal do Paraná-UTFPR, Pato Branco-PR 85503-390, Brazil; gsalvatti94@gmail.com.br (G.A.S.); rcardoso@utfpr.edu.br (R.C.); jpcosta@utfpr.edu.br (J.P.d.C.); cmstein@utfpr.edu.br (C.M.d.O.S.)

**\*** Correspondence: emerson@utfpr.edu.br

Received: 5 December 2019; Accepted: 28 January 2020; Published: 5 March 2020

**Abstract:** Energy Storage Systems (ESS) and Distributed Generation (DG) are topics in a large number of recent research works. Moreover, given the increasing adoption of EVs, high capacity EV batteries can be used as ESS, as most vehicles remain idle for long periods during work or home parking. However, the high EV penetration introduces some issues related to the charging power requirements, thereby increasing the peak demand for microgrids where EV chargers are installed. In addition, photovoltaic distributed generation is becoming another issue to deal with in EV charging microgrids. Therefore, this new scenario requires an Energy Management System (EMS) able to deal with charging demand, as well as with generation intermittency. This paper presents an EMS strategy for Microgrids that contain an EV parking lot (EVM), Photovoltaic (PV) arrays, and dynamic loads connected to the grid considering a Point of Common Coupling (PCC). The EVM-EMS utilizes the projections of future PV generation and future demand to accomplish a dynamic programming technique that optimizes the EVs' charging (G2V) or discharging (V2G) profiles. This algorithm attends to user preferences while reducing the demand grid dependences and improves the microgrid efficiency.

**Keywords:** smart grid; optimization; energy management; electric vehicles; distributed generation
