Other Parts Discussed in Thread: EV2400, BQSTUDIO, BQ34Z100
Hello,
we are using BQ34Z100-G1 as the gauging solution for the lead acid batteries in our robots. The lead acid batteries (each 12V 17Ah) are connected in series. Following are the configuration parameters we use
no of Cells =12 //(each battery 6 cells)
nominal Cell Voltage = 2100 mV
design Capacity = 17000 mAh
design Energy = nominal Cell Voltage * design Capacity = 35700 mWh
charge cutoff Voltage = 2160 mV
ok Cell Volt = 1000 mV
T1-T2 = 2000 mV
T2-T3 = 2330 mV
T3-T4 = 2110 mV
CCGain = 5 (5 milliOhm resistor)
CCDelta = 5 (5 milliOhm sense resistor)
chemID = 808
We do not have access to bqstudio or EV2400, hence most of our configurations have been a process of trial and error. The test value for voltage divider is 26080 which reports a good enough voltage estimate.
However the current estimates are always very bad and vary alot.
This is the code for calibrating the sense resistor. All the values listed above are updated to the gauge before performing this step.
void BQ34Z100::calibrateSenseR(float currentApplied)
{
if(currentApplied > -200.0f && currentApplied < 200.0f)
return;
auto currentMeasured = getCurrent();
/*if(currentMeasured < 0)
currentMeasured -= currentMeasured;*/
if(currentMeasured == 0)
currentMeasured = 20;
hw::Timer.udelay(190);
readDataFlashBlock(0x68,0x00,16); //read calibration subclass 104
//The data gets stored in local buffer flashData according to the index
uint32_t oldCurrentGain = ((uint32_t)flashData[0]) << 24 | (uint32_t)(flashData[1]) << 16 | (uint32_t)(flashData[2]) << 8 | (uint32_t)(flashData[3]);
float currentGainR = 4.768f/xemicsToFloat(oldCurrentGain);
float newCurrentGain = (static_cast<float>(currentMeasured)/currentApplied) * currentGainR;
uint32_t xemicCCGain = floatToXemics(4.768/newCurrentGain);
uint32_t xemicCCDelta = floatToXemics(5677445/newCurrentGain);
flashData[0] = static_cast<uint8_t>(xemicCCGain >> 24);
flashData[1] = static_cast<uint8_t>(xemicCCGain >> 16);
flashData[2] = static_cast<uint8_t>(xemicCCGain >> 8);
flashData[3] = static_cast<uint8_t>(xemicCCGain);
flashData[4] = static_cast<uint8_t>(xemicCCDelta >> 24);
flashData[5] = static_cast<uint8_t>(xemicCCDelta >> 16);
flashData[6] = static_cast<uint8_t>(xemicCCDelta >> 8);
flashData[7] = static_cast<uint8_t>(xemicCCDelta);
writeDataFlashBlock(0x68,0,16);
hw::Timer.udelay(190);
writeCheckSum();
}
the applied current is -1.00 A and usually the value reported by the gauge is either too high or zero. Is this the proper way of calibrating the gauge? are the configuration parameters correct for a leac acid battery pack?