Next Article in Journal
Artificial Intelligence-Driven Optimal Charging Strategy for Electric Vehicles and Impacts on Electric Power Grid
Previous Article in Journal
YOLOv11-BSS: Damaged Region Recognition Based on Spatial and Channel Synergistic Attention and Bi-Deformable Convolution in Sanding Scenarios
Previous Article in Special Issue
Fuzzy Logic-Based Dynamic Difficulty Adjustment for Adaptive Game Environments
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Fuzzy Battery Manager: Charging and Balancing Rechargeable Battery Cells with Fuzzy Logic

The Electrical and Computer Engineering Department, The University of Michigan Dearborn, Dearborn, MI 48128, USA
*
Author to whom correspondence should be addressed.
Electronics 2025, 14(7), 1470; https://doi.org/10.3390/electronics14071470
Submission received: 7 February 2025 / Revised: 25 March 2025 / Accepted: 26 March 2025 / Published: 6 April 2025

Abstract

:
This paper presents the design, implementation, and testing of a fuzzy battery manager featuring a novel hardware design. The system uses a fuzzy inference system to charge and balance two battery cells in series, integrating a microcontroller and a battery charging IC to demonstrate battery management with real hardware. It supports two battery chemistries, showcasing how the fuzzy system can be flexibly adapted to different rechargeable battery technologies. The fuzzy battery manager successfully achieves its goal of charging and balancing cells with high adaptability by simply adjusting membership functions. Its stability and effectiveness on real hardware have been confirmed. This adaptability offers significant potential across various industries. For example, a replacement battery pack designed for longevity using LiFePO4 cells could serve as an alternative to Li-Ion cells in electric vehicles, especially since LiFePO4 cells endure many more charge cycles, albeit with lower charge densities. The required membership functions for this replacement battery could be stored in just a few bytes of ROM within the battery pack, enabling seamless integration and use with existing vehicles and charging systems.

1. Introduction

Battery management systems (BMS) are vital for charging, maintaining, and protecting batteries within larger systems. They process numerous inputs, such as current cell voltages, temperatures, and loads, to produce various outputs, including setting output voltage, adjusting charge current, triggering cell balancing circuitry, and reporting cell health. The functions utilized by a BMS to calculate these outputs are closely tied to the specific properties of each battery technology. For example, ref. [1] provides measurements and explanations of these properties for Li-ion battery cells, while [2] outlines a charging profile for LiPo cells. It is crucial for the BMS to consider parameters like nominal voltage and normalized charge current, as well as to recognize that different chemistries respond differently to temperature, often generating more heat during charging.
This paper aims to simplify the complex equations used in battery management systems and enhance their adaptability to various battery chemistries by employing fuzzy logic. By adjusting the membership functions of linguistic values for each input and output to suit specific battery chemistries, the BMS equations can be transformed into a fuzzy system. The proposed study develops a hardware implementation with real rechargeable cells and charging circuitry that manages both Li-Ion and LiFePO4 batteries, using fuzzy logic for all calculations. LiFePO4 batteries offer enhanced safety and longevity compared to Li-Ion batteries, although with lower energy density, and they are more environmentally friendly and less prone to overheating and catching fire.
This work demonstrates a physical implementation of fuzzy logic for battery management, supporting functions such as charging, discharging specific cells for balancing and temperature management, and draining the series of cells to prepare them for recharging. The system uses two cells in series to effectively showcase cell balancing features, and includes the capability to measure the voltage and temperature of each cell at any time. Fuzzy logic and inference in battery management are established concepts in the literature. For instance, ref. [3] describes a fuzzy system for managing when a battery should connect to specific electrical loads, focusing on disconnecting during under-charge or under-voltage states. Meanwhile, ref. [4] employs a fuzzy system to estimate the charge state of a Li-ion battery, incorporating temperature readings to calculate optimal charging voltage. Similarly, ref. [5] uses a fuzzy system to assess the health of a LiPo battery, an essential BMS function.
The constant-temperature constant-voltage (CT-CV) model, as discussed in [6], uses a PID controller to adjust the charging current based on cell temperature, crucial for managing rechargeable lithium cells. Ref. [6] also describes the constant-current constant-voltage (CC-CV) charging method; however, this does not factor in temperature, operating closer to an open-loop system and posing efficiency and safety challenges. These insights emphasize the importance of integrating cell temperature as an input in the proposed fuzzy system.
Balancing cells within battery packs is also crucial, as discussed in [7], who survey various techniques. Due to capacity differences that evolve over a cell’s lifecycle, cell balancing is essential for safe operation. While active balancing redistributes energy among cells, it requires complex hardware. Thus, a passive approach, as detailed in [7], is adopted by the fuzzy battery manager for simplicity, using a current path to drain specific cells.
The most significant contribution to developing the fuzzy battery manager is drawn from [8], which describes a system using fuzzy logic to optimize voltage and current for charging by processing temperature, cell voltage, and capacity. This project builds upon such foundations, proving system functionality on hardware and enhancing it with cell balancing capabilities, adaptability to various battery types, and adjustable membership functions envisioned in [8].
This proposed fuzzy battery manager compiles various research insights into a cohesive application, enhancing previous designs by incorporating energy dumping control, approximating CC-CV charging as per [6], and supporting fast passive cell balancing as detailed in [7]. A key feature is its ability to switch between different battery chemistries easily, underscoring the versatility of a fuzzy logic approach.
The paper is organized as follows: Section 2 presents the background and related work, Section 3 outlines the requirements for the proposed design, Section 4 details the design itself, Section 5 describes the implementation, Section 6 presents the results of the new system, Section 7 offers a discussion, and Section 8 concludes the paper.

2. Background and Related Work

