2.2.3. Li-Ion Battery Thermal Model

Following the development in [14] the dynamics of Li-ion battery thermal model block is described by the following equations:

$$mc\_p \frac{dT\_c}{dt} = hS(T\_0 - T\_c) + R\_{in} \mu^2 \tag{14}$$

$$T\_c(\mathbf{s}) = \frac{R\_{th}P\_{loss} + T\_0}{T\_{th}\mathbf{s} + 1},\ P\_{loss} = R\_{in}\mu^2\tag{15}$$

$$R\_{in}(T) = R\_{in}|T\_0 + \exp\left(\csc\left(\frac{1}{T\_c} - \frac{1}{T\_0}\right)\right), \csc = \frac{E}{RT} \tag{16}$$

$$K\_{\mathbb{P}}(T) = K\_{\mathbb{P}}|T\_0 + \exp\left(\beta(\frac{1}{T\_c} - \frac{1}{T\_0})\right), \beta = \frac{E}{RT} \tag{17}$$

where, the variables and the coefficients have the following significance and values:

*m*the mass of the battery cell [kg]

*cp* the specific heat capacity [J/molK]

S—the surface area for heat exchange [m2]

*Tc* the variable temperature of the battery cell [K]

*T*0the ambient or reference temperature [K]

*Rin*(*T*)the value of internal resistance of the battery cell dependent on temperature [Ω]

*Kp*(*T*)ppolarization constant of Li-ion Battery [V]

*u*the input charging and discharging profile current [A]

*Tc*(*s*)the internal temperature of the cell [◦K] in complex s–domain (the Laplace transform)

*Rth* thermal resistance, cell to ambient (◦C/W), *Rth* = 6 [◦C].

*Tth*the thermal time constant, *Tth* = 2000 [s]

*Ploss*the overall heat generated (W) during the charge or discharge process [w]

<sup>∝</sup>, βArrhenius rate constant

*E*—the activation energy, *E* = 20 [kJ/mol]

*R*Boltzmann constant, *R* = 8.314 [J/molK]

In MATLAB simulations, the battery temperature profile, and the robustness of the proposed SOC battery estimators are tested for the following approximate values, closed to a commercial battery type ICP 18,650 series [14]:

$$S = 15.4E-3\begin{bmatrix}m^2\end{bmatrix}, m = 0.0375\ \text{[kg]}, \ c\_p = 925\ \text{[J/kgK]}, h = 5[w], \ t\_0 = 20\ \text{[}^\circ\text{C]}\tag{18}$$

*Batteries* **2020**, *6*, 42

An accurate simplified thermal model is provided in MATLAB R2019b library, at MATLAB/Simulink/Simscape/Battery, for a Li-ion generic battery model, implemented in Simulink Simscape as is shown in Figure 8, as is developed in [14]. The Equations (17) and (18) reveal a strong dependence of the internal resistance *Rin*(*T*) and the polarization constant *Kp*(*T*) of the Li-ion battery Simscape model.

**Figure 8.** The detailed Simulink diagram of the Simulink Simscape thermal model block (see [14]).

Since the internal resistance of the Li-ion battery is the most sensitive to temperature developed inside the Li-ion battery, an overall Simulink model diagram block is designed that also integrates the Li-ion battery models such as is shown in Figure 9. It is essential to emphasize the fact that for performance comparison purpose, the overall Simulink model diagram shown in Figure 9, is sharing the same simplified thermal model to have an identical profile temperature and values of internal resistance *Rin*(*T*) and polarization *Kp*(*T*) .

**Figure 9.** Simulink Simscape model diagram setup that integrates two main blocks. Legend: First block from bottom side encapsulates the Li-ion battery model and Simulink thermal model block; Second block from the top side is a Simscape block with two Li-ion batteries, first one from the top simulate the temperature effects and second one from the bottom of first one doesn't take into consideration the temperature effects.

It is important to remark that in Figure 9 the second block from the top of the Simulink diagram is introduced only to investigate the SOC and temperature profile evolutions delivered by the first block from the bottom side in comparison to SOC and the temperature profile delivered by the top side block. The ambient temperature profile and the output temperature of the Simulink Simscape thermal model described by Equations (15)–(18) are shown in Figure 10a,b respectively.

**Figure 10.** (**a**) The input ambient temperature profile; (**b**) the output temperature as response to input ambient temperature of the thermal model block.

The evolution of the battery internal resistance *Rin*(*T*) and polarization constant *Kp*(*T*) at room temperature t0 = 20 ◦C, is shown in Figure 11a,b.

**Figure 11.** (**a**) The internal battery *Rin*(*T*) at ambient temperature (20 ◦C); (**b**) The polarization constant at ambient temperature Kp(T) (20 ◦C).

The output temperature profile of the Simulink Simscape thermal model for changes in ambient temperature is shown in Figure 12a, and the effects on internal battery resistance *Rin*(*T*) and polarization *Kp*(*T*) are presented in Figure 12b,c.

**Figure 12.** (**a**) The effect of changes in ambient temperature, shown in Figure 10a, on output temperature profile; (**b**) The effect of changes in ambient temperature on the internal resistance *Rin*(*T*); (**c**) The effect of changes in ambient temperature on the polarization constant *Kp*(*T*) .

2.2.4. RC ECM Li-ion Battery Model—MATLAB Simulink Simulations Result

The MATLAB simulations result of 3RC ECM Li-ion battery model implementation is shown in the Figures 13 and 14. In Figure 13a,b are depicted the FTP current profile test (a), and the value of 3RC ECM Li-ion model SOC versus ADVISOR SOC estimate to the FTP current profile test (b) obtained on NREL ADVISOR MATLAB platform as shown in Figure 5.

**Figure 13.** 3RC ECM Li-ion battery model (**a**) The Federal Test Procedure (FTP)-75 current profile test; (**b**) The corresponding 3RC ECM SOC true value versus ADVISOR state of charge (SOC) estimate (Li-ion battery model validation).

**Figure 14.** (**a**) Li-ion battery terminal voltage; (**b**) the OCV = f(SOC) curve for a discharging constant current at 1C-rate (6A); (**c**) the Li-ion battery voltage; (**d**) the Li-ion battery SOC for a discharging constant current at 1C-rate (6A).

Using a MATLAB magnification tool on two portions of the graph, the visibility of both curves shown in Figure 13b increases considerably [26]. The Li-ion battery terminal voltage for an FTP-75 current charging and discharging profile test, the following three, namely OCV = f(SOC) curve, battery terminal voltage and its SOC, all of these three simulated for a constant discharge current at 1C-rate (6A), it can see in the Figure 14a–d.

The simulation results from last three Figure 14b–d reveal that all three battery characteristics are quite close to the manufacturing specifications. It should also be noted that the OCV = f(SOC) curve from Figure 14b is almost flat on a large portion. Therefore, the Coulomb counting method is not accurate for direct SOC measurement for Li-ion batteries. Thus, its estimation is necessary using one of the best known Kalman filtration techniques.

### 2.2.5. RC ECM Li-Ion Battery Model—MATLAB Model Validation

For validation of 3RC ECM Li-ion battery model, in the first stage is calculated the model SOC residue as a difference between the SOC values of the 3RC ECM model and the estimated values of ADVISOR SOC estimator. The SOC accuracy performance of 3RC ECM Li-ion battery model is analyzed by evaluating the SOC residual error. The residual percentage error is depictured in Figure 15.

**Figure 15.** The Li-ion battery SOC accuracy performance assessment–SOC residual.

The results of the MATLAB simulations shown in Figure 13b for a current FTP-75 driving cycle profile test reveal excellent SOC accuracy of the 3RC ECM compared to the estimated SOC value obtained by the ADVISOR simulator. From a quantitative point of view, this confirms the information extracted by evaluating the SOC residues generated in MATLAB and presented in Figure 15. From Figure 15 it can be seen that the SOC residue is in the range [−1.1, 0, 4], and the SOC error rate is less than 1.2%, which is an excellent result, comparable to those reported in the literature, even better. This result reveals that the 3RC ECM Li-ion battery model is very accurate in terms of SOC calculation, and the model is undoubtedly validated based on available information about its behaviour.

### **3. Li-Ion Battery Simscape Generic Model**

A full representation of the generic battery model, dependent on the temperature and ageing effects, is developed by MathWorks team, as shown in the MATLAB R2019b/Simulink/Simscape/Power Systems/Extra Sources Library-Documentation.

### *3.1. Li-Ion Battery Simscape Generic Model—Description and Parameters' Specifications*

Li-ion battery cell specifications for a Simscape model are shown in Figure 16a–c. The Li-ion battery Simscape model is more realistic and suitable to operate safely in different conditions. Also, this model is beneficial for an appropriate choice of battery chemistry and for different parameters specifications. The Simscape generic model developed by MathWorks team takes into consideration the thermal model of the battery (internal and environmental temperatures) and its ageing effects. The battery terminal voltage, current and SOC "can be visualized to monitor and control the battery SOH condition" [14].


**Figure 16.** SAFT Li-ion battery specification—Simscape model; (**a**) Simscape model graphic representation (icon); (**b**) block parameters and battery type; (**c**) block parameters' battery specification for a discharging constant current.

The nominal current discharge characteristics according to a choice of a Li-ion battery which has a rated capacity of 6 Ah and a nominal voltage of 3.6 V for different x-scales (time, Ah) are shown in the Figures 17 and 18.

**Figure 17.** SAFT Li-ion battery nominal current discharge characteristic @1C (6A) (top side view); @6.5A, 13A and 32.5A (bottom view)—Simscape non-linear model (x-scale is the time in minutes).

**Figure 18.** SAFT Li-ion battery nominal current discharge characteristic @1C (6A) (top side view); @6.5A, 13A and 32.5A (bottom view)—Simscape nonlinear model (x-scale is the capacity in Ampere-hour (Ah)).

The Simscape model of a generic 6 Ah and 3.6 V Li-ion battery SAFT-type without temperature and ageing effects is shown in Figure 19, the same shown in [14], p. 12.

