## 1 Introduction  
### Energy Management of Microgrids  
When talking about low-power distributed generation with intermittent renewable energy sources (IRES), the concept of microgrids (MGs) comes along as a system that is intended to integrate this type of energy sources into the utility electrical networks. MGs can have different configurations and, according to the classification presented by [PERSON] et al. [1], the system proposed in our work is a DC, centralized, grid-connected, commercial MG.  
The energy management (EM) of MGs is still an open research topic, and the variety of approaches is extensive [1,2]. It relates to the strategy used to schedule the resources of the MG (also called distributed energy resources or DERs), which normally respond to specific objectives. At the utility scale, this action is called unit commitment (UC).  
The techniques that are commonly used to perform EM vary from case to case, and as mentioned in [1], the supervisory control architecture of an energy management system (EMS) can be divided into two types: centralized and decentralized. At the core of a centralized EMS (such as the one hereby proposed) we find the working objective(s), which is related to a given service that the system is required to deliver and/or optimize. Artificial intelligence (AI) techniques have been also recently proposed to perform energy management of microgrids or battery energy storage system (BESS) optimization. Unsupervised learning through Reinforcement Learning (RL) is a technique, where an agent (the microgrid controller) learns by trial-and-error based on a reward function. This is one of the state-of-the-art techniques that is under test to perform energy management. While very versatile, as it can adapt to different microgrid configurations and operating conditions, it faces some challenges regarding the learning time and the safety of the system during the learning process [3, 4, 5]. Supervised learning techniques using Artificial Neural Networks (ANNs) is one of the most commonly-used AI techniques that has been applied to perform energy management [2,6,7]. These techniques are also very versatile as they can also be applied to a variety of scenarios; however, the learning time and computational requirements might be big, as well as the training data set that sometimes is not easily available. Neural networks can be used as the \"brain\" of the agent in a reinforcement learning approach, which gets rid of the disadvantages of reinforcement learning mentioned above.  
A service provided by a MG could be defined as any action performed by the system that will improve to some extent the well-being of the users. An example of a typical service provided by a MG would be the cost of the energy, understood as the ability of the MG to offer energy at a competitive cost with respect to the utility grid. In order to achieve the working objective, two main EMS branches can be identified: Optimization-Based (OB-EMS) and Rule-Based (RB-EMS) [8]. The latter can assure attaining the working objective but cannot guarantee an optimal performance, whereas the former can achieve optimal or quasi-optimal performance for a given service. An OB-EMS normally requires a forecast (at least of production and consumption), to issue an optimal action to be followed in the future, which is also called scheduling. The optimization horizon can vary from seconds or minutes (intra-hour) to hours (inter-hour) or days (day-ahead). The optimization objectives can vary a lot, but, as pointed out by [9], some of the most common are: carbon emissions, capital and operational costs, energy storage cost, and load shedding costs, among others.