Clear Sky Science · en

Optimized battery energy management using an improved type-2 fuzzy logic approach

· Back to index

Smarter Power for Sun-Powered Buildings

As more homes and offices add rooftop solar panels and battery packs, a new question emerges: how do we decide, minute by minute, whether to use solar energy, store it, or sell it back to the grid? This paper explores a smarter way to manage that flow of electricity so that buildings can cut their bills, rely more on clean power, and extend the life of their batteries—all without needing supercomputers or constant human supervision.

Why Solar and Batteries Need a Brain

Solar panels are wonderfully clean but frustratingly unpredictable. Clouds, temperature swings, and changing demand inside a building cause solar output and electricity needs to rise and fall all day long. Batteries help by soaking up extra power and feeding it back later, but careless charging and discharging can waste energy, wear the battery out, or buy power at the wrong time of day. Traditional control systems tend to follow rigid “if–then” rules: if there is extra solar power, charge the battery; if there is a shortage, discharge it. These simple rules ignore many real-world complications, like fast-changing weather or shifting electricity prices, and they are usually tuned by hand for one specific situation.

Figure 1
Figure 1.

A Softer Kind of Decision-Making

The authors propose a more flexible “fuzzy” controller to act as the brain of a solar-and-battery setup. Instead of treating inputs as simply high or low, the controller works with shades of gray: power surplus can be slightly positive, strongly positive, or somewhere in between; battery charge can be low, medium, or high; prices can be cheap, normal, or expensive. Their improved controller, called a type‑2 fuzzy logic system, goes a step further by also accounting for the uncertainty in those inputs—such as noisy sensors or rapidly changing clouds—rather than pretending the measurements are exact. It takes in three main pieces of information: the difference between solar generation and building demand, the battery’s state of charge, and the current electricity price. Using 45 carefully designed rules, it decides how strongly to charge or discharge the battery, or when to let the grid help.

From Equations to a Working Microgrid

To test this smart control, the researchers first build detailed models of the solar panels, the battery pack, and the power converters that link everything together. These models describe how the solar array responds to light and temperature, how different battery types behave during charge and discharge, and how electronic converters step voltages up or down as needed. On top of this virtual microgrid, they place two competing “brains”: the conventional rule-based controller and the improved type‑2 fuzzy logic controller. Both are run on standard computing hardware in a setup similar to what could be installed at the “edge” of a real building’s energy system, close to where data is collected and decisions are made.

Putting the New Controller to the Test

Using real-world weather, demand, and price data over a 24‑hour period, the team compares how the two approaches behave during both a clear sunny day and a partly cloudy day. They find that the fuzzy controller keeps the microgrid’s voltage more stable, which is good for appliances and power electronics. It also directs more solar power straight to the building rather than needlessly cycling it through the battery, and it uses the battery more gently, keeping its charge in a healthier mid-range instead of deep discharges. On cloudy days, when solar output jumps up and down, the flexible controller adapts smoothly, drawing on the battery and the grid only when genuinely needed. Overall, the fuzzy system cuts grid power use by about a quarter compared with having no storage, and lowers energy costs by roughly 22–32 percent compared with standard strategies in similar setups.

Figure 2
Figure 2.

What This Means for Future Buildings

For building owners and grid operators, the message is clear: a smarter control strategy can turn existing solar panels and batteries into a more reliable and cost-effective energy system. By embracing a “soft” style of decision-making that tolerates uncertainty instead of fighting it, the improved fuzzy logic controller keeps lights on, bills lower, and batteries healthier, even when the sun and demand are anything but predictable. With further real-world trials and long-term studies, this kind of controller could become a key ingredient in making buildings both greener and more resilient.

Citation: Naoui, M., Romdhane, M., Gacem, A. et al. Optimized battery energy management using an improved type-2 fuzzy logic approach. Sci Rep 16, 11469 (2026). https://doi.org/10.1038/s41598-026-41490-7

Keywords: solar energy management, battery storage control, microgrid optimization, fuzzy logic, smart buildings