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.

BQ76907: How to calculate current offset for bq76907

Part Number: BQ76907

Tool/software:

Hi Team,

How to calculate the current offset for BQ76907.

Method 1: -5A and -2A Current measurement

Current 1 = -5000mA

Raw Current 1 = -83940 (average of 30 reading) 

Current 2 = -2000mA

Raw Current 2 = -30179

Curr Gain = 8192 * [(-5000)-(-2000)]/[(-83940)-(-30179)]

               = 8192 * [-3000/-53761]

               = 457.1

=> How to calculate the offset based on this 2 current reading?

Method 2: -5A and 0A Current measurement

Current 1 = -5000mA

Raw Current 1 = -83940

Current 2 = 0A

Raw Current 2 = 5500 (average of 30 reading)

Curr Gain = 8192 * [(-5000)-(0)]/[(-83940)-5500)]

               = 8192 * [-5000/-89440]

               = 457.9

Curr Offset = 5500

The current reading using this Gain and offset is not accurate. Register 0x3A reading for -5A will fluctuate between -5023mA to -5203mA? 

During 0A, no discharge register 3A current reading will fluctuate from 10mA to -200mA

=> What causes this?

When CC1 gain and offset were set to the same value,

CC1 Gain = 457

CC1 offset = 5500

The CC1 current register, 0x3C current reading will fluctuate between, -164mA to -193mA at 0A. 

Noise is reduce but seems like using the wrong offset value. 

=> how to calculate the offset for cc1 current?

 When both current and CC1 current gain to set to 32, the raw current, 0x36 readings changed to 2276 instead of 5500.

=> Why the raw current value will change when gain is changed?

Method 3: -5A and -2A Current measurement

Current 1 = -5000mA

CC1 current,0x3c = -341

Current 2 = -2000mA

CC1 current, 0x3c = -131

CC1 Gain = 32 x [(-5000) - (2000)]/[(-341) - (-131)] = 457

Stated in the TRM, to calculate the CC1 offset, set CC1 gain to 32 (cc1 current offset = 0) and read 0x3c CC1 current for 256 samples at 0A and 1A, i get CC1 current offset = 8.

=> why 1A and 0A condition i got the same cc1 offset value as 8?

In my firmware Setting,  

CC1 current gain = 457

CC1 current offset = 8

running the code,

=> At 0A, CC1 current, 0x3c fluctuate between 114 to 128mA , why not 0mA?

=> At 1A, CC1 current, 0x3c fluctuate between -872, -885mA, why not 1A?

If i manually changed CC1 current offset,0x3c and current offset, 0x3a from 8 to 2300, the resulting CC1 current, 0x3c, will be close to our set value.

=> Seems our calibrated cc1 current offset(8) is wrong. how to calculate the CC1 current offset?

Looking forward to your quick reply.

Thanks.

Regards,Ferlyn                 

  • Hi Ferlyn,

    The CC1 current offset needs to be multiplied by 256 before being entered.

    Regards,

    Max Verboncoeur

  • Hi Max,

    How to calculate the current offset for current, 0x3A?

    Method 2: -5A and 0A Current measurement

    Current 1 = -5000mA

    Raw Current 1 = -83940

    Current 2 = 0A

    Raw Current 2 = 5500 (average of 30 reading)

    Curr Gain = 8192 * [(-5000)-(0)]/[(-83940)-5500)]

                   = 8192 * [-5000/-89440]

                   = 457.9

    Curr Offset = 5500

    The current reading using this Gain and offset is not accurate. Register 0x3A reading for -5A will fluctuate between -5023mA to -5203mA? 

    During 0A, no discharge register 3A current reading will fluctuate from 10mA to -200mA

    => What causes this?

    TRM pg 30, mentioned " The value for Calibration:Current:CC1 Offset can be obtained by setting the Calibration:Current:CC1 Gain to 32 and
    summing 256 samples of 0x3C CC1 Current()."

    => What is the setting for current gain and current offset when obtaining CC1 offset? As i notice different setting in current offset will affect the cc1 current offset reading?

    At 0A, current offset = 0 and cc1 gain = 32, cc1 current will read 8

    At 0A, current offset = 5500 and cc1 gain = 32, cc1 current will read -13  

    => Is it a must to set the current offset to 0 and current gain to 32 while obtaining CC1 offset?

    Regards,

    Ferlyn

  • Hi Ferlyn,

    The current reading using this Gain and offset is not accurate. Register 0x3A reading for -5A will fluctuate between -5023mA to -5203mA? 

    During 0A, no discharge register 3A current reading will fluctuate from 10mA to -200mA

    => What causes this?

    What is your sense resistor value? The value given by 0x3A and 0x3C is in units of userAmps which changes based on the sense resistor and gain values and is not necessarily 1mA.

    The value of userA can be calculated with the following equation: 29.2nV * 8192 / (Gain * Rsense) = 1 userA

    TRM pg 30, mentioned " The value for Calibration:Current:CC1 Offset can be obtained by setting the Calibration:Current:CC1 Gain to 32 and
    summing 256 samples of 0x3C CC1 Current()."

    => What is the setting for current gain and current offset when obtaining CC1 offset? As i notice different setting in current offset will affect the cc1 current offset reading?

    You should be able to just leave the Curr Gain and Curr Offset as the values you calculated prior for the best results.

    At 0A, current offset = 0 and cc1 gain = 32, cc1 current will read 8

    At 0A, current offset = 5500 and cc1 gain = 32, cc1 current will read -13  

    => Is it a must to set the current offset to 0 and current gain to 32 while obtaining CC1 offset?

    No, the offset reading would be thrown off when you set the Curr Offset and Gain back to their calculated values.

    Regards,

    Max Verboncoeur