The code snippet below sets the balance voltage if balancing is requested but it doesn't appear to work for me. I wonder if the last 2 lines commented as //balancing bits need to be set to something, although the code never appears to do this. Is it enough just to send each module the balance voltage or perhaps i wonder to the bit settings need setting for each cell to apply to, or something else i'm missing.
Does anyone else have this working outside of simpbms, or does anyone have a can dump of a working setup in balance mode ?
thanks
Code: Select all
msg.id = 0x080 | (nextmes);
msg.len = 8;
if (balancecells == 1) {
msg.buf[0] = lowByte((uint16_t((bms.getLowCellVolt()) * 1000) + 5));
msg.buf[1] = highByte((uint16_t((bms.getLowCellVolt()) * 1000) + 5));
} else {
msg.buf[0] = 0xC7;
msg.buf[1] = 0x10;
}
msg.buf[2] = 0x00; //balancing bits
msg.buf[3] = 0x00; //balancing bits