A nonlinear double-integral sliding mode controller design for hybrid energy storage systems and solar photovoltaic units to enhance the power management in DC microgrids

Correspondence Tushar Kanti Roy, Department of Electronics, and Telecommunication Engineering, Rajshahi University of Engineering & Technology, Rajshahi 6204, Bangladesh. Email: tkroy@ete.ruet.ac.bd Abstract In this paper, a nonlinear decentralized double-integral sliding mode controller (DI-SMC) is designed along with an energy management system (EMS) for the DC microgrid (DCMG). This DCMG includes having a hybrid energy storage system (HESS) that incorporates a battery energy storage system (BESS) and supercapacitor energy storage system (SCESS) while the load demand is met through the power generated from solar photovoltaic (SPV) units. First, dynamical models of each subsystem of DCMGs such as the SPV system, BESS, and SCESS are developed to capture highly nonlinear behaviors of DCMGs under various operating conditions. The proposed nonlinear DI-SMC is then designed for each power unit in DCMGs to ensure the desired voltage level at the common DC-bus and appropriate power dispatch of different components to fulfill the load requirement of the DCMG. On the other hand, an energy management system (EMS) is designed to determine the set point for the controller with an aim of ensuring the power balance within DCMGs under various operating conditions where the overall stability is assessed using the Lyapunov theory. Simulation studies along with the processor-in-loop validation, including a comparative study with a proportional-integral (PI) controller, verify the applicability and effectiveness of the EMS-based DI-SMC under different operating conditions of the DCMG.


