Overcurrent discharge does not disable

good day once again .
Upon further testing i have found that amperages that exceed the values predefined in main.cpp do not shut off discharging ?
BMS.setOvercurrentDischargeProtection(15000, 520); // delay in ms

at this value of 15 amp the unit continues to run .
The library does support the feature and the shunt resistors i have used 4 and a set the shunt ohms to
#define SHUNT_RESISTOR 0.25 // mOhm

long bq769x0::setOvercurrentDischargeProtection(long current_mA, int delay_ms)
{
regPROTECT2_t protect2;

// Remark: RSNS must be set to 1 in PROTECT1 register

protect2.bits.OCD_THRESH = 0;
for (int i = sizeof(OCD_threshold_setting)-1; i > 0; i--) {
    if (current_mA * shuntResistorValue_mOhm / 1000 >= OCD_threshold_setting[i]) {
        protect2.bits.OCD_THRESH = i;
        break;
    }
}

protect2.bits.OCD_DELAY = 0;
for (int i = sizeof(OCD_delay_setting)-1; i > 0; i--) {
    if (delay_ms >= OCD_delay_setting[i]) {
        protect2.bits.OCD_DELAY = i;
        break;
    }
}

writeRegister(PROTECT2, protect2.regByte);

// returns the actual current threshold value
return (long)OCD_threshold_setting[protect2.bits.OCD_THRESH] * 1000 /
    shuntResistorValue_mOhm;

}

//---------------------------------------------------

The reason is that your overcurrent setting is too low for such a small resistor value. You can’t set the overcurrent protection to any value, but just to the values specified in the datasheet (and in the array OCD_threshold_setting). The lowest setting is 17 mV, but 15 A with 0.25 mOhm resistor results in a voltage drop of only 3.75 mV.

good day, i didnt refer the to datahsheet of the current sense resistors totally over looked the voltage difference for r sense measurement on low side resistors …
Thank you !

i tried some reasonable value as per below. Ran some big loads and the bms continues to enable discharge fet , There must be a condition im missing but all seems in order .

#define SHUNT_RESISTOR 0.25 // mOhm

BMS.setTemperatureLimits(-20, 45, 0, 45);
BMS.setShuntResistorValue(SHUNT_RESISTOR);
BMS.setShortCircuitProtection(95000, 200);  // delay in us
BMS.setOvercurrentChargeProtection(65000, 200);  // delay in ms
BMS.setOvercurrentDischargeProtection(85000, 320); // delay in ms

these are well over the 17mv setting . Using 4 x Bourns CRE2512-R001E-3

based on some tests im not getting the discharge fet disable call. i have been monitoring the serial output .For Temperature discharge disable we do get a call though . Temperature error (CHG)Disabling DISCHG FET

Serial interface started. Time: 0
NumCells: 8, voltage: 26110 V
checkStatus() = 0
Umin = 3261
temperatures[0] = 208
checkStatus() = 0
Umax = 3266
temperatures[0] = 208
Enabling CHG FET
Disabling CHG FET
Temperature error (CHG)Disabling DISCHG FET
Temperature error (DSG)checkStatus() = 0
Umax = 3271
temperatures[0] = 549
Enabling CHG FET
Clearing temperature error (CHG)checkStatus() = 0
Umin = 3265
temperatures[0] = 549
Clearing temperature error (DSG)

ive managed to test again this time with 1 resistor set to a value of 1mOhm and SCD settings work but OCD still does not work at any values close or above the scd value . i tried 10A 20A 30A and 40A more then double the limit of the resistor . Please help .

Can you post the content of the registers (using the printRegisters function)?

Do I understand correctly that you changed your PCB and removed 3 of the 4 resistors to that the effective resistance is now 1 mOhm?

good day
Many thanks for responding .
I have removed 3 of the four current sense resistors and im currently testing with 1 resistor and the value of config_48.h has been set to 1.0mOhm respectively as indicated for using a single resistor setup . As mentioned even in this condition i do not get a Over current disable flag .
the registers are as follows .

