## 5 Comparison between Fuzzy Logic Controller (FLC) and PI Controller-Based Energy Management System  
The FLC shows better performance as compared to the PI controller. The PI controller parameters are tedious and tiresome to tune as compared to the FLC. In the FLC, the performance of the entire system depends upon the membership function selected. The FLC has a wider range for operating conditions. The step response of the PI controller and fuzzy logic controller has been compared in Figure 12, which shows the effectiveness of FLC. It can be seen that the rise time of the fuzzy logic controller is smaller than the PI controller. The response time of the fuzzy logic controller is also smaller as compared to the PI controller. In FLC applications, non-numerical data can also be used to ease the expression of rules and facts. The main benefit of using the FLC is in the rule-based formulation of the control problem and the nonlinear characteristics of the control surface, which depicts a better match with the nonlinear system. Moreover, the development cost of FLC is less than the PI controller. The flexibility of FLC is more than the PI controller because they shape their controlling surface due to the high number of parameters. The FLC is easy to understand due to its rule-based representation. The PI controller can be tuned by using the following equation:  
\[Y\ =\ K_{p}\cdot e\ +\ K_{i}\int e\cdot dt \tag{33}\]  
where, \(K_{p}\), \(K_{i}\) represents the proportional gain and integral gain, respectively, \(e\) represents the difference between reference and actual speed and \(Y\) is the output response. The rise time of the fuzzy logic controller is 2.6 ms as compared to the PI controller, which is 67.2 ms. The overshoot of the FLC is \(-\)0.82%, while for the PI controller, it is 0.5%, which is shown in Table 8. The settling time for FLC is low as compared to the PI controller. \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline \multirow{2}{*}{**BLDC Speed**} & **Error** & **Current** & \multirow{2}{*}{**P**} & **BLDC Speed** & **Battery** & **SOC** & \multirow{2}{*}{**F**} \\  & **N** & **Z** & & & & **L** & **H** & \\ \hline VL & VL & L & L & VL & VL & L & L \\ S & VL & L & M & S & VL & L & L \\ M & L & M & H & M & L & L & M \\ F & L & M & H & F & L & M & H \\ SF & M & M & H & SF & M & M & H \\ \hline \hline \end{tabular}
\end{table} 
Table 7: Rules for the Proposed FLC. \begin{table}
\begin{tabular}{c c c c c} \hline \hline \multirow{2}{*}{**Controller**} & **Rise Time** & **Settling** & **Percentage** & **Slew Rate** & **Percentage** \\  & **(ms)** & **Time** & **Undershoot** & **(/s)** & **Overshoot** \\ \hline Fuzzy Logic & 2.6 & 1.47 & 0.82 & 5.20/m & \(-\)0.82 \\ Controller & 67.2 & 0.98 & 1.9 & 11.2 & 0.5 \\ \hline \hline \end{tabular}
\end{table} 
Table 8: Comparison between FLC and PI Controller for Step Response. The output voltages and current of the SEPIC converter at a variable input voltage are shown in Figure 13. From these results at variable input voltages, the output voltage corresponding to the 80 V input voltage is chosen for the charging of the battery. The losses become high as we increase the input voltages. The oscillations in output voltages and current of the boost converter using FLC are less than the results of the converter using a PI controller which are shown in Figures 14 and 15, respectively. Figure 12: Comparison of step responses of PI controller and FLC. Figure 13: SEPIC converter output voltage and current at variable input voltage. The overall 3D output of the proposed model is depicted in Figure 16a,b, which shows the behavior of the system. According to Figure 16a, the duty cycle increases or decreases when the value of the error current increases or decreases, while, during this process, if the battery's SOC is greater than 85%, then speed will increase. According to Figure 16b, the duty cycle increases or decreases when the error current increases or decreases so that the speed of the motor can be increased or decreased.