INTRODUCTION
of energy storage technologies such as BESSs, hydrogen-based energy storages, SCESSs, etc. Among these ESSs, the BESS is widely used to compensate the power imbalance in DCMGs as it shows some distinct features (e.g., high energy density, matured technology, low cost, and availability) as compared to other ESSs [11]. However, the BESS is not able to provide the power into the MG in a quicker way owing to its slow response time during the fast transient. On the other hand, SCESSs are widely used along with BESSs to tackle such a fast transient and enhance the dynamic performance of DCMGs [12,13].
Since the maintenance of the DC-bus voltage at a constant level is required, the output voltage of each component of the DCMG needs to be regulated to match with this voltage. This output voltage regulation for each component can be carried out by controlling power electronic converters interfacing these components. Furthermore, the controller for converters in DCMGs should be capable to maintain the overall stability under severe disturbances such as large changes output power of RESs and huge variations in load demands. Generally, centralized, decentralized, and distributed control scheme are adopted in the literature to achieve the desired control objective [14,15].
Centralized control schemes are designed in [15,16] for each unit of DCMGs where a dedicated communication channel is used to share the information among different entities. However, the controller is designed without capturing the dynamics of converters though these dynamic behaviors play an important role on the stability of the DC-bus voltage, especially under large disturbances. Furthermore, the communication channel introduces a delay in the control signal due to the communication delay among various components which leads to a poor voltage regulation for the DC-bus. The issue related to the communication delay is resolved in [17,18] where a linear state feedback controller is designed based on the dynamical model of converters by considering the communication latency at the control input of converters to enhance the stability of the DCbus voltage and improve the current sharing within the DCMG. However, the performance of this controller is tested on a DCMG having its major components as ideal sources without considering ESSs and inherent behaviors of RESs which will have a significant impact on the transient stability of the DCbus voltage. This problem is tackled in [19] using a hierarchical controller which is designed using the dynamical model of hybrid ESSs to demonstrate the practical behaviors. However, these centralized controllers [17][18][19] are designed by assuming the model as either linear or model-free which ensure the stable operation of DCMGs only for the scenario/situation captured in the model and control algorithm and unable to preserve the stability when the operation shifts from the pre-defined scenario due to transient behaviors. Moreover, the centralized control structure is vulnerable to the single point failure that affects the overall controllability, reliability, and flexibility of DCMGs.
The distributed control strategy as proposed in [20,21] overcomes some limitations of the centralized structure which allows to exchange information among different components in microgrids with and assists to make the control decision locally. A linear distributed control scheme based on the H ∞ approach is proposed in [22] whose operation is limited to some specific condition. This issue is resolved in [23] by employing a nonlinear distributed controller without considering the dynamic behaviors of different component. Though a properly designed distributed controller resolves the single-point failure even with the failure of some communication links, it introduces a complicated structure and experiences communication delays which in turn affect the optimal operation under large disturbances.
The decentralized controller for DCMGs can be considered as an alternative option as it increases the scalability and reliability without requiring any communication links among local controllers [24][25][26][27][28][29]. A decentralized droop control scheme is presented in [24][25][26] where the control action is obtained by emulating the virtual impedance at the output of the power converter. However, the performance of this droop controller relies on the accuracy of droop coefficients and inaccurate values of such coefficients result in unexpected voltage drop across the virtual impedance for which the voltage at the DC-bus cannot be regulated properly. The decentralized controllers in [24][25][26] are designed for microgrid structures having a single ESS which cannot manage the severe transients. The hybrid ESS (HESS) in such microgrids as discussed in [27][28][29] can be considered as a potential solution for this problem. However, the proportionalintegral (PI) controllers are used which have very limited range of operations.
The existing literature includes several nonlinear decentralized schemes for DCMGs. Nonlinear backstepping controllers (NBC) are used in [30,31] for each component of DC microgrids where the main objective is to match the output voltage of these components with the DC-bus voltage so that the power balance can be ensured. The NBC in [30,31] is designed without considering the effects of variations in parameters or external disturbances. Hence, an adaptive NBC is proposed in [32] to ensure robustness against parametric uncertainties while improving the dynamic performance. However, both NBC and adaptive NBC require some user-defined positive constants and adaptation gain parameters which need to be determined accurately to achieve the desired performance. Though these parameters are not sensitive to the overall stability, the overall response of the system becomes slower, especially against large disturbances in DCMGs which can be sufficient to make the system unstable.
The feedback linearization controllers (FBLCs) have the faster response time as it simplifies the original system model. A partial FBLC is used in [33] for enhancing the regulation of the DC-bus voltage. However, the partial FBLC highly depends on the accuracy of the system parameters which is quite impossible as these parameters change due to changes in the operating point of DCMGs. The decentralized control scheme in [34] uses the features of both adaptive NBC and partial FBLC to make a trade-off between the robustness against parametric uncertainties and the response time. However, the scheme in [34] still requires to determine some user defined and adaptation gain parameters though the number of these parameters reduces significantly due to the simplification of the system model. The nonlinear sliding model controller (SMC) inherently possesses some features that provide robustness against parametric uncertainties including external disturbances and therefore, it can be used to overcome the challenges associated with other nonlinear controllers so far discussed in this paper [35].
The DC-bus voltage in a DCMG as presented in [36] is regulated using a SMC while ensuring the proper power sharing among different components. However, the DCMG in [36] utilizes a single ESS while employing an SMC which cannot tackle the fast transients. An effort is made in [37][38][39] where a HESS is used for balancing the power mismatch in DCMGs under different conditions. However, the SMC in [37][38][39] are designed by considering only the dynamics of converters and ignoring the dynamic properties of energy sources. Moreover, the basic sliding surface is considered to design all these SMCs which cannot ensure the faster convergence of the DC-bus voltage to its desired value. Hence, it is significantly important to design an SMC for DCMGs by appropriately selecting the sliding surface that can ensure the faster convergence. Furthermore, the power dispatch from different components requires an energy management system (EMS) which is not covered with these SMCs.
This paper focuses to design an EMS-based nonlinear decentralized double-integral SMC (DI-SMC) for DCMGs having HESSs (mainly, BESSs and SCESSs) and SPV units supplying DC loads. The EMS is developed to determine the power dispatch requirement from HESSs through charging and discharging depending the power generation from SPV units and load demands. The proposed EMS will assist to prolong the lifetime of BESSs by appropriately compensating the fast transient through the SCESS as well as to generate the set point for the controller in DC-DC converters. Here, the DC-DC converters are controlled using the proposed DI-SMC and the relevant control laws are obtained by considering the double integral action on the sliding surface to minimize steady-state errors during severe transients. The control actions for DC-DC converters with the SPV unit and bidirectional DC-DC converters with the BESS and SCESS ensure desired DC-bus voltage tracking under any operating situations, that is, changes in the output power of the solar PV unit. The Lyapunov stability theory is used to assess the overall stability of DCMGs with the proposed DI-SMC. The performance of the proposed EMS-based decentralized DI-SMC is analyzed in both simulation and processorin-loop by considering different operating scenarios of the DC microgrid and comparative results are presented against a PI controller.

