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.

BQ27421-G1: learning cycle

Part Number: BQ27421-G1
Other Parts Discussed in Thread: BQSTUDIO, , GPCCHEM

Hi Wyatt Keller,

I need your help. I've been trying to do the learning cycle for weeks and can't.
I have a battery with a capacity of 2000mAh and a nominal voltage of 3.7V.
As you told me I am following the instructions written on the document SLUA597. I'm ignoring the IT_ENABLE command and the QEN bit as they don't exist in the bq27421.
I start by discharging the battery to a voltage below 3 V. At this point I wait for the relaxation time but this never comes. The RUP_DIS bit is cleared but the VOK bit is not set. After hours of waiting I decide to continue anyway. I put the battery in charge. At the end of the charge (FC set) I wait for the relaxation time but UPDATE_STATUS does not go to 1. Why does UPDATE_STATUS not go to 1?
Thank you.

  • Hello,


    Would you please attach your gg file and log file? 

    Are you waiting 5 hours during each relaxation (after every charge/discharge)?
    When doing a learning cycle, update status should be configured to 03 (bit-0 and bit-1 should be set). Make sure you set UPDATE_STATUS back to zero after successful learning cycle

    VOK bit only indicates cell voltages are ok for Qmax updates (which means an OCV measurement will be taken, once taken, it will clear). In order for the gauge to update OCV, there has to be a good relaxation (please make sure you relax for at least 5 hours)

    For learning cycles:

    1- make sure you fully discharge the cell to empty(TermV) first (use a discharge rate of at least C/5). The range is between C/5 and C/10.

    2- Relax for at least 5 hours. This is a recommended time for VOK and RDIS to clear, it can happen sooner.

    3- charge battery to full. (typical charging rate C/2) Make sure IT is enabled, you can do this by sending a Gauge_EN() command from bqStudio if using it. VOK should be set now. 

    4- Relax for 5 hours again. VOK bit -> Same as step 2. At this point, QMax should be updated. 

    5 - Discharge the battery again to empty. Here your resistance table will update during discharge.

    6 - Relax for 5 hours. VOK should be clear, REST flag set. 

    This gauge does not change Update_status register at all, it is only user configured. You can use the RES_UP and QMAX_UP bits to indicate when Qmax and Ra get updated.

    Regards,

    Jose Couso

  • Hi Jose,

    you wrote: "Make sure IT is enabled, you can do this by sending a Gauge_EN () command from bqStudio if using it". But I can't find the IT bit in the bqStudio nor the Gauge_EN command.

    Where do I find them?

    I am attaching an image of my bqStudio.
    Thank you.
    Best regards.

  • Hello Stefano,

    Sorry, I forgot this gauge does not have the Gauge_EN() subcommand in the right side of bqStudio.

    The Impedance Track algorithm starts as soon as the gauge detects the insertion of the battery. There are two ways you can do this:

    1 - When the BIE bit is set in the OpConfig register, host is responsible for driving BIN pin from logic high to low to signal the battery insertion. More info in section 2.5.2 in the technical reference manual. 

    2- When the BIE bit is NOT set, the host needs to send the BAT_INSERT subcommand to signal the battery insertion.

    For me, method-2 is easier. As you may see, you do have this BAT_INSERT subcommand in the right side of bqStudio. So, you would just make sure you configure BIE bit from OpConfig register to zero before you send the BAT_INSERT subcommand. 

    Regards,
    Jose Couso

  • Hi Jose,

    I did as you told me but the learning cycle is not successful.

    Before starting the learning cycle I set the following parameters:
    Terminate Voltage = 3100 mV
    Design Capacity = 2000mAh
    Design Energy = 7400 mWh (2000 * 3.7)
    Taper Rate = 250 (80 mA)
    Quit Current = 300 (66.6 mA)
    Update Status = 03 (as you told me)
    I also cleared the BIE bit and sent the BAT_INSERT command (as you told me). After that I started the learning cycle by charging the battery.

    Can you tell me what I'm doing wrong? I am attaching the log files.
    Thank you.
    Best regards.
    Stefano

    .4572.log.zip

  • Hello Gabriel,

    There are a few things wrong.

    First, going back to my first reply. Remember that for successful learning cycles you must first discharge completely the battery, rest, charge to full, rest, discharge to empty again, then rest. After looking at your log file, I saw that you are not following this sequence. You fully charged the battery, when you have to fully discharge it first. 

    Your cycling process:


    Here' an example of what the data should look like when doing a learning cycle. Notice how the learning cycle sequence is followed.


    Second, your configurations can be enhanced to tune the gauge's parameters better for best accuracy.

    I believe you are confusing the taper rate with taper current. I believe your taper current is desired to be 250 mA. 
    Given a taper current of 250 mA, the taper rate formula is: 

    Taper Rate = Design Capacity / (0.1 * (Taper Current + 15% of taper current))

    Please follow the quick start guide for bq27421-G1 where they talk about this, and much more.
    https://www.ti.com/lit/ml/sluuah7b/sluuah7b.pdf?ts=1659017241535&ref_url=https%253A%252F%252Fwww.google.com%252F

    Third, aside from following the quick start guide, there are other parameters you should have in consideration when configurating your gauge for your application.

    Make sure the following conditions meet in your configuration parameters:

    - taper current > chg current threshold > quit current

    - dsg current threshold > quit current (quit current is an absolute value)

    - make sure your quit current is less than C/20. For your application, your quit current should be less than 100 mA

    Fourth, make sure you are using the correct ChemID for this gauge before you attempt to do the learning cycle. Since this is a ROM gauge you can't program the chem ID, we sell 3 different order-able parts and you have to use the GPCCHEM tool to see which one would be the best fit for you to order.

    To check the chemistry you are using:


    Regards,
    Jose Couso

  • Hi Jose,

    I have set up the gauge as follows:

    • Terminate Voltage       = 3100 mV
    • Design Capacity         = 2000 mAh
    • Design Energy           = 7400 mWh (2000 * 3.7)
    • Quit current                = 300 (66.6 mA)
    • Taper rate                   = 217 (taper current = 80 mA)
    • chg current threshold = 286 (70 mA)
    • dsg current threshold = 286 (70 mA)
    • Update Status            = 0x03

    The following conditions are met (as you told me):

    • taper current > chg current threshold > quit current    -->   80 mA > 70 mA > 66.6 mA
    • dsg current threshold > quit current          -->  70 mA > 66.6 mA
    • quit current is less than C/20               -->  66.6 mA < 100

    I cleared the BIE bits and sent the command BAT_INSERT.

    At this point I discharged the battery and left it to rest overnight. I waited for VOK and RUP_DIS to cancel ("2- Relax for at least 5 hours. This is a recommended time for VOK and RDIS to clear, it can happen sooner.") but that didn't happen.

    Can you tell me what am I doing wrong?

    Do you think the settings are right?

    I am attaching the log files.

    Thank you.
    Best regards.
    Stefano

    Log_2022_08_01.zip

  • Hello Stefano,

    For Qmax to update (for successful learning cycle):

    - RUP_DIS must not be set
    - MinPassedChargePercent parameter must be 90%, this means you have to fully discharge your battery.

    From your log file I noticed that in your ControlStatus register, RUP_DIS is always set as well as VOK. These bits will only get cleared if you rest for 5 hours. I know you mentioned you relaxed for 5 hours, but your log file still shows no rest period. Also, are you exporting your log file correct? This is what I am getting.

    As you can see in the picture above, your current is always equal to zero. How are you making sure you are discharging? 

    I did not see a relaxation point in your log file, this is very important for RUP_DIS and VOK to clear.

    As for your configuration settings, they look fine.


    Regards,
    Jose

  • Hi Jose,

    I managed to get the learning cycle. I thank you.

    I managed to get the learning cycle. I thank you.
    Now I have a question: every time the battery is disconnected the gauge loses all data. How do I know that the battery has been reconnected and reload the learning cycle data? Is there a register that can give me this information?
    In fact, the battery is equipped with a protection circuit that cuts the voltage if it drops too much. So I have to figure out if this has happened and reload the learning cycle.

    Thank you.
    Best regards.
    Stefano

  • Hello Stefano,

    I am glad you were able to get a successful learning cycle. 

    The bq27421 is a ROM based gauge, it will load default parameters after it shutdown and powers up again. To ensure battery is inserted you can read from Flags() register BAT_DET bit. If BAT_DET bit is high, then is inserted.

    I recommend you follow this app note on how to go to production after a successful learning cycle.


    https://www.ti.com/lit/an/slua595/slua595.pdf?ts=1659712439510&ref_url=https%253A%252F%252Fwww.ti.com%252Fproduct%252FBQ27421-G1%253Futm_source%253Dgoogle%2526utm_medium%253Dcpc%2526utm_campaign%253Dapp-null-null-GPN_EN-cpc-pf-google-wwe%2526utm_content%253DBQ27421G1%2526ds_k%253DBQ27421-G1%2526DCM%253Dyes%2526gclid%253DEAIaIQobChMIqJ37tf6v-QIVrhfUAR2I4Q0CEAAYASAAEgI5NPD_BwE%2526gclsrc%253Daw.ds

    Regards,
    Jose Couso

  • Hi Jose,

    I'm confused. Do you want to tell me that every time I unplug the battery I lose the learning cycle data?

    Do I have to upload the learning cycle data every time I reconnect the battery?

    Does the device not have a non-volatile memory where to save the learning cycle data?

    Best regards.
    Stefano

  • Hello Stefano,

    Sorry for the confusion. 

    The purpose of the learning cycle is to update Qmax and to update the resistance table. After doing a successful learning cycle like you did, customer must tune parameters in the Data Memory tap if using bqStudio. Then, ensure your parameters were configured properly by monitoring RSOC, RM, FCC, etc. After customer make sure all this is working properly, customer must export the golden image. The golden image is a file which contains all flash data that is used at the production line to program the bq27421.

    I'm confused. Do you want to tell me that every time I unplug the battery I lose the learning cycle data?

    If battery gets disconnected, data gets erased. The gauge has a bit (ITPOR) which if set, it indicates that RAM configuration registers have been reset to default values and the host should reload the golden image. The ITPOR bit is in the Flags() register.

    Does the device not have a non-volatile memory where to save the learning cycle data?

    The golden image will contain all flash data you configured in the Data Memory. This is why it needs to be exported once customer is ready for production.

    It's a good idea for the host (uC) to regularly read Ra and State class and save it on the host's file-system. Then load it in case ITPOR is 1.

    Regards,
    Jose Couso

  • Hi Jose,

    I managed to do everything. I thank you for your availability and your patience.

    But now I have another problem. I extracted the golden image (.gm.fs file). When I tried to program another BQ27421 device, the bqStudio software returned the following error: "Read compare error on line 7".

    I understand that this error is due to the firmware version of the device. In fact, the device with which I did the learning cycle has a firmware version 0x0109. While the device I want to program has a firmware version 0x0108.

    I understand that this error is due to the firmware version of the device. In fact, the device with which I did the learning cycle has a firmware version 0x0109. While the device I want to program has a firmware version 0x0108.
    How can I program the device?
    Do I have to repeat the learning cycle with this device too?
    Is there a way to update the device to version 0x0109?
    If in the future the firmware version changes again what should I do?

    Having solved this problem, I will load the Golden Image following the instructions in the SLUA801 document (https://www.ti.com/lit/an/slua801/slua801.pdf). Correct?

    Best regards.
    Stefano

  • Hello Stefano,

    The bq27421 has a fixed FW in ROM, so the version cannot be upgraded. What you can do instead for the 0x0108 version is the following:

    - The easiest path is to export the gg file from version 0x0109 and import it to the 0x0108 FW version and then manually check if all relevant parameters were updated (do not forget to click the "write all"). This uses references to names of parameters and not addresses, hence it usually works. 

    Once you have it working with the 0x0108 version, you can also export the golden image for this version.

    Regarding your last question, I would check SLUA801 and SLUA595 app notes when uploading golden image. You can simply use bqStudio to upload golden images.

    Regards,
    Jose Couso