**1. Introduction**

The integration of renewable energy sources (RES) into electrical power systems has been an active field of study for more than ten years, which is usually oriented to reduce the environmental impact of energy generation and to increase the coverage of electrical networks [1,2]. Microgrids (MGs) have been used to integrate multiple RES, fossil fuels, energy storage systems (ESSs), electrical loads, and the electrical grid [3]; this by using AC or DC buses to exchange electrical power in two modes: stand-alone or connected to the grid [4]. As presented in [5,6], the integration of ESS into a microgrid mitigates the energy production intermittency of renewable sources caused by the night and weather conditions (cloudy operation, solar irradiance, temperature, wind speed, etc.); moreover, the ESS helps to control the power flows inside the MG to achieve the global power balance and maximize the benefits for the operator or proprietary. In addition, to manage the intermittency of renewable energy resources and load demand characteristics, an EMS is an essential part of the MGs for optimal use of the distributed energy resources in reliable and coordinated ways [5,6].

DC microgrids have advantages over AC MGs in terms of efficiency and connection simplicity; for example, as reported in [7], the DC MG avoids performing a frequency control for the main bus; which reduces the installation complexity. Moreover, DC MGs are formed by distributed generators (DGs), ESS, and electrical loads [8–11]. In particular, photovoltaic systems (PVSs) are commonly included in DC MGs as DGs due to the wide availability of solar energy [12]; and the integration of a PVS, an ESS, and loads is known as a stand-alone photovoltaic system (SPVS) [13]. Those SPVSs are used in multiple applications for attending non-critical loads, such as plug-in chargers for electrical vehicles, lighting systems, television sets, data centers (facility lighting or non-critical workstations used for log files inspection), air-conditioning, home applications, among others [14–17]. Many of the SPVS applications described above are present in educational buildings, e.g., schools, universities, among others [18]. In this sense, a correct energy managemen<sup>t</sup> of the SPVS allows to reduce the operational cost and improve the quality of the electrical service of the educational building; thus improving the life conditions of the users in those spaces [19]. For example, in [20] a EMS for stand-alone DC microgrid based on a photovoltaic source, electrochemical storage, a supercapacitor, and a diesel generator was proposed. The proposed strategy allows to control the system to balance the power injection accounting the slow start-up characteristic of the diesel generator by means of a supercapacitor dynamics. A similar solution was published in [21], where an EMS is proposed for a stand-alone hybrid AC/DC microgrid formed by a PV system, a fuel cell as a secondary power source, and a battery and a supercapacitor as hybrid ESS. The proposed EMS allows to manage the system under different modes and SOC limits of the hybrid energy storage when all devices are connected to the DC bus. For the reasons discussed above, this paper is aimed to design an energy managemen<sup>t</sup> strategy for PV based microgrids that consider the environmental conditions and power demand of the Universidad Nacional de Colombia, located at Medellín-Colombia.

SPVS devices must be integrated using a DC-bus interfaced with DC/DC converters, which enable the operation of each device in the corresponding safe and optimal operating condition [22]. For example, the DC/DC converter associated with the PVS is regulated using algorithms and/or control strategies aimed at tracking the maximum power point (MPP); hence, such algorithms are known as MPP tracking (MPPT) solutions. The ESS integration with the DC-bus is performed using bidirectional converters and control strategies [23,24] to regulate the DC-bus voltage and to guarantee the global power balance in the standalone MG when excess or shortage power exists. However, additional conditions can also be considered; for example, a limitation to the power generated by the PVS [25–27], which is applied when the ESS reaches the maximum state of charge (*SOC*) during low power demand, or a load disconnection when the ESS reaches the minimum *SOC* during high power demand [25,28]. Those protections are needed to prevent an accelerated reduction of the ESS lifetime [29–31], hence reducing costs.

Energy managemen<sup>t</sup> systems (EMSs) used in SPVSs consider a load shedding strategy for preventing the ESS from violating the minimum *SOC* only when noncritical loads are connected to the MG [32–34]. However, this requires an oversizing of both the generators and the ESS when critical loads are present. The main challenge in EMS design concerns the limitation of the maximum *SOC* condition because traditional control techniques are unable to supply power to the load without using the ESS; therefore, ESS are constantly discharged and charged with small amounts of power. This situation produces charge/discharge sub-cycles, which are integrated as full cycles that reduce the lifetime of the battery [35]. Therefore, this paper proposes a new EMS based on operating states for controlling a SPVS without violating both the maximum and minimum *SOC* of the ESS. For that purpose, the EMS considers three operating regions for the ESS: overcharge, normal operation, and bulk charge; and two operating modes for the PVS are also defined: MPPT and power demand tracking (PDT) [36]. The proposed EMS also includes a capacitor connected in parallel with the battery as backup ESS. The function of this capacitor is to enable the disconnection of the battery in both overcharge (high *SOC*) and bulk charge (low *SOC*) conditions, hence avoiding charge/discharge sub-cycles in the battery.

Therefore, the main paper contribution is the design and test of a control strategy for an EMS aimed at regulating a microgrid based on a PV system and ESS. The solution is also intended to avoid the sub-cycles problem present in power demand tracking operation, which causes an accelerated aging of the battery pack due to the integration of charge/discharge sub-cycles into full charge/discharge cycles. This is done by inserting an auxiliary capacitor into the ESS to support the PDT operation, which enables to disconnect the battery to avoid the sub-cycles problem. Moreover the EMS also considers all the states needed to protect battery, including the load disconnection when the power balance is not achievable due to both low SOC and low PV power production. This document is organized as follows: Section 2 presents the background of SPVSs based on DC microgrids. Then, Section 3 introduces the structure, control strategies, and energy managemen<sup>t</sup> system used in the proposed solution. The results and simulations analysis are reported in Section 4, and the conclusions close the paper.

#### **2. Background of SPVSs**

Figure 1 shows the SPVS architecture adopted in this work, which is formed by a PVS, an ESS (lithium-ion battery in parallel with a capacitor), the controlled DC/DC converters, and the load [37,38]. Such microgrid structure is commonly used in several applications that require a global power balance [39–41].