SYSTEM CONFIGURATION AND DYNAMICAL MODELING OF DCMGs
This section aims to discuss the system configuration and modeling used in this work through different subsections as outlined below.

System configuration
The overall configuration of the proposed DCMG is depicted in Figure 1 which includes the SPV unit as the major power genera-  Figure 1 includes a BESS and SCESS to store the excess energy and release the energy depending on the generation surplus and deficit, respectively, to meet the load demand. The SPV unit and HESS are connected to the DC-bus through converter whereas the DC load is directly connected to the DC-bus. Hence, the SPV is the main source to supply the DC load while the HESS smoothens the fluctuations to ensure the power balance and maintain a constant DC-bus voltage. The converter used with the SPV unit is basically a DC-DC boost converter as its output voltage is lower than the DC-bus voltage. The main reason for supplying the load demand through the power generated from only the solar photovoltaic system is that the application scenario is considered for small-scale systems in rural and remote areas. Hence, the hybrid system is not considered. Furthermore, the inclusion of wind turbine might be noisy for rural and remote communities. At the same time, DC-DC converters with the BESS and SCESS are bidirectional buck-boost in nature as the energy is stored at a lower voltage and released at a higher voltage. In this work, the SPV uses a maximum power point tracking (MPPT) algorithm based on the incremental conductance method for extracting the maximum power under varying climate conditions. Here, the SCESS is considered in conjunction with the BESS for providing auxiliary services during the fast transient which in turn reduces the stress on the battery and keeps the battery safe from frequent charging and discharging, thereby, increasing the lifetime and efficiency. This work considers the battery energy storage systems (BESS) as the main element for storing energy and ensuring the power balance in DC microgrids due to its cost effectiveness while comparing with other storage technologies such as the supercapacitor, superconducting magnetic energy storage system (SMESS), and flywheel. The supercapacitor, SMES, and flywheel provides faster transient response than the BESS. While considering the cost for these technologies, the supercapacitor provides a better trade-off between the cost and transient performance. Hence, the supercapacitor is used in this work in conjunction with the BESS.

Dynamical modeling of SCESSs
The dynamical model of a SCESS with a bidirectional DC-DC converter as shown in Figure 2, using the concept of averaging where i sc is an output current of the SCESS, v sc is a terminal voltage of the SCESS, v dc is the common DC-bus voltage, r sc is an internal resistance of the SCESS; L sc is the inductance of the converter, r Lsc is an internal resistance of the inductors, C 01 is an output capacitance of the SCESS, R load is the load resistance, and u sc is the switching control signal of the converter coupled with the SCESS.

Dynamical modeling of BESSs
The equivalent circuit of a BESS along with a converter is shown in Figure 3 and the dynamical model can be obtained based on this figure which can be written as: where i b is the output current of the BESS, v b is the controlled voltage of the battery, L b is the inductance of the converter, r b is FIGURE 4 Equivalent circuit configuration of a SPV unit with a converter the internal resistance of the battery, r Lb is the internal resistance of the converter, C 02 is the output capacitor of the BESS, and u b is the switching control signal of the converter coupled with the BESS. It should be noted here that the charging and discharging of the BESS is carried out depending on the maximum and minimum state of charge (SoC) along with the maximum limit of charging and discharging currents to protect the BESS from overcharging and discharging. This condition can be explained as follows: where SoC b is the state of charge of the battery. The dynamic of the SoC needs to be considered for the battery if the switching frequency is high, for example, 100 kHz or so. The model is considered based on the switching frequency of 10 kHz. The main reason for this is that the use of high switching frequency will incorporate more losses which in turn will reduce the overall efficiency of the system.

