foxBMS / foxbms-2

foxBMS 2, online documentation at https://docs.foxbms.org
https://foxbms.org
Other
258 stars 118 forks source link

Error(s) in MXM driver: balancing control #9

Open Virtex7 opened 2 years ago

Virtex7 commented 2 years ago

suspect, there are two mistakes in the balancing control driver of the mxm driver. both are located in: mxm_17852.c

1st: line 408: pState->batteryCmdBuffer.msb &= ((uint8_t)1u << 7u); / set CBRESTART bit / because the Bit CBRESTART is active high, it should be set. actually the highByte of MXM_REG_BALSWCTRL is getting zeroed out by the command and the timeout-restart-bit is not set. also see the datasheet, page 310 and page 311 for CBRESTART -> pState->batteryCmdBuffer.msb |= 1<<7;

2nd: line 468: pState->batteryCmdBuffer.lsb = 0x0EU; -> enable balancing switches for a minimum amount of time. i would suggest to change to 0xEEu or even 0xFEu to bring the balancing duty to 93,75% or even its maximum if possible between measurements (not sure, EE works fine for me).

after this two changes the balancing driven by the max17852 works. the alternating balancing scheme between even and odd cells could be seen as well (works).

foxBMS commented 2 years ago

Dear @Virtex7,

many thanks for the report. We will have a look at this and come back, as soon as we have news.

Best regards, The foxBMS Team