**Figure 1.** Conventional stand-alone DC microgrid.

Equation (1) formalizes the global power balance of the SPVS, where *PESD* represents the power supplied or stored by the external storage device (ESD), *PPV* is the power generated by the PVS, and *PLoad* is the power demanded by the load. In this balance, the supplied power is positive and the consumed power is negative.

$$P\_{ESD} + P\_{PV} + P\_{Load} = 0\tag{1}$$

EMSs should consider the fact that batteries have two *SOC* limits: a maximum state of charge (*SOCMax*), i.e., overcharge, and a minimum state of charge (*SOCMin*), i.e., bulk charge. If the battery operates outside those limits, the ESS lifetime could be significantly reduced [42–44]. Therefore, EMSs should also integrate two operating modes: (1) constraining the power generated by the PVS so that it equals the power demanded by the load ( *PPV* ≈ *PLoad*), which is needed when *SOCMax* is achieved; and (2) disconnecting the load when the ESS reaches the *SOCMin*. In the second mode, the PVS must be operated at the MPP until the battery reaches an acceptable *SOC* value to reconnect the load [36].

An example of this kind of EMSs is presented in [40], where a multi-loop and multi-segment adaptive droop-controller is used to manage the energy flow in a PV/battery hybrid system for a stand-alone DC MG. That solution controls the power generated by the PVS to regulate the charge/discharge battery power. However, since the battery is used to regulate the voltage in the DC-bus, such an action produces charge/discharge sub-cycles, which reduce the lifetime of the battery. Similarly, in [45] the authors proposed a double-layer hierarchical controller to ensure the global power balance of a DC MG. In such EMS, both the generators and the ESS can operate as voltage source converters or current source converters, which enable both types of devices to regulate the DC-bus voltage. This solution requires a virtual batteries disconnection when the *SOCMax* is reached, which is performed by controlling the power generated by the PVS. Such a strategy may cause voltage instability due to the absence of a storage device because no device is capable of storing the small amount of excess power that could be produced by the PVS due to quantization or controller errors.

Other solutions have been focused on regulating the power generation of the PVS to prevent the batteries from operating outside the *SOC* limits. This is the case in [36], where PVS generation is constrained depending on battery *SOC* and grid availability. Similarly, in [46] is reported a real-time rule-based algorithm for the power managemen<sup>t</sup> of an MG that considers a constraint to the power generated by the PVS. Different authors [47] have also proposed an EMS based on multiple MG operating states: MPPT mode and constant voltage (CV) mode. The CV mode is used when the battery *SOC* reaches the maximum limit; hence the PVS power generation is constrained to ensure a constant battery voltage. The same strategy has been applied by other authors to avoid an excessive *SOC* condition [36,40,45,46]. However, in those solutions the batteries are not disconnected; therefore, the small amount of excess power that could be produced by the PVS (due to quantization or controller errors) is stored or supplied by the battery, generating charge/discharge sub-cycles, which reduce the battery's lifetime.

The problem associated with the charge/discharge sub-cycles of the ESS is illustrated in Figure 2, which considers the control of PVS generation reported in [36]. That control strategy was implemented following the flowcharts reported in [36], but modifying the power profiles reported in that paper since those profiles do not illustrate the sub-cycles problem. Such solution has MPPT and PDT modes, where both modes are based on the Perturb and Observe algorithm. This simulation includes a single BP585 PV module with a constant irradiance of 1000 W/m2, a constant power load of 40 W, and an initial battery *SOC* equal to 0.99995, which is near *SOCMax*. The simulation considers constant power profiles for both the photovoltaic source and load to illustrate the sub-cycles problem in an easy way: those constant profiles enable to visualize the source of the sub-cycles problem without the action of other controller transitions. The results presented in Figure 2a show that the PVS operates in MPPT mode at the beginning of the simulation to provide the power required by the load, while charging the battery. The MPPT mode is active for 0.34 s; at that moment, the battery *SOC* reaches *SOCMax*. From that moment on, the system operates in PDT mode to reduce the power generated by the PVS. In PDT mode, two different waveforms can be observed in the PVS power curves: (1) when the battery *SOC* is higher than *SOCMax* (between 0.34 s and 0.63 s) and (2) when the *SOC* is almost equal to *SOCMax* (from 0.63 s on). In the first part of this PDT operation, the control strategy uses the excess power from the battery to supply part of the load power, thus discharging the battery to respect the *SOC*

limit. However, when the *SOC* is almost equal to *SOCMax*, small errors of the PDT control produce small charge/discharge sub-cycles in the battery (observed in Figure 2b), which are integrated as full charge/discharge cycles that reduce the battery's lifetime. In this simulation, the PDT errors are caused by the discretization of the Perturb and Observe algorithm that is used to track the load power, which is an unavoidable condition. Similar errors will occur in other tracking solutions, such as incremental conductance, extremum seeking or linear and non-linear controllers.

**Figure 2.** Photovoltaic systems (PVS) power generation control.

The following section proposes both a circuital structure and a control strategy to address this problem.

#### **3. Circuital Structure and Control Strategy for the EMS**

To solve the problem described in Section 2, this paper proposes an EMS for a SPVS that considers battery *SOC* limits, PVS power generation control, and the integration of a backup capacitor to avoid charge/discharge sub-cycles in the battery. The backup ESS (capacitor) is used to support the power balance when the main ESS (battery) is disconnected, which occurs when the battery *SOC* falls outside safe limits. Such procedure avoids charge/discharge sub-cycles in the battery and, hence, artificial battery degradation.

The EMS proposed in this work is based on three operating regions (OR), defined by the SOC limits, and two control modes for the PVS; a graphic representation of those regions is provided in Figure 3. Region 1 (OR1) covers the normal battery operation and PVS; hence, the PVS works in MPPT mode and the battery is connected to the EMS. The second operating region (OR2) occurs when the battery *SOC* reaches the maximum limit (*SOC* ≥ *SOCMax*), which forces the PVS to operate in PDT mode and disconnect the battery. OR2 uses the capacitor as backup ESD to ensure a correct power balance, thus eliminating the charge/discharge sub-cycles described in the previous section. The EMS remains in OR2 while the MPP of the PVS is higher than the power demanded by the load.