Dynamical modeling of SPV units
The equivalent circuit configuration of a SPV unit along with a DC-DC boost converter is shown in Figure 4 from where the dynamical model can be obtained as: where v pv is the output voltage of the SPV; i pv is output current of the SPV unit; i Ls is the current flowing through the internal inductance L sp and resistance r Ls of the converter; C pv is the output capacitance of the SPV unit; C 03 is the output capacitance of the SPV unit; R load is a load resistance; and u pv is the control signal for the DC-DC boost converter coupled with the SPV unit.
It is worth mentioning that the proposed scheme is developed in a generalized way. It is applicable to all converters including dual active bridge (DAB) converters and several DC-DC converters in different configurations as long as their corresponding dynamical models can be represented in the form of a generalized nonlinear system model. It is worth mentioning that all converters model can be represented in the generalized form of a nonlinear system as the linear system is even a class of nonlinear systems with only one operating point. For all cases, the proposed controller will ensure the desired power sharing. The following section shows the proposed DI-SMC design based on all these dynamical models.

DI-SMC DESIGN FOR DIFFERENT COMPONENTS OF DCMGs
In this section, the design procedure of the DI-SMC is described for the SCESS, BESS and SPV unit. The main objective is to obtain the control laws for corresponding converters with these components using the proposed scheme to make sure that the DC-bus voltage is maintained at the desired value while ensuring the desired tracking of other properties such the current and internal voltage depending on the variables in the average state-space model. The Lyapunov stability theory is embedded within the design process to assess the stability of DCMGs with the proposed control scheme. The following sections present the derivation of control actions for converters with different components in the DCMG as shown in Figure 1.

DI-SMC controller design for the converter with the SCESS
First, the output current tracking error (e i,sc ) of the SCESS can be defined as the difference between the reference (i sc,re f ) and the actual values which can be written as: where the value of i sc,re f is generated using the decision from the EMS based on the DC-bus voltage tracking as shown in the following equation: where k p,sc and k i,sc denote proportional and integral gains of the PI controller, respectively. The dynamic of e i,sc using Equation (1) can be written as: where sc = 1 − u sc . According to design objective, the double integral sliding surface (S sc ) can be defined as follows: where 1 , 1 , 2 , 1 , and 2 are design parameters for the controller which need to determine in a way that S sc → 0 in a finite time. For analyzing the convergence with the proposed DI-SMC, the dynamic of the sliding surface can be written as follows:Ṡ sc = 1̇ei,sc + 1 |e i,sc | 1 sgn(e i,sc ) Using Equation (7), Equation (9) can be rewritten as: with From Equation (11), ( sc−eq ) can be expressed as follows: The switching control or reaching law ( sc−sw ) for compensating disturbances can be considered as follows: where k sc and sc are user defined positive coefficients. At this point, the overall control law can be expressed as: Using Equations (12) and (13), Equation (14) can be written as: ] .
The substitution of Equation (15) into Equation (10) will yield: The stability for this component can easily be assessed by considering the following Lyapunov function (V sc ): The derivative of V sc using Equation (16) can be simplified as:V with |S sc | = S sc sgn(S sc ). Equation (18) clearly indicates that the control law for the super-capacitor stabilizes the system and helps to achieve the desired DC-bus voltage. The derivations of control laws for converters with the BESS and SPV unit are discussed in the next subsections.

DI-SMC controller design for the converter with the BESS
This subsection includes the control input for the converter with the BESS which is derived using the same approach as described in the previous subsection. Therefore, the derived control law for the BESS is provided in the following equation without any repetition: where e i,b = i b,re f − i b represents the tracking error for the output current of the battery with

