Kia Niro BMS
-
zuuus
- Posts: 39
- Joined: Wed Sep 10, 2025 9:27 am
- Location: Netherlands
- Has thanked: 4 times
- Been thanked: 3 times
Re: Kia Niro BMS
Hi,
I updated the code so it works correctly with more modules in the daisy chain. I'm now testing the balancing part but I can't seem to get it working.
My question is what are these big pads on the PCB for with the 6 1k resistors in parallel? Filtering of measurements? Any idea how the balancing works?
PS. Comes from a Peugeot E-208 pack
EDIT: I think the big pads are for the cell balancing with bleed off resistors.
I updated the code so it works correctly with more modules in the daisy chain. I'm now testing the balancing part but I can't seem to get it working.
My question is what are these big pads on the PCB for with the 6 1k resistors in parallel? Filtering of measurements? Any idea how the balancing works?
PS. Comes from a Peugeot E-208 pack
EDIT: I think the big pads are for the cell balancing with bleed off resistors.
- Attachments
-
- BMS2_7_4_MAX17854_CELLOK_TEMPOK_v3.ino
- (54.14 KiB) Downloaded 3 times
- bexander
- Posts: 897
- Joined: Tue Jun 16, 2020 6:00 pm
- Location: Gothenburg, Sweden
- Has thanked: 78 times
- Been thanked: 102 times
Re: Kia Niro BMS
As you mention, most likely are the resistors for cell balancing bleed off and the large pads are to aid cooling of the resistors. Is there more stacks of resistors on the other side of the PCB?
- bexander
- Posts: 897
- Joined: Tue Jun 16, 2020 6:00 pm
- Location: Gothenburg, Sweden
- Has thanked: 78 times
- Been thanked: 102 times
Re: Kia Niro BMS
Maybe you need to set a watchdog time in BALEXP1 (0x70)? It is at least needed for MAX17823/45.
Re: Kia Niro BMS
Reenable the balanceCells() function call. Enable CBTEMPEN in register 0x80 so that your IC will shutdown shunts if it overheats, pg. 277 MAX17854.pdfzuuus wrote: ↑Wed Apr 08, 2026 1:01 pm Hi,
I updated the code so it works correctly with more modules in the daisy chain. I'm now testing the balancing part but I can't seem to get it working.
My question is what are these big pads on the PCB for with the 6 1k resistors in parallel? Filtering of measurements?
20260408_141837.jpg
Any idea how the balancing works?
PS. Comes from a Peugeot E-208 pack
EDIT: I think the big pads are for the cell balancing with bleed off resistors.
Code: Select all
// Cell-balancing: put device in Manual Cell Balancing by Second mode (CBMODE=010), disable expiration timer (BALEXP1=3FFh)
// BALCTRL (0x80): CBMODE[2:0]=010 at bits[13:11] => 0x1000
writeAllSlaves(0x80, 0x10E4, true); // manual balancing by secondI use CBTimer which you have disabled, ok for debugging but not a good solution long term. Start reading the balance status register to see what needs doing such as a timer reset, see bottom of post for some example code.
Here's the key part that may fix your setup, bit 15 CBRESTART should be high when setting the shunts. Whilst you have set the CBtime to infinity, there may need to be an initial kick.
Code: Select all
/*********************
* Balancing of cells *
*********************/
boolean balanceCells(uint16_t lowestCellVoltage)
{
boolean measureVoltages = true;
const uint16_t CELL_MASK = (1U << numberOfCellsPerModule) - 1U;
for (uint8_t m = 0; m < numberOfModules; m++)
{
uint16_t cellToBalance = 0x0000;
for (uint8_t j = 0; j < numberOfCellsPerModule; j++)
{
uint8_t cellNumber = j + m * numberOfCellsPerModule;
if ((cellVoltage[cellNumber] > startShuntVoltage) &&
((int16_t)(cellVoltage[cellNumber] - lowestCellVoltage) > voltageAllowance))
{
cellToBalance |= (1U << j);
}
}
cellToBalance &= CELL_MASK;
if (cellToBalance != 0)
{
cellToBalance |= 1 << 15; // adds CBRESTART bit, see pg.267 MAX17854.pdf
writeAddressedSlave(0x6F, cellToBalance, m, true);
Serial.print(F("Module "));
Serial.print(m + 1);
Serial.print(F(" BALSWCTRL = 0x"));
Serial.print(cellToBalance, HEX);
Serial.print(F(" cells=0b"));
Serial.println(cellToBalance, BIN);
measureVoltages = false;
}
else
{
writeAddressedSlave(0x6F, 0x0000, m, true);
Serial.print(F("Module "));
Serial.print(m + 1);
Serial.println(F(" BALSWCTRL = 0x0000"));
}
}
return measureVoltages;
}Code: Select all
void Maxim852Device::debug_balance() {
SPI_return = spi_read(ALL, ADDR_BALCTRL);
short raw = SPI_return[2] | (short)SPI_return[3] << 8;
char cbactive = ((raw & 0xc000) >> 14);
switch (cbactive) {
case 0:
Serial.println("Cell Balancing is Disabled ");
// pi_write(ALL, ADDR_BALAUTOUVTHR, (min_cell_adc_raw < 1))
break;
case 1:
Serial.println("Cell-Balancing Operations are Active");
break;
case 2:
Serial.println("Cell Balancing Completed Normally due to Reaching CBUVTHR or CBEXP Exit Conditions ");
// auto_balance(result);
break;
case 3:
Serial.println("Cell Balancing Halted Unexpectedly due to Thermal Exit (ALRTCBTEMP), Time Out (ALRTCBTIMEOUT), or Calibration Fault (ALRTCBCAL) Conditions ");
break;
default:
Serial.println("?? 1 ");
break;
}
char cbmode = ((raw & 0x3800) >> 11);
switch (cbmode) {
case 0:
Serial.println("Cell Balancing Disabled (default)");
break;
case 1:
Serial.println("Emergency/EOL Discharge by Hour");
break;
case 2:
Serial.println("Manual Cell Balancing by Second");
break;
case 3:
Serial.println("Manual Cell Balancing by Minute");
break;
case 4:
Serial.println("Auto Individual Cell Balancing by Second");
break;
case 5:
Serial.println("Auto Individual Cell Balancing by Minute");
break;
case 6:
Serial.println("Auto Group Cell Balancing by Second");
break;
case 7:
Serial.println("Auto Group Cell Balancing by Minute");
break;
default:
Serial.println("?? 1 ");
break;
}
char cbduty = ((raw & 0xF0) >> 4);
Serial.print("Duty cycle ");
switch (cbduty) {
case 0:
printf("6.25%% (default)\n\r");
break;
case 1:
Serial.printf("12.5%%\n\r");
break;
case 2:
Serial.printf("18.75%%\n\r");
break;
case 3:
Serial.printf("25%%\n\r");
break;
case 4:
Serial.printf("31.25%%\n\r");
break;
case 5:
Serial.printf("37.5%%\n\r");
break;
case 6:
Serial.printf("43.75%%\n\r");
break;
case 7:
Serial.printf("50%%\n\r");
break;
case 8:
Serial.printf("56.25%%\n\r");
break;
case 9:
Serial.printf("62.5%%\n\r");
break;
case 10:
Serial.printf("68.75%%\n\r");
break;
case 11:
Serial.printf("75%%\n\r");
break;
case 12:
Serial.printf("81.25%%\n\r");
break;
case 13:
Serial.printf("87.5%%\n\r");
break;
case 14:
Serial.printf("93.75%%\n\r");
break;
case 15:
Serial.printf("100%%, less NOL and measurement/calibration overhead\n\r");
break;
default:
Serial.printf("Unknown\n\r");
break;
}
char cbmeasuren = (raw & 0x3);
Serial.printf("CBMEASEN %d\n\r", cbmeasuren);
SPI_return = spi_read(ALL, ADDR_BALSTAT);
raw = SPI_return[2] | (short)SPI_return[3] << 8;
Serial.printf("CBTIMER %d \n\r", (raw & 0x3ff));
Serial.printf("CBCNTR %d \n\r", ((raw & 0xc00) >> 10));
Serial.printf("CBUNIT %d \n\r", ((raw & 0x3000) >> 12));
SPI_return = spi_read(ALL, ADDR_BALAUTOUVTHR);
raw = SPI_return[2] | (short)SPI_return[3] << 8;
Serial.printf("CBUVTHR %d stored in bms \n\r", ((raw & 0xfffe) >> 2));
Serial.printf("CBUVTHR %d from cell readings \n\r", min_cell_adc_raw);
SPI_return = spi_read(ALL, ADDR_STATUS3);
raw = SPI_return[2] | (short)SPI_return[3] << 8;
Serial.printf("ADDR_STATUS3 %d \n\r", raw);
}-
zuuus
- Posts: 39
- Joined: Wed Sep 10, 2025 9:27 am
- Location: Netherlands
- Has thanked: 4 times
- Been thanked: 3 times
Re: Kia Niro BMS
Hi,
Thankyou woleg for the suggestions, I will try to do these changes.
Update photo of the PCB on the modules (No modification, all stock)
No resistors on other side of pcb
Thankyou woleg for the suggestions, I will try to do these changes.
Update photo of the PCB on the modules (No modification, all stock)
-
zuuus
- Posts: 39
- Joined: Wed Sep 10, 2025 9:27 am
- Location: Netherlands
- Has thanked: 4 times
- Been thanked: 3 times
Re: Kia Niro BMS
Here is the debug output of the registers. The cell voltages and temperatures are correct.
EDIT: fixing the read/command path, Ignore current readings, sensor not connected/not used
Code: Select all
Entering Configuration Mode Successful!
Setting Baudrate Successful!
Starting to Set Mask!
Setting Mask Successful!
Starting to Set Filter!
Setting Filter Successful!
Starting to Set Filter!
Setting Filter Successful!
Starting to Set Mask!
Setting Mask Successful!
Starting to Set Filter!
Setting Filter Successful!
Starting to Set Filter!
Setting Filter Successful!
Starting to Set Filter!
Setting Filter Successful!
Starting to Set Filter!
Setting Filter Successful!
Current sens calib
Current sens calib NOK: 205, 240 (range)
Current sens calib
Current sens calib NOK: 178, 239 (range)
Current sens calib
Current sens calib NOK: 224, 239 (range)
Current sens calib
Current sens calib NOK: 171, 239 (range)
Current sens calib
Current sens calib NOK: 218, 239 (range)
Current sens calib
Current sens calib NOK: 177, 239 (range)
Current sens calib
Current sens calib NOK: 174, 239 (range)
Current sens calib
Current sens calib NOK: 204, 239 (range)
Current sens calib
Current sens calib NOK: 157, 239 (range)
Current sens calib
Current sens calib NOK: 203, 239 (range)
Configured modules = 2
Read capacity from EEPROM
Configured modules: 2
Configured cells: 12
Message length: 9
Daisy chain init
HELLOALL returned: 57 0 2
Set all slaves
STATUS raw: 3 2 20 40 A0 0 0 0 0 0 0 0
MEASUREEN2 readback failed
=== Balance debug module 1 ===
0x80 BALCTRL = 0xFFFF
CBMODE = 7
HOLDSHDNL = 3
CBDUTY = 15
CBDONEALRTEN = 1
CBTEMPEN = 1
CBMEASEN = 3
0x81 BALSTAT = 0xFFFF
CBACTIVE = 3
CBUNIT = 3
CBCNTR = 3
CBTIMER = 1023
0x6F BALSWCTRL = 0xFFFF
CBRESTART(rd)= 1
BALSWEN mask = 0x3FFF
0x70 BALEXP1 = 0xFFFF
CBEXP1 = 1023
=== Balance debug module 2 ===
0x80 BALCTRL = 0xFFFF
CBMODE = 7
HOLDSHDNL = 3
CBDUTY = 15
CBDONEALRTEN = 1
CBTEMPEN = 1
CBMEASEN = 3
0x81 BALSTAT = 0xFFFF
CBACTIVE = 3
CBUNIT = 3
CBCNTR = 3
CBTIMER = 1023
0x6F BALSWCTRL = 0xFFFF
CBRESTART(rd)= 1
BALSWEN mask = 0x3FFF
0x70 BALEXP1 = 0xFFFF
CBEXP1 = 1023
Saved to EEPROM, FORCEPOR
Module 1 Temps: 18C 19C 19C | Die: 17
Module 2 Temps: 19C 19C 19C | Die: 17
WRITEDEVICE raw: 4 6F 0 0 37 1 0 0 0 0
Module 1 BALSWCTRL = 0x0000
WRITEDEVICE raw: C 6F 1 80 C1 1 0 0 0 0
Module 2 BALSWCTRL = 0x8001 cells=0b1
=== Balance debug module 2 ===
0x80 BALCTRL = 0xFFFF
CBMODE = 7
HOLDSHDNL = 3
CBDUTY = 15
CBDONEALRTEN = 1
CBTEMPEN = 1
CBMEASEN = 3
0x81 BALSTAT = 0xFFFF
CBACTIVE = 3
CBUNIT = 3
CBCNTR = 3
CBTIMER = 1023
0x6F BALSWCTRL = 0xFFFF
CBRESTART(rd)= 1
BALSWEN mask = 0x3FFF
0x70 BALEXP1 = 0xFFFF
CBEXP1 = 1023
CAN: 44.3V -333.-2A 29.1% CH_HEX1 CH_STAT0
Module 1: 3648mV 3648mV 3648mV 3646mV 3649mV 3648mV
Module 2: 3940mV 3696mV 3698mV 3696mV 3696mV 3688mV
Module 1 Temps: 18C 19C 19C | Die: 17
Module 2 Temps: 19C 19C 19C | Die: 17
WRITEDEVICE raw: 4 6F 0 0 37 1 0 0 0 0
Module 1 BALSWCTRL = 0x0000
WRITEDEVICE raw: C 6F 1 80 C1 1 0 0 0 0
Module 2 BALSWCTRL = 0x8001 cells=0b1
=== Balance debug module 2 ===
0x80 BALCTRL = 0xFFFF
CBMODE = 7
HOLDSHDNL = 3
CBDUTY = 15
CBDONEALRTEN = 1
CBTEMPEN = 1
CBMEASEN = 3
0x81 BALSTAT = 0xFFFF
CBACTIVE = 3
CBUNIT = 3
CBCNTR = 3
CBTIMER = 1023
0x6F BALSWCTRL = 0xFFFF
CBRESTART(rd)= 1
BALSWEN mask = 0x3FFF
0x70 BALEXP1 = 0xFFFF
CBEXP1 = 1023
CAN: 44.3V -16.-2A 29.1% CH_HEX1 CH_STAT0
Module 1: 3648mV 3648mV 3648mV 3647mV 3649mV 3648mV
Module 2: 3940mV 3696mV 3698mV 3697mV 3696mV 3688mV
Module 1 Temps: 18C 19C 19C | Die: 17
Module 2 Temps: 19C 19C 19C | Die: 17
WRITEDEVICE raw: 4 6F 0 0 37 1 0 0 0 0
Module 1 BALSWCTRL = 0x0000
WRITEDEVICE raw: C 6F 1 80 C1 1 0 0 0 0
Module 2 BALSWCTRL = 0x8001 cells=0b1
=== Balance debug module 2 ===
0x80 BALCTRL = 0xFFFF
CBMODE = 7
HOLDSHDNL = 3
CBDUTY = 15
CBDONEALRTEN = 1
CBTEMPEN = 1
CBMEASEN = 3
0x81 BALSTAT = 0xFFFF
CBACTIVE = 3
CBUNIT = 3
CBCNTR = 3
CBTIMER = 1023
0x6F BALSWCTRL = 0xFFFF
CBRESTART(rd)= 1
BALSWEN mask = 0x3FFF
0x70 BALEXP1 = 0xFFFF
CBEXP1 = 1023
CAN: 44.3V -16.-1A 29.1% CH_HEX1 CH_STAT0
Module 1: 3649mV 3649mV 3649mV 3647mV 3649mV 3648mV
Module 2: 3940mV 3696mV 3697mV 3697mV 3696mV 3688mV
Module 1 Temps: 18C 19C 19C | Die: 17
Module 2 Temps: 19C 19C 19C | Die: 17
WRITEDEVICE raw: 4 6F 0 0 37 1 0 0 0 0
Module 1 BALSWCTRL = 0x0000
WRITEDEVICE raw: C 6F 1 80 C1 1 0 0 0 0
Module 2 BALSWCTRL = 0x8001 cells=0b1
=== Balance debug module 2 ===
0x80 BALCTRL = 0xFFFF
CBMODE = 7
HOLDSHDNL = 3
CBDUTY = 15
CBDONEALRTEN = 1
CBTEMPEN = 1
CBMEASEN = 3
0x81 BALSTAT = 0xFFFF
CBACTIVE = 3
CBUNIT = 3
CBCNTR = 3
CBTIMER = 1023
0x6F BALSWCTRL = 0xFFFF
CBRESTART(rd)= 1
BALSWEN mask = 0x3FFF
0x70 BALEXP1 = 0xFFFF
CBEXP1 = 1023
CAN: 44.3V -16.-1A 29.1% CH_HEX1 CH_STAT0
Module 1: 3649mV 3648mV 3649mV 3647mV 3649mV 3648mV
Module 2: 3940mV 3696mV 3698mV 3697mV 3695mV 3688mV
Module 1 Temps: 18C 19C 19C | Die: 17
Module 2 Temps: 19C 19C 19C | Die: 17
WRITEDEVICE raw: 4 6F 0 0 37 1 0 0 0 0
Module 1 BALSWCTRL = 0x0000
WRITEDEVICE raw: C 6F 1 80 C1 1 0 0 0 0
Module 2 BALSWCTRL = 0x8001 cells=0b1
=== Balance debug module 2 ===
0x80 BALCTRL = 0xFFFF
CBMODE = 7
HOLDSHDNL = 3
CBDUTY = 15
CBDONEALRTEN = 1
CBTEMPEN = 1
CBMEASEN = 3
0x81 BALSTAT = 0xFFFF
CBACTIVE = 3
CBUNIT = 3
CBCNTR = 3
CBTIMER = 1023
0x6F BALSWCTRL = 0xFFFF
CBRESTART(rd)= 1
BALSWEN mask = 0x3FFF
0x70 BALEXP1 = 0xFFFF
CBEXP1 = 1023
CAN: 44.3V -16.-8A 29.0% CH_HEX1 CH_STAT0
Module 1: 3647mV 3648mV 3648mV 3647mV 3649mV 3648mV
Module 2: 3940mV 3697mV 3698mV 3696mV 3696mV 3688mV
-
zuuus
- Posts: 39
- Joined: Wed Sep 10, 2025 9:27 am
- Location: Netherlands
- Has thanked: 4 times
- Been thanked: 3 times
Re: Kia Niro BMS
Here is my latest version of my code
- Attachments
-
- BMS2_7_4_MAX17854_CELLOK_TEMPOK_v4_copy.ino
- (55.61 KiB) Downloaded 1 time
-
zuuus
- Posts: 39
- Joined: Wed Sep 10, 2025 9:27 am
- Location: Netherlands
- Has thanked: 4 times
- Been thanked: 3 times
Re: Kia Niro BMS
Latest version of code.
The new log with this code:
The new log with this code:
Code: Select all
Entering Configuration Mode Successful!
Setting Baudrate Successful!
Starting to Set Mask!
Setting Mask Successful!
Starting to Set Filter!
Setting Filter Successful!
Starting to Set Filter!
Setting Filter Successful!
Starting to Set Mask!
Setting Mask Successful!
Starting to Set Filter!
Setting Filter Successful!
Starting to Set Filter!
Setting Filter Successful!
Starting to Set Filter!
Setting Filter Successful!
Starting to Set Filter!
Setting Filter Successful!
Current sens calib
Current sens calib NOK: 187, 128 (range)
Current sens calib
Current sens calib NOK: 130, 128 (range)
Current sens calib
Current sens calib NOK: 165, 128 (range)
Current sens calib
Current sens calib NOK: 139, 128 (range)
Current sens calib
Current sens calib NOK: 174, 128 (range)
Current sens calib
Current sens calib NOK: 125, 128 (range)
Current sens calib
Current sens calib NOK: 190, 128 (range)
Current sens calib
Current sens calib NOK: 123, 128 (range)
Current sens calib
Current sens calib NOK: 180, 128 (range)
Current sens calib
Current sens calib NOK: 137, 128 (range)
Configured modules = 2
Read capacity from EEPROM
Configured modules: 2
Configured cells: 12
Message length: 9
Daisy chain init
HELLOALL returned: 57 0 2
Set all slaves
STATUS raw: 3 2 20 40 A0 0 0 0 0 0 0 0
READDEVICE raw: 5 65 3F 0 B 1 D3 0 0 0
MEASUREEN2 readback = 0x3F
READDEVICE raw: 5 80 E4 50 77 51 D3 0 0 0
READDEVICE raw: 5 81 0 50 7D 51 D3 0 0 0
READ 0x81 ok=1
RAW 0x81: 5 81 0 50 7D 51 D3
READDEVICE raw: 5 6F 0 0 95 1 D3 0 0 0
READDEVICE raw: 5 70 0 0 C4 1 D3 0 0 0
M1 ok80=1 ok81=1 ok6F=1 ok70=1
0x80=50E4
0x81=5000
0x6F=0
0x70=0
READDEVICE raw: D 80 E4 50 F3 51 D3 0 0 0
READDEVICE raw: D 81 0 50 F9 51 D3 0 0 0
READ 0x81 ok=1
RAW 0x81: D 81 0 50 F9 51 D3
READDEVICE raw: D 6F 0 0 11 1 D3 0 0 0
READDEVICE raw: D 70 0 0 40 1 D3 0 0 0
M2 ok80=1 ok81=1 ok6F=1 ok70=1
0x80=50E4
0x81=5000
0x6F=0
0x70=0
Saved to EEPROM, FORCEPOR
Module 1 Temps: 19C 19C 19C | Die: 18
Module 2 Temps: 19C 19C 19C | Die: 18
WRITEDEVICE raw: 4 6F 0 0 37 1 0 0 0 0
Module 1 BALSWCTRL = 0x0000
WRITEDEVICE raw: C 80 E2 10 42 1 0 0 0 0
WRITEDEVICE raw: C 70 FF 3 29 1 0 0 0 0
WRITEDEVICE raw: C 6F 1 80 C1 1 0 0 0 0
Module 2 BALSWCTRL = 0x8001 cells=0b1
READDEVICE raw: D 80 E2 50 B9 51 D3 0 0 0
READDEVICE raw: D 81 0 50 F9 51 D3 0 0 0
READ 0x81 ok=1
RAW 0x81: D 81 0 50 F9 51 D3
READDEVICE raw: D 6F 1 0 D1 1 D3 0 0 0
READDEVICE raw: D 70 0 0 40 1 D3 0 0 0
M2 ok80=1 ok81=1 ok6F=1 ok70=1
0x80=50E2
0x81=5000
0x6F=1
0x70=0
CAN: 44.3V -9.-3A 29.1% CH_HEX1 CH_STAT0
Module 1: 3648mV 3648mV 3648mV 3647mV 3649mV 3648mV
Module 2: 3940mV 3696mV 3697mV 3696mV 3695mV 3688mV
Module 1 Temps: 19C 19C 19C | Die: 18
Module 2 Temps: 19C 19C 19C | Die: 18
WRITEDEVICE raw: 4 6F 0 0 37 1 0 0 0 0
Module 1 BALSWCTRL = 0x0000
WRITEDEVICE raw: C 80 E2 10 42 1 0 0 0 0
WRITEDEVICE raw: C 70 FF 3 29 1 0 0 0 0
WRITEDEVICE raw: C 6F 1 80 C1 1 0 0 0 0
Module 2 BALSWCTRL = 0x8001 cells=0b1
READDEVICE raw: D 80 E2 50 B9 51 D3 0 0 0
READDEVICE raw: D 81 0 50 F9 51 D3 0 0 0
READ 0x81 ok=1
RAW 0x81: D 81 0 50 F9 51 D3
READDEVICE raw: D 6F 1 0 D1 1 D3 0 0 0
READDEVICE raw: D 70 0 0 40 1 D3 0 0 0
M2 ok80=1 ok81=1 ok6F=1 ok70=1
0x80=50E2
0x81=5000
0x6F=1
0x70=0
CAN: 44.3V -7.-4A 29.1% CH_HEX1 CH_STAT0
Module 1: 3648mV 3648mV 3649mV 3647mV 3649mV 3648mV
Module 2: 3939mV 3697mV 3698mV 3697mV 3696mV 3688mV
Module 1 Temps: 19C 19C 19C | Die: 18
Module 2 Temps: 19C 19C 19C | Die: 18
WRITEDEVICE raw: 4 6F 0 0 37 1 0 0 0 0
Module 1 BALSWCTRL = 0x0000
WRITEDEVICE raw: C 80 E2 10 42 1 0 0 0 0
WRITEDEVICE raw: C 70 FF 3 29 1 0 0 0 0
WRITEDEVICE raw: C 6F 1 80 C1 1 0 0 0 0
Module 2 BALSWCTRL = 0x8001 cells=0b1
READDEVICE raw: D 80 E2 50 B9 51 D3 0 0 0
READDEVICE raw: D 81 0 50 F9 51 D3 0 0 0
READ 0x81 ok=1
RAW 0x81: D 81 0 50 F9 51 D3
READDEVICE raw: D 6F 1 0 D1 1 D3 0 0 0
READDEVICE raw: D 70 0 0 40 1 D3 0 0 0
M2 ok80=1 ok81=1 ok6F=1 ok70=1
0x80=50E2
0x81=5000
0x6F=1
0x70=0
CAN: 44.3V 1.2A 29.1% CH_HEX1 CH_STAT0
Module 1: 3648mV 3648mV 3648mV 3647mV 3649mV 3648mV
Module 2: 3939mV 3696mV 3698mV 3696mV 3695mV 3688mV
Module 1 Temps: 19C 19C 19C | Die: 18
Module 2 Temps: 19C 19C 19C | Die: 18
WRITEDEVICE raw: 4 6F 0 0 37 1 0 0 0 0
Module 1 BALSWCTRL = 0x0000
WRITEDEVICE raw: C 80 E2 10 42 1 0 0 0 0
WRITEDEVICE raw: C 70 FF 3 29 1 0 0 0 0
WRITEDEVICE raw: C 6F 1 80 C1 1 0 0 0 0
Module 2 BALSWCTRL = 0x8001 cells=0b1
READDEVICE raw: D 80 E2 50 B9 51 D3 0 0 0
READDEVICE raw: D 81 0 50 F9 51 D3 0 0 0
READ 0x81 ok=1
RAW 0x81: D 81 0 50 F9 51 D3
READDEVICE raw: D 6F 1 0 D1 1 D3 0 0 0
READDEVICE raw: D 70 0 0 40 1 D3 0 0 0
M2 ok80=1 ok81=1 ok6F=1 ok70=1
0x80=50E2
0x81=5000
0x6F=1
0x70=0
CAN: 44.3V 1.5A 29.1% CH_HEX1 CH_STAT0
Module 1: 3648mV 3648mV 3648mV 3647mV 3648mV 3648mV
Module 2: 3939mV 3697mV 3698mV 3696mV 3696mV 3688mV
Module 1 Temps: 19C 19C 19C | Die: 18
Module 2 Temps: 19C 19C 19C | Die: 18
WRITEDEVICE raw: 4 6F 0 0 37 1 0 0 0 0
Module 1 BALSWCTRL = 0x0000
WRITEDEVICE raw: C 80 E2 10 42 1 0 0 0 0
WRITEDEVICE raw: C 70 FF 3 29 1 0 0 0 0
WRITEDEVICE raw: C 6F 1 80 C1 1 0 0 0 0
Module 2 BALSWCTRL = 0x8001 cells=0b1
READDEVICE raw: D 80 E2 50 B9 51 D3 0 0 0
READDEVICE raw: D 81 0 50 F9 51 D3 0 0 0
READ 0x81 ok=1
RAW 0x81: D 81 0 50 F9 51 D3
READDEVICE raw: D 6F 1 0 D1 1 D3 0 0 0
READDEVICE raw: D 70 0 0 40 1 D3 0 0 0
M2 ok80=1 ok81=1 ok6F=1 ok70=1
0x80=50E2
0x81=5000
0x6F=1
0x70=0
CAN: 44.3V 4.1A 29.1% CH_HEX1 CH_STAT0
Module 1: 3648mV 3648mV 3649mV 3647mV 3649mV 3648mV
Module 2: 3940mV 3697mV 3698mV 3696mV 3695mV 3688mV
Module 1 Temps: 19C 19C 19C | Die: 18
Module 2 Temps: 19C 19C 19C | Die: 18
WRITEDEVICE raw: 4 6F 0 0 37 1 0 0 0 0
Module 1 BALSWCTRL = 0x0000
WRITEDEVICE raw: C 80 E2 10 42 1 0 0 0 0
WRITEDEVICE raw: C 70 FF 3 29 1 0 0 0 0
WRITEDEVICE raw: C 6F 1 80 C1 1 0 0 0 0
Module 2 BALSWCTRL = 0x8001 cells=0b1
READDEVICE raw: D 80 E2 50 B9 51 D3 0 0 0
READDEVICE raw: D 81 0 50 F9 51 D3 0 0 0
READ 0x81 ok=1
RAW 0x81: D 81 0 50 F9 51 D3
READDEVICE raw: D 6F 1 0 D1 1 D3 0 0 0
READDEVICE raw: D 70 0 0 40 1 D3 0 0 0
M2 ok80=1 ok81=1 ok6F=1 ok70=1
0x80=50E2
0x81=5000
0x6F=1
0x70=0
CAN: 44.3V 0.-7A 29.1% CH_HEX1 CH_STAT0
Module 1: 3648mV 3648mV 3648mV 3647mV 3649mV 3648mV
Module 2: 3940mV 3696mV 3698mV 3697mV 3696mV 3688mV
Module 1 Temps: 19C 19C 19C | Die: 18
Module 2 Temps: 19C 19C 19C | Die: 18
WRITEDEVICE raw: 4 6F 0 0 37 1 0 0 0 0
Module 1 BALSWCTRL = 0x0000
WRITEDEVICE raw: C 80 E2 10 42 1 0 0 0 0
WRITEDEVICE raw: C 70 FF 3 29 1 0 0 0 0
WRITEDEVICE raw: C 6F 1 80 C1 1 0 0 0 0
Module 2 BALSWCTRL = 0x8001 cells=0b1
READDEVICE raw: D 80 E2 50 B9 51 D3 0 0 0
READDEVICE raw: D 81 0 50 F9 51 D3 0 0 0
READ 0x81 ok=1
RAW 0x81: D 81 0 50 F9 51 D3
READDEVICE raw: D 6F 1 0 D1 1 D3 0 0 0
READDEVICE raw: D 70 0 0 40 1 D3 0 0 0
M2 ok80=1 ok81=1 ok6F=1 ok70=1
0x80=50E2
0x81=5000
0x6F=1
0x70=0
CAN: 44.3V 0.-7A 29.1% CH_HEX1 CH_STAT0
Module 1: 3649mV 3648mV 3648mV 3647mV 3649mV 3648mV
Module 2: 3940mV 3697mV 3698mV 3697mV 3696mV 3688mV
- Attachments
-
- BMS2_7_4_MAX17854_CELLOK_TEMPOK_v4.01_copy.ino
- (56.27 KiB) Downloaded 3 times
Re: Kia Niro BMS
Register 0x70 (BALEXP1) is zero, that means there's no balance timer set.
Change line 1729
Remove lines 872-874 out of the balance loop, these registers are already set in the setupSlaves() function.
Replace lines 754-758 - you really do want to enable AUTOBALSWDIS, dis automatically disables the shunts momentarily when taking voltage readings. If you do not enable this, your voltage reading will be lower than actual due to the shunts being active.
Expectations are that this will enable the shunts as needed, and the CBTimer will eventually expire when the pack is balanced.
This section of MAX17854.pdf is instructive
and call which will reset the timer. You will need to implement this logic!
Unfortunately, I do not have any spare MAX17854 modules spare at the moment and so cannot test.
(pg. 267 Max17854.pdf)Value 0x3FF operates balancing indefinitely (no timer expiration).
Default value 0x000 disables cell balancing (preconfigured timer expiration).
Change line 1729
Code: Select all
writeAllSlaves(0x70, 0x0258, true); // BALEXP1 = 600s/10mins - not indefiniteCode: Select all
// FORCE proper launch of balancing (important for manual mode)
writeAddressedSlave(0x80, 0x10E2, m, true); // BALCTRL: manual, measurements enabled
writeAddressedSlave(0x70, 0x03FF, m, true); // BALEXP1: long timeoutCode: Select all
// MAX17854: SCANCTRL (0x66)
// AUTOBALSWDIS=1, OVSAMPL=32x, SCANMODE=1, SCAN pulse
// CHANGE Enabled AUTOBALSWDIS (1 << 12)
const uint16_t scanctrl_start =
(1 << 12) | (0b100 << 3) | (1 << 1) | (1 << 0); This section of MAX17854.pdf is instructive
Translated, balance the pack until all voltage conditions are met, at which point CBRESTART is not sent. If the pack becomes unbalanced, reissue aCBRESTART Usage in Manual Mode
The CBRESTART bit within the BALSWCTRL register must periodically be written to a 1 to restart the watchdog timer
and prevent the cell-balancing switches from being automatically disabled due to exiting manual mode when CBTIMER
reaches CBEXP1. In the event that a host fails to write the CBRESTART bit or forgets to disable the cell-balancing
switches, the cell-balancing watchdog can automatically disable all cell-balancing switches, regardless of the BALSWEN
configuration. The cell-balancing watchdog does not modify the contents of the BALSWEN bits within the BALSWCTRL
register.
The CBRESTART bit is used in manual cell-balancing mode only. It provides a means to select new BALSW settings
and refresh the watchdog timer with a single command.
This bit is ignored and has no effect outside of an active manual cell-balancing operation. If a manual operation was
selected and the timer is allowed to expire, the operation must be relaunched with a write to BALCTRL (i.e., CBRESTART
will not reinitiate a manual operation that has allowed the CBTIMER to expire).
Code: Select all
writeAllSlaves(0x80, 0x10E4, true); Code: Select all
balanceCells(); Unfortunately, I do not have any spare MAX17854 modules spare at the moment and so cannot test.
-
zuuus
- Posts: 39
- Joined: Wed Sep 10, 2025 9:27 am
- Location: Netherlands
- Has thanked: 4 times
- Been thanked: 3 times
Re: Kia Niro BMS
So I did the changes but I don't notice any balancing active on my modules. It doesn't change in temperature or voltage. From what I can see in the log is cell 1 balancing is active on module 2 and stays on. CBRESTART is working. See log (Current sensor not connected/not used, so ignore the current reading)
Code: Select all
Entering Configuration Mode Successful!
Setting Baudrate Successful!
Starting to Set Mask!
Setting Mask Successful!
Starting to Set Filter!
Setting Filter Successful!
Starting to Set Filter!
Setting Filter Successful!
Starting to Set Mask!
Setting Mask Successful!
Starting to Set Filter!
Setting Filter Successful!
Starting to Set Filter!
Setting Filter Successful!
Starting to Set Filter!
Setting Filter Successful!
Starting to Set Filter!
Setting Filter Successful!
Current sens calib
Current sens calib NOK: 261, 223 (range)
Current sens calib
Current sens calib NOK: 307, 223 (range)
Current sens calib
Current sens calib NOK: 295, 223 (range)
Current sens calib
Current sens calib NOK: 263, 223 (range)
Current sens calib
Current sens calib NOK: 327, 223 (range)
Current sens calib
Current sens calib NOK: 254, 223 (range)
Current sens calib
Current sens calib NOK: 328, 223 (range)
Current sens calib
Current sens calib NOK: 264, 223 (range)
Current sens calib
Current sens calib NOK: 300, 223 (range)
Current sens calib
Current sens calib NOK: 296, 223 (range)
Configured modules = 2
Read capacity from EEPROM
Configured modules: 2
Configured cells: 12
Message length: 9
Daisy chain init
HELLOALL returned: 57 0 2
Set all slaves
STATUS raw: 3 2 20 40 A0 0 0 0 0 0 0 0
READDEVICE raw: 5 65 3F 0 B 1 D3 0 0 0
MEASUREEN2 readback = 0x3F
READDEVICE raw: 5 80 E4 50 77 51 D3 0 0 0
READDEVICE raw: 5 81 0 50 7D 51 D3 0 0 0
READ 0x81 ok=1
RAW 0x81: 5 81 0 50 7D 51 D3
READDEVICE raw: 5 6F 0 0 95 1 D3 0 0 0
READDEVICE raw: 5 70 0 0 C4 1 D3 0 0 0
M1 ok80=1 ok81=1 ok6F=1 ok70=1
0x80=50E4
0x81=5000
0x6F=0
0x70=0
READDEVICE raw: D 80 E4 50 F3 51 D3 0 0 0
READDEVICE raw: D 81 0 50 F9 51 D3 0 0 0
READ 0x81 ok=1
RAW 0x81: D 81 0 50 F9 51 D3
READDEVICE raw: D 6F 0 0 11 1 D3 0 0 0
READDEVICE raw: D 70 0 0 40 1 D3 0 0 0
M2 ok80=1 ok81=1 ok6F=1 ok70=1
0x80=50E4
0x81=5000
0x6F=0
0x70=0
Saved to EEPROM, FORCEPOR
Module 1 Temps: 19C 19C 19C | Die: 18
Module 2 Temps: 19C 19C 19C | Die: 18
READDEVICE raw: 5 80 E4 50 77 51 D3 0 0 0
Module 1 BALCTRL readback = 0x50E4
READDEVICE raw: D 80 E4 50 F3 51 D3 0 0 0
Module 2 BALCTRL readback = 0x50E4
WRITEDEVICE raw: C 6F 1 80 C1 1 0 0 0 0
READDEVICE raw: D 6F 1 0 D1 1 D3 0 0 0
Module 2 wrote BALSWCTRL = 0x8001
Module 2 0x6F readback ok=1 value=0x1
CAN: 44.3V -10.-4A 29.1% CH_HEX1 CH_STAT0
Module 1: 3648mV 3648mV 3648mV 3647mV 3649mV 3648mV
Module 2: 3939mV 3697mV 3698mV 3697mV 3696mV 3688mV
Module 1 Temps: 19C 19C 19C | Die: 18
Module 2 Temps: 19C 19C 19C | Die: 18
READDEVICE raw: 5 80 E4 50 77 51 D3 0 0 0
Module 1 BALCTRL readback = 0x50E4
READDEVICE raw: D 80 E4 50 F3 51 D3 0 0 0
Module 2 BALCTRL readback = 0x50E4
WRITEDEVICE raw: C 6F 1 80 C1 1 0 0 0 0
READDEVICE raw: D 6F 1 0 D1 1 D3 0 0 0
Module 2 wrote BALSWCTRL = 0x8001
Module 2 0x6F readback ok=1 value=0x1
CAN: 44.3V -11.-6A 29.1% CH_HEX1 CH_STAT0
Module 1: 3648mV 3648mV 3648mV 3647mV 3649mV 3649mV
Module 2: 3940mV 3697mV 3697mV 3697mV 3696mV 3688mV
Module 1 Temps: 19C 19C 19C | Die: 18
Module 2 Temps: 19C 19C 19C | Die: 18
READDEVICE raw: 5 80 E4 50 77 51 D3 0 0 0
Module 1 BALCTRL readback = 0x50E4
READDEVICE raw: D 80 E4 50 F3 51 D3 0 0 0
Module 2 BALCTRL readback = 0x50E4
WRITEDEVICE raw: C 6F 1 80 C1 1 0 0 0 0
READDEVICE raw: D 6F 1 0 D1 1 D3 0 0 0
Module 2 wrote BALSWCTRL = 0x8001
Module 2 0x6F readback ok=1 value=0x1
CAN: 44.3V -10.-7A 29.1% CH_HEX1 CH_STAT0
Module 1: 3648mV 3648mV 3649mV 3647mV 3649mV 3648mV
Module 2: 3940mV 3697mV 3698mV 3697mV 3695mV 3688mV
Module 1 Temps: 19C 19C 19C | Die: 18
Module 2 Temps: 19C 19C 19C | Die: 18
READDEVICE raw: 5 80 E4 50 77 51 D3 0 0 0
Module 1 BALCTRL readback = 0x50E4
READDEVICE raw: D 80 E4 50 F3 51 D3 0 0 0
Module 2 BALCTRL readback = 0x50E4
WRITEDEVICE raw: C 6F 1 80 C1 1 0 0 0 0
READDEVICE raw: D 6F 1 0 D1 1 D3 0 0 0
Module 2 wrote BALSWCTRL = 0x8001
Module 2 0x6F readback ok=1 value=0x1
CAN: 44.3V -10.-9A 29.1% CH_HEX1 CH_STAT0
Module 2: 3940mV 3696mV 3698mV 3696mV 3695mV 3688mV
Module 1 Temps: 19C 19C 19C | Die: 18
Module 2 Temps: 19C 19C 19C | Die: 18
READDEVICE raw: 5 80 E4 50 77 51 D3 0 0 0
Module 1 BALCTRL readback = 0x50E4
READDEVICE raw: D 80 E4 50 F3 51 D3 0 0 0
Module 2 BALCTRL readback = 0x50E4
WRITEDEVICE raw: C 6F 1 80 C1 1 0 0 0 0
READDEVICE raw: D 6F 1 0 D1 1 D3 0 0 0
Module 2 wrote BALSWCTRL = 0x8001
Module 2 0x6F readback ok=1 value=0x1
CAN: 44.3V -11.-5A 29.1% CH_HEX1 CH_STAT0
Module 1: 3649mV 3648mV 3649mV 3647mV 3649mV 3648mV
Module 2: 3940mV 3697mV 3697mV 3696mV 3695mV 3688mV
Module 1 Temps: 19C 19C 19C | Die: 18
Module 2 Temps: 19C 19C 19C | Die: 18
READDEVICE raw: 5 80 E4 50 77 51 D3 0 0 0
Module 1 BALCTRL readback = 0x50E4
READDEVICE raw: D 80 E4 50 F3 51 D3 0 0 0
Module 2 BALCTRL readback = 0x50E4
WRITEDEVICE raw: C 6F 1 80 C1 1 0 0 0 0
READDEVICE raw: D 6F 1 0 D1 1 D3 0 0 0
Module 2 wrote BALSWCTRL = 0x8001
Module 2 0x6F readback ok=1 value=0x1
CAN: 44.3V -11.0A 29.1% CH_HEX1 CH_STAT0
Module 2: 3940mV 3696mV 3697mV 3696mV 3696mV 3688mV
Module 1 Temps: 19C 19C 19C | Die: 18
Module 2 Temps: 19C 19C 19C | Die: 18
READDEVICE raw: 5 80 E4 50 77 51 D3 0 0 0
Module 1 BALCTRL readback = 0x50E4
READDEVICE raw: D 80 E4 50 F3 51 D3 0 0 0
Module 2 BALCTRL readback = 0x50E4
WRITEDEVICE raw: C 6F 1 80 C1 1 0 0 0 0
READDEVICE raw: D 6F 1 0 D1 1 D3 0 0 0
Module 2 wrote BALSWCTRL = 0x8001
Module 2 0x6F readback ok=1 value=0x1
CAN: 44.3V -11.-2A 29.1% CH_HEX1 CH_STAT0
Module 1: 3649mV 3648mV 3648mV 3647mV 3649mV 3649mV
Module 2: 3939mV 3697mV 3698mV 3697mV 3696mV 3688mV
Module 1 Temps: 19C 19C 19C | Die: 18
Module 2 Temps: 19C 19C 19C | Die: 18
READDEVICE raw: 5 80 E4 50 77 51 D3 0 0 0
Module 1 BALCTRL readback = 0x50E4
READDEVICE raw: D 80 E4 50 F3 51 D3 0 0 0
Module 2 BALCTRL readback = 0x50E4
WRITEDEVICE raw: C 6F 1 80 C1 1 0 0 0 0
READDEVICE raw: D 6F 1 0 D1 1 D3 0 0 0
Module 2 wrote BALSWCTRL = 0x8001
Module 2 0x6F readback ok=1 value=0x1
CAN: 44.3V -10.-4A 29.1% CH_HEX1 CH_STAT0
Contactor Error
Module 1: 3648mV 3648mV 3648mV 3647mV 3649mV 3648mV
Module 2: 3940mV 3696mV 3697mV 3696mV 3696mV 3688mV
Module 1 Temps: 19C 19C 19C | Die: 18
Module 2 Temps: 19C 19C 19C | Die: 18
READDEVICE raw: 5 80 E4 50 77 51 D3 0 0 0
Module 1 BALCTRL readback = 0x50E4
READDEVICE raw: D 80 E4 50 F3 51 D3 0 0 0
Module 2 BALCTRL readback = 0x50E4
WRITEDEVICE raw: C 6F 1 80 C1 1 0 0 0 0
READDEVICE raw: D 6F 1 0 D1 1 D3 0 0 0
Module 2 wrote BALSWCTRL = 0x8001
Module 2 0x6F readback ok=1 value=0x1
CAN: 44.2V -12.0A 29.1% CH_HEX81 CH_STAT0
Module 2: 3939mV 3696mV 3697mV 3696mV 3695mV 3687mV
Module 1 Temps: 19C 19C 19C | Die: 18
Module 2 Temps: 19C 19C 19C | Die: 19
READDEVICE raw: 5 80 E4 50 77 51 D3 0 0 0
Module 1 BALCTRL readback = 0x50E4
READDEVICE raw: D 80 E4 50 F3 51 D3 0 0 0
Module 2 BALCTRL readback = 0x50E4
WRITEDEVICE raw: C 6F 1 80 C1 1 0 0 0 0
READDEVICE raw: D 6F 1 0 D1 1 D3 0 0 0
Module 2 wrote BALSWCTRL = 0x8001
Module 2 0x6F readback ok=1 value=0x1
CAN: 44.2V -10.-5A 29.1% CH_HEX81 CH_STAT0
Module 1: 3647mV 3648mV 3648mV 3646mV 3648mV 3648mV
Module 2: 3940mV 3696mV 3697mV 3696mV 3695mV 3688mV
Module 1 Temps: 19C 19C 19C | Die: 18
Module 2 Temps: 19C 19C 19C | Die: 19
READDEVICE raw: 5 80 E4 50 77 51 D3 0 0 0
Module 1 BALCTRL readback = 0x50E4
READDEVICE raw: D 80 E4 50 F3 51 D3 0 0 0
Module 2 BALCTRL readback = 0x50E4
WRITEDEVICE raw: C 6F 1 80 C1 1 0 0 0 0
READDEVICE raw: D 6F 1 0 D1 1 D3 0 0 0
Module 2 wrote BALSWCTRL = 0x8001
Module 2 0x6F readback ok=1 value=0x1
CAN: 44.3V -12.-2A 29.1% CH_HEX81 CH_STAT0
Module 1: 3648mV 3648mV 3649mV 3647mV 3649mV 3648mV
Module 2: 3940mV 3697mV 3698mV 3697mV 3696mV 3688mV
Module 1 Temps: 19C 19C 19C | Die: 19
Module 2 Temps: 19C 19C 19C | Die: 19
READDEVICE raw: 5 80 E4 50 77 51 D3 0 0 0
Module 1 BALCTRL readback = 0x50E4
READDEVICE raw: D 80 E4 50 F3 51 D3 0 0 0
Module 2 BALCTRL readback = 0x50E4
WRITEDEVICE raw: C 6F 1 80 C1 1 0 0 0 0
READDEVICE raw: D 6F 1 0 D1 1 D3 0 0 0
Module 2 wrote BALSWCTRL = 0x8001
Module 2 0x6F readback ok=1 value=0x1
CAN: 44.3V -9.-9A 29.1% CH_HEX81 CH_STAT0
Module 1: 3648mV 3648mV 3649mV 3647mV 3649mV 3647mV
Module 2: 3940mV 3696mV 3698mV 3696mV 3695mV 3688mV
Module 1 Temps: 19C 19C 19C | Die: 19
Module 2 Temps: 19C 19C 19C | Die: 19
READDEVICE raw: 5 80 E4 50 77 51 D3 0 0 0
Module 1 BALCTRL readback = 0x50E4
READDEVICE raw: D 80 E4 50 F3 51 D3 0 0 0
Module 2 BALCTRL readback = 0x50E4
WRITEDEVICE raw: C 6F 1 80 C1 1 0 0 0 0
READDEVICE raw: D 6F 1 0 D1 1 D3 0 0 0
Module 2 wrote BALSWCTRL = 0x8001
Module 2 0x6F readback ok=1 value=0x1
CAN: 44.2V -12.-4A 29.1% CH_HEX81 CH_STAT0
Module 1: 3648mV 3648mV 3648mV 3646mV 3649mV 3648mV
Module 2: 3939mV 3696mV 3697mV 3696mV 3696mV 3688mV
Module 1 Temps: 19C 19C 19C | Die: 19
Module 2 Temps: 19C 19C 19C | Die: 19
READDEVICE raw: 5 80 E4 50 77 51 D3 0 0 0
Module 1 BALCTRL readback = 0x50E4
READDEVICE raw: D 80 E4 50 F3 51 D3 0 0 0
Module 2 BALCTRL readback = 0x50E4
WRITEDEVICE raw: C 6F 1 80 C1 1 0 0 0 0
READDEVICE raw: D 6F 1 0 D1 1 D3 0 0 0
Module 2 wrote BALSWCTRL = 0x8001
Module 2 0x6F readback ok=1 value=0x1
CAN: 44.3V -10.-2A 29.1% CH_HEX81 CH_STAT0
Module 1: 3648mV 3647mV 3648mV 3647mV 3649mV 3648mV
Module 2: 3940mV 3697mV 3698mV 3696mV 3695mV 3688mV
Module 1 Temps: 19C 19C 19C | Die: 19
Module 2 Temps: 19C 19C 19C | Die: 19
READDEVICE raw: 5 80 E4 50 77 51 D3 0 0 0
Module 1 BALCTRL readback = 0x50E4
READDEVICE raw: D 80 E4 50 F3 51 D3 0 0 0
Module 2 BALCTRL readback = 0x50E4
WRITEDEVICE raw: C 6F 1 80 C1 1 0 0 0 0
READDEVICE raw: D 6F 1 0 D1 1 D3 0 0 0
Module 2 wrote BALSWCTRL = 0x8001
Module 2 0x6F readback ok=1 value=0x1
CAN: 44.3V -12.-5A 29.1% CH_HEX81 CH_STAT0
Module 1: 3648mV 3647mV 3648mV 3646mV 3649mV 3648mV
Module 2: 3940mV 3696mV 3698mV 3697mV 3695mV 3688mV
Module 1 Temps: 19C 19C 19C | Die: 19
Module 2 Temps: 19C 19C 19C | Die: 19
READDEVICE raw: 5 80 E4 50 77 51 D3 0 0 0
Module 1 BALCTRL readback = 0x50E4
READDEVICE raw: D 80 E4 50 F3 51 D3 0 0 0
Module 2 BALCTRL readback = 0x50E4
WRITEDEVICE raw: C 6F 1 80 C1 1 0 0 0 0
READDEVICE raw: D 6F 1 0 D1 1 D3 0 0 0
Module 2 wrote BALSWCTRL = 0x8001
Module 2 0x6F readback ok=1 value=0x1
CAN: 44.3V -9.-6A 29.1% CH_HEX81 CH_STAT0
Module 1: 3648mV 3648mV 3648mV 3647mV 3649mV 3648mV
Module 2: 3940mV 3696mV 3698mV 3697mV 3696mV 3688mV
Module 1 Temps: 19C 19C 19C | Die: 19
Module 2 Temps: 19C 19C 19C | Die: 19
READDEVICE raw: 5 80 E4 50 77 51 D3 0 0 0
Module 1 BALCTRL readback = 0x50E4
READDEVICE raw: D 80 E4 50 F3 51 D3 0 0 0
Module 2 BALCTRL readback = 0x50E4
WRITEDEVICE raw: C 6F 1 80 C1 1 0 0 0 0
READDEVICE raw: D 6F 1 0 D1 1 D3 0 0 0
Module 2 wrote BALSWCTRL = 0x8001
Module 2 0x6F readback ok=1 value=0x1
CAN: 44.2V -12.-5A 29.1% CH_HEX81 CH_STAT0
Module 1: 3648mV 3647mV 3648mV 3646mV 3649mV 3648mV
Module 2: 3939mV 3696mV 3698mV 3696mV 3695mV 3688mV
Module 1 Temps: 19C 19C 19C | Die: 19
Module 2 Temps: 19C 19C 19C | Die: 19
READDEVICE raw: 5 80 E4 50 77 51 D3 0 0 0
Module 1 BALCTRL readback = 0x50E4
READDEVICE raw: D 80 E4 50 F3 51 D3 0 0 0
Module 2 BALCTRL readback = 0x50E4
WRITEDEVICE raw: C 6F 1 80 C1 1 0 0 0 0
READDEVICE raw: D 6F 1 0 D1 1 D3 0 0 0
Module 2 wrote BALSWCTRL = 0x8001
Module 2 0x6F readback ok=1 value=0x1
CAN: 44.3V -9.-4A 29.1% CH_HEX81 CH_STAT0
Module 1: 3647mV 3648mV 3648mV 3647mV 3649mV 3647mV
Module 2: 3940mV 3697mV 3698mV 3696mV 3696mV 3688mV
Module 1 Temps: 19C 19C 19C | Die: 19
Module 2 Temps: 19C 19C 19C | Die: 19
READDEVICE raw: 5 80 E4 50 77 51 D3 0 0 0
Module 1 BALCTRL readback = 0x50E4
READDEVICE raw: D 80 E4 50 F3 51 D3 0 0 0
Module 2 BALCTRL readback = 0x50E4
WRITEDEVICE raw: C 6F 1 80 C1 1 0 0 0 0
READDEVICE raw: D 6F 1 0 D1 1 D3 0 0 0
Module 2 wrote BALSWCTRL = 0x8001
Module 2 0x6F readback ok=1 value=0x1
CAN: 44.3V -12.-5A 29.1% CH_HEX81 CH_STAT0
Module 1: 3648mV 3648mV 3648mV 3647mV 3649mV 3648mV
Module 1 Temps: 19C 19C 19C | Die: 19
Module 2 Temps: 19C 19C 19C | Die: 19
READDEVICE raw: 5 80 E4 50 77 51 D3 0 0 0
Module 1 BALCTRL readback = 0x50E4
READDEVICE raw: D 80 E4 50 F3 51 D3 0 0 0
Module 2 BALCTRL readback = 0x50E4
WRITEDEVICE raw: C 6F 1 80 C1 1 0 0 0 0
READDEVICE raw: D 6F 1 0 D1 1 D3 0 0 0
Module 2 wrote BALSWCTRL = 0x8001
Module 2 0x6F readback ok=1 value=0x1
CAN: 44.3V -9.-3A 29.1% CH_HEX81 CH_STAT0
Module 2: 3939mV 3696mV 3698mV 3696mV 3695mV 3688mV
Module 1 Temps: 19C 19C 19C | Die: 19
Module 2 Temps: 19C 19C 19C | Die: 19
READDEVICE raw: 5 80 E4 50 77 51 D3 0 0 0
Module 1 BALCTRL readback = 0x50E4
READDEVICE raw: D 80 E4 50 F3 51 D3 0 0 0
Module 2 BALCTRL readback = 0x50E4
WRITEDEVICE raw: C 6F 1 80 C1 1 0 0 0 0
READDEVICE raw: D 6F 1 0 D1 1 D3 0 0 0
Module 2 wrote BALSWCTRL = 0x8001
Module 2 0x6F readback ok=1 value=0x1
CAN: 44.3V -12.-5A 29.1% CH_HEX81 CH_STAT0
Module 1: 3648mV 3648mV 3649mV 3646mV 3649mV 3648mV
Module 2: 3940mV 3696mV 3697mV 3696mV 3695mV 3688mV
Module 1 Temps: 19C 19C 19C | Die: 19
Module 2 Temps: 19C 19C 19C | Die: 19
READDEVICE raw: 5 80 E4 50 77 51 D3 0 0 0
Module 1 BALCTRL readback = 0x50E4
READDEVICE raw: D 80 E4 50 F3 51 D3 0 0 0
Module 2 BALCTRL readback = 0x50E4
WRITEDEVICE raw: C 6F 1 80 C1 1 0 0 0 0
READDEVICE raw: D 6F 1 0 D1 1 D3 0 0 0
Module 2 wrote BALSWCTRL = 0x8001
Module 2 0x6F readback ok=1 value=0x1
CAN: 44.3V -9.-3A 29.1% CH_HEX81 CH_STAT0
Module 1: 3648mV 3648mV 3648mV 3647mV 3649mV 3648mV
Module 2: 3940mV 3696mV 3698mV 3697mV 3696mV 3688mV
Module 1 Temps: 19C 19C 19C | Die: 19
Module 2 Temps: 19C 19C 19C | Die: 19
READDEVICE raw: 5 80 E4 50 77 51 D3 0 0 0
Module 1 BALCTRL readback = 0x50E4
READDEVICE raw: D 80 E4 50 F3 51 D3 0 0 0
Module 2 BALCTRL readback = 0x50E4
WRITEDEVICE raw: C 6F 1 80 C1 1 0 0 0 0
READDEVICE raw: D 6F 1 0 D1 1 D3 0 0 0
Module 2 wrote BALSWCTRL = 0x8001
Module 2 0x6F readback ok=1 value=0x1
CAN: 44.3V -12.-5A 29.1% CH_HEX81 CH_STAT0
Module 2: 3939mV 3696mV 3698mV 3697mV 3696mV 3688mV
Module 1 Temps: 19C 19C 19C | Die: 19
Module 2 Temps: 19C 19C 19C | Die: 19
READDEVICE raw: 5 80 E4 50 77 51 D3 0 0 0
Module 1 BALCTRL readback = 0x50E4
READDEVICE raw: D 80 E4 50 F3 51 D3 0 0 0
Module 2 BALCTRL readback = 0x50E4
WRITEDEVICE raw: C 6F 1 80 C1 1 0 0 0 0
READDEVICE raw: D 6F 1 0 D1 1 D3 0 0 0
Module 2 wrote BALSWCTRL = 0x8001
Module 2 0x6F readback ok=1 value=0x1
CAN: 44.3V -9.-7A 29.1% CH_HEX81 CH_STAT0
Module 1: 3648mV 3648mV 3649mV 3647mV 3649mV 3648mV
Module 1 Temps: 19C 19C 19C | Die: 19
Module 2 Temps: 19C 19C 19C | Die: 19
READDEVICE raw: 5 80 E4 50 77 51 D3 0 0 0
Module 1 BALCTRL readback = 0x50E4
READDEVICE raw: D 80 E4 50 F3 51 D3 0 0 0
Module 2 BALCTRL readback = 0x50E4
WRITEDEVICE raw: C 6F 1 80 C1 1 0 0 0 0
READDEVICE raw: D 6F 1 0 D1 1 D3 0 0 0
Module 2 wrote BALSWCTRL = 0x8001
Module 2 0x6F readback ok=1 value=0x1
CAN: 44.3V -12.0A 29.1% CH_HEX81 CH_STAT0
Module 1: 3648mV 3648mV 3648mV 3647mV 3649mV 3648mV
Module 2: 3939mV 3696mV 3698mV 3697mV 3695mV 3688mV
- Attachments
-
- BMS2_7_4_MAX17854_CELLOK_TEMPOK_v4_02.ino
- (56.72 KiB) Downloaded 4 times
Re: Kia Niro BMS
All your cells are below the startShuntVoltage.
Line 83
change to
Line 83
Code: Select all
const int16_t startShuntVoltage = 3750;Code: Select all
const int16_t startShuntVoltage = 3600;-
zuuus
- Posts: 39
- Joined: Wed Sep 10, 2025 9:27 am
- Location: Netherlands
- Has thanked: 4 times
- Been thanked: 3 times
Re: Kia Niro BMS
Still nothing happening. I also tested at 3500 but that also doesn't work.
EDIT: Could it be that I see nothing because the bleed current is low? I calculated 6 1k resistors with highest cell voltage 3.94V gives me 23.6mA of bleed current. That would mean I would run it a long time before I see any changes. How did you guys test the cell balancing on the MAX17823 modules?
EDIT: Could it be that I see nothing because the bleed current is low? I calculated 6 1k resistors with highest cell voltage 3.94V gives me 23.6mA of bleed current. That would mean I would run it a long time before I see any changes. How did you guys test the cell balancing on the MAX17823 modules?
Re: Kia Niro BMS
Ohh, if you’re looking for change…forget about it. These balance really slowly. Check the thermals (die temp) for indications of balancing.
- bexander
- Posts: 897
- Joined: Tue Jun 16, 2020 6:00 pm
- Location: Gothenburg, Sweden
- Has thanked: 78 times
- Been thanked: 102 times
Re: Kia Niro BMS
There is also 2 resistors in series when balancing is active, so total resistance is 1k/6 + 1k/6 = 333ohm and at 3,939V thats just under 12mA. So really slow balancing.
Let the program be active for ~1h and see if the cell voltages changes, to see if balancing is active.
To get that 3,9 cell down to the others I would manually connect an external resistor or light bulb, otherwise it will take forever...
Let the program be active for ~1h and see if the cell voltages changes, to see if balancing is active.
To get that 3,9 cell down to the others I would manually connect an external resistor or light bulb, otherwise it will take forever...
-
zuuus
- Posts: 39
- Joined: Wed Sep 10, 2025 9:27 am
- Location: Netherlands
- Has thanked: 4 times
- Been thanked: 3 times
Re: Kia Niro BMS
That explains why I see nothing happening. I will run it for 1h or more and see if I see anything different. Thanks!
Re: Kia Niro BMS
To give you an idea of how slow some Maxim based packs balance, it took 6 months to resolve a 250mV delta on one of my packs.
You have three options.
1. Watch the die temps, they should heat up when shunts are active.
2. Disable AUTOBALSWDIS in the scan code, you can then watch the individual cell voltage dip when shunted (not a feature on MAX17823 chips)
3. Watch the medium term data, take snapshots of data every 12 hours.
You have three options.
1. Watch the die temps, they should heat up when shunts are active.
2. Disable AUTOBALSWDIS in the scan code, you can then watch the individual cell voltage dip when shunted (not a feature on MAX17823 chips)
3. Watch the medium term data, take snapshots of data every 12 hours.