Firmware v1 is done! 🧠
The brain is complete! 🎉
Remember when we said the Kalman filter was alive? Since then the rest of the OpenBMS firmware has caught up, and the initial version is now finished. Everything a battery needs runs right on the STM32, no PC required.
Here’s what’s inside.
Learning test (HPPC) 📈
The first time you connect a battery, OpenBMS runs a learning test, also called an HPPC test. It charges and discharges the pack in small steps with current pulses and rests in between. From that, the board builds a model of each cell: its open-circuit voltage curve, internal resistance and how the voltage recovers after a load. You run it once, and the board remembers your battery.
State of charge (SOC) 🔋
With the cell model in place, a Kalman filter combines voltage and current to estimate the state of charge. It also corrects itself:
- a full charge sets SOC to 100 %
- after a rest, SOC is checked against the measured cell voltage
- the shown percentage moves smoothly, without sudden jumps
Over time the firmware also learns the real capacity, which gives you the state of health (SOH) of the pack.
Cell balancing ⚖️
While charging, cells that run ahead of the others get a small bleed current until the pack is even again. The fuel gauge takes that bleed current into account, so SOC stays correct.
Temperature compensation 🌡️
Batteries behave differently in the cold and in the heat. Cell resistance and usable capacity change with temperature, and the model adjusts to that, so SOC and remaining capacity stay accurate on a cold morning too.
Protections 🛡️
The firmware protects the pack against:
- over-voltage and under-voltage (slow and fast)
- over-current while charging and discharging (slow and fast)
- over-temperature and under-temperature, with separate limits while charging
When a protection trips, the FETs switch off and the reason is stored so you can see what happened.
Testing in progress 🔬
The firmware is now running on the new Rev B boards, hooked up to the OpenBMS Test Bench and real battery packs. We’re checking every feature against real-world measurements, and we’ll share the results soon.
Want to try it yourself? Have a look at Get started. Stay charged! ⚡
← Back to blog