DI-SMC controller design for the converter with the SPV unit
Typically, the boost converter of a SPV unit is controlled by regulating inductor current (i Ls ) where the reference current (i Ls,re f ) is calculated by regulating the reference output voltage (v pv,re f ) of the SPV unit. However, the control input is derived using the similar approach adopted for the SCESS as discussed earlier which is derived as: where e i,pv = i Ls,re f − i Ls with i Ls,re f = k p,pv (v pv,re f − v pv ) + k i,pv ∫ (v pv,re f − v pv )dt ; k p,pv and k i,pv denote proportional and integral gains of the PI controller; k pv and pv are user defined positive coefficients; T pv = 5 |e i,pv | 5 sgn(e i,pv ) + ∫ 6 |e i,pv | 6 sgn(e i,pv )dt ; 3 , 5 , 6 , 5 , and 6 are userdefined control parameters and positive constants; and S pv (t ) = 3 e i,pv + ∫ 5 |e i,pv | 5 sgn(e i,pv )dt + ∫ ∫ 6 |e i,pv | 6 sgn(e i,pv )dtdt is the sliding surface.
This proposed control scheme is developed based on the classical model. However, the key innovative feature of this scheme is the inclusion of the double integral action in the control scheme and the use of supercapacitor for handling the transient behaviors with changes in both power generation and load demand. Furthermore, the utilisation of a DI-SMC is new for these types of applications.

EMS FOR DC MICROGRIDS
In this work, the proposed EMS is developed as a supervisory framework which is shown in Figure 5. As mentioned earlier, the maintenance of the power balance in DCMGs is a quite challenging task as the output power of SPV units and power consumed by loads are highly unpredictable which introduces the power mismatch and leads the instability of the DC-bus voltage. The net power flow among different components with the DCMG will be monitored by the EMS in order to achieve the stable DC-bus voltage. The net power flow in DCMGs can be described as: where P net is the net power flow in DCMGs, i dc = C dc dv dc dt is the DC current, dv dc dt is the change in the DC-bus voltage, P pv is the output power of the SPV unit, P b is the battery power, P sc is super-capacitor power, and P loss is the power loss. From Equation (21), it can be seen that the power imbalance in DCMGs can be aroused in the form of surplus or deficit power modes which cause rise or drop in the DC-bus voltage, respectively. The EMS monitors the status of DC-bus voltage, output power of the SPV unit, load demand, energy level of the BESS including its SoC, and energy level of the SCESS through the measurement devices (e.g., sensors) in order to regulate the current, output voltage for appropriately sharing power among different components in DCMGs. Based on these information, the proposed EMS helps to determine the reference signal for the DI-SMC to achieve the desired control objective. The proposed EMS as presented in Figure 5 can be operated based on two modes: surplus and deficit power modes under different working conditions of DCMGs as briefly discussed in the following.

Deficit power mode (DPM)
The DPM is defined when the power generated by the SPV unit is not sufficient to meet the load demand, that is, P pv < P load . In order to obtain the power balance and stability of the DC-bus voltage in the DCMG, the deficit power (i.e., the difference between the power generated by the SPV unit and load demand) will be supplied by the HESS where the HESS will be controlled through the proposed DI-SMC based on this calculation. Depending on the situation, the EMS will coordinate with the respective controller in a way that the HESS will be sufficiently discharged (definitely, subject to the available capacity) to ensure the power balance which in turn ensures the stabilization of the DC-bus voltage. There will be four possible cases associated with the DPM in a DCMG as shown in Figure 5 for obtaining the power balance which are explained in this subsection.

DPM1
This DPM is related to the calculation of the reference value for the discharging current where the EMS observes the SoC limit of the BESS and SCESS. This reference value is calcu-lated to supply the difference between the output power of the SPV power and load demand. If the combined SoC level of both BESS and SCESS is higher than the minimum SoC level and the reference value of the discharging current for the HESS is lower than their corresponding peak discharging currents, the HESS will compensate the power deficit by releasing the stored energy. Therefore, the power balance managed through the HESS with ensure the fastest voltage stability. In this case, the SCESS is discharged first to compensate the transient behaviors due to large fluctuations in the output power of the SPV units and variations in load demands.

DPM2
This mode demonstrates the situation when the SoC of SCESSs decreases to a level lower than the minimum limit due to the consumption of the stored energy in other deficit modes. In this mode, it is considered that the SoC of the BESS is still higher than its minimum level and its available energy is still sufficient to make up the power deficit. Hence, the BESS will release the energy and the converter with the BESS will be controlled based on the reference value of the discharging current.