22:33:26.533 -> 0x00 SYS_STAT: 10000000
22:33:26.533 -> 0x01 CELLBAL1: 00000000
22:33:26.533 -> 0x04 SYS_CTRL1: 00011000
22:33:26.533 -> 0x05 SYS_CTRL2: 01000011
22:33:26.533 -> 0x06 PROTECT1: 10011010
22:33:26.533 -> 0x07 PROTECT2: 01100000
22:33:26.533 -> 0x08 PROTECT3: 01100000
22:33:26.533 -> 0x09 OV_TRIP: 01011101
22:33:26.533 -> 0x0A UV_TRIP: 10001111
22:33:26.533 -> 0x0B CC_CFG: 00011001
22:33:26.533 -> 0x32 CC_HI: 11111111
22:33:26.533 -> 0x33 CC_LO: 01100010
22:33:27.552 -> 0x00 SYS_STAT: 00000000
22:33:27.552 -> 0x01 CELLBAL1: 00000000
22:33:27.552 -> 0x04 SYS_CTRL1: 00011000
22:33:27.552 -> 0x05 SYS_CTRL2: 01000011
22:33:27.552 -> 0x06 PROTECT1: 10011010
22:33:27.552 -> 0x07 PROTECT2: 01100000
22:33:27.552 -> 0x08 PROTECT3: 01100000
22:33:27.552 -> 0x09 OV_TRIP: 01011101
22:33:27.552 -> 0x0A UV_TRIP: 10001111
22:33:27.552 -> 0x0B CC_CFG: 00011001
22:33:27.552 -> 0x32 CC_HI: 11111111
22:33:27.552 -> 0x33 CC_LO: 01100101
22:33:28.534 -> 0x00 SYS_STAT: 00000000
22:33:28.534 -> 0x01 CELLBAL1: 00000000
22:33:28.534 -> 0x04 SYS_CTRL1: 00011000
22:33:28.534 -> 0x05 SYS_CTRL2: 01000011
22:33:28.534 -> 0x06 PROTECT1: 10011010
22:33:28.534 -> 0x07 PROTECT2: 01100000
22:33:28.534 -> 0x08 PROTECT3: 01100000
22:33:28.534 -> 0x09 OV_TRIP: 01011101
22:33:28.534 -> 0x0A UV_TRIP: 10001111
22:33:28.534 -> 0x0B CC_CFG: 00011001
22:33:28.534 -> 0x32 CC_HI: 11111110
22:33:28.534 -> 0x33 CC_LO: 11011011
22:33:29.551 -> 0x00 SYS_STAT: 00000000
22:33:29.551 -> 0x01 CELLBAL1: 00000000
22:33:29.551 -> 0x04 SYS_CTRL1: 00011000
22:33:29.551 -> 0x05 SYS_CTRL2: 01000011
22:33:29.551 -> 0x06 PROTECT1: 10011010
22:33:29.551 -> 0x07 PROTECT2: 01100000
22:33:29.551 -> 0x08 PROTECT3: 01100000
22:33:29.551 -> 0x09 OV_TRIP: 01011101
22:33:29.551 -> 0x0A UV_TRIP: 10001111
22:33:29.551 -> 0x0B CC_CFG: 00011001
22:33:29.551 -> 0x32 CC_HI: 11111110
22:33:29.551 -> 0x33 CC_LO: 11100111
22:33:30.533 -> 0x00 SYS_STAT: 00000000
22:33:30.533 -> 0x01 CELLBAL1: 00000000
22:33:30.533 -> 0x04 SYS_CTRL1: 00011000
22:33:30.533 -> 0x05 SYS_CTRL2: 01000011
22:33:30.533 -> 0x06 PROTECT1: 10011010
22:33:30.533 -> 0x07 PROTECT2: 01100000
22:33:30.533 -> 0x08 PROTECT3: 01100000
22:33:30.533 -> 0x09 OV_TRIP: 01011101
22:33:30.533 -> 0x0A UV_TRIP: 10001111
22:33:30.533 -> 0x0B CC_CFG: 00011001
22:33:30.533 -> 0x32 CC_HI: 11101000
22:33:30.533 -> 0x33 CC_LO: 00001110
22:33:31.549 -> 0x00 SYS_STAT: 00000000
22:33:31.549 -> 0x01 CELLBAL1: 00000000
22:33:31.549 -> 0x04 SYS_CTRL1: 00011000
22:33:31.549 -> 0x05 SYS_CTRL2: 01000011
22:33:31.549 -> 0x06 PROTECT1: 10011010
22:33:31.549 -> 0x07 PROTECT2: 01100000
22:33:31.549 -> 0x08 PROTECT3: 01100000
22:33:31.549 -> 0x09 OV_TRIP: 01011101
22:33:31.549 -> 0x0A UV_TRIP: 10001111
22:33:31.549 -> 0x0B CC_CFG: 00011001
22:33:31.549 -> 0x32 CC_HI: 11100111
22:33:31.549 -> 0x33 CC_LO: 10110001
22:33:32.532 -> 0x00 SYS_STAT: 10000000
22:33:32.532 -> 0x01 CELLBAL1: 00000000
22:33:32.532 -> 0x04 SYS_CTRL1: 00011000
22:33:32.532 -> 0x05 SYS_CTRL2: 01000011
22:33:32.532 -> 0x06 PROTECT1: 10011010
22:33:32.532 -> 0x07 PROTECT2: 01100000
22:33:32.532 -> 0x08 PROTECT3: 01100000
22:33:32.532 -> 0x09 OV_TRIP: 01011101
22:33:32.532 -> 0x0A UV_TRIP: 10001111
22:33:32.532 -> 0x0B CC_CFG: 00011001
22:33:32.532 -> 0x32 CC_HI: 11100111
22:33:32.532 -> 0x33 CC_LO: 10110000
22:33:33.447 -> 0x00 SYS_STAT: 00000000
22:33:33.447 -> 0x01 CELLBAL1: 00000000
22:33:33.481 -> 0x04 SYS_CTRL1: 00011000
22:33:33.481 -> 0x05 SYS_CTRL2: 01000011
22:33:33.481 -> 0x06 PROTECT1: 10011010
22:33:33.481 -> 0x07 PROTECT2: 01100000
22:33:33.481 -> 0x08 PROTECT3: 01100000
22:33:33.481 -> 0x09 OV_TRIP: 01011101
22:33:33.481 -> 0x0A UV_TRIP: 10001111
22:33:33.481 -> 0x0B CC_CFG: 00011001
22:33:33.481 -> 0x32 CC_HI: 11100111
22:33:33.481 -> 0x33 CC_LO: 10110001
22:33:34.530 -> 0x00 SYS_STAT: 00000000
22:33:34.530 -> 0x01 CELLBAL1: 00000000
22:33:34.530 -> 0x04 SYS_CTRL1: 00011000
22:33:34.530 -> 0x05 SYS_CTRL2: 01000011
22:33:34.530 -> 0x06 PROTECT1: 10011010
22:33:34.530 -> 0x07 PROTECT2: 01100000
22:33:34.530 -> 0x08 PROTECT3: 01100000
22:33:34.530 -> 0x09 OV_TRIP: 01011101
22:33:34.530 -> 0x0A UV_TRIP: 10001111
22:33:34.530 -> 0x0B CC_CFG: 00011001
22:33:34.530 -> 0x32 CC_HI: 11100111
22:33:34.530 -> 0x33 CC_LO: 10110110
22:33:35.544 -> 0x00 SYS_STAT: 00000000
22:33:35.544 -> 0x01 CELLBAL1: 00000000
22:33:35.544 -> 0x04 SYS_CTRL1: 00011000
22:33:35.544 -> 0x05 SYS_CTRL2: 01000011
22:33:35.544 -> 0x06 PROTECT1: 10011010
22:33:35.544 -> 0x07 PROTECT2: 01100000
22:33:35.544 -> 0x08 PROTECT3: 01100000
22:33:35.544 -> 0x09 OV_TRIP: 01011101
22:33:35.544 -> 0x0A UV_TRIP: 10001111
22:33:35.544 -> 0x0B CC_CFG: 00011001
22:33:35.544 -> 0x32 CC_HI: 11100111
22:33:35.544 -> 0x33 CC_LO: 10111110
22:33:36.526 -> 0x00 SYS_STAT: 00000000
22:33:36.526 -> 0x01 CELLBAL1: 00000000
22:33:36.526 -> 0x04 SYS_CTRL1: 00011000
22:33:36.526 -> 0x05 SYS_CTRL2: 01000011
22:33:36.526 -> 0x06 PROTECT1: 10011010
22:33:36.526 -> 0x07 PROTECT2: 01100000
22:33:36.526 -> 0x08 PROTECT3: 01100000
22:33:36.526 -> 0x09 OV_TRIP: 01011101
22:33:36.526 -> 0x0A UV_TRIP: 10001111
22:33:36.526 -> 0x0B CC_CFG: 00011001

all during the test i was running a load greater than the cut off at 48A
with ocd set at 44000 Mah and time set to 100ms

Posting the register content one time would have been enough :wink:

With these settings it should definitely trip. Please double-check if the settings from the register correspond to what you set in the software:

SCD:

  • Delay is set to 400 us, which is quite high and not recommended in the datasheet.
  • The threshold is set to 89 mV, corresponding to 89 A with the 1 mOhm resistor

OCD:

  • Delay is set to 640 ms
  • Threshold: 8 mV = 8 A

I guess you applied the current for several seconds, so the delay should not be the issue. Don’t have an idea at the moment why the OCD doesn’t trip.