The third operating region (OR3) occurs when the battery *SOC* reaches the minimum limit (*SOC* ≤ *SOCMin*), which forces the battery disconnection and the use of the backup capacitor for ensuring the global power balance. Moreover, if the capacitor is discharged (hence the capacitor voltage reaches a safe minimum value), the load is disconnected to force the capacitor to charge until the capacitor voltage reaches the battery voltage, which enables the EMS to reconnect the battery. Finally, the load is reconnected when the battery has been charged to a safe *SOC* value.

**Figure 3.** Proposed methodology.

#### *3.1. Devices and Control Strategies*

The components of the proposed EMS are depicted in Figure 4: PV panel, battery, capacitor, DC/DC converters, control strategies, and common DC-bus. The PVS is connected to the DC-bus using an unidirectional DC/DC boost converter, which is regulated using the sliding-mode controller (SMC) proposed in [48]. Such a SMC regulates the DC/DC converter to impose a desired PV voltage despite the environmental and DC-bus voltage conditions, hence the voltage of the PV source is always equal to the voltage reference (*VPV*−*REF*); the design and stability proof of the SMC are reported in [48]. The reference of such a SMC is provided by the Perturb and Observe (P&O) algorithm proposed in [36], which has two operation modes: the MPPT mode tracks the optimal PV voltage that ensures the maximum power generation, while the PDT mode tracks the PV voltage to produce a given power reference. Therefore, the used strategy to control the power generation of the PVS does not require the implementation of forecasting methods, since the combined action of the P&O and SMC algorithms ensures the production of the maximum power possible (MPPT mode) or a lower power level to match the load demand (PDT mode) depending on the microgrid requirements. In addition, the proposed structure also has adjustable parameters to control the power generated by the PV sources, with one limitation: the maximum power that can be delivered is constrained by the environmental conditions, while the minimum power is controllable. This section of the power system is modeled using the electrical equations of both the PV panel and the unidirectional DC/DC converter given in Equations (2)–(4):

$$i\_{\mathbb{P}^\upsilon} = i\_{\mathbb{p}\mathbb{I}} - i\_0 \left[ \exp \left( q \left( v\_{\mathbb{P}^\upsilon} + i\_{\mathbb{P}^\upsilon} R\_\mathfrak{s} \right) / \left( N\_\mathfrak{c} \eta k T\_\mathfrak{c} \right) \right) - 1 \right] - \left( v\_{\mathbb{P}^\upsilon} + i\_{\mathbb{P}^\upsilon} R\_\mathfrak{s} \right) / R\_\mathfrak{h} \tag{2}$$

$$\frac{d\upsilon\_{pv}}{dt} = \frac{i\_{pv} - i\_{L\_{pv}}}{L\_{pv}} \tag{3}$$

$$\frac{di\_{Lpv}}{dt} = \frac{\upsilon\_{pv} - \upsilon\_{dc}\left(1 - \mu\_{pv}\right)}{L\_{pv}}\tag{4}$$

Equation (2) describes the PV current *ipv* and voltage *vpv* imposed by the unidirectional DC/DC converter, the photo-induced current *iph*, which is almost proportional to the irradiance level, the inverse saturation current *io*, the series and shunt resistances *Rs* and *Rh*, the electron charge *q*, the Bolzmann constant *k*, the quality factor *η*, the number of cells *Nc* and the temperature in kelvins *Tc*. Equation (3) describes the dynamic behavior of the PV voltage, where *Cpv* is the capacitor in parallel with the PV source, *Lpv* is the inductance of the unidirectional DC/DC converter and *iLpv* is the current of that inductor. Finally, Equation (4) describes the dynamic inductor current behavior, where *vdc* corresponds to the bus voltage and *upv* is the activation signal of the converter MOSFET, which is generated by the SMC.

**Figure 4.** Structure and control of the proposed SPVS.

The backup capacitor *C* of the structure is used in OR2 and OR3 for supporting the power balance and, at the same time, enabling the control of the DC-bus voltage in both OR2 and OR3. The capacitor is always connected to the EMS, while the battery is disconnected in OR2 and OR3 using the switch *SWBat*. It must be noted that, independent of the size or the selected technology of the battery bank, the sub-cycles problems will remain; the quantization errors of the PDT control strategy will produce small charge/discharge sub-cycles, which are integrated as full charge/discharge cycles. The solution to avoid that problem is to disconnect the battery bank when the PV system must operate in PDT mode. A larger battery bank will suffer a small impact of the sub-cycles problem, since each sub-cycle will be divided into the batteries forming the bank, but the solution proposed in this paper is intended to remove the sub-cycles degradation independent of the battery size or selected technology.

The capacitor size is calculated using the average power values obtained when the system operates in PDT. Equation (5) calculates the average current in the capacitor, where *Pc* is the maximum allowable power for the capacitor, and *VBat* is the battery nominal voltage. Equation (6) can be used to calculate the capacity of the capacitor, where *t* represents the selected discharging time and Δ*V* is the maximum voltage drop allowed for those *t* seconds; both values are assigned by the MG designer according to the generator and load characteristics.

$$I\_{\mathbb{C}} = \frac{P\_{\mathbb{C}}}{V\_{Bat}} \tag{5}$$

$$C = \frac{I\_C}{\Delta V} \ast t \tag{6}$$

The hybrid ESS is connected to the DC-bus using the bi-directional converter depicted in Figure 4, which is controlled to regulate the DC-bus voltage. The control strategy adopted here was proposed in [49]; it consists in a SMC for the charger/discharger that ensures a stable DC-bus voltage in any operating condition: charging, discharging, or stand-by. This control strategy is active in all the operating regions by using the battery or capacitor as ESS, thus ensuring the global power balance of the system. This section of the model is represented by Equation (7), where *vESD* corresponds to the ESD voltage, *LESD* corresponds to the inductor of the bidirectional DC/DC converter and *iLESD* is the current of that inductor; finally, *uESD* is the activation signal of the MOSFETs generated by the SMC of this charger/discharger.