Battery management systems (BMSs) play a pivotal role in optimizing the performance, safety, and lifespan of rechargeable battery packs, serving as the backbone of modern energy storage solutions. Traditionally, these systems have relied on deterministic, non-fuzzy approaches that require precise mathematical models and equations tailored specifically to each battery chemistry and type [1,2,6].
Battery chemistry considerations:
  • Li-ion and LiPo batteries: These widely used batteries have distinct charging profiles, characterized by unique voltage and current settings. Ensuring precise adherence to these settings is critical, as any deviation—such as applying a LiPo-optimized charging current to a Li-ion cell—can lead to significant safety hazards, including overheating, reduced efficiency, and potential failure.
  • Unique characteristics of different chemistries:
    °
    Nickel–Cadmium (NiCd) cells: Known for their “memory effect,” these batteries can suffer from reduced capacity if not fully discharged before recharging, which complicates their management [9].
    °
    Pulse charging responses: Battery chemistries also respond differently to pulse charging techniques, which can necessitate entirely different control strategies [10]. As a consequence, each chemistry often demands its own control system with unique constants and parameters.
These challenges commonly result in the need to replace a traditional BMSs when switching between different battery types, underscoring the limitations of existing systems. The intricacies of managing various chemistries within a single BMS framework underscore the urgent need for more advanced, flexible solutions—capabilities that traditional approaches struggle to provide.

2.1. Fuzzy Logic in BMSs

In the quest to overcome the limitations of conventional battery management systems, recent research has turned to fuzzy logic—a paradigm known for its flexibility and adaptability. This sophisticated approach leverages membership functions to interpret critical input variables like voltage, current, and temperature, empowering battery management systems (BMSs) to dynamically accommodate various battery chemistries. This dynamic adaptability is groundbreaking in its ability to redefine operational parameters, such as identifying what constitutes a “high charging current,” adapted accordingly for different battery types—for instance, adjusting from two amps for LiPo cells to half an amp for Li-ion cells.
Revolutionizing adaptability and safety:
  • Dynamic adjustments: Fuzzy logic systems have the revolutionary capability to dynamically recalibrate themselves to align with the specific characteristics and needs of different battery chemistries. This prominent feature not only enhances safety, but also significantly boosts the efficiency and lifespan of the batteries.
Broad spectrum of research and applications:
  • Optimizing battery health: Several studies [3,4,5] have successfully employed fuzzy logic to refine real-time battery health assessments and state-of-charge estimations, ensuring accurate and efficient energy management.
  • Pioneering energy management innovations:
    °
    Unmanned Aerial Vehicles (UAVs): Research [11] demonstrates that the use of fuzzy logic in energy management systems notably enhances UAV efficiency by optimizing resource control.
    °
    Hybrid electric vehicles: Studies [12,13,14] highlight advancements in energy management strategies through teaching–learning-based optimization, optimizing crucial metrics such as energy consumption, lithium battery output current, and peak power.
    °
    Emerging trends and innovations: A thorough literature review [15] explores microcontroller-driven battery management in hybrid energy systems, spotlighting emerging trends in control strategies. Further innovations [16,17,18,19,20] range from improving maritime operations to developing algorithms that manage energy in sensor networks, all leveraging the distinctive advantages of fuzzy logic combined with principles like reinforcement learning, showcasing its diverse applicability.
Summarizing the expansive research, fuzzy logic emerges as a transformative and adaptive alternative to traditional BMS methods, being adept at responding to diverse battery needs. By enabling flexible parameter adjustments aligned with specific battery types, fuzzy logic dramatically advances both the adaptability and security of modern battery management systems, fulfilling the increasing demands of contemporary energy storage solutions.

2.2. Identified Gaps

Despite significant advancements in battery management systems, a fully comprehensive and adaptable BMS that seamlessly integrates fuzzy logic into hardware systems remains elusive. Current limitations include the following:
  • Overemphasis on theoretical frameworks: Many existing studies predominantly focus on theoretical models or simulations, which, while valuable for understanding potential system behavior, fall short in demonstrating practical real-world applicability. This disconnect highlights a need for tangible hardware implementations that can reliably showcase operational functionality and ensure safety across a range of battery chemistries.
  • Lack of unified functionality: Existing solutions often address either charging management or cell balancing, but rarely both within a single system. This division mandates separate approaches, complicating the integration of various chemistries into a cohesive management strategy. A unified system that can simultaneously manage charging and balance cells across multiple battery types would significantly advance the field, providing a streamlined and efficient solution.
These gaps underscore the necessity for a BMS that is capable of transcending theoretical limitations and delivering robust, versatile solutions in diverse practical contexts. Achieving such advancements is crucial for the future of battery technology, particularly as demand for diverse and efficient energy storage solutions continues to grow.

2.3. Contribution of the Current Study

This study pioneers the development of the fuzzy battery manager, addressing critical gaps in existing battery management systems. Key advancements include the following:
  • Hardware-validated system: The fuzzy battery manager transcends theoretical constructs, delivering a system that is rigorously validated in real-world conditions. This validation assures stakeholders of its reliable performance, positioning it as a groundbreaking step forward in practical battery management applications.
  • Seamless integration with charging ICs: Utilizing a state-of-the-art ARM M core microcontroller, the system efficiently orchestrates charging and balancing operations. This integration highlights the solution’s adaptability and real-world practicality, ensuring seamless operation across diverse hardware configurations.
  • Innovative modifiable membership functions: The system’s standout ability to dynamically adjust charging parameters for different battery chemistries through customizable membership functions represents a paradigm shift in adaptability and safety. Unlike traditional BMSs that necessitate complete system overhauls when switching chemistries [9,10], this approach delivers unparalleled flexibility and ease of adaptability, ensuring optimal operation and safety.
  • Comprehensive and cohesive framework: By synthesizing and expanding upon insights from previous studies [8], the fuzzy battery manager offers a comprehensive framework that extends the boundaries of current fuzzy logic applications. This framework not only aligns with established methodologies, but also pushes the envelope further, addressing practical considerations crucial for diverse battery chemistries in contemporary and future realms of BMS technology.
