## 3 Materials and Methods
### Bidirectional DC-DC Converter
It was due to the maximum possible duty cycle of the control. For the PWM generator, a 25 kHZ switching frequency was used with a sample time of \(5\times 10^{-6}\) s to switch on the MOSFET. The same switching frequency was used to calculate the equivalent parameters of the DC-DC buck-boost converter. A combination of the constant current-voltage method was used to charge the batteries. The voltage and current charging reference were determined by the current and voltage PI controller. The LAB was charged with a charging reference voltage of 13.1 V and 14.2 V for LIB, obtained from the datasheet of the batteries used in this research study. The battery was charged at a constant current based on the nominal constant discharge current of the given batteries connected with gain (\(-1\)), which represents the negative current during charging. The batteries were connected in parallel, and each was connected in series with a bidirectional DC-DC buck-boost converter. The two DC-DC converters' output was linked to the DC-Bus. The proposed battery management system consisted of (1) Fuzzy Logic Control, which was used to allocate the CCA/C demand to the batteries and controlled the batteries' SoC during charging and discharging by ensuring that it stayed within limits (i.e., 98.5% to 99.99%) to avoid overcharge and deep discharge. (2) Voltage and current triple-loop PI-based controllers with a PWM generator, which was used to control the desired voltage and current flow during charging and discharging modes. In terms of fuzzy logic control, it was utilised to allocate the total current demand to the two battery  
Figure 5: Experimental procedure for the developed HESS. technologies. The FLC gave the reference current based on the requested current to the batteries and protected the batteries against over-charging/deep discharge by determining the minimum and maximum values of the SoC; it comprises three parts, including fuzzification, inference, and defuzzification, as stated in [42; 43; 44; 45]. The fuzzification is the part of fuzzy logic control, which decides the input and output data into suitable language values. The fuzzification involves two processes: To derive the membership functions for the input and output variables and present them with linguistic variables. This process is equivalent to translating or plotting classical sets to fuzzy sets to varying degrees. The input variables of the proposed FLC are \(CCC_{Demand}\), \(\Delta SoC_{LAB}\) and \(\Delta SoC_{LIB}\). The following conditions are represented in (19) and (20), as in [37]:  
\[\Delta SoC_{LAB}=SoC_{LAB}-SoC_{LAB-Command}; \tag{19}\]  
\[\Delta SoC_{LIB}=SoC_{LIB}-SoC_{LIB-Command}; \tag{20}\]  
Thus, \(\Delta SoC_{LAB}\) and \(\Delta SoC_{LIB}\) represent the membership function sets between 0 and 100, which represents the change in battery SoC, where the CCC ranges from 0 to 650 A depending on the size of the battery. The proposed FLC output membership function has two output variables (i.e., \(CCC_{LAB}\) and \(CCC_{LIB}\)) each is set between \(-1\) and 1, which represents the percentage of CCC that HESS supplies to the vehicle. The FLC allocated the reference percentage CCC, which the battery needs to supply. The positive represents the HESS supplies the current to the vehicle, and the negative current represents that the HESS has been charged from the alternator. The FLC was designed to give the CCC reference, which each battery needs to supply. The LIB was designed to supply between 30% and 50% of the required CCC, whereas the LAB supplies the remaining CCC. The following criteria were followed:  
* \(CCC_{LAB}\) is the membership function during the start-up function, LAB supplied between 45% and 70% of the required startup current, and \(CCC_{LIB}\) supplied about 30% to 70% depending on the operating scenario. * Zero is the mode when there is no action from the HESS, it means the HESS will not charge or discharge.