$$\frac{di\_{LSD}}{dt} = \frac{v\_{ESD} - v\_{dc} \left(1 - \mu\_{ESD}\right)}{L\_{ESD}}\tag{7}$$

To evaluate the proposed EMS, constant power load (CPL) [50] models were selected due to their widely use in DC MGs analyses [51–55]. That representation has the main characteristic of changing both the load current and voltage to keep the load consumption constant; therefore, when the bus voltage exhibited perturbations, the load current changed accordingly. This is different from the constant impedance load (CIL) representation, in which perturbations in the bus voltage causes a different load power consumption. In practical applications of DC Microgrids CPL is an accurate representation of the loads due to the presence of DC/DC converters interfacing the loads with the DC bus: the load current changes according to the perturbations in the bus voltage (load voltage) to consume the power requested by the load [51–53]. Therefore, CIL is not an accurate representation of the loads in DC Microgrids with commercial loads. In any case, CPL models can be used to represent loads interfaced with DC/DC converters having variable power consumptions. In that case the power requested by the load is just updated in the model, but the load keeps behaving as a CPL: the current changes according to the bus voltage perturbations to ensure the desired power consumption.

In addition, the load voltage was considered equal to the DC-bus voltage; hence, there was no need for an additional DC/DC converter for the load interface. Finally, since the load was disconnected in OR3, a switch *SWLoad* was included in the EMS circuit to disconnect and reconnect the load from the DC-bus.

#### *3.2. Energy Management System Proposed to Control the SPVS*

Figure 3 presents the operating regions defined around the technical operating limits established for the battery *SOC*. Such regions should consider the different operating modes of the PVS (MPPT and PDT) and the battery and load connection/disconnection depending on the requirements of each operating region. The following subsections explain the types and operating ranges of the battery *SOC* and the control strategies applied to the regions proposed in this work: overcharge, normal charge, and bulk charge. It also describes the requirements to move from one region into another and connect/disconnect the battery and the load so that voltage fluctuations are as small as possible. To provide a better explanation of the EMS, the three regions are described in the following order: Region 1 (normal operation); Region 2 (overcharge); and Region 3 (bulk charge).

#### 3.2.1. Region 1 (*Normal* : *SOCMin* < *SOC* < *SOCMax*)

In this region, the PVS should always operate in MPPT in order to utilize its maximum power generation. Because the battery is responsible of the global power balance at all times, it should always be connected (*SWBat* = 1). Additionally, the load is always connected in this region (*SWLoad* = 1) because the PVS and the battery, combined, can produce sufficient power to supply the power demanded by the load. The restrictions and considerations to enter this operating region are detailed in the subsections describing Regions 2 and 3. To leave this operating region, the battery just needs to reach its *SOC* limits. The state diagram in Figure 5 enables a better interpretation of those interactions.

**Figure 5.** Flowchart of the control strategy in Region 1.

#### 3.2.2. Region 2 (*Overcharge* : *SOC* ≥ *SOCMax*)

This operating region occurs when the power generated by the PVS is higher than that consumed by the load and the battery reaches *SOCMax*. For that reason, the backup ESS (in this case, the capacitor) must replace the battery and take control of the power balance and the voltage at the DC-bus, keeping the load connected at all times (*SWLoad* = 1). It should be noted that, for the EMS to operate in this region, the battery *SOC* should be equal to or higher than the maximum limit (*SOC* ≥ *SOCMax*). In this OR, there are different operating scenarios depending on the values of the power generated by the PVS, the power demanded by the load, and the maximum and minimum voltage limits assigned to the capacitor, which are explained below and presented in the state diagram of Figure 6.

**Figure 6.** Flowchart of the control strategy in Region 2.


the battery disconnected (*SWBat* = 0). The system continues operating in Region 2 as long as the condition to change to OR1 (described in the previous paragraph) is not met. If that condition is not satisfied and the condition (*Ppv* ≥ *PLoad*) remains, the capacitor is charged up to the battery nominal voltage and the PVS operates in PDT once again.

#### 3.2.3. Region 3 (*Bulkcharge* : *SOC* ≤ *SOCMin*)

When the battery reaches the minimum allowable *SOC*, it should not supply power to the load. For that reason, the battery is disconnected when the operating state *SOC* ≤ *SOCMin* is reached, while the capacitor is in charge of supplying the demanded power in such a way that the global power balance is satisfied and the voltage level at the DC-bus is controlled. The previous condition will be fulfilled as long as the capacitor does not reach the minimum voltage level established for its operation (*VcMin*). At the same time of the battery disconnection, a warning signal is sent to indicate that the system is operating in Region 3 and it might be de-energized. Such signal takes a value of one (*Warning* = 1) when the battery reaches its minimum *SOC* and continues that way until the *SOC* achieves a safe operating level, at which point it changes to zero (*Warning* = 0). That warning signal is adapted in the managemen<sup>t</sup> system to alert users of the equipment that they should store their data because the system will stop supplying power for a period of time.

When the system is operating in Region 3, two operating conditions can be created: (1) The generated power is higher to or equal than the power demanded by the load ( *PPV* ≥ *PLoad*); therefore, the system should charge the capacitor until its voltage reaches or exceeds the battery voltage in order to connect the latter (*SWBat* = 1), while charging the battery until it reaches a safe recovery level (*SOCRec*). Only when this condition is met, the warming is off (*Warning* = 1) and the system starts to operate in Region 1. (2) The generated power is lower than the power demanded by the load (*PPV* < *PLoad*). If the capacitor reaches its minimum voltage in this condition, the load is disconnected, while the battery is kept disconnected until the capacitor reaches a voltage level equal or higher than the battery voltage. When this condition is satisfied, the battery is connected, and its charge cycle is started until its *SOC* is equal to or higher than *SOCRec*. Only when this condition is met, the load is reconnected, the warming signal is off and the system can start to operate in OR1. It is important to highlight that, by using the hysteresis band generated between *SOCMin* and *SOCRec*, it is possible to avoid the connection and disconnection of the battery for short periods of time and the load connection and disconnection when the second operating condition is fulfilled. In an operating state of variable demand, this prevents fluctuations and continuous transients in the system. Additionally, in OR3 the PVS operates in MPPT at all times so that the maximum power is generated. The state diagram in Figure 7 is a graphic representation of this strategy.

