If brick index numbers are normally coming sequentially, a simple approach would be to fill cell readings sequentially based on just checking the new brick index is higher than the one received before. To autodetect the layout, use Michael's new CheckChangeCellArrangement calls to let the cell array grow for every new highest brick number received. Once the first complete brick sequence is received, the BMS cell layout should match the actual battery layout. A better option able to handle sparse frames: collect the brick index keys in a std::set or sorted array, use the key index to address the cells in the BMS, and for auto detection let the cell layout grow with the set size. Regards, Michael Am 12.11.22 um 14:12 schrieb Michael Geddes:
I did have some code that handled this kind of stuff... But it was over complicated.. There's a new function that allows you to set the new size that the ioniq 5 code uses... But a similar function could be added that just compresses what is there as well.
Michael
On Sat, 12 Nov 2022, 9:02 pm Mark Webb-Johnson, <mark@webb-johnson.net> wrote:
The original Model S had a fairly simple to decode CAN bus message 0x6f2 with the first byte in range 0..1f and each message encoding 3 battery bricks, for a total of 96 bricks.
However, things have now got more complicated. A 75kWh Model X, and a replacement pack for a 85kWh Model S, contain cut-down packs with modules missing, so 0x6f2 only contains 28 messages, for 84 bricks, with bricks #15, #16, #17 and #31 missing from the message.
When we feed this into BmsSetCell… calls, the OVMS BMS support code sees the missing bricks, assumes things are missing, and refuses to give an output.
So my (hopefully simple) question, is how to tell it the brick arrangement? Or how to deal with these missing bricks?
Regards, Mark.
_______________________________________________ OvmsDev mailing list OvmsDev@lists.openvehicles.com http://lists.openvehicles.com/mailman/listinfo/ovmsdev
_______________________________________________ OvmsDev mailing list OvmsDev@lists.openvehicles.com http://lists.openvehicles.com/mailman/listinfo/ovmsdev
-- Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal Fon 02333 / 833 5735 * Handy 0176 / 206 989 26