**Figure 19.** The Simscape model of a generic 6 Ah and 3.2 V Li-ion battery (without temperature and aging effects (see [14], p. 12) connected to FTP-75 input current profile.

A significant advantage of the Simscape model of Li-ion battery is the simplicity with which the model parameters for different chemistry and specifications are extracted as if we had access to the specifications of the battery manufacturers. The parameters of Li-ion battery choice extracted from the discharge characteristics shown in Figure 17 or Figure 18 have the following values:

$$E\_0 = 4.5646 \,\text{[V]}, R\_{in} = 0.006 \,\text{[ $\Omega$ ]}, \,\text{K}\_p = 0.0054929 \,\text{[V]}, \, A = 0.00029416, \, B = 10.1771 \,\text{
(19)}$$

where

*E*0 denotes the battery constant voltage [V]. *Rin*designates the internal resistance of the battery [Ω]. *Kp*is the polarization battery voltage constant [V]. *A*represents the exponential zone amplitude [V]. *B*meanstheexponentialzonetimeconstantinverse[1/(Ah)].

### *3.2. Li-Ion Battery Simscape Model—Discrete Time in State Space Representation*

The Simscape model parameters suggested in Figures 16–18 fit the following adopted model represented in discrete time in a unidimensional state space, like the model developed in [14], p. 21:

$$\mathbf{x}\_1(k+1) = \mathbf{x}\_1(k) - T\_s \left(\frac{\eta}{\mathbb{Q}\_{\text{num}}}\right) \times \boldsymbol{\mu}(k) \tag{20}$$

$$y(k) = E\_0 - \frac{K\_p T\_s}{x\_1(k)} \times u(k) + A \exp\left(-\frac{BQ\_{\text{nom}}}{\eta}(1 - x\_1(k))\right) - R\_{\text{in}} u(k) \tag{21}$$

where *<sup>x</sup>*1(*k*) - *<sup>x</sup>*1(*kTs*) = *SOC*(*kTs*) , *<sup>u</sup>*(*k*), *y*(*k*) , *Qnom* , η and *Ts* have the same meaning as the variables and parameters that describe the 3RC ECM Li-ion battery model given by Equations (12)–(14). It is essential to emphasize a grea<sup>t</sup> advantage of the adopted Simulink Simscape model, presented in (21) and (22), consisting of a considerable model simplification and dependence only on SOC. Also, the dynamics of this model is described by the first Equation (21) which is linear and the second Equation (22) is a highly nonlinear static representation.

The Simulink Simscape model of Li-ion battery that implements Equations (21) and (22) is shown in Figure 20.

**Figure 20.** Simulink Simscape Diagram of Li-ion model. The values of the parameters from Simulink diagram are allocated in a MATLAB script that runs first for initialization, and then is running the Simulink model to extract these values from MATLAB workspace.

### *3.3. Li-Ion Battery Simscape Generic Model—MATLAB Simulations Results and Model Validation*

The MATLAB simulations result is shown in Figure 21a,c.

**Figure 21.** Simscape model Li-ion battery SOC accuracy assessment (**a**) Li-ion battery Simscape model SOC versus ADVISOR SOC estimate; (**b**) SOC residual; (**c**) terminal output voltage.

In Figure 21a, the simulation result reveals an excellent SOC accuracy of the Simscape model of the Li-ion battery. This result is also supported by a small SOC residue, recorded in Figure 21b, which falls in the range [−1.4, 1]. Like the 3RC ECM Li-ion battery model, the Simscape model of the Li-ion battery based on the available information extracted from Figure 21a,b also works very well, because the SOC error percentage is less than 1.4%, compared to the typical value of 2% reported in the literature for similar applications. These results also validate this model, which is suitable to use it in the second part for real-time design and implementation on an attractive MATLAB 2020Ra environment.

### *3.4. Simulink Simscape Graphic Models Integrated in Fuel Cell HEV Applications—Energy Management System*

This section presents some HEV applications that operate with graphic Simscape models. In this description, the Simscape "blocks language" allows much faster models of physical systems to be created within the Simulink environment, "based on physical connections that directly integrate with block diagrams and other modeling paradigms" [8]. In Simscape, the models can be parametrized using MATLAB variables and expressions and can be designed and implemented control systems for any physical system in Simulink". Users can easily integrate physical object icons into the design of Simulink diagrams or combine object models with the symbols of di fferent physical objects. Indeed, behind each image is encapsulated the dynamic pattern of physical objects. However, it significantly eliminates the user's e ffort to write a lot of equations for modelling the dynamics of objects, which takes a long time, and the diagrams become much more complicated [8].

3.4.1. Hybrid Energy Storage of Energy Management System (EMS)—Simulink and Simscape Components Description

The hybrid energy storage (HES) of an EMS, shown in Figure 22, is a hybrid combination of three power sources, such as a fuel cell, Li-ion battery, and supercapacitor [5,7]. The control strategy of HES is implemented in Simulink Simscape to "manage the energy consumption of the hydrogen fuel, and at the same time the pulsed or transient power required (load profile) by the load should be supplied." [11]. To simplify the Simulink diagram of the EMS, are used Simscape components such as Li-ion battery, supercapacitor and FCPM that also encapsulates a hydrogen fuel stack cell Simscape model, provided by MATLAB Simulink Toolbox/Simscape. In this section, a brief presentation of this topic is given, since is only emphasized the fact that using a single power source such as Li-ion battery in driving HEV powertrains applications "has certain disadvantages such as recharging, longevity, poor power density, etc." [24].

**Figure 22.** The adapted EMS of HEV SMCAR—Simulink Simscape diagram (adapted from Noya, [5,7]).

In this diagram other Simscape components are integrated such as three DC–DC boost/buck converters blocks to interface with all three sources. The first is a 12.5 kW fuel cell DC/DC boost converter, with regulated output voltage and input current limitation, and the other are two DC/DC converters for discharging (4 kW boost converter) and respectively for charging (1.2 kW buck converter) the battery system. Normally, a "single bidirectional DC/DC converter can also be used to reduce the weight of the power system" [7]. The FC is controlled by a DC–DC boost converter, an electronic device controlled also by a signal sent by one of five control strategies conceived for this purpose inside the EMS block, as is described in [5]. Similarly, the Li-ion battery and the supercapacitor are controlled by a bidirectional DC-DC buck-boost converters, since during operation they are charging and discharging. The topology configuration and the electronic circuits are well described in [11]. The charging and the discharging cycles of the bidirectional DC-DC converters are controlled by a voltage signal provided by EMS block that adjusts the duty cycles (D) of both DC–DC converters, based on the following relationship [11]:

$$D = \frac{V\_{out}}{V\_{out} - V\_{in}} \tag{22}$$

where *D* is the duty cycle, *Vout* designates the output voltage of the converter, and *Vin* denotes the input voltage. In this section is presented only briefly the most relevant MATLAB simulation results for EMS techniques to have a better insight of the behavior of all three Simscape components of hybrid power sources, i.e., FC, Li-ion battery, and SC (UC). In the Simulink Simscape diagram of fuel-cell hybrid power generation (FCHPG) shown in Figure 22, the inverter DC/AC that supplies the load is rated at 270 V DC in input, and 200 V AC, 400 Hz, 15 kVA in output.

A three-phase load profile is "emulated to consider variations in power at the different timings and simulations to see the behavior of the hybrid energy storage system (HESS) as a whole and the response of each storage system" [11]. Also, a Simscape "15 kW protecting resistor is integrated in the Simulink diagram to avoid overcharging the supercapacitor and battery systems" [7].

### 3.4.2. Hybrid Energy Storage of EMS—Simulink Simscape Applications

As a practical application, the following three scenarios are implemented to reveal the behavior of HESS components:

• Scenario 1: DC grid interfaces only the AC Grid and AC load, such in [7,11].

The HESS distributes the power among the energy sources according to a given energy managemen<sup>t</sup> strategy. The MATLAB simulation results of EMS techniques are shown only for three setups, such as the state machine control strategy (SMCS), classical PI control strategy (PICS), and the equivalent consumption minimization strategy (ECMS) [5,7,25]. To obtain a sound theoretical background on the EMS design and implementation in a real-time MATLAB simulation environment, the following sources [5,7,11,24] provide valuable information. For EMS-SMCS setup shown in Figure 23, the MATLAB simulations result is presented in the Figure 24.

**Figure 23.** The EMS—state machine control strategy setup.

**Figure 24.** SMCAR HEV power–EMS state machine control strategy setup.

In Figure 24 is depictured the powers' distribution for FC, Li-ion battery, UC, and Load profile for a hypothetical SMCAR HEV case study. The balance equation is given by:

$$P\_{\rm F\overline{C}} + P\_{\rm Ratt} + P\_{\rm LIC} = P\_{\rm L} \tag{23}$$

where *PFC* is the power provided by FC, *PBatt* is the power delivered by Li-ion battery, *PUC* is the power delivered by the UC to manage power peaks for vehicle acceleration and regeneration, and *PL* is the load profile (demand, total power required). From Figure 24 it is straightforward to check that Equation (23) is satisfied for each time moment. Also, it is obvious that for load power profile pecks the power delivered by UC is very sharp to cover the power demanded (*PL*).

In the Figure 25a–d are shown the load profile (a), fuel cell voltage (b), fuel current (c) and hydrogen consumption respectively (d), according to the load profile.

**Figure 25.** (**a**) Load profile; (**b**) fuel-cell voltage; (**c**) fuel-cell current; (**d**) fuel hydrogen consumption.

The simulation results in Figure 25 show a decrease in FC battery voltage from 56 V at t = 0 [s] to 42 V at t = 70 [s] and remain almost constant until t = 250 [s], followed by an increase to 48 V at t = 350 [s]. The FC current has the same evolution trend as the FC power, increasing from 0 [A}, to t = 0, at approximately 210 [A] at t = 70 [s]. Inside the window [70, 250] [s] the FC current remains almost constant, and at t = 250 [s] it decreases to 80 [A] at t = 350 [s]. FC fuel consumption follows the same trend as FC current. The amount of fuel increases at the beginning of the simulation to 100 [lpm], then remains almost constant inside the window [70, 250] [s] when it delivers maximum power to the DC network, because in this interval the load power profile reaches some peaks of maximum value between 8 kW and 10 kW.

In the Figure 26a,b are depicted the UC current (a) and UC voltage variation (b) respectively, according to the load profile.

**Figure 26.** (**a**) UC current; (**b**) UC voltage.

Matlab simulation results reveal an evolution with sharp peaks for UC current and UC voltage when Li-ion battery needs to provide much more power to the DC network or during sudden acceleration and regeneration.

In the Figure 27a–c are presented the Li-ion battery current (a), battery terminal voltage (b) and battery SOC (c) respectively, according to power required.

**Figure 27.** (**a**) Li-ion battery current; (**b**) battery terminal voltage; (**c**) battery SOC.

Figure 27a,b show several peaks (positive and negative) in the evolution of the current of the Li-ion battery, which correspond to the charging and discharging cycles of the battery, as can be seen from the evolution of SOC in Figure 27c. The terminal voltage of the Li-ion battery also has a lot of variations in its growth, decreasing from 83 V to t = 0 V to 60 V around t = 125 [s], followed by an increase to 83V when t = 83V.MATLAB simulation results analysis for Scenario 1

In this application, it is important to analyze the power distribution shown in Figure 24. The result of the analysis provides a better perspective on how EMS works in real-time simulations. In this figure, the red colour curve represents the profile of the power load, i.e., a variable power required for the AC load in the first 350 s of real-time simulation. The blue colour curve designates the main power generated by FC source, which is the dominant source, i.e., the one that delivers the most considerable amount of power to a DC grid and is almost constant inside the 150 s window length (75,225) [s]. The brown curve refers to the second power supply source, which is a Li-ion battery that delivers power to the DC grid in a smaller and variable amount during charging and discharging cycles, compared to FC. Finally, the green colour curve refers to the third power supply source that delivers the smallest amount of power to the DC grid only during the short periods of sharp acceleration and regeneration. The power distribution balance can be easily checked for enough moments because the MATLAB Data

Tips measurement tool can help to mark several points on each curve. For example, at time t = 70 s, the power delivered by each source of power supply has the following values:

$$P\_{\rm FC} = 6.985 \text{ kW}, P\_{\rm Batt} = 3.041 \text{ kW}, P\_{\rm LC} = 0 \text{ kW}, \text{and } P\_{\rm L} = 10.07 \text{kW}$$

The power distribution evaluated at t = 70 s verifies with enough accuracy Equation (23), since:

 $P\_{\rm FC} + P\_{\rm Batt} + P\_{\rm UC} = 10.026 \text{ kW}$ 
 $\text{so close to } P\_{\rm L} = 10.07 \text{ kW}$ 

As Equation (23) is satisfied for each moment, it is easy to observe the behavior of all three power supply sources. The MATLAB simulation results shown in Figures 25c, 26a and 27a reveal the same trend of current evolution as that of each corresponding power supply.

As in the case of the EMS-SMCS setup, similar graphs with the same meaning are presented in Appendix A, Figures A1–A10 for second EMS-PICS setup, and in the ([30], Figures A11–A20) for third EMS-ECMS setup. The theory and all the Simulink diagrams behind the five EMS techniques are fully documented in [5]. In our research, these EMS techniques are presented only as complementary information for interested readers, such as to give a clue, motivation and to open new research directions for future HEV developments. Nonetheless, the topic is beyond the scope of this paper, which is focused only on the modeling aspects and Li-ion battery SOC estimation techniques.

• Scenario 2: A 100 HP, 1750 RPM asynchronous induction motor (squirrel cage) is connected to AC grid as is shown in Figure 28.

**Figure 28.** The 100 HP, 1750 RPM speed asynchronous induction motor (squirrel cage) connected to the output of a direct current/alternating current (DC/AC) converter (inverter).

In this scenario is shown only the MATLAB simulations result related to the evolution of asynchronous induction motor speed, as can be seen in Figure 29.

**Figure 29.** The MATLAB simulation result of unregulated RPM speed of induction motor.

From Figure 29, it is easy to observe that the speed of induction motor connected to AC grid is not controlled, but it is quite close to 1750 RPM in steady state, for a torque load of 375 Nm.

• Scenario 3: A 2 HP 1750 permanent magne<sup>t</sup> DC motor connected to DC side of the grid, as is shown in Figure 22 (the right topside block).

Since the block from Figure 22 encapsulates the PMDCM Simscape model, for clarity, Figure 30 shows the PMDCM Simscape model with all the details of electrical connections.

**Figure 30.** A 2HP 1750 RPM PMDCM—Simscape model (see [12]).

Unlike the uncontrolled speed of the asynchronous induction motor (ASM), the PMDCM is connected by a negative feedback in a closed-loop to a block of proportional-integral-derivative (PID) controller, to control its speed, as is shown in Figure 31, and developed in [12].

**Figure 31.** Closed-loop PMDCM-proportional-integral-derivative (PID) RPM speed control.

The MATLAB PMDCM RPM speed step response is shown in Figure 32. A big advantage of the PID controller is that the PMDCM speed response converges quickly and reaches the target speed of 1500 RPM in almost 1.8 s.

**Figure 32.** PMDCM RPM speed step response.

The characteristics curves of a Li-ion battery connected to PMDCM as a DC load are shown in Figure 33a–c, namely the battery SOC (a), a sequence of discharging and charging current cycles (b), and the battery terminal output voltage changes during battery operation (c). The SOC of the Li-ion battery remains almost constant during PMDCM operation. The battery current increases to almost 15 A at the beginning of the first transient and remains constant for a short period of time during steady state. However, at the beginning of the second transient it rises sharply to 60 A for a short time, then slowly decreases to −15 A at the end of steady state. The battery output voltage, shown in Figure 33c, decreases slightly during the first transient from 62.4 V to 62.2 V, and at the beginning of the second transient falls slowly for a short time and then increases linearly. At the end of steady state, it reaches 62.4 V. Therefore, the evolution of the battery output voltage is smooth, keeping an almost constant value during PMDCM operation.

**Figure 33.** Li-ion battery supplying the PMDCM; (**a**) Li-ion battery SOC; (**b**) Li-ion battery current; (**c**) Li-ion battery terminal voltage.

The behaviour of the SC connected to the DC grid to supply power to the PMDCM during sudden changes in the load torque is described in Figure 34a for the SC current and in Figure 34b for the SC voltage. The SC current, during the first transient, decreases from 2000 A to 900 A at the end of the first steady-state period, and then at the beginning of the second transient continues the fall to −1000 A for which t = 2 [s]. After that the SC current increases to almost −300 A at t = 5 [s] which coincides with the end of steady-state. The SC voltage increases during the first transient from 0 [V] to almost 10 [V] at t = 1.8 [s], when PMDCM suddenly changes speed from 100 RPM to 1500 RPM, absorbing much more power. This justifies the presence of the SC to provide much more energy at this switching time. Therefore, the SC voltage suddenly increases from 10 V to 350 V in the time window (2, 2.5) [s] and then decreases to 200 V until the end of the steady-state. During this time, the SC protects the Li-ion battery so that it works smoothly, maintaining a constant SOC value.

**Figure 34.** Supercapacitor (SC) supplying the PMDCM during sharp changes in the load torque; (**a**) SC current; (**b**) SC voltage.

The PMDCM behavior during the operation is shown in Figure 35a–d.

**Figure 35.** PMDCM—DC load. (**a**) PMDCM load torque; (**b**) PMDCM input absorbed power; (**c**) PMDCM armature current; (**d**) PMDCM armature voltage.

Figure 35a shows the linear evolution of the load torque with its PMDCM speed (scaling factor 0.011). Graph 35b describes the input power that changes abruptly in the step moment from 0 to 7 kW at t = 2 [s], followed by a decrease to 2.5 kW during steady state. Figure 35c shows the armature current absorbed by the PMDCM with a similar evolution trend as for the absorbed PMDCM power. Figure 35d shows the supplied armature voltage which is the same as the SC voltage, which justifies its presence to provide a large amount of energy, again protecting the Li-ion battery to make this e ffort. SC ensures the required voltage absorbed by PMDCM to achieve excellent speed profile tracking performance.

### **4. Li-Ion Battery Models Accuracy Performance—Battery Selection**

### *4.1. Statistical Criteria to Asses the Accuracy of the Models*

In a general formulation, for a better understanding of how to select an accurate Li-ion battery model, as well as a high-precision SOC state estimator and an excellent prediction of the selected battery output voltage, it can use some statistical criteria performance to compute the fitting errors between a set of candidates models reported in the literature [14,17,26,27]. Selection of Li-ion battery models and Kalman filter SOC estimators can be made by using the performance criteria developed in the "recent years in statistical learning, machine learning, and big data analytics" [27]. It is essential to emphasize the fact that now there are several criteria reported in the literature for models and estimators' selection, that "receives much attention due to growing areas in machine learning, data mining and data science" [27]. Among them, the mean squared error (MSE), root mean squared error (RMSE), R2-squared, mean absolute squared error (MAE), standard deviation σ, the mean absolute percentage error (MAPE) [27], Adjusted R2, Akaike's information criterion (AIC), Bayesian information criterion (BIC), AICc are "the most common criteria that have been used to measure model performance and select the best model from a set of potential models" [27].

Both models, i.e., the 3RC ECM and Simscape, are already validated by the available information extracted for each of them from the results of MATLAB simulations shown in Figure 13b, Figure 15, Figure 21a,b, that reveal an excellent accuracy due to SOC residual percentage errors being very low. A baseline for comparison is used the estimated value of ADVISOR SOC, as mentioned in the previous sections. The accuracy of both models is better compared to SOC residual error of 2%, usually reported in the literature for similar applications. The first model records a residual error of 1.2% (Figure 15) and the second one of 1.4% (Figure 21b).

Furthermore, to make a better delimitation between them, additional information is required. The values provided by all six statistical criteria, such as root mean squared error (RMSE), mean squared error (MSE), mean absolute error (MAE), standard deviation (std), mean absolute percentage error (MAPE) and squared, coe fficient of determination (R2-squared), as are defined in [26,27], is valuable information that makes the di fference when two models perform close in terms of accuracy. These values are presented in Table 5, for the 3RC ECM, respectively Table 6, for Simscape Li-ion battery models. All these performance criteria have lower values thus validate, without any doubt, the both models. Moreover, because for both RMSE, MSE, std, MAPE models are very close and R2-squared = 0.959 and 0.951, respectively, very close to 1, this is valuable information that indicates how close the values of the data set of the models are and of estimated values ADVISOR SOC. Thus, the overall performance is quite close, with a slight superiority of the 3RC ECR battery model, but the di fference is still negligible..

**Table 5.** Statistical errors root mean squared error (RMSE), mean squared error (MSE), AMSE—Li-ion 3RC ECM SOC values versus ADVISOR SOC estimates.



 0.0384  1.19  0.951

 0.007

**Table 6.** Statistical errors RMSE, MSE, MAE, std, MAPE and R<sup>2</sup> for Simscape Li-ion model validation versus ADVISOR estimate.
