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 .
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 .