**Figure 7.** Flowchart of the control strategy in Region 3.

#### **4. Simulation Results**

This section describes the simulations that were conducted to make sure that each one of the regions and operating states in the EMS are satisfied and enable the SPVS to operate adequately. In order to simulate the components of the SPVS and the control strategies, it was employed the specialized software PSIM. The BP585 single mono-crystalline PV panel, formed by 36 cells in series, was selected. Table 1 presents the module characteristics in standard conditions (STC-irradiance, 1 kW/m2; and cell temperature, 25 ◦C). To estimate the module parameters, the mathematical formulation proposed in [56] and the data in standard conditions were used. Changes in the irradiance and temperature are also considered by changing the short-circuit current of the PV source model, which is a common simulation practice as it is reported in [56]. It must be highlighted that the adopted PV model is also valid for representing modules currently available at the market, which exhibit characteristics similar to the ones of the PB585 module, e.g., M36PCS (85 W), P36PCS (85 W), among others. The nominal voltage of the lithium-ion battery (used to form the ESS) was 12V, with three cells in series, one set of cells in parallel, and a nominal capacity of 5.2 Ah. The limits *SOCMax* = 0.9 and *SOCMin* = 0.1 were defined in the managemen<sup>t</sup> strategy to extend the lifetime of the device [57]. Additionally, for an adequate transition from Region 3 to Region 1, the EMS implemented a *SOCRec*, which was specified in each test scenario.

**Table 1.** Parameters of the BP585 panel.


The parameters of the different elements that formed the control strategies and the converters used to design this SPVS are described in the references cited in Section 3. For a better understanding and analysis of the results obtained by the proposed EMS, this section starts with the validation of each one of the operating regions considering the variation in photovoltaic generation and the power demanded by the load. For that purpose, it was necessary to use short simulation times and an analysis of the transients of each OR and their transitions, as well as the DC-bus voltage. Finally, a 24-h test scenario was defined (with load and solar irradiation variations sensed by a laboratory of the Universidad Nacional de Colombia, located in Medellín-Colombia) to evaluate the behavior of the SPVS in all the operating regions.

#### *4.1. Simulation and Validation of the Proposed Operating Regions*

This subsection analyzes each operating region in order to validate all the conditions and constrains considered in the proposed EMS. For that purpose, the EMS parameters were adjusted as follows.

The capacitor was calculated by analyzing the behavior of the PVS when PDT was applied in the presence of the battery and an irradiance of 1000 W/m2; thus, obtaining the scenario of maximum power in which the capacitor will operate. After analyzing the results of this scenario (see Figure 2), *Pc* = 10 W was defined so that the capacitor had sufficient power to assume the power excess generated in this operating mode. The maximum voltage drop of 1 V was also considered for a time of 1 s, which requires a 0.833 μF capacitor. Based on the capacitor calculation, the values *VcMax* = 18 V, *VcMin* = 5 V, and (Δ*Vc* = 1 V) were assigned. It is considered a margin of 60% (upper limit) and 50% (lower limit) of the nominal voltage of the battery in order to establish the voltage levels in this EMS and offer an adequate power level in the capacitor. It is important to highlight that the capacitor voltage limits vary depending on the specific equipment and manufacturer. In addition, it was considered *Δ VPV* = 0.2 V as the voltage rate in the power control strategy of the PVS and assigned a value of *SOCRec* = 0.10005 as the recovery *SOC* of the battery. These values were selected in order to validate the operating states in a short period of time and analyze the transients generated by the fulfillment of the conditions as well as transitions from one OR to the next. Finally, each one of the proposed scenarios has an initial load, PVS power generation, and variable power demanded by the load so that all the states and regions in the EMS can take place. Note that all the test scenarios in this work use the same minimum and maximum *SOC* limits previously defined.

#### 4.1.1. Region 1 (*Normal* : *SOCMin* < *SOC* < *SOCMax*)

This subsection describes different test cases in the same scenario, in which power generation and demand in the SPVS are changed to test the conditions established for the system operation in Region 1 (normal) and Region 2 (overcharge). Figure 8 presents this test scenario, describing the system dynamics under the proposed EMS. PVS power generation was divided into three levels. The first level was generated by a solar irradiance of 1000 W/m2, which resulted in approximately 84 W produced by the PVS. At *t* = 6.2 s, a 40% reduction (400 W/m2) was applied, and the PV generated 50 W after that. Finally, another 40% reduction (400 W/m2) was applied at *t* = 6.5 s, which generated a total drop of 80% in the maximum irradiation from the start of the test scenario until the time under analysis. Thus, the final power delivered by the PVS was approximately 16 W. Additionally, this scenario considered the variation in the power demanded by the load, which was 20 W at *t* = 0 s, 90 W at *t* = 2 s, and, finally, 30 W at *t* = 3 s. The time interval between seconds 4 and 5 presents a load increase with positive slope from 30 W to 50 W, which is maintained until *t* = 6 s. Finally, the load drops to 30 W from *t* = 6 s to the end of the period under analysis. The previous scenario of PVS generation and power demand by the load is defined in such way that transitions between ORs 1 and 2 occur and the PVS operates in PDT and MPPT. The test simulation was divided into 5 time intervals for a correct interpretation of the test scenario as well as the PVS behavior based on the different variations. The intervals represent a scenario where power generation and demand change, one exceeding the other.

