This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

BQ34110: BQ34110: bq34110 does not count the same charge charging as discharging among other issues

Part Number: BQ34110
Other Parts Discussed in Thread: BQ34Z100

Tool/software:

Hello.  I'm not sure if this question has been covered already.  We have a design in development that uses the bq34110 (the BQ34110PW specifically).  We've repeatedly tested this gas gauge and consistently run into the same issue.  I know it is for applications where the battery is only rarely discharged, but we wanted to test in all conditions.  We have performed complete discharge tests on multiple units, multiple times.  We know that at the beginning of the tests (battery full charged and BQ34110PW reporting correctly, battery full charged).  As we run down the battery the reported charge seems to be counted correctly.  The battery is spec'd at 4930mAh and the gas gauge reports ~4750mAh have passed through it during discharge.  However, on charging, we consistently see the BQ34110PW only counts ~3550mAh over a complete charge.  We can confirm that the battery was in fact completely discharged.  Why might this be?  We've seen it said we could perform multiple charge/discharge cycles for calibration, but this is unacceptable for a production line setting.  We can't have units go out that report funky values for several charge/discharge cycles.  Has anyone encountered this?  I am a EE.  I can provide our schematic (dragged into editor).  We followed the application notes.  I do not have much detail on the code, but if that is needed I can have our FW engineers provide that information.  Let me know what you can.

We don't have a .gg file.  We are programming with this:

int bq341xx_calibrate(const struct device* dev, const struct bq341xx_calib_data* calib_data) {

if (!dev || !calib_data) {
return -EINVAL;
}

int rc = 0;

LOG_INF("Calibrate Battery Gauge");

rc = bq341xx_gauge_set_sealed(dev, false);
if (rc != 0) {
LOG_ERR("unseal fail");
return -EBADF;
}

rc = bq341xx_cfg(dev, 0x002D, true);
if (rc != 0) {
LOG_ERR("enter calib err");
return -EBADF;
}

/* Calibration mode */
{
LOG_INF("update flash OK");

// Voltage Divider
(void)bq341xx_change_df_u16(dev, 0x4010, 18981u);

k_msleep(BQ341XX_DELAY * 2);

/* Flash OK */
rc = bq341xx_change_df_u16(dev, 0x4157, 1000);
if (rc != 0) {
LOG_WRN("flash-ok fail");
}

k_msleep(BQ341XX_DELAY * 2);

// Voltage Divider
rc = bq341xx_change_df_u16(dev, 0x4010, 18981u);

k_msleep(BQ341XX_DELAY * 2);

LOG_INF("change pin ctl");
rc = bq341xx_calibrate_pin_ctl(dev);
if (rc != 0) {
LOG_WRN("pin ctl fail");
}

k_msleep(BQ341XX_DELAY * 2);

rc = bq341xx_change_df_u16(dev, 0x41F9, calib_data->design_voltage);
if (rc != 0) {
LOG_WRN("design-vol fail");
}

for (int i = 0; i < ARRAY_SIZE(calib_data->voltage_dod); ++i) {
k_msleep(BQ341XX_DELAY * 2);
const uint16_t dod_addr = 0x4263 + (i * 2);

bq341xx_change_df_u16(dev, dod_addr, calib_data->voltage_dod[i]);

k_msleep(BQ341XX_DELAY * 2);
}

/* Design Capacity */
rc = bq341xx_change_df_u16(dev, 0x41F5, calib_data->design_capacity);
if (rc != 0) {
LOG_WRN("design-cap fail");
}

rc = bq341xx_change_df_u16(dev, 0x40C0, calib_data->design_capacity);
if (rc != 0) {
LOG_WRN("design-cap fail");
}

bq341xx_change_df_u16(dev, 0x40C5, 0);

bq341xx_change_df_u16(dev, 0x4184, 3150);
bq341xx_change_df_u8(dev, 0x4186, 2);
bq341xx_change_df_u16(dev, 0x4187, 3400);

bq341xx_change_df_u16(dev, 0x4189, 4300);
bq341xx_change_df_u8(dev, 0x418B, 2);
bq341xx_change_df_u16(dev, 0x418C, 4200);

// Disable self discharge
bq341xx_change_df_u8(dev, 0x4295, 0);

/* Design Cells */
rc = bq341xx_change_df_u8(dev, 0x4155, calib_data->cells_count);
if (rc != 0) {
LOG_WRN("design-cells fail");
}

k_msleep(BQ341XX_DELAY);

/* Max Pack Voltage */
rc = bq341xx_change_df_u16(dev, 0x4088, (uint16_t)(calib_data->max_voltage / 20));
if (rc != 0) {
LOG_WRN("design-cells fail");
}

rc = bq341xx_change_df_u16(dev, 0x4123, (uint16_t)(calib_data->max_voltage));
if (rc != 0) {
LOG_WRN("design-cells fail");
}

k_msleep(BQ341XX_DELAY);

rc = bq341xx_change_df_u16(dev, 0x408A, (uint16_t)(calib_data->min_voltage / 20));
if (rc != 0) {
LOG_WRN("design-cells fail");
}

k_msleep(BQ341XX_DELAY);

rc = bq341xx_change_df_u8(dev, 0x400F, 0);
}

k_msleep(BQ341XX_DELAY);

rc = bq341xx_cfg(dev, 0x2D, false);
if (rc != 0) {
LOG_WRN("exit calib err");
}

bq341xx_reset(dev);

return 0;
}

This is our register mapping:

Register   Address Value
0x4010    18981u
0x4157    1000
0x4010    18981u (repeated)
0x41F9    calib_data->design_voltage
0x4263 + (i * 2) calib_data->voltage_dod[i] (looped)
0x41F5    calib_data->design_capacity
0x40C0    calib_data->design_capacity
0x40C5    0
0x4184    3150
0x4186    2
0x4187    3400
0x4189    4300
0x418B    2
0x418C    4200
0x4295    0 (Disable self-discharge)
0x4155    calib_data->cells_count (Design Cells)
0x4088    (uint16_t)(calib_data->max_voltage / 20)
0x4123    (uint16_t)(calib_data->max_voltage)
0x408A    (uint16_t)(calib_data->min_voltage / 20)
0x400F    0

  • Hi,

    Can you share a log file?

    Are these the only parameters you have changed?

    Regards,

    Diego

  • Yes, that is all the FW team gave me so it must be all they're setting.  I was surprised also because in the datasheet there are many more that give formulas and things to calculated the correct setting, implying they need to be set.  I think the FW guy might be confused because I asked him and he said those were 'learned' and updated themselves, but when I checked a box that had gone through several cycles they had not changed.  I recently talked to the company that made the battery and they said they may have suggestions for all the settings for this part.  Do you guys have an example setup that I could pass along to the FW guy so he can see what all he should be looking at in addition to the ones above?

  • Hello again.  Another question or two.  In my last reply I mentioned how the battery maker said they had recommended parameters for the BQ34110, but it turns out they were using the what they called the "BQ34100".  I'm looking into how similar those are to each other.  Could you shed any light on that?  When I search DigiKey or Google BQ34100 I only get hits for BQ34Z100.  I'm concerned now since they weren't actually using the same part and potentially didn't even give me the right PN for what they were using.  

  • Hello again.  Could I get some feedback here?  I've gotten the FW team to look at this again and they're looking at the other parameters they need to set.  I've also gotten in touch with the manufacturer of the battery we're using to try and get all the physical parameter information from them that will help with the register setting and calibration.