Overall, the fuzzy battery manager represents a leap forward in the field, providing a versatile and adaptable solution that meets the complexities of modern energy storage demands.

3. The New Proposed System Requirements

The requirements for the proposed design in this paper are primarily non-functional, as our objective is to demonstrate the hardware implementation of fuzzy logic. While timing and efficiency are crucial in any BMS, they are not the primary focus of the proposed system. The requirements are as follows:
i.
Implement a fuzzy system that takes current cell voltages and temperatures as inputs and outputs the maximum charging current and control for the balancing circuitry.
ii.
Use the results from the fuzzy system to interact with the battery-charging IC and manage the cell balancing circuitry, effectively charging and balancing the battery cells.
iii.
The ARM M core microcontroller should control the battery-charging IC, enable a load on the battery, and manage the cell balancing circuitry.
iv.
Ensure that the fuzzy system never outputs an unsafe charging current for the battery cells.
v.
Demonstrate the real-world functionality of the fuzzy battery manager through hardware implementation.

4. The New Proposed System Design

Due to the relatively small number of required inputs and outputs, the fuzzy battery manager was implemented using a standard Mamdani fuzzy inference system. As previously discussed, it processes four inputs and produces three outputs. The inputs are cell 1 voltage, cell 2 voltage, cell 1 temperature, and cell 2 temperature. The outputs are the balancing duty cycles for cell 1 and cell 2, as well as the charging current limit. Membership functions for the cell voltages are defined according to the specifications outlined in the datasheet for each rechargeable cell. For example, the Lithium-Ion cells used in testing are Molicel INR-18650-P28A models. The manufacturer datasheet [21] provides vital parameters such as maximum charge voltage, temperature range, critical cutoff voltage, and maximum charge current. These parameters are used to establish membership values for cell voltage, temperature, and charging current limit.
Cell voltage membership functions are depicted in Figure 1, temperature membership functions in Figure 2, and current limit membership functions in Figure 3. For these membership functions, the voltages at which ’critically low’ and ’critically high’ reach a membership value of ’1’ are taken directly from [21], with 2.5 V as the discharge voltage and 4.2 V as the charge voltage. The definitions for the three intermediate voltage membership functions are designed to provide relatively even spacing, allowing for the fuzzy system rules to utilize them effectively. Notably, the ’critically high’ membership function is relatively crisp compared to the others. This attribute is used in the system’s rules to prevent any cell from being charged above its charge voltage, a risk that arises when cells are unbalanced and the sum of the series’ cell voltages is unchecked.
The cell temperature membership functions are based on the charging temperature requirements outlined in [21]. The ‘high’ and ‘low’ temperature memberships are set to approximately 5 degrees closer to room temperature than the absolute specified limits to promote more ideal charging conditions. Finally, the current limit membership functions are conservatively derived from the cell’s standard and maximum charging current limits provided in [21].
For the cell balancing control membership function, the output is a duty cycle ranging from 0 to 1. As previously discussed, the fuzzy battery manager switches a load across individual cells for balancing. The simplest way to control this with precision is to modulate the load on and off using a duty cycle.
Figure 4 shows cell balancing control membership functions.
For the other battery chemistry, the tested units are LiFePO4 Headway cells, with specifications detailed in datasheet [22]. These rechargeable cells differ from Li-ion cells in several key aspects, necessitating distinct membership functions for voltage, temperature, and current limits.
The LiFePO4 membership functions are similar to those for Li-Ion cells, as shown in Figure 5, Figure 6 and Figure 7. However, these functions differ in key areas: voltage levels are generally lower, LiFePO4 cells are more resistant to low temperatures but less tolerant of high temperatures, and the current limit values are higher. These adjustments align with the specifications provided in [22].
Beyond selecting these specifications for the fuzzy system, it is essential to define the system’s If-Then rules. The detailed structure of these rules is explained in the Implementation section of this document. For the design, various categories of rules are adapted from existing works and then expressed in an If-Then format.
Category 1 comprises rules based on common sense and the parameters of the rechargeable cells. For instance, charging should be halted when one or more cells reach a critically high voltage, and cell balancing should be activated with a high duty cycle for such cells. These rules protect cells from reaching temperatures or voltages beyond their datasheet specifications. They include the following:
i.
Do not charge cells when one or more cells is at a critically high voltage.
ii.
Do not charge cells at a critically high temperature.
iii.
Charge very cold cells only with a slow current.
iv.
Activate balancing hardware for a cell at critically high voltage.
v.
Activate balancing hardware for a cell that has significantly higher voltage than another cell.
Category 2 of the rules is inspired by [6], aiming to approximate the temperature-based control used in CT-CV charging calculations. These rules are as follows:
i.
Charge colder cells with a higher current, except for those too cold to be charged.
ii.
Slowly charge cells approaching unsafe high temperatures.
Category 3 is derived from a temperature management technique described in [23]. Battery cells have internal impedance, which is higher in very cold cells, leading to heat generation during charging and discharging. By charging a cell while simultaneously discharging it through balancing hardware at a similar rate, the cell can be warmed without significantly altering its state of charge. This category includes the following:
i.
Warm up a cold cell by applying a slow charge current and a moderate balancing duty cycle.
ii.
Avoid charging or balancing cells that are too hot.
From these three categories, a total of nine rules can be expanded into the complete set of If-Then rules for the fuzzy system.
In addition to the fuzzy system, hardware capable of performing inference and utilizing the outputs is required. This hardware must support setting voltage and current limits and enabling cell-specific loads for balancing purposes. For the battery charger, TI’s BQ25713 IC is selected for its ability to set voltage and current limits. The chosen switches for balancing are TI’s TPS22810DBVR digital feed-forward power switches. An STM32G0B1RE microcontroller is used to execute fuzzy inference and output controls to the battery charger and balancing switches.
The software operates using FreeRTOS (see https://www.freertos.org/ (accessed on 7 February 2025 for more information)) with three tasks:
The first task periodically reads cell voltages and temperatures, using them as inputs for fuzzy inference. It then sends the calculated current limit to the battery charger IC and writes the balancing duty cycle to global variables.
The second task sleeps for 1 ms and counts how many times it has slept. If the count is less than 1000 times the duty cycle variable for a cell, that cell’s balancing switch is turned on; otherwise, it is turned off.
The third task monitors overall voltage and updates the four charge status LEDs to reflect the approximate state of charge.

5. The Proposed System Implementation

The fuzzy system rules, as expanded from the 9 free-form rules in the design, come to 44 rules, as shown in Table 1.
The fuzzy system is implemented using the Fuzzy Logic Toolbox in Matlab, as illustrated in Figure 8. The configuration is as follows: the ’And’ method uses ’min’, the ’Or’ method uses ’max’, the implication method is ’min’, and the aggregation method is ’max.’ The defuzzification method employed is the centroid. Figure 9 displays the surface curve for Cell 1’s balancing duty cycle at a temperature of 25 °C, while Figure 10 presents the surface curve for the current limit.
The hardware PCB is largely based on the reference design for the battery charger IC, as shown in Figure 11. It is a buck-boost regulator with current sensing capability. The microcontroller communicates with it using I2C, and also sets the cell balancing switches using digital outputs, as shown in Figure 12.
The fuzzy inference system is developed using qFIS [24], an engine implemented in C. qFIS provides tools for defining membership functions, inputs, outputs, rules, and mathematical methods to construct a fuzzy system. After creating the system, it can perform inferences directly in C.
Additionally, there is a Matlab script [25] that converts fuzzy systems from Matlab’s Fuzzy Logic Toolkit into C code. This script is particularly useful for obtaining membership function definitions for different types of battery chemistries.
Overall, this process enables the execution of the fuzzy system on a microcontroller, ensuring that the outcomes are identical to those obtained in Matlab.
Figure 13 illustrates the calling graph for the Fuzzy Inference task, which is responsible for gathering inputs, executing fuzzy inference, and writing outputs to shared memory or battery charger registers. This task calls various functions to manage these processes.
To interact with the battery charger IC, the task uses functions that write to 14 device registers via ST’s HAL I2C peripheral functions. Initially, it writes to each of the ten charge option registers. Then, it enters an infinite loop for continuous operation.
Within this loop, the task performs the following steps:
  • Read cell voltages and temperatures:
    °
    Uses four different ADC channels to read each cell’s voltage and temperature.
    °
    Calibrates the ADC channel using ST HAL functions before each measurement.
    °
    Starts the ADC conversion and polls for the result.
  • Average ADC results:
    °
    Takes a specified number of samples for each channel to average the readings.
    °
    Averages 100 samples for each of the four inputs.
  • Process data with fuzzy inference:
    °
    Places the averaged values into an inputs array.
    °
    Executes fuzzy inference using the ChargerFuzzySysLi* functions.
  • Write outputs:
    °
    Updates global variables for the cell balancing task with the calculated duty cycle outputs.
    °
    Sends the current limit output to the battery charger using I2C.
This task ensures the efficient and accurate management of the battery charging system through continuous monitoring and control using fuzzy logic.
Figure 14 depicts the call graph for the Balance Toggle task, which operates within a loop running every millisecond. The task performs the following operations:
  • Duty cycle counter:
    °
    It increments a counter every millisecond until it reaches 1000, then resets it to 0.
    °
    When the counter’s value is below the balancing duty cycle assigned to each cell by the fuzzy inference task, the respective cell’s balancing switch is activated. Otherwise, the switch is deactivated.
  • Balancing switch control:
    °
    This control scheme ensures that each cell’s balancing switch operates according to its specific duty cycle using a one-second period.
  • “Charge Okay” check:
    °
    The task periodically checks the “charge okay” output from the battery charger.
    °
    Balancing is only enabled if the battery charger is active, avoiding unnecessary balancing when the battery is not charging and not at risk of overcharging.
This approach enables precise duty cycle control for cell balancing while ensuring that balancing only occurs during active charging periods.
Figure 15 presents the call graph for the charge indicator task, which manages the charge status indicator LEDs to reflect the batteries’ charge state. This task performs the following functions:
  • Battery voltage assessment:
    °
    It reads the battery voltage measurement obtained from the fuzzy inference task.
    °
    It compares this measurement to specific fractions of the full charge voltage to determine the appropriate charge status.
  • Full charge voltage determination:
    °
    The task calculates the full charge voltage by checking the mode switch input.
    °
    This input allows for dynamic switching between battery chemistries, such as Li-Ion and LiFePO4, during operation.
    °
    Depending on the mode switch status, the task references the appropriate charge voltage for comparisons.
This setup ensures that the charge status LEDs accurately represent the charge state across different battery chemistries, adapting to changes in the mode switch input.

6. Results

The fuzzy system utilized by the fuzzy battery manager is tested using the following primitive model in Matlab:
  • current1 = out(3) − v1*0.5*out(1)/4.2;
  • current2 = out(3) − v2*0.5*out(2)/4.2;
  • v1 = v1 + 0.01*current1;
  • v2 = v2 + 0.01*current2;
  • t1 = t1 + 0.01*(20-t1) + 0.5*(abs(current1));
  • t2 = t2 + 0.01*(20-t2) + 0.5*(abs(current2));
The code simulates updates for each cell’s voltages and temperatures based on the fuzzy system’s outputs. Specifically, “out (1)” and “out (2)” represent the cell balancing duty cycles, while “out (3)” indicates the current limit output.
In this model, the following parameters are obtained:
1.
Current calculation:
°
The current to each cell is calculated by subtracting the impact of the cell balancing coefficient from the current limit.
2.
Model approximations:
°
The voltage of each cell is modeled as linearly related to the current, and the temperature increase is also assumed to be linear with current.
°
Although these simplifications can lead to inaccuracies, the model is still useful for demonstrating the stability of the fuzzy system in a way that is more intuitive than analyzing surface curves, like those in Figure 9 and Figure 10.
3.
Fuzzy system reaction visualization:
°
By performing fuzzy inference on the outputs from this simplified model and using these as inputs for the fuzzy model, it becomes easier to visualize how the fuzzy system reacts to varying inputs.
Overall, despite its limitations, this model can effectively illustrate the system’s behavior and stability, providing valuable insights into the fuzzy system’s dynamics.
Figure 16 illustrates the results of executing 50 inference steps, starting from various initial cell voltages. Each arrow in the plot originates from an initial configuration of cell voltages and temperatures and points to the state of the cell voltages after 50 inference steps. The plot demonstrates two key outcomes:
1.
Voltage regulation:
°
Regardless of the initial voltages, the fuzzy system consistently ensures that no cell exceeds 4.2 V, which is the maximum charge voltage for Li-Ion batteries.
2.
Convergence to full charge:
°
The system consistently trends towards achieving a full charge for both cells at 4.2 V.
This demonstrates the fuzzy system’s ability to stabilize the charging process, maintaining safe voltage levels while efficiently moving towards fully charging the cells.
Figure 17 resembles Figure 16, but starts with cell 1 at an initial temperature of 40 °C instead of 25 °C. This change noticeably slows the charging process compared to Figure 16, as indicated by shorter vector magnitudes. Additionally, it shows that balancing occurs more slowly for cell 1 than cell 2 when either cell initially exceeds 4.2 V. This behavior is desired because charging or discharging a cell generates additional heat.
Further analysis with datasets similar to Figure 16 and Figure 17 was conducted programmatically for a wide range of initial temperatures. This confirmed that the fuzzy system consistently avoids unsafe behaviors, such as the following:
  • Charging or discharging hot cells;
  • Discharging cells below the cutoff voltage;
  • Charging cold cells with high current;
  • Overcharging cells.
This simplified model was instrumental in verifying that the fuzzy system produces safe outputs across thousands of initial input scenarios.
Breakpoints were configured in the physical system to monitor for the overcharging of the cells during testing. Figure 18 displays the recorded history of cell voltages while charging Li-ion cells from a near-empty state. The results demonstrate the successful charging of the Lithium Ion cells without triggering the overcharge breakpoint, indicating effective charge management and safety compliance.
Figure 19 presents the results of a similar test using LiFePO4 cells instead of the Li-Ion cells featured in Figure 18. This test commenced with Cell 1 at 2.5 V and Cell 2 at 2.9 V, involving a significant balancing task during charging. The curve is particularly notable because it clearly indicates when the charging transitions from being limited by the fuzzy system’s current limit output to being constrained by the battery’s intrinsic properties, being around 7 volts.
In the “rough” region, spanning from approximately 7 volts to 7.15 volts, Cell 2 reaches a particularly high voltage. This causes the charging current limit to drop to 0 as Cell 2 discharges through its balancing resistor, resulting in a temporary decrease in overall battery voltage. The voltage stabilizes once the fuzzy system recalculates and increases the current limit.
Overall, the charging curve observed in Figure 19 aligns with the desired and expected behavior of the system, demonstrating effective management of the LiFePO4 cells under these conditions.

7. Discussion

The new proposed fuzzy battery manager integrates a variety of existing battery charging research and ideas into a comprehensive application. Similarly, to the system described in [8], it utilizes a fuzzy logic-based system to convert cell temperatures and voltages into appropriate charging currents. However, it extends beyond [8] by introducing control mechanisms for dissipating energy by balancing circuitry, which helps balance battery cells and can also adjust cell temperatures when necessary.
Additionally, the proposed fuzzy system approximates constant current-constant voltage (CC-CV) charging calculations, as discussed in [6], and implements fast passive cell balancing, as described in [7]. A notable feature of this system is its ability to switch battery chemistries through a simple flip of a switch, showcasing a key advantage of using a fuzzy logic approach.
In summary, the new fuzzy battery manager retains the benefits of earlier fuzzy battery charger designs while adding functionalities such as cell balancing and the ability to quickly adapt to different battery chemistries.

8. Conclusions

The proposed fuzzy battery manager system (BMS) effectively achieves its goal of charging and balancing rechargeable cells with high adaptability to different battery chemistries through the adjustment of membership functions. Proven to be stable and functional on real hardware, this adaptability holds significant potential across various industries. For example, a replacement battery pack using LiFePO4 cells, known for their longevity and ability to endure more charge cycles, could serve as an alternative to Li-Ion cells in electric vehicles. Although LiFePO4 cells have lower charge density, their membership functions could be stored in a few bytes of ROM within the battery pack itself, enabling seamless integration with existing vehicles and charging systems.
Looking ahead, the proposed fuzzy battery manager could further enhance its capabilities by incorporating true state-of-charge (SoC) estimation. Adopting the methods discussed in [4] would make the system a more comprehensive BMS solution. Additionally, applying this fuzzy system to manage hybrid batteries, composed of different cell chemistries, would be an intriguing direction for future work. Explorations should also consider integrating adaptive SoC estimation models with fuzzy logic for an even more robust solution.

Author Contributions

Conceptualization, A.K.S. and Z.B.; Methodology, Z.B.; Software, Z.B.; Validation, Z.B.; Resources, Z.B.; Writing—original draft, A.K.S.; Writing—review & editing, A.K.S.; Supervision, A.K.S. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Data Availability Statement

The original contributions presented in this study are included in the article. Further inquiries can be directed to the corresponding author.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Ji, G.; He, L.; Wu, T.; Cui, G. The design of fast charging strategy for lithium-ion batteries and intelligent application: A comprehensive review. Appl. Energy 2025, 377, 124538. [Google Scholar] [CrossRef]
  2. Pérez, J.A.O.; Guerra, R.G.; Hernández, Y.L.; Velázquez, J.E.V.; Martínez, L.A.V. Charge of LiPo Batteries via Switched Saturated Super-Twisting Algorithm. In Proceedings of the 2020 17th International Conference on Electrical Engineering, Computing Science and Automatic Control (CCE), Mexico City, Mexico, 11–13 November 2020; pp. 1–6. [Google Scholar] [CrossRef]
  3. Magsumbol, J.-A.V.; Rosales, M.A.; Concepcion, R.; Bandala, A.A.; Sybingco, E.; Vicerra, R.R.P. FLi-BMS: A Fuzzy Logic-based Intelligent Battery Management System for Smart Farm. In Proceedings of the 2022 IEEE 14th International Conference on Humanoid, Nanotechnology, Information Technology, Communication and Control, Environment, and Management (HNICEM), Boracay Island, Philippines, 1–4 December 2022; pp. 1–5. [Google Scholar] [CrossRef]
  4. Marisno, D.; Chin, C.S.; Shan, C.; See, S. Performance of Adaptive Neuro-Fuzzy Inference System State-of-Charge Estimation of Lithium-Ion Batteries for Electric Ship. In Proceedings of the 2023 8th International Conference on Computational Intelligence and Applications (ICCIA), Haikou, China, 23–25 June 2023; pp. 205–209. [Google Scholar] [CrossRef]
  5. Ananto, P.; Syabani, F.; Indra, W.D.; Wahyunggoro, O.; Cahyadi, A.I. The state of health of Li-Po batteries based on the battery’s parameters and a fuzzy logic system. In Proceedings of the 2013 Joint International Conference on Rural Information & Communication Technology and Electric-Vehicle Technology (rICT & ICeV-T), Bandung, Indonesia, 26–28 November 2013; pp. 1–4. [Google Scholar] [CrossRef]
  6. Transue, T.; Maldonado, A.; Santre, T. Fuzzy Inference System for Large Scale Lithium-Ion Battery Management Systems. In Proceedings of the 2019 IEEE Green Technologies Conference (GreenTech), Lafayette, LA, USA, 3–6 April 2019; pp. 1–5. [Google Scholar] [CrossRef]
  7. Bashir, H.; Yaqoob, A.; Kousar, F.; Khalid, W.; Akhtar, S.; Sultan, W. A Comprehensive Review of Li-ion Battery Cell Balancing Techniques & Implementation of Adaptive Passive Cell Balancing. In Proceedings of the 2022 International Conference on Electrical Engineering and Sustainable Technologies (ICEEST), Lahore, Pakistan, 14–15 December 2022; pp. 1–6. [Google Scholar]
  8. Joshi, B.; Maherchandani, J.K.; Chhipa, A.A. Comparison Between Open and Closed Loop Battery Charging Technique for Lithium-ion Battery. In Proceedings of the 2021 7th International Conference on Electrical Energy Systems (ICEES), Chennai, India, 11–13 February 2021; pp. 150–155. [Google Scholar]
  9. Plett, G. Battery Management Systems, Volume I: Battery Modeling; Artech: Boston, MA, USA, 2015; p. 37. [Google Scholar]
  10. Vermeer, W.; Stecca, M.; Mouli, G.R.C.; Bauer, P. A Critical Review on The Effects of Pulse Charging of Li-ion Batteries. In Proceedings of the 2021 IEEE 19th International Power Electronics and Motion Control Conference (PEMC), Gliwice, Poland, 25–29 April 2021; pp. 217–224. [Google Scholar]
  11. Bayrak, Z.U.; Kaya, M.N. Modeling and Detailed Analysis of Rule Based, Conventional Fuzzy and Type-II Fuzzy Logic Energy Management Systems of Fuel Cell-Battery Hybrid Powered Unmanned Aerial Vehicles. IEEE Access 2024, 12, 110655–110670. [Google Scholar] [CrossRef]
  12. Rostami, S.M.R.; Al-Shibaany, Z. Intelligent Energy Management for Full-Active Hybrid Energy Storage Systems in Electric Vehicles Using Teaching–Learning-Based Optimization in Fuzzy Logic Algorithms. IEEE Access 2024, 12, 67665–67680. [Google Scholar] [CrossRef]
  13. Suhail, M.; Akhtar, I.; Kirmani, S.; Jameel, M. Development of Progressive Fuzzy Logic and ANFIS Control for Energy Management of Plug-In Hybrid Electric Vehicle. IEEE Access 2021, 9, 62219–62231. [Google Scholar] [CrossRef]
  14. Maghfiroh, H.; Wahyunggoro, O.; Cahyadi, A.I. Energy Management in Hybrid Electric and Hybrid Energy Storage System Vehicles: A Fuzzy Logic Controller Review. IEEE Access 2024, 12, 56097–56109. [Google Scholar] [CrossRef]
  15. Malele, R.H.; Mendu, B.; Monchusi, B.B. Microcontroller-Driven Battery Management in Hybrid Energy Systems: A Systematic Review of Applications, Control Strategies, and Emerging Trends. IEEE Access 2025, 13, 29341–29360. [Google Scholar] [CrossRef]
  16. Guler, N.; Ismail, Z.M.; Hazem, Z.B.; Naik, N. Adaptive Fuzzy Logic Controller-Based Intelligent Energy Management System Scheme for Hybrid Electric Vehicles. IEEE Access 2024, 12, 173441–173454. [Google Scholar] [CrossRef]
  17. Fan, A.; Li, Y.; Fang, S.; Li, Y.; Qiu, H. Energy Management Strategies and Comprehensive Evaluation of Parallel Hybrid Ship Based on Improved Fuzzy Logic Control. IEEE Trans. Transp. Electrif. 2024, 10, 7651–7666. [Google Scholar] [CrossRef]
  18. Abdelaal, S.; Mukhopadhyay, S.; Rehman, H. Battery Energy Management Techniques for an Electric Vehicle Traction System. IEEE Access 2022, 10, 84015–84037. [Google Scholar] [CrossRef]
  19. Wang, J.; Zhou, Y. Energy Management of Plug-In Hybrid Electric Vehicles for Autonomous Driving in a Following Environment Based on Fuzzy Adaptive PID Control. IEEE Access 2024, 12, 183832–183850. [Google Scholar] [CrossRef]
  20. Gautier, M.; Berder, O. Adapting Quality of Service of Energy-Harvesting IoT Devices. In Intelligent Security Management and Control in the IoT; Wiley: Hoboken, NJ, USA, 2022; pp. 133–162. [Google Scholar] [CrossRef]
  21. INR18650P28A-V1-80093, INR-18650-P28A, Molicel. [Online]. Available online: https://www.molicel.com/wp-content/uploads/INR18650P28A-V1-80093.pdf (accessed on 6 February 2025).
  22. HeadWay-WI-RD-04, HW 38120HP, Headway. [Online]. Available online: https://www.servovision.com/Battery/Life/Life/HeadWAY38120HP(8Ah)%20LiFePo4%20%20%20Specification.pdf (accessed on 6 February 2025).
  23. Maiorino, A.; Cilenti, C.; Petruzziello, F.; Aprea, C. A review on thermal management of battery packs for electric vehicles. Appl. Therm. Eng. 2024, 238, 122035. [Google Scholar] [CrossRef]
  24. Doxygen Awesome. Github.io. 2024. Available online: https://kmilo17pet.github.io/qlibs/qfis_desc.html (accessed on 6 February 2025).
  25. Cadavid, J. qfiscgen (Fuzzy C-Code Generator for Embedded Systems). Matlab Central File Exchange. 13 September 2022. Available online: https://www.mathworks.com/matlabcentral/fileexchange/117465-qfiscgen-fuzzy-c-code-generator-for-embedded-systems (accessed on 6 February 2025).
Figure 1. Cell voltage membership functions (Li-Ion).
Figure 1. Cell voltage membership functions (Li-Ion).
Electronics 14 01470 g001
Figure 2. Cell temperature membership functions (Li-ion).
Figure 2. Cell temperature membership functions (Li-ion).
Electronics 14 01470 g002
Figure 3. Current limit membership functions (Li-Ion).
Figure 3. Current limit membership functions (Li-Ion).
Electronics 14 01470 g003
Figure 4. Cell balance control membership function.
Figure 4. Cell balance control membership function.
Electronics 14 01470 g004
Figure 5. Cell voltage membership functions (LiFePO4).
Figure 5. Cell voltage membership functions (LiFePO4).
Electronics 14 01470 g005
Figure 6. Cell temperature membership functions (LiFePO4).
Figure 6. Cell temperature membership functions (LiFePO4).
Electronics 14 01470 g006
Figure 7. Current limit membership functions (LiFePO4).
Figure 7. Current limit membership functions (LiFePO4).
Electronics 14 01470 g007
Figure 8. Fuzzy system inputs and outputs.
Figure 8. Fuzzy system inputs and outputs.
Electronics 14 01470 g008
Figure 9. Cell 1 balancing duty cycle surface curve (T = 25 °C).
Figure 9. Cell 1 balancing duty cycle surface curve (T = 25 °C).
Electronics 14 01470 g009
Figure 10. Current limit surface curve.
Figure 10. Current limit surface curve.
Electronics 14 01470 g010
Figure 11. PCB rendering.
Figure 11. PCB rendering.
Electronics 14 01470 g011
Figure 12. PCB with soldered components.
Figure 12. PCB with soldered components.
Electronics 14 01470 g012
Figure 13. Fuzzy inference task call graph.
Figure 13. Fuzzy inference task call graph.
Electronics 14 01470 g013
Figure 14. Balance toggle task call graph.
Figure 14. Balance toggle task call graph.
Electronics 14 01470 g014
Figure 15. Charge indicator task call graph.
Figure 15. Charge indicator task call graph.
Electronics 14 01470 g015
Figure 16. Primitive model inference results (T1 = 25 °C, T2 = 25 °C).
Figure 16. Primitive model inference results (T1 = 25 °C, T2 = 25 °C).
Electronics 14 01470 g016
Figure 17. Primitive model inference results (T1 = 40 °C, T2 = 25 °C).
Figure 17. Primitive model inference results (T1 = 40 °C, T2 = 25 °C).
Electronics 14 01470 g017
Figure 18. Li-Ion charging curve.
Figure 18. Li-Ion charging curve.
Electronics 14 01470 g018
Figure 19. LiFePO4 charging curve.
Figure 19. LiFePO4 charging curve.
Electronics 14 01470 g019
Table 1. Fuzzy system rules.
Table 1. Fuzzy system rules.
Rule NumberRule
1If (Cell1V is CritHigh) and (Temp1 is not High) then (Cell1Bal is HighBal)(Cell2Bal is None)(CurrentLimit is NoCharge)(1)
2If (Cell2V is CritHigh) and (Temp2 is not High) then (Cell1Bal is None)(Cell2Bal is HighBal)(CurrentLimit is NoCharge)(1)
3If (Cell1V is High) and (Cell2V is Low) and (Temp1 is not High) then (Cell1Bal is HighBal)(Cell2Bal is None)(1)
4If (Cell1V is Low) and (Cell2V is High) and (Temp2 is not High) then (Cell1Bal is None)(Cell2Bal is HighBal)(1)
5If (Cell1V is Low) and (Cell2V is Low) then (Cell1Bal is None)(Cell2Bal is None)(1)
6If (Cell1V is CritLow) and (Cell2V is CritLow) then (Cell1Bal is None)(Cell2Bal is None)(1)
7If (Cell1V is Medium) and (Cell2V is Medium) then (Cell1Bal is None)(Cell2Bal is None)(1)
8If (Cell1V is High) and (Cell2V is High) then (Cell1Bal is None)(Cell2Bal is None)(1)
9If (Cell1V is CritLow) then (Cell1Bal is None)(1)
10If (Cell1V is CritLow) then (Cell2Bal is None)(1)
11If (Cell1V is High) and (Cell2V is CritLow) and (Temp1 is not High) then (Cell1Bal is HighBal)(Cell2Bal is None)(1)
12If (Cell1V is CritLow) and (Cell2V is High) and (Temp1 is not High) then (Cell1Bal is None)(Cell2Bal is HighBal)(1)
13If (Cell1V is Medium) and (Cell2V is Low) then (Cell1Bal is None)(Cell2Bal is None)(1)
14If (Cell1V is Low) and (Cell2V is Medium) then (Cell1Bal is None)(Cell2Bal is None)(1)
15If (Cell1V is High) and (Cell2V is Medium) then (Cell1Bal is SlowBaL)(Cell2Bal is None)(1)
16If (Cell1V is Medium) and (Cell2V is High) then (Cell1Bal is None)(Cell2Bal is SlowBal)(1)
17If (Temp1 is High) then (Cell1Bal is None)(1)
18If (Temp2 is High) then (CellBal is None)(1)
19If (Cell1V is not CritHigh) and (Temp1 is Low) then (Cell1Bal is SlowBal)(1)
20If (Cell2V is not CritHigh) and (Temp2 is Slow) then (CellBal is SlowBal)(1)
21If (Cell1V is CritLow) and (Cell2V is not CritHgih) and (Temp1 is not High) and (Temp2 is not High) then (CurrentLimit is SlowCharge)(1)
22If (Cell1V is not CritHigh) and (Cell2V is CritLow) and (Temp1 is not High) and (Temp2 is not High) then (CurrentLimit is SlowCharge)(1)
23If (Cell1V is Low) and (Cell2V is Low and (Temp1 is not High) and (Temp2 is not High) then (CurrentLimit is FastCharge)(1)
24If (Cell1V is CritHigh) and (Cell2V is CritHgih) then (CurrentLimit is NoCharge)(1)
25If (Cell1V is Medium) and (Cell2V is Medium) and (Temp1 is Medium) and (Temp2 is Medium) then (CurrentLimt is FastCharge)(1)
26If (Cell1V is High) and (Cell2V is High) and (Temp1 is Medium) and (Temp2 is Medium) then (CurrentLimt is MediumCharge)(1)
27If (Cell1V is High) and (Cell2V is Medium) and (Temp1 is not High) and (Temp2 is not High) then (CurrentLimt is MediumCharge)(0.01)
28If (Cell1V is Medium) and (Cell2V is High) and (Temp1 is not High) and (Temp2 is not High) then (CurrentLimt is SlowCharge)(0.01)
29If (Cell1V is Low) and (Cell2V is High) and (Temp1 is not High) and (Temp2 is not High) then (CurrentLimt is SlowCharge)(1)
30If (Cell1V is High) and (Cell2V is Low) and (Temp1 is not High) and (Temp2 is not High) then (CurrentLimt is SlowCharge)(1)
31If (Cell1V is not CritHgih) and (Cell2V is not CritHigh) and (Temp1 is Low) and (Temp2 is not Hgih) then (CurrentLimt is SlowCharge)(1)
32If (Temp1 is High) then (CurrentLimit is NoCharge)(1)
33If (Temp2 is High) then (CurrentLimit is NoCharge)(1)
34If (Cell1V is not CritHgih) and (Cell2V is not CritHigh) and (Temp1 is not Hgih) and (Temp2 is Low) then (CurrentLimt is SlowCharge)(1)
35If (Cell1V is not CritHgih) and (Cell2V is High) and (Temp1 is Medium) then (Cell2Bal is HighBal)(1)
36If (Cell1V is Hgih) and (Cell2V is CritLow) and (Temp1 is Medium) then (Cell2Bal is HighBal)(1)
37If (Cell1V is CritLow) and (Cell2V is Medium) and (Temp1 is Medium) then (Cell1Bal is None)(1)
38If (Cell1V is Medium) and (Cell2V is CritLow) and (Temp2 is Medium) then (Cell1Bal is None)(1)
39If (Cell1V is CritHigh) and (Cell2V is High) and (Temp2 is not Low) then (Cell2Bal is None)(1)
40If (Cell1V is Hgih) and (Cell2V is CritHgih) and (Temp1 is not Low) then (Cell1Bal is None)(1)
41If (Cell1V is Low) and (Cell2V is CritLow) and (Temp1 is not Low) then (Cell1Bal is None)(1)
42If (Cell1V is CritLow) and (Cell2V is Low) and (Temp2 is not Low) then (Cell2Bal is None)(1)
43If (Cell1V is Medium) and (Cell2V is CritLow) and (Temp1 is Medium) then (Cell1Bal is SlowBal)(1)
44If (Cell1V is CritLow) and (Cell2V is Medium) and (Temp2 is Medium) then (Cell1Bal is SlowBal)(1)
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Shaout, A.K.; Brauchler, Z. Fuzzy Battery Manager: Charging and Balancing Rechargeable Battery Cells with Fuzzy Logic. Electronics 2025, 14, 1470. https://doi.org/10.3390/electronics14071470

AMA Style

Shaout AK, Brauchler Z. Fuzzy Battery Manager: Charging and Balancing Rechargeable Battery Cells with Fuzzy Logic. Electronics. 2025; 14(7):1470. https://doi.org/10.3390/electronics14071470

Chicago/Turabian Style

Shaout, Adnan K., and Zachary Brauchler. 2025. "Fuzzy Battery Manager: Charging and Balancing Rechargeable Battery Cells with Fuzzy Logic" Electronics 14, no. 7: 1470. https://doi.org/10.3390/electronics14071470

APA Style

Shaout, A. K., & Brauchler, Z. (2025). Fuzzy Battery Manager: Charging and Balancing Rechargeable Battery Cells with Fuzzy Logic. Electronics, 14(7), 1470. https://doi.org/10.3390/electronics14071470

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop