## 1 Introduction  
The growing energy demand in the industrial, commercial, and residential sectors around the world has significantly increased energy consumption during the last decades. The total primary energy supply, or the energy available in nature before being converted or transformed, has increased from 6.1 billion tons of oil equivalent in 1973 to 13.7 billion tons in 2016 [1]. This increment in energy consumption has generated a negative impact on the concentration of greenhouse gases [2], indicating that many countries focus their resources on improving energy efficiency and increasing the production of clean energy. As a consequence of these actions, there has been a sustained increment in the usage of renewable energy sources (RES), where photovoltaic and wind energies the ones with the highest growth worldwide [3]. However, new problems have appeared when RESs are combined with traditional sources of energy [3]. For instance, unexpected fluctuations in the response of RES can affect the voltage and frequency of the network, constrained power electronics requirements, different control and dispatch methods, etc. Thus, the microgrid (MG) concept appeared to solve some of these drawbacks [4]. A microgrid is a low-voltage distribution network consisting of loads, distributed generation elements, and energy storage systems (ESS), which can be connected to the mains at a single point of common coupling (PCC). It has an associated energy management system (EMS) that allows the reliable, safe, and economic operation of the elements within the microgrid [5]. An EMS controls the power flux of different microgrid elements to achieve certain goals, such as minimize operating costs or maximize revenues [6; 7]. Several EMSs have been presented in the literature, each of them considering different types of MG architecture (i.e., AC, DC, and hybrid AC-DC microgrids) [8; 9; 10] and pursue different objectives under different conditions [11; 12]. For instance, [13] presents a stochastic risk-constrained framework for short-term optimal scheduling of autonomous microgrid to maximize the expected profit of the microgrids operator. In [14], an intelligent EMS using mixed-integer linear programming of grid-connected home-type microgrid is presented. This approach reduced energy costs of non-dispatchable distributed energy resources. The study in [15] presents the design of an EMS for a grid-connected microgrid equipped with photovoltaic (PV) generator to manage the load supply with the maximum exploitation of solar energy and improving the thermal comfort of the occupants. However, RES such as wind and PV feed power into the grid in a very variable way, directly related to the variability of the energy source itself (i.e., wind and irradiance). As these power sources are set to attain very high degrees of penetration level in the current grid, this power variability is of great concern for grid operators [16; 17; 18]. Therefore, various studies have been developed in recent years to minimize power fluctuations (i.e., ramp-rates) on the power exchanged with the grid [19; 20; 21]. For instance, the study in [19] analyzes the effect of smoothing the tie-line power fluctuations for grid-connected industrial microgrids using demand-side approach. In addition, the studies in [20] and [21] present a heuristic design of an EMS of residential electrical and electro-thermal grid-connected microgrids, respectively, including an ESS, RES, and a residential electrical load. Due to its heuristic nature, some studies have focused on the design of the EMS using expert knowledge rule-based systems since they have proven to be easy to implement and low computational run time cost than other sophisticated analytical solutions [22; 23]. Thus, a fuzzy logic control (FLC) EMS of two inputs, one output, and 25 rules is developed in [24] and experimentally validated in [25]. The same approach, but now using generation and demand forecasts is described and validated in [26].