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.

BQ34Z110 RM and SOC measurements

Other Parts Discussed in Thread: BQ34Z110, BQEVSW

Hello.
In my application i use lead-acid battery (Fiamm FG22703 12V, 27Ah) with bq34z110 fuel gauge, which connected to MCU stm32l151c6t6 over internal i2c. The bq34z110 in my app is supervisor. I have several questions:

1. First of all, at which order bytes from bq34z110 to MCU? LSB->MSB->...etc. or MSB->LSB->...etc.? And which order bytes from MCU to bq34z110? LSB->MSB->...etc. or MSB->LSB->...etc.?

2. Secondly, I have no evaluation board with bq34z110 on-board, so i can`t use Evaluation Software. Could you tell me Chemical_ID for my battery?

3. Thirdly, I tried to configure my bq34z110 next method: DesignCapacity = QmaxCell = 27000(mAh), CellTerminationVoltage = 1630 (mV), all other parameters is default. When i try to read data from the gauge (Voltage, Current, Temperature, FullCapacity, RemainingCapacity and StateOfCharge), Voltage, Current and Temperature that MCU receives is possible correct, but RemainingCapacity and StateOfCharge sometimes incorrect. I know that RemainingCapacity was calculated using Current, Voltage and Temperature measured by bq34z110, but why RM and SOC sometimes is incorrect if other parameters is correct?

4. Finally, what i must do to get correct values of StateOfCharge and RemainingCapacity? Should I follow all the instructions of the algorithm (Design Steps) described in the user manual (SLUSB55B, page 29)?

Thanks in advance.

  • Please help me! My application is not working properly!

  • Ivan,

    The data is transferred LSB, then MSB, over the I2C bus. Using the proper ChemID is critical for IT gauges. We have not characterized your battery, so I cannot assign a ChemID to it. You can collect discharge data and I can use a Mathcad program to try to find a match to one of our PbA ChemIDs. You can reference the attached document for guidance in collecting the data. I have found the gauge to return the RM and SOC in the same format as other parameters. Can you read FCC correctly? It should be the same process and RM. You will not get a proper RM and SOC value until you use the proper ChemID and run the optimization cycle. This could be the root of your problem. 

    Tom

    Chemistry selection.pdf
  • Thanks for reply, Tomas.


    I know how to collect data for battery identification, but at now is impossible, because my device is very simple, and i dont know how transmit this data into my PC - there are not external interfaces at my device. I will try to solve this problem for a couple of days, if need.

    With regard to the FCC, I can read the value, and it is correct, but only when during chip configuration I post DesignCapacity and Qmax values in the sequence of bytes MSB then LSB. Value SOC, in this case, too correct (at least the instantaneous value). Otherwise, the values of RM and FCC are not true (30825 instead of 27000). Could you explain what that means? The chip is corrupted or what?

    And yet, I must calibrate chip? As I understand it, i must run the optimization loop and set ChemID, right?

  • Thomas, could you tell me, what mean C/100, C/10? C - means capacity or C - means amperage? If so, in my case C/100, C/10 - amperage levels? What values they have? I found ChemID to other similar batteries (Panasonic LC P1220P, 12V, 20Ah) in bqChem, can I use it? What happens if I use it? ChemID = 803. If I will need to collect the data (temperature, current and voltage of the battery) is suitable for you, format of log files by type: position number, current time, current voltage, current, temperature of the battery. I could collect these data in a simple text file. Could you tell me how to better provide this data for you?

  • Ivan

    C is the capacity of the pack. You have a 27000mAh battery, so C/100 = 270mA and C/10 = 2700mA. Using the proper ChemID is not important when collecting this data, because you are not gauging. You can leave the ChemID at the default 800, until you find a better candidate. We need time, voltage, temperature and current logged into a file to analyze the ChemID. I can work with a text file and I would not try to reformat it. Sometimes people reformat the data and introduce a problem. Just log during the enter process. (charge, rest, discharge, rest)

    Tom

  • Thomas,

    on the basis of what you have said earlier, how am I supposed to understand that now is C/10 (or C/100) capacity level? I just don't understand... Before, I thought that I need to collect data of discharge process, from a fully charged battery until fully discharged state (to CellTerminationVoltage level). Am I wrong? 

    And yet, within a few days I will try to collect the data (on a fully charged battery to a fully discharged battery status) to determine ChemID and send them to you.

    Thanks again for your help, Tom.

  • Ivan,

    You will charge until the charging current drops below 270mA. You will use a 2700 mA discharge current.

    Yes, you need to discharge from full charge to the cell term voltage.

    Tom

  • Now it is clear to me, thank you Thomas. After collect the data - I will send the results to you.

  • Thomas,

    could you tell me, can i read data from BQ34Z110  (temperature, for example) often than one measurement per ~2 second? I2C, in my case, running at 400 kHz.

  • Yes, that should work. You can increase the sample time to 5 seconds, if necessary.

  • Thomas,

    today I finished measurements. Log-file is attached to this message. At log file, you can see that discharge current is ~2.9A(this value measured by bq34z110), but really this value is 2.69-2.7A (this value measured by multimeter). Other parameters, maybe, are correct. Also, at first ~1200 measurements you may see final charging process stage. 

  • Ivan,

    I tried to find a ChemID match to your data, but the program could not find one. The data does not have the rest period after the discharge completed and this is critical to finding a ChemID match. Do you have the portion of the profile logged? The rest period between charge and discharge was only 18 minutes long and it needs to be at least 2 hours long. Also, you mentioned that the bq34z110 current does not match the current measured with the multimeter. You should be able to calibrate the current to within a couple of milliamperes. An accurate current measurement will be critical in finding a ChemID match and in running the optimization cycle.

    Tom

  • Ok, Tom, first of all, i must calibrate channels measurements of the bq34z110 , after that, I must charge the battery (logging is enabled). After full charge, I need  give the battery a rest about 2 hours, then discharge it. Previously you say that after full discharge we are must give the battery rest, about 5 hours, but how i can do it, if my device powered from that battery?

  • Ivan,

    The device should be attached to the battery throughout the entire process. (charge-rest-discharge-rest) The battery does power the device, but the quiescent current is very small and will not affect the results.

    Tom

  • Hello, Thomas.
    I completely don`t understand the order of data transfer between MCU and bq34z110. You said earlier that the data is transmitted LSB then MSB, but in fact, when I read the data, for example LifetimeMaxTemp (SubClassID = 59, Offset = 0), the data to the MCU come in reverse order (Arr [0] = MSB, Arr [1 ] = LSB)! I think so, because that the default value is obtained only when bytes in to the MCU are transferred in order MSB-> LSB! I do not understand ... Why when i reading StandardCommands response, data is transmitted as you said, LSB-> MSB, but when working with ExtendedCommands, on the contrary, MSB-> LSB ???

  • Does anyone answer my question?

  • Ivan,

    1). The device transfers data for Standard and Extended commands LSB -> MSB. It will transfer block data from a SubClass as it is stored in the flash and this will be MSB -> LSB.

    2) We have covered this an you are collecting data for analysis.

    3) and 4) We covered this previously. Some of these parameters will not report correctly until the device has been calibrated and the optimization cycle has been completed.

    I think that you would have a lot better success, if you use the EV2300 and our bqEVSW to interface with the device until you can get more experience with it and get it setup.


    Please let me know if you have other questions and it would be helpful to provide log data showing the issue.

    Regards
    Tom

  • Okay, now it's clear to me. Thanks for the tips, Thomas, they helped me a lot. When I'll get new, correct measurements, I'll write to you.
    Regards, Stepanov Ivan.

  • Thomas,

    Unfortunately, I do not have the ability to use the bq34z110 through EV2300 together with bqEVSW, so I must use bq34z110 as is.

    Today I have some free time, and I decided to continue my experiments with bq34z110. I was faced with another problem, which I don't understand. When I try set the Rsense value, namely parameters CCGain and CCDelta subclass Calibration = 104, I can not read them correctly! I read the value CCGain = 0x7f71205c (hex), which should mean 0,47095 (float), but how? If the method of conversion of 4-byte hexademical a floating value corresponds to IEEE754, I get the value 3.2051197 e38. Could you explain to me how bq34z110 converts 4-byte hexademical to floating value and back? Or to get access these parameters should I use other method, that not described in chapter ACCESSING DATA FLASH, to work with bq34z110 parameters (for example CCGain, CCDelta)?

    Thanks in advance.

  • You can search for SLUA640 on the TI website. This document provides some guidance with manipulating the floating point numbers.
  • I am sorry for my dumb questions, Thomas, but I need fully understand this chip :(
  • Hello, Thomas.
    Today, I figured out with the algorithm for converting floating-point numbers in 32-bit hexadecimal value. But faced with another problem: according to the documentation (SLUSB55B, page 42), the values and CCGain CCDelta (DataFlash) are calculated as 4.768 / Rsense and 5677445 / Rsense respectively, and represent characteristics of Rsense . However, when I set the value of our measuring resistor (10 milliohms), current measurements have not changed. I have the impression that the calibration has not give effect (current value measured by multimeter - 1,64A, bq34z110 - 1,84A). My question is need I whether to change the values and CCOffset BoardOffset, and what physical meaning they carry? When I tried to set the CCOffset = 0, at first glance, nothing has changed (the default value that I have read - (-1490), or (-0.7152)). And another question. Why in SLUSB55B CCOffset and BoardOffset, is calculated in mV and uV, but in bqEVSW - mA and uA, respectively? Where is the mistake? How to calibrate CCOffset and BoardOffset for better accuracy, like described in SLUA664 page 27?
    Regards, Stepanov Ivan.

  • I have not been able to determine which units are correct, but you should not try to modified the parameters manually. You should use the Control Subcommand CC Offset and Board Offset calibration commands and let the device calculate the offsets.
  • Oh, okay, thanks Tom.
  • Hello Tom,
    Could you explain me, how ССOffset and BoardOffset calibration, can change measurements of current? Yesterday I tried to calibrate these parameters (by calling the respective subcommands of control() command), but the result is practically not affected for current measurement, however I can see that values in appropriate registers are changed. What is the problem? Why is the current value measured by bq34z110 differs from the value measured through various multimeters, about 10%?

  • Does the gauge report a current when the pack is unloaded? The CC Offset and Board Offset values should be okay, if it reports 0mA. Are you saying that the reported current is off by 10% as compared to current measured with a multimeter? How much current does the 10% represent? If so, what current did you use to calibrate the pack? Was it comparable to the current that you are trying to compare? One thing that you can try is setting the Board Offset current to 0 in the data flash and then calibrate the full scale current again to see if this helps with the accuracy. Are you calibrating the currents at room temperature?

  • 1. When the pack is unloaded (), the current is 0 mA;
    2. Yes. 10% - is a value from 10ma to 100mA at (0-1000)mA range. Actually, we are tried to load battery at different current range, about (-2700 to + 1700) mA, but effect exist at this range too;
    3. When I tried to calibrate ccOffset & BoardOffset, the battery was charging, and current was about 1300-1400 mA (mesured by multimeter, but the gauge reports current with error about ~10%). Is it right?
    4. Yes, at room temperature.

    Maybe I'm something wrong to do? How to calibrate the current measured by gauge? Must I only request corresponding subcommands from Control() and waiting?

    Last changes.

    Today I am tried calibrate bq34z110, at room temperature about 20 degrees and when battery current is -94, 74 mA (both variants), previously I set the BoardOffset value to 0. Result has not changed.

  • You should calibrate the CC Offset and Board Offset using the Control Subcommands. You can also use the bqEVSW, but you mentioned that you do not use the program. The CC Offset and Board Offset calibrations have to be performed when there is no current present or the calibration will be corrupted. You can then calibrate the full scale current. There was a calibration applications report released for a sister device and the calibration processes are the same. You can find the document on the TI website by searching for SLUA640.
  • Thanks for reply Tom.

  • Tom, could you help me with another problem? How to calculate RawClibrationCurrent? Today I am tried the algorythm described in SLUA640, page 4, but I dont understand it, from the moment of collecting the rawData... At that document says that rawData we must read from address 0x79, 7 bytes. But how? That address - points to DeviceChemistryLength (0x79) and DeviceChemistry (the following 6 bytes), and there are no any raw data (for current, voltage or temperature)... I can not see any AnalogConversionCounter or AnalogCurrent or something else. Please, tell me, how to read correct rawData?
    Thanks in advance.
  • Did you place the device into CAL mode before reading the raw data? The sequence using the Write I2C Block method is:

    I2C Command 00 Data Block 2D00 <Write Data>

    I2C Command 00 Data Block 8100 <Write Data>

    I2C Command 00 Data Block 1000 <Write Data>

    Read I2C Block

    I2C Command 79 Read Data Size 7 <Read Data>

    The device will return 7 bytes.

    Byte 1          Analog Conversion Counter

    Bytes 3,2    Analog Current

    Bytes 5,4    Analog Voltage

    Bytes 7,6    Analog Temperature

  • You are right, that's what I did. Yes, I am switched the device in the calibration mode. But 7 bytes readed from the address 0x79 in ASCII is always ".pBa".

  • The raw data is returned in HEX and it is byte swapped.
  • I know that. I can't see that AnalogConversionCounter increases or decreases. Why? In my opinion, AnalogConversionCounter changes after reading analog characteristic (for example current). Am I wrong?
  • I do see the Analog Conversion Counter increment. There is an error in the flow chart. The counter is read with command 0x79 and not 0x75.

  • I know that!!! Ok, can you describe your version of algorythm for me? In my opinion, to calculate awerage raw current, we need:
    1. Switch device to UNSEALED mode by writing 0x00 to BLOCK_DATA_CONTROL() 0x61;
    2. Send subcommand CAL_ENABLE (0x002D);
    3. Send subcommand ENTER_CAL (0x0081);
    4. Sent subcommand CONTROL_STATUS (0x0000);
    5. Read Control() command, if CalMod bit set to low, then retry (go to point 2);
    6. Read 7 bytes from 0x79 address, for example to _buff array;
    7. Create variable raw_data, and assign it: raw_data = _buff[2] then raw_data <<= 8 then raw_data += _buff[1];
    8. Create variable avgRawDataStore and assign it to raw_data value;
    9. Create two variables: counterPrev = 0 and counterNow = _buff[0] (AnalogConversionCounter);
    10. Start cycle, loop_count = 0, while(loopCount <= 8), and check if(counterNow > counterPrev) then do points from 7 to 9 without creation new variables, but assigning values to existing variables. Loop_count ++;
    11. After exiting cycle, send subcommand EXIT_CAL (0x0080);
    12. Send subcommand CAL_ENABLE (0x002D);
    13. Calculates avgRawData like avgRawDataStore / 10;

    All delays are existing in code, but not described here. Getting starting from 6, and further reading 7 bytes from address 0x79 returns to same results, described earlier.
    I know that I have already torment you Tom, but I no longer have anyone to ask for help. Thanks you.
  • Tom, please, help me
  • Hello Thomas. Could you take a look at my previous post, and tell me whether I am right or not?

  • Ivan,
    I am not sure how to help you. The process that you outlined looks correct and I verified that the process presented in the document will return the correct raw data. Is any of the data that you read correct?
    Tom
  • " The process that you outlined looks correct and I verified that the process presented in the document will return the correct raw data." Ok, thanks. That means that error someware in my app, when i fix it, i will tell you.
  • Ok. Yesterday I tried to rewrite the algorithm "Obtain Raw Calibration Data". I did it and now I see the correct results for current, voltage and temperature. Now the question is, what registers in the section DataFlashCalibration, correspond to a calibrated voltage and temperature?

    Thanks for your patience. Regards, Ivan.
  • Ivan,

    Could you point out which document and section you are referring to for the calibrated voltage and temperature? They are not data flash parameters. The device read raw data and uses the calibration parameters to create the calibrated voltage and temperature and they are stored in RAM and read over the I2C bus.

    Tom

  • I concluded described above, because in the document SLUA640 page 6 written: "A known voltage must be applied to the device for voltage calibration. The calculated voltage offset must be written to thr corresponding location if DF". DF - as I understand it, this Data Flash. If I'm wrong - correct me. As for how to use the obtained values of voltage, temperature, avgRawVoltage, avgRawTemperature - I did not see any mention in any document, how to get the correct value of voltage and temperature.

    Thanks.

  • Tom, please, could you tell me, where are described algorythms calibration of temperature, voltage and amperage? In the SLUA640 document?
  • Ivan,
    The flowcharts in the SLUA640 document provide the processes to determine the offsets. In normal operation, the device will read the raw data, apply the offset and then report the voltage, current or temperature through the I2C bus.
    Tom
  • Tom,

    We are facing a problem related to current calibration,

    1) During current calibration we are getting and offset current of 52mA.

    2) The actual current shown in multimeter was 0mA and measured by gas gauge was 52.

    3) We tried to calibrate with a load current of 610mA, gas gauge is showing only 555 mA.

    4) Out of 8 gas gauge we observed this behaviour in 2 numbers.

    I am attaching the log file , excel sheet and also the gg file used in the gauge.

    Charging data.zip

    Kindly help us to resolve the problem. 

    Regards,

    Arun Dev