DPM3
This mode appears when the BESS is fully exhausted as its SoC reaches to the lower limit due to the energy release for supplying the load demand. However, the SCESS is capable to partially supply the load demand. For this reason, the load shedding occurs to maintain the power balance and DC-bus voltage stability of the DCMG.

DPM4
In this DPM, it is considered that the HESS is fully discharged and the load is partially supplied by the primary source, that is, the SPV unit but still not enough to meet the desired load demand. Therefore, the load shedding is imposed by EMS to ensure the power balance without violating the DC-bus voltage limit.

Surplus power mode (SPM)
In this mode, it is considered that the power generated by the SPV unit is higher than the required load, that is, P pv > P load . Therefore, the surplus energy needs to be stored into the HESS in which the converter is controlled based on the decision from the EMS. There are also four possible SPMs that depict different situations in the DCMG.

SPM1
The mode assesses the net power flow in the DCMG to calculate the reference value of the charging current for the HESS.
If the SoC and charging current of the HESS are within their limits, the HESSs, that is, both BESS and SCESS participate in charging to store the excess energy for stabilizing the DCvoltage and ensuring the power balance. Here, the SCESS gets the priority over the BESS for charging up to a certain limit as it is used first to eliminate the transient behaviors in the DCMG.

SPM2
The SoC of both BESSs and SCESSs increases due to the continuous charging operation while monitoring the charging current and SoC limits of the HESS to prevent from overcharging. In this mode, it is assumed that the SoC of the BESS reaches to its higher limit first and the SCESS still has some available capacity as its SoC is lower than the maximum SoC limit. Here, the reference value of the charging current needs to be maintained within its limit to charge the SCESS.

SPM3
This mode appears when the SCESS is fully charged but the BESS is still capable to store the energy as its SOC is low than the maximum threshold. Hence, the power balance is achieved through the BESS and the stabilization of the DC-bus voltage is guaranteed for the stable and reliable operation of the DCMG.

SPM4
This mode is an extension of SPM3 where the HESS (i.e., both the BESS and SCESS) is to store the excess energy. However, the power generated from the SPV unit is still higher than the load demand and this excess power is compensated using the dummy load (DL).

FIGURE 6 Implementation block diagram of the proposed EMS-based DI-SMC
Based on all these DPMs and SPMs, the performance of the EMS-based DI-SMC is evaluated in the next section.

CONTROLLER PERFORMANCE EVALUATION
To demonstrate the effectiveness of the designed nonlinear decentralized DI-SMC, a similar DCMG as shown in Figure 1 is used. In this system, the nominal value of the DC-bus voltage is considered as 120 V. Since the load demand in a DCMG is highly unpredictable its minimum and maximum values are set as 4 kW and 10 kW, respectively. In addition, the capacity of the SPV unit is maintained as 9 kW which is obtained at the rated solar irradiance and temperature conditions. However, the solar irradiance and temperature are highly fluctuating which lead to a continuous variation of the power generated from the SPV unit in the DCMG. The lithium-ion battery is used as the BESS and the nominal terminal voltage of both BESS and SCESS is set as 72 V. The capacities of the BESS and SCESS are considered as 500 Ah and 42 Ah, respectively.
The implementation block diagram of the designed nonlinear DI-SMC along with the EMS is shown in Figure 6. From Figure 6, it can be seen that the reference value of currents for the different components of the DCMG that will be controlled are determined from the EMS. Based on the reference signal and local measurement, the designed DI-SMC for each component regulates the switching actions for relevant converters. It is worth noting that all these reference are calculated to make sure that the desired DC-bus voltage tracking is ensured. Hence, the designed controller will ensure both the stabilization of the DC-bus voltage and sharing of appropriate power under different operating points. The effectiveness for the DI-SMC against transients in the DCMG is compared with a PI controller. All simulations are carried out in MATLAB/Simulink platform along with further validation in the PIL platform as discussed below.

