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: BQ27427YZFR always reports charging/negative current.

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

Tool/software:

My team has a PCB with the BQ27427YZFR to measure the current state of charge; however, we are struggling to build a sensible driver for determining the state of the battery.

We've tried multiple batteries, but it seems no matter what the configuration of the system, we are seeing the following:

AverageCurrent() is _always_ negative, the DSG bit of Flags() is _always_ 0.

We are configuring: Design Capacity, Design Energy, Terminate Voltage, and Taper Rate as a part of writing out our configuration.

My gut says we're missing something, but its just not obvious to me.

For reference, our test bench is using the Zephyr driver (https://github.com/zephyrproject-rtos/zephyr/tree/main/samples/sensor/bq274xx).

We are also applying the CC Gain sign change per: e2e.ti.com/.../bq27427evm-misbehaving-stateofcharge

  • Hey Joe, 

    The negative current during charging and the positive current during discharging is likely caused by the sign of the CC Gain parameter. Please ensure that you have correctly and successfully changed the sign by doing a read back on the value you have programmed. 

    Regards, 

    Robert. 

  • Robert, but the system always seems to report negative current, in all circumstances. If the system is connected to the battery + charger or just the battery.

    We've even pulled our debug boards out of the housing and are directly powering them via a breadboard with the battery connected in parallel. Whether the power supply is on or off, the current always reports negative.

  • Hello Joe, 

    Can you attempt to change the sign of the CC Gain parameter using bqStudio? I am still not convinced that the sign of the CC Gain parameter is correctly being changed. 

    Regards, 

    Robert. 

  • Robert,

    Is it possible to use bqStudio on production hardware? My understanding is we need a TI device (EV2400 I believe) with direct access to the I2C headers.

    Am I incorrect?

  • Hello Joe, 

    You can use bqStudio + the EV2400 with your production board as long as you are able to access the I2C lines. 

    Regards, 

    Robert. 

  • Ok,

    I will need to make some modifications to access those lines, but I did modify our software to intentionally mess with the CC Gain, and it isn't fixing the behavior.

    When I force CC Gain to be negative: The current is always positive, whether the charger is connected or not.


    When I force CC Gain to be positive: The current is always negative, whether the charger is connected or not.

    Is it possible another parameter is incorrect and causing this? The cells we are using are 3.7V, and we are configuring the 4.2V chemistry. We also set the design capacity and terminate voltage to 85 mAh and 3V respectively.

  • Hello Joe, 

    When you manually read off the Hex value for CCGain, can you please share with me the value you read back? 

    Regards, 

    Robert.

  • Ok, have the system setup in BQ Studio. Can confirm that CC Gain is positive (It is being reported as 0.3349).

    The value is: 0x7F 0x2B 0x78 0x03

    Also, I noticed that the currents are wildly inaccurate, even though the sign is wrong. Talking significantly off (ex: Bench power supply is reporting consumed current is 32 mA while charging, chip is average current is -74 mA).

    The fact that it is not just sign, could this point to the parameters being incorrect? Particularly because this device's battery is small.

  • Hey Joe, 

    Have you performed a current calibration on the gauge? If not please perform the current calibration on the gauge.

    Regards, 

    Robert. 

  • How do I do that?

    And how would I push that calibration to multiple devices? Like how would I write out that calibration to production devices? We don't have the headers to hook up to bqStudio on our production boards.

  • Hello Joe, 

    What you can do is perform the current calibration procedure on 20+ boards, then take the average for the current calibration parameters and program this averaged value onto the gauges in production. 

    Regards, 

    Robert. 

  • Robert,


    Sorry, I don't think I was specific enough. Which calibration parameters do I need to take for the production gauges? 

    The calibration seems to have worked, I just don't know to which values I need to pay attention.

  • Hello Joe, 

    This should be the CC Cal parameters. 

    Regards, 

    Robert. 

  • Ok, I think something still isn't right.

    The production software behavior is not matching what we're seeing with our bench setups in BQStudio.

    Specifically, we have one bench setup connected to BQStudio with a battery and charger, we are seeing a switch between positive and negative currents based on whether the charger is connected. I pulled those 4 CC Cal parameters you mentioned.

    Those CC Cal parameters, when put into production software and written via i2C to the 0x69 memory block are not producing the same behavior with the same battery and charger.

    Both setups had Design Capacity, Design Energy, Taper Current, Discharge Threshold, Charge Threshold, Terminate Voltage, and Quit Current manually entered.

  • Hello, 

    Could you please provide me with the HEX value you are obtaining for the CC Cal parameters? 

    Regards, 

    Robert. 

  • So, I read the entire block at 0x69:

    00 00 0B D4 81 0B E4 04 95 1F 2A 1E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00


    I am writing that entire block out starting at 0x40, followed by the checksum (B0) at 0x60.

  • Hey Joe, 

    Using bqStudio, could you send a screenshot of the exact commands being sent and the hex value you read back. Sorry I wasn't clear about this in my last response. 

    Regards, 

    Robert. 

  • Sure, I will pull it when I am in the office.