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.

BQ27427: Fuel gauge measures backwards

Part Number: BQ27427
Other Parts Discussed in Thread: BQSTUDIO,

Hi!

I’m experiencing an unexpected behavior when using the battery fuel gauge. It seems to measure current in the wrong direction, making the SOC calculation all backwards. For instance, the SOC value decreases during charging and then increases when discharging the battery.

The average current and power registers show accurate (amplitude) positive numbers when running on battery and negative numbers when charging the battery. The battery is connected to the BAT pin (C3) and the charger and system voltage connected to the SRX pin (C2).

Have our hardware team got the design wrong, or am I missing some critical configuration from the software side? I’m using the default settings since the should be close enough to our battery.

Can anyone please advice on how I shall proceed.

Best regards,

Oscar

  • Hello Oscar, 

    Please change the sign of the CCGain parameter. Having a negative sign for the CCGain is known to cause this behavior. 

    Regards, 

    Jonny. 

  • Thank you for you reply! 

    I don't know if I have the wrong manual (SLUUCD5), but I cant find any parameter that matches CCGain. The closest I find is "CC Cal Temp" which only seems to compensate for temperature. 

    Can you please advise to which manual I should consult?

    My situation is that I have a bunch of assembled PCB:s, without external access to the i2c-bus, so I don't think I can use calibration feature from bqStudio as it was intended. So I need to change the calibration values from my firmware. 

    Best regards,

    Oscar

  • Hello Oscar, 

    This is not in the BQ27427 TRM. Below are the steps to changing the BQ27427 CC Gain parameter without bqStudio (Note that this is just an example and the actual CC Gain value will vary from gauge to gauge, so it is important to be able to read the CC Gain from the gauge). 

    Step1. Write to 0xAA ack data: 0x00 0x13 0x00  //  SET CFGUPDATE

    Step2. Write to 0xAA ack data: 0x61 0x00

    Step3. Write to 0xAA ack data: 0x3E 0x69            // Subclass ID  105(0x69) for CC cal

    Step4. Write to 0xAA ack data: 0x3F 0x00            // for DataBlock()

    Step5. Read from 0xAA data 0x40: 0x00 0x00 0x0B 0xD3 0x7F 0xB8 0xD4 0xFE 0x92 0x0F 0xC5 0x7C 0x00

     0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00

    • Here 0x7F 0xB8 0xD4 0xFE is the floating point value for CC Gain in Hex. The 23rd bit is the sign of the number, since it is a 1 it is a negative sign. To change the sign of the CC Gain all you have to do is flip the 23rd bit to 0, so the new CC Gain will be 0x7F 0x38 0xD4 0xFE. For reference, my CC Gain I did the test with is 0.3610. Hint: if the 23rd bit is 0 then the sign of the CC Gain is positive, if the 23rd bit is 1 then the sign of the CC Gain is negative. 

    Step6. Write to 0xAA ack data: 0x40 0x00 0x00 0x0B 0xD3 0x7F 0x38 0xD4 0xFE 0x92 0x0F 0xC5 0x7C 0x00

     0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00

    Step7. Write to 0x55 ack data: 0x60 0xAE           //0XAE is the checksum

    Regards, 

    Jonny.