Simulation results
The performance of the DI-SMC is analyzed for a duration of t=0 s to t=18 s which is segmented into different intervals to demonstrate different operating modes as discussed earlier. During the first interval, that is, from t=0 s to t=6 s, it is assumed that the SPV unit is generating 9 kW by operating under standard atmospheric conditions while load demand is only 5 kW. Hence, this indicates an SPM having an excess power of 4 kW which will be stored into the BESS or SCESS depending on the available capacity of the HESS. Since this is the start of the operation, it is assumed that both BESS and SCESS are capable to store the energy corresponding this excess power. The power profiles of different components in this DCMG are shown in Figure 7 and the charging characteristics of both BESS and SCESS are shown in Figure 8 while Figure 9 shows the dynamic stability of the DC-bus voltage. This intervals correspond to SPM1 of the EMS. At t=6 s, the solar irradiance is suddenly dropped to 0.5 kW/m 2 due to varying weather conditions and it continues until t=12 s while the temperature is kept constant at 298 K. From t=6 s to 8 s, the load demand is 5 kW which is fully supplied by the power generated from the SPV unit. Therefore, the BESS and SCESS are not being charged or discharged which can be clearly seen from the corresponding power profiles in Figure 7 and the charging/discharging profiles in Figure 8. The effectiveness of the DI-SMC against this environmental change can be found from dynamic stability of power profiles of different components in Figure 7 and DC-bus voltage in Figure 9.
During the time interval t=8 s to 12 s, the load demand suddenly increases from 5 kW to 10 kW as shown in Figure 1b and the power generated from the SPV unit is 5 kW. This interval introduces a DPM in the DCMG with an amount of 5 kW. The HESS releases the energy by appropriately discharging the BESS and SCESS (please see Figure 8) which can be clearly found from power profiles in Figure 7. The effectiveness of the DI-SMC can be evident from Figures 7 and 9 which clearly demonstrate post-transient steady-state responses of power and DC-bus voltage. This mode corresponds to DPM1 of the EMS.
At t=12 s, the power generation from the SPV unit is increased from 5 kW to 8 kW which continues until t=16 s whereas the load demand is kept as 10 kW until t=13 s. Therefore, the deficit power is 2 kW which can be seen in Figures 7a  and 7b, respectively. Both BESS and SCESS release energy equally to forfeit the deficit as shown in Figures 7c and 7d while their corresponding discharging profiles representing the SoC can be found in Figure 8. At t=13 s, the load demand is shifted to 5 kW which is continued until t=18 s as shown in Figure 7b. From t=13 s to t= 16 s, the SPV unit is generating 8 kW and this interval enters into an SPM having an excess power of 3 kW that will be stored into the BESS and SCESS as can be evi-  Figures 7c and 7d, respectively, and charging profiles in Figure 8. The stability of the DC-bus voltage can be evidenced from Figure 9.
The final interval of the simulation is considered from t=16 s to t=18s in which the output power of the SPV unit is dropped to 0 kW due to the unavailability of the sunlight while the load demand is still 5 kW. During this interval, the power shortage in the DCMG is 5 kW which is balanced by both BESS and SCESS as the SoC of is higher than the minimum SoC as shown in Figure 8. In all intervals, both controllers achieve the power balance and ensure the desired DC-bus voltage though the designed nonlinear DI-SMC controller provides the fast transient response having less overshoots/undershoots and faster settling times as compared with the PI controller. Furthermore, it is observed that the nonlinear DI-SMC controller provides the lower steady-state error in comparison with the PI controller.
The benefits of having the HESS is further justified by considering the condition where the DCMG operates with and without the SCESS. This has been carried out by considering the similar output power profile of the solar PV unit as shown in Figure 7a. The corresponding power profiles (mainly for the load and BESS), DC-bus voltage, and SoC of the BESS are  Figures 10, 11, and 12, respectively. From Figures 10  and 11, it can be clearly observed that the HESS can provide the quick power response and DC-bus voltage stabilization due to the fast dynamic response of the SCESS as compared to the situation having only the BESS. Furthermore, the inclusion of the SCESS reduces the transient effect on the BESS which in turn enhance its operating life cycles by reducing the stress as shown in Figure 12. Thus, it can be concluded that the HESS is capable to handle the transient effect in a much better way while comparing only the BESS under various operating scenarios of the DCMG.

