How can I get individual cell voltages from the battery pack from Battery Builder?

17 次查看(过去 30 天)
I am using Battery Builder to create a battery management system. The current system for validation purposes is simply 3 cells in series. When I export my libary so that it creates a Simulink block I can only get the voltage for the entire pack. Is there a way that I can have ports for the individual cell voltage and potentially other properties?

回答(1 个)

Umar
Umar 2025-10-16,0:51

Hi @Josie,

Yes, you can get individual cell voltages (and SOC, temp, etc.), but those per-cell outputs must be provided by the cell model and the generated Pack/Module blocks usually present them as multiplexed vectors that you then split in Simulink. See the official docs below for each step. ([MathWorks][1]). Here is step by step approach to address your comments.

1. Ensure the cell model block you used exposes the signals you need (voltage, SOC, temperature). The generated battery blocks only forward outputs that exist on the cell block you specify. If the shipped cell model doesn’t expose a port you want, use a custom Simscape cell block or enable the conditional parameters in `CellModelBlock`. ([MathWorks][2])

2. Rebuild / export the battery library with Battery Builder or `buildBattery(...)`. Building regenerates the Pack/Module/ModuleAssembly blocks from your battery objects so they incorporate whatever outputs the cell block provides. ([MathWorks][3])

3. Inspect the generated blocks: ModuleAssembly groups each cell model output into a corresponding multiplexed output signal; similarly the Pack groups module outputs into multiplexed signals. That’s why you often see one vector port (e.g., `vCell`) rather than many scalar ports. ([MathWorks][4])

4. In your top-level Simulink model, split the multiplexed vector into scalars using a Demux, Selector, or Bus Selector, or create a small wrapper subsystem around the generated block that promotes each vector element to a named Outport (cleaner interface for BMS logic). If the generated signal has nested grouping (module→pack), you may need nested selectors or reshape steps. ([MathWorks][4])

Here are some notes that can help you further understand the concept.

  • Changing a cell block’s parameters in the library does not automatically change generated blocks — you must rebuild so the generated blocks pick up the new port definitions. ([MathWorks][2])
  • If you plan to read many per-cell signals in real time (hundreds of cells), be mindful of simulation performance and signal management — a wrapper that selectively exposes only needed signals helps. (Docs/examples show workflows for modules/packs and thermal coupling.) ([MathWorks][5])

Useful documentation pages I used

  • ModuleAssembly (Generated Block) — explains how cell outputs are grouped. ([MathWorks][4])
  • Pack (Generated Block) — describes pack-level multiplexing of module outputs. ([MathWorks][6])
  • batteryCellModelBlock / CellModelBlock docs — how cell-block options and conditional parameters affect what is forwarded. ([MathWorks][7])
  • Battery Builder / Get started & buildBattery — shows workflow to create/export the library and regenerate blocks. ([MathWorks][1])

Hope this helps.

References

[1]: https://www.mathworks.com/help/simscape-battery/ug/get-started-battery-builder.html "Get Started with Battery Builder App - MATLAB & Simulink"

[2]: https://www.mathworks.com/help/simscape-battery/ref/simscape.battery.builder.cellmodelblock.html "CellModelBlock - Set of conditional parameters for Cell object"

[3]: https://www.mathworks.com/help/simscape-battery/ref/batterybuilder-app.html "Battery Builder - Define battery system and automatically ..."

[4]: https://www.mathworks.com/help/simscape-battery/ref/moduleassemblygeneratedblock.html "ModuleAssembly (Generated Block) - Simscape Battery"

[5]: https://www.mathworks.com/help/simscape-battery/ug/build-battery-pack.html "Build Simple Model of Battery Pack in MATLAB and ..."

[6]: https://www.mathworks.com/help/simscape-battery/ref/packgeneratedblock.html "Pack (Generated Block) - Simscape Battery"

[7]: https://www.mathworks.com/help/simscape-battery/ref/batterycellmodelblock.html "batteryCellModelBlock - Set of conditional parameters for ..."

类别

Help CenterFile Exchange 中查找有关 Battery Pack Modeling 的更多信息

产品


版本

R2024b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by