**Figure 8.** Power demanded and generated by the SPVS: test system in Operating Region (OR)1 and OR2.

To validate the operation of the proposed EMS in OR1, the battery *SOC* started at 0.5 so that, during the entire simulation time, the EMS stayed within the ranges assigned to operate in this

region. Figure 9 presents the behavior of the system when load and demand variations were applied. Remarkably, the PVS operated in MPPT at all times, keeping the battery and load connected throughout the simulation, while the battery was in charge of supplying and storing the excess power generated by the PVS so that a global power balance could be achieved. The subfigure that presents the voltage assigned to the PVS by the DC/DC converter shows the way the EMS modified that voltage as the irradiation on the panel varied (fell), always staying in MPPT mode. This validates the correct operation of the external control strategy applied to obtain the maximum power from the PVS. Moreover, it was proved that the managemen<sup>t</sup> strategy selected to control the ESS could be used to control the DC-bus voltage, always keeping the voltage near its nominal value ( *VDC* = 48 V), and the power demanded by the load is supplied and absorbed without affecting the MG operation. In this test system, the power flow supplied by the ESD is provided by the battery, since the switch of the ESD is closed (please refer to Figure 4 to check the switch). The voltage peaks in DC bus are associated with strong variations in the demand, which are mitigated by the control strategy. This test scenario does not consider the transition to other ORs because that is validated in ORs 2 and 3.

**Figure 9.** Energy Management System: Test system in OR 1.

#### 4.1.2. Region 2 (*Overcharge* : *SOC* ≥ *SOCMax*)

In order to validate the conditions proposed for OR2, the same test system presented in Figure 8 was used. The validation of the correct operation of the EMS is presented in Figure 10, which details the control actions performed by the EMS in different operating and demand scenarios of OR2 divided into time intervals based on variations in load and PVS generation. The waveforms of battery *SOC* and voltage demonstrate that, during most of the simulation time, the system operated with *SOC* ≥ *SOCMax* and the battery was disconnected, while the capacitor was in charge of supplying and storing the excess power required by the system to achieve the global power balance. As a result, the sub-cycles of the battery associated with the operation in PDT in this OR could be eliminated. In Interval 1, the generated power was higher than the demand of the system and, because the *SOC* level was lower than the maximum established limit, 0.9 (*SOC* = 0.89995), the system started operating in OR1. As the simulation progressed, the battery was charged until it reached the maximum allowable limit for the *SOC* at *t* = 0.36 s. When this happened, the operation of the system changed to OR2, the battery was disconnected, and the PVS system was operated in PDT. This can be observed in the graph that illustrates the voltage of the battery and the voltage assigned by the converter to the PVS (PV voltage). This operating mode continued until Interval 2. The capacitor voltage shows that this device was in charge of supplying and storing the excess power associated with the PDT during Interval 1, when the system operated in that mode. In Interval 2, the power state in the SPVS changed: the demanded power was higher than the power generated by the PVS. For that reason, the photovoltaic system changed to operate in MPPT at *t* = 2 s, reducing the PV voltage so that the power required by the load was delivered. Because the power generated by the PVS was not sufficient to cover the load demand, the capacitor should have compensated for that deficit. During this entire interval the battery was disconnected because the system did not meet the conditions to change operating regions.

**Figure 10.** Energy Management System: test system in OR2.

In Interval 3, the load conditions led the system to operate in PDT once again, increasing the voltage of the PVS until it reached an adequate power level. Because the capacitor should have delivered the power difference in this operating mode, its voltage started to drop (as can be seen from the voltage waveform), keeping the battery disconnected. Interval 4 presents different load levels, which were correctly managed by the EMS. In the simulation, the 4 s ≤ *t* ≤ 5 s interval exhibited a step-shaped load increase during which the PDT never lost control over the generation and immediately adapted to such an increase. This produces voltage dropped in *Vpv* and, as a result, the power generated by the PVS rose in a controlled manner. In that interval, the DC-bus presented higher voltage fluctuations than in other intervals in the test scenario, to which the capacitor and the managemen<sup>t</sup> strategy responded adequately. After *t* = 5 s, the load was constant (*PLoad* = 50 W) until *t* = 6 s, while the system was operating in PDT with a disconnected battery without any problem. At *t* = 6 s, the demanded power dropped to 30 W, because the PDT conditions were maintained, and the system continued operating in this OR without any problem. Additionally, Interval 4 presented a drop in SR, which had an impact on the power generated by the PVS and resulted in an immediate reduction in power produced by the PV panel. During the first power reduction, which occurred in the 6.2 s ≤ *t* ≤ 6.4 s interval, the power generation stayed above the power demanded by the load; for that reason the PVS operateed in PDT mode at all times. Note that, although the reduction in power generated by the PVS was important, the EMS was not affected at all, correctly responding by reducing the reference voltage of the PVS. Nevertheless, charge and discharge power fluctuations were produced in the capacitor, although smaller than those generated during the step-shaped increase in the load in the 4 s ≤ *t* ≤ 5 s interval. Finally, a second drop in SR took place between Intervals

4 and 5, 6.5 s ≤ *t* ≤ 6.7 s, which caused the power generated by the PVS to drop below the power demanded by load at *t* = 6.6 s. The PVS then changed from PDT to MPPT mode. The EMS for OR2 maintained the system in that OR until the capacitor reached the battery voltage at *t* = 6.8 s, satisfying the condition for battery reconnection in Interval 5. For that reason, the SPVS started to operate in OR1, while the battery *SOC* noticeably fell since *t* = 6.8 s until the end of the simulation. Remarkably, in the entire test scenario, the operating voltage of the DC-bus was maintained near its nominal voltage (*VDC* = 48 V), with a maximum variation of 0.72%.

The test scenario in Figure 10 does not show the charge/discharge action of the capacitor when the maximum and minimum limits are reached. For that reason, Figures 11 and 12 present the behavior of the system when forced into these two operating states in order to demonstrate the adequate operation of the system and the satisfactory performance of the proposed EMS. Figure 11 illustrates a scenario where the capacitor reaches *VcMax* when the PVS is operating in PDT. Thus, we assigned an initial voltage (Vc = 18.1), *SOC* ≥ *SOCMAX*, and the power demanded by the load (40 W). These conditions forced the system to discharge the capacitor to a safe voltage level (Vc = 17 V in this case). For that purpose, the EMS operated the system in Voc until the capacitor voltage reached the safe level established by the control strategy, thus generating *PPV* = 0 W and forcing the capacitor to supply all the power required by the load. When the capacitor reached the safe voltage level, the system switched modes to operate in MPPT at *t* = 0.388 s until it reached the required power level to continue operating in PDT at *t* = 0.397 s, which can be seen in the graph of PVS, load, and capacitor power. Figure 11 presents the voltage levels assigned by the control strategy (reference) and the converter to the PVS, as well as the stabilization of the capacitor voltage in the levels assigned by the EMS. Note that if (while the capacitor is being discharged) the system changed the load conditions and it was necessary to switch to OR1, this would only occur if the capacitor voltage equals that of the battery. This was guaranteed by the condition for the transition from OR 2 to OR1 in Figure 6.

**Figure 11.** Control strategy to reduce the power generation in the PVS in order to discharge the capacitor when *Vc* ≥ *VcMax*in PDT mode.

Figure 12 illustrates the test scenario in which the capacitor reaches the minimum voltage limit allowable in OR1, with the PVS operating in PDT. In this scenario, the load power was 40 W and *SOC* = 0.91, thus generating *VBat* = 11.94 V. In order to violate the minimum voltage limit (*Vc* < *VBat* − <sup>Δ</sup>*Vc*), an initial voltage of 10.92 V was assigned to the capacitor so that the system charged it. Due to the previous conditions, the power graph of the devices in Figure 12 shows that the system, when the simulation started, immediately operateed in MPPT until the capacitor reached the minimum allowable voltage level to operate in PDT in OR2 at *t* = 0.242 s, when it d to PDT *Vc* ≥ *VBat*. Importantly, the power to charge the capacitor was extracted from the excess power of PVS generation. Additionally, the figure of the voltage levels in this test scenario presented different voltage signals that can be used to interpret the way the system worked when the capacitor was charged in OR2. At the start of the simulation, the capacitor voltage was under the allowable level, i.e., a volt below that of the battery voltage (Δ*Vc* = 1 V) . For that reason, the voltage assigned to the PVS by the control strategy resulted in the system operating in MPPT until the capacitor voltage equals that of the battery at the moment of the disconnection. After that point, the system operated in PDT again until the load and generation conditions in the SPVS changed.

**Figure 12.** Control strategy to increase the power generation in the PVS in order to charge the capacitor when *Vc* = *VBat*− Δ*Vc* in PDT mode.

#### 4.1.3. Region 3 (*Bulkcharge* : *SOC* ≤ *SOCMin*)

In order to validate the adequate system operation in OR3, this subsection proposes two test scenarios to study the conditions that can exist when the SPVS works in that region. Figure 13 shows the test scenario that represents the operating condition in which the battery reached the *SOCmin* and the power of the PVS changed to *PPV* ≥ *PLoad*. Such a scenario considered an initial *SOC* of *SOC* = 0.100025 and *SOCRec* = 0.10005, and the system started to operate in OR1. Additionally, the power generated by the PVS (*PPV* = 84 W) was constant and the power demanded by the load was variable. More specifically, the load started with a demand of 120 W and, as a result, the system changed from OR1 to OR3 at *t* = 0.104*<sup>s</sup>*. When the SPVS changed to OR3, the warning signal took a value of 1, which indicated the users that the system may have been close to a complete load disconnection. After *t* = 0.2 s, the power demanded by the load decreased (*PLoad* = 60 W) until *t* = 1.6 s. Due to that drop in the load, the power state of the system changed (*PPV* ≥ *PLoad*), and as a result, the capacitor started to charge. When the condition *Vc* ≥ *VBat* was satisfied at *t* = 0.806 s, the EMS reconnected the battery and started the charging process. Importantly, only when the *SOC* reached the recovery level at *t* = 1.446 s the system started to operate in OR1. At that point, the warning signal took a value of zero, which indicated there was no risk of load disconnection anymore. Finally, in OR1 there was a load increase (*PLoad* = 60) W, but the system continued operating without any problem and storing the generated excess power in the battery. Note that, during the entire test scenario, the system operated in MPPT to take advantage of the power generated by the PVS and escape the bulk charge condition.

In this simulation the EMS maintained the voltage level of the DC-bus approximately equal to the nominal voltage (*VDC* = 48) V, presenting maximum variations of 4.5% and 0.2% on average. Remarkably, the strongest voltage fluctuations were caused by variations in the power demanded by the load, under which the sliding-mode control strategy used for the batteries offered an excellent performance, as can be seen in Figure 14.

**Figure 13.** Test system in OR3 (operating condition (*PPV* ≥ *PLoad*)).

**Figure 14.** Voltage of the DC-bus test system in OR3 (operating condition (*PPV* ≥ *PLoad*)).

Figure 15 presents a test scenario to validate the operating conditions when the load is disconnected. Such a scenario considers an initial *SOC* of 0.100025 and *SOCRec* = 0.10005. As in the previous scenario, the power generated by the PVS (*PPV* = 84) W was considered to be constant and the power demand by the load, variable. The systems started its operation in OR1, with a power demand of *PLoad* = 120 W; for that reason, it changed to OR3 at *t* = 0.036 s. Immediately after the SPVS changed operating regions, the battery was disconnected and the warning signal took a value of 1, indicating load disconnection risk. At the same time, the capacitor started its discharge process, which was accelerated at *t* = 0.4 s due to an increase in the power demanded by the load (*PLoad* = 140 W). At *t* = '0.507 s, the capacitor reached its minimum voltage limit (*Vc* ≤ *VcMin*); for that reason, the load was disconnected and the charging process of the capacitor was started. When the capacitor reached the battery voltage at *t* = 1.021 s, the latter was reconnected and its charging process was started until it reaches the *SOCRec*. When the recovery *SOC* was reached at *t* = 1.28 s, the load was reconnected with a value of *PLoad* = '140 W, thus forcing the system to operate in OR1. At that time the warning signal took a value of zero, indicating the end of the disconnection risk. During the remaining simulation time, the SPVS operated in OR1 while the battery was supplying the missing power to the load. In addition, the excess power produced by the reduction in the power demanded by the load (*PLoad* = 80 W) at *t* = 1.6 s was stored. In this test scenario (as in the previous one), the PVS operated in MPPT all the time, correctly following the reference voltage assigned by the control strategy of the DC/DC converter.

**Figure 15.** Test system in OR3 (with disconnected load).

Regardless of the load and battery disconnection, the capacitor maintained the voltage level in the DC-bus constant. The bus exhibited high voltage variations when the load was connected and disconnected, which were correctly mitigated by the adopted control strategy. The capacitor dealt with the excess power associated to the control of the DC-bus when the load was disconnected (*t* = 0.507 s), and the battery was responsible for managing such power when the load was reconnected (*t* = 1.285 s). This situation can be seen in Figure 16.

**Figure 16.** Voltage of the DC-bus test system in OR3 (with disconnected load).

#### *4.2. 24-h Test Scenario*

After the correct operation of the SPVS was validated in each one of the operating regions defined in the proposed EMS, a 24-h test scenario was defined using the irradiation values reported by NASA for the University Nacional de Colombia located in Medellín, Colombia, [58] and the same PVS and operating conditions as in the previous power generation tests. Moreover, such scenario uses a power curve that represents the typical behavior of a residential building in the location under study [59]. The power levels were adjusted to observe the different operating regions proposed in this work; Figure 17 presents those values. Because the simulation times in this scenario were longer than in the previous subsection, the EMS parameters were adjusted: for the calculation of the capacitor, *Pc* = 10 W was considered, as well as a maximum voltage drop of 1 V, and a discharge time *t* = 60 s. Those values result in a 49.9 F (almost 50 F) capacitor. In addition, a *VcMax* = 18 V, *VcMin* = 5 V, and (Δ*Vc* = 1) V were defined. For the PVS voltage rate, the control strategy considered *δVPV* = 1 V. Finally, *SOCRec* = 0.2 was established to create an adequate hysteresis band (10% of the *SOC*) and to avoid multiple transitions between OR1 and OR3.

**Figure 17.** PV generation and power demanded by the load in a 24-h scenario.

Figure 18 presents the results obtained when the EMS was applied in the power and demand scenario described in Figure 17. The analysis begins at hour 6, when the system started with *SOC* = *SOCMin* and, for that reason, it entered in OR3, disconnecting the battery and producing the load disconnection. Because the solar irradiance was not available, power was not generated at that time. Nevertheless, the PVS operated in MPPT mode waiting for an increase in irradiance. The previous operating condition was maintained until hour 7, when the PVS started to generate power due to an increase in the irradiance. First, it charged the capacitor and then connected the battery when *Vc* ≥ *Vbat* at *t* = 7.67 h. The voltage waveforms of both the battery and the capacitor show that the battery charging process started after that point. At *t* = 8.64 h the battery reached *SOCRec* = 0.2; therefore, the load was connected and the SPVS moved into OR1, keeping the PVS operating in MPPT. Noticeably, in this state, the excess power and power requirements were managed by the battery without any inconvenience. At *t* = 12.10 h the battery reached *SOCMax* = 0.9; for that reason, the system moved to OR2, which caused the PVS to switch modes to PDT and the immediate disconnection of the battery, while the capacitor was in charge of supplying and absorbing the excess power associated with PDT mode. At *t* = 12.60 h the capacitor reached the maximum voltage limit allowable in OR2; as a result, the EMS set the PVS to operate in open-circuit voltage so that the capacitor was forced to supply the power required by the load and reach an adequate operating voltage level using the Δ*Vc* previously established. This can be seen in the sub-figures of both battery and capacitor voltage and the power of the elements in the MG. In the 13.07 h ≤ *t* ≤ 13.93 h interval, it is observed that the EMS did not allow the capacitor to violate the voltage drop limit established above, (Δ*Vc* = 1) V, forcing the capacitor to charge up to battery voltage every time that limit was

reached. This was achieved using the transition of the PVS from PDT to MPPT, which led to an increase in the power generation in the PVS, and the excess power was injected into the capacitor to charge it (see Power sub-figure). In the 13.93 h ≤ *t* ≤ 16.09 h interval, the system operated in PDT, while the capacitor was responsible for guaranteeing the global power balance operating in accordance with the conditions defined for OR2. Due to the reduction in generation after hour 13, the system met the conditions to change to OR1 at *t* = 16.10 h; and in that instant the capacitor reached the voltage level of the battery, and the battery was reconnected. From that moment on, the PVS operated in MPPT, while the battery was responsible of supplying the excess power needed to serve the load due to the reduction in PVS generation. The battery *SOC* started to decrease until *t* = 18.53 h, when it reached the minimum allowable limit; consequently, the system changed to OR3. Due to the amount of power demanded by the load at that time, the capacitor was taken to the minimum allowable voltage limit and, as a result, the load was disconnected. After that instant, the capacitor started to charge by absorbing the small amount of energy generated by the panel, reaching the voltage of the battery at *t* = 19.23 h (when the latter is connected). When the battery was reconnected, the power generated by the PVS was limited by the low irradiance, and the battery did not reach the *SOCRec*; for that reason the load remained disconnected until hour 6. The bottom sub-figure in Figure 18 presented the warning signal of the system, which was activated every time the system entered OR3 and deactivated when the recovery *SOC* was reached, it forced the system to enter in OR1. The simulation demonstrated the correct operation of the warning signal in the scenario under analysis.

**Figure 18.** 24-h test scenario.