PIL validation
The theoretical analyses and simulation results for the DI-SMC are further validated through the PIL platform in which the same system, that is, the DC microgrid is used. Here, the DC microgrid is kept in the MATLAB/Simulink platform and the control inputs are fed back to a practical processor (Rasberry Pi 3B Quad-Core 64-bit Microprocessor Development Board) through a PIL block as shown in Figure 13 and the control signals generated from this processor are used to control the converters. This means that the control signal is generated in the practical environment. Here, the development board receives analog signals for all set points which are determined by the EMS algorithm together with the respective actual measured values of all components. After processing all these data, the computer generates the corresponding control signal for each converter within the system which are then transferred and supplied as an analog signal to the switching pulse generator. The Ethernet cable as depicted in Figure 13 is used to send and receive all data between the development board and the MAT-LAB/Simulink. It is worth mentioning that the parameters used in the experiment are kept the same as those used in the simulations as described earlier on. Several cases are then considered by changing the power generation and load demand.
At the beginning (i.e., from t=0 s to t=3 s), the output of the SPV unit is considered as 9 kW at standard atmospheric conditions while the load demand as 5 kW till t=6 s as shown in Figures 14a and 14b, respectively. During this interval, the EMS monitors the net power flow and there will be a power surplus of 4 kW that will be stored into both BESS and SCESS as their SoC is lower than the maximum SoC limit as depicted in Figure 15. From these responses, it can be seen that the power balance is achieved with the DI-SMC which is an indication of the dynamic stability of all power responses and the common DC-bus voltage as shown in Figures 14 and 16, respectively. These responses also indicate better transient behaviors while comparing with the PI controller.
Afterward, the sudden variation in the solar irradiation from 1 kW/m 2 to 0.5 kW/m 2 occurs at t=3 s for which the generated power from SPV unit is recorded as 5 kW and this generation scenario continues till t=9 s as illustrated in Figure 14a. The response in Figure 14b demonstrates that the load demand is kept as the same to that of the previous condition (i.e., 5 kW). Thus the load demand is fully met by the solar power generation system. During this interval (i.e., from t=3 s to t=6 s), the EMS generates all set points for the controller by monitoring the net power flow in such a way that the HESS does not perform charging or discharging operations. This operation is clearly justified by the obtained results depicting the dynamic response of the power profiles, SoC, and the main DC-bus voltage as shown in Figures 14, 15, and 16, respectively.
At t=6 s, the load demand suddenly increases from 5 kW to 10 kW which continues till t=9 s as can be seen from Figure 14b whereas the output power of the solar PV generator is 5 kW as shown in Figure 14a. Hence, the total shortage power is 5 kW for this interval which needs to be supplied by the BESS and SCESS based on the reference command from the EMS. The power sharing responses and discharging operations of the storage systems as shown in Figures 14 and 15, respectively, ensure the power balancing. Moreover,the effectiveness of the DI-SMC is obvious from Figures 14 and 16 which clearly illustrate at the instant of the transient as well as during the post-transient responses of power profiles and the common DC-bus voltage. Therefore, it can be summarized that the proposed scheme works perfectly for the DPM.
From t=9 s to t=11 s, the load demand is reduced from 10 kW to 5 kW whereas the generation from the SPV unit is increased from 5 kW to 9 kW owing to changes in the solar irradiation (i.e., 1 kW/m 2 ). The total surplus power in this mode is 4 kW which is stored into the HESS as the SoC for both storage systems is lower than their maximum SoC. Figure 15 depicts the corresponding charging profiles of the BESS and SCESS. The corresponding power responses and main DC-bus voltage responses are demonstrated in Figures 14 and 16, respectively, which clearly demonstrate the power balance in the DCMG.
Finally, from the extensive simulation studies and the PIL validation, it can be concluded that the designed EMS-based DI-SMC for a DCMG with the HESS significantly enhances the transient and dynamic stability under different operating scenarios.