• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Power Management » Battery Management » Battery Management - Gas Gauge Forum » Current calibration with BQ20z95
Share
Battery Management
  • Forums
  • Announcements
  • Files
  • E2E Wiki
Options
  • Subscribe via RSS

Forums

Current calibration with BQ20z95

This question is answered
Dimitri Marquois
Posted by Dimitri Marquois
on Apr 20 2011 08:53 AM
Intellectual640 points

Hello,

I am trying to make a current calibration. I use your datasheet SLUA404–December 2006 page 279.

 3857.SLUA404 - Z70_90 app book (2).pdf

My program commands a dynamic load to provide -2 Amperes. Then I send 0x0040 to put the BQ20z95 in calibration mode, now I send the current value in milliAmperes (-2000) like your datasheet says:

'// GO TO CALIB MODE

IError = WriteSMBusInteger(&H0, &H40)

 '// iCurrent is in milliamps (normally negative, such as -2000)

IError = WriteSMBusInteger(&H60, iCurrent)

IError = WriteSMBusInteger(&H51, &HC0D5)

'// POLL CALIBRATION STATUS - WAIT FOR LOWER 14 BITS TO ALL CLEAR

bDoingCal = True

While bDoingCal

IError = ReadSMBusUnsignedInteger(&H52, IValue)

bDoingCal = IValue And &H3FFF

DoDelay 0.2 '// check every 200 millisecond

Wend

'// TRANSFER RESULTS TO DATAFLASH

IError = WriteSMBusCommand(&H72)

DoDelay 0.1 '// Insure write process is finished

'// EXIT CALIB MODE

IError = WriteSMBusCommand(&H73)

 

After that, I write 0x73 to put the BQ20z95 in gas gauge mode.

The problem is that my current is really wrong. This code is not working really great. The better current calibration it's when iCurrent = -1 .

I am asking if iCurrent would not be a offset value, and not current value (?)

I try to voltage and temperature calibration and they work great. Also I try current calibration with your software “bq Evaluation Software” and it work ok

Thank for your help

calibration Smbus BQ20ZX gas gauge. fuel gauge. bq20z95 Visual Basic
Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • Jackie Hui
    Posted by Jackie Hui
    on Apr 20 2011 15:54 PM
    Expert3855 points

    iCurrent is the actual current value in mA. When the device is in Cal mode, both CHG/DSG FETs are off. So when you apply the current, you should apply it through PACK- and BAT-, which will bypass the FETs and apply directly to the sense resistor. If you put the current through PACK+ and PACK- and execute the routine, the current calibration will be wrong.You should also make sure the current is stable before running the code. i.e. Apply the current to the pcb before executing the routine.

    If you have doubt of the calibration code, you can manually send the commands (following the sequence in the code) through EVSW PRO screen.

    calibration
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Dimitri Marquois
    Posted by Dimitri Marquois
    on Apr 21 2011 01:38 AM
    Intellectual640 points

     

    I always put my current through PACK+ and PACK- even when I use "bq Evaluation Software" Calibration screen. I put -2000 miliamperes then CHG/DSG FETs go off and the current calibration is good. So why with VB code I can't do the same ? Does it depends of FET Control: ON (External load) or OFF( Bypassed) ? Can I configure this, with VB code ? 


     

    calibration bq20z95 Visual Basic current
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Chase7071949597
    Posted by Chase7071949597
    on Apr 21 2011 09:46 AM
    Verified Answer
    Verified by Dimitri Marquois
    Expert6520 points

    Yes, you can use this method with VB as well. All you need to do is send 0x0006 to extended SBS command 0x46. This will turn the FETs on. Send 0x0000 to 0x46 to turn them off again.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Dimitri Marquois
    Posted by Dimitri Marquois
    on Apr 21 2011 10:02 AM
    Intellectual640 points

    Ok

    So I need to apply a current (-2000 milliampere), go in calibration mode, then close FETs send icurrent (-2000 milliampere), then reopen FETs and for finish retour to gas gauge mode. Am I right ? (I am not sure about reopen FETs) do I need to add a delay between commands ?

    Thank you for your time

    calibration bq20z95 current FETs
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Chase7071949597
    Posted by Chase7071949597
    on Apr 21 2011 10:18 AM
    Expert6520 points

    I believe the FETs will turn back off automatically after calibration. If not, you will probably need a few second delay.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Jackie Hui
    Posted by Jackie Hui
    on Apr 21 2011 11:18 AM
    Verified Answer
    Verified by Dimitri Marquois
    Expert3855 points

    The VB code put the device into CAL mode for calibration. Standard and extended SBS command are not supported in this mode. When the device is in CAL mode both CHG and DSG FETs are off. That's why the current is forced through PACK- and BAT- side. This will bypass the FETs. I'm not sure how the calibration is done through EVSW. In fact, we always tell our customer to select the FET off option and apply current through PACK- and BAT-.

     

    Anyway, if you choose to follow the VB code, which is putting the device in CAL mode, you should use command 0x54 (instead of the extended SBS command 0x46) to turn on the FETs. This command is not documented because calibrating the current directly through the sense resistor is recommended. Is there a particular reason you can only apply the current through PACK+ and PACK- for calibration?

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Dimitri Marquois
    Posted by Dimitri Marquois
    on Apr 22 2011 02:53 AM
    Intellectual640 points

    The Battery will be closed, so I could not access to BAT-

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Dimitri Marquois
    Posted by Dimitri Marquois
    on Apr 26 2011 10:02 AM
    Intellectual640 points

    I still have a problem with current calibration. My VB code work fine for calibrate the current, but it modified my pack voltage (14730mV to 15183mV). I do not understand why my current calibration can modified my tension value.

    With EVSW I have no problem with pack tension after calibrate the current. What is the difference between the two code ?

     

     

    calibration bq20z95 current FETs
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Dimitri Marquois
    Posted by Dimitri Marquois
    on Apr 27 2011 04:06 AM
    Intellectual640 points

    Ok I see my mistake

    Command 0x51 must be change.

    byte value must be for calibration :
              Current :C040
              Voltage : C080
              Temperature :C010 (if External temperature sensor 1)

    For ADC Offset and Coulomb Counter Offset, when can I perform this calibration ? can I make it during Voltage calibration ? How this calibration works without parameters ?

    calibration VB code
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Jackie Hui
    Posted by Jackie Hui
    on Apr 27 2011 10:40 AM
    Verified Answer
    Verified by Dimitri Marquois
    Expert3855 points

    There is no input parameter for CC offset calibration. You have to make sure there is NO current flow to the PCB in order to calibrate CC offset though.

    If needed, you can enable CC offset and voltage calibration at the same time. Make sure the voltage is stable and make sure there is no current flow.

    calibration VB code
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Al Mighty
    Posted by Al Mighty
    on Jun 15 2011 17:58 PM
    Prodigy45 points

    Hi Jackie,

    Could you please send me the codes for the Function WriteSMBusInteger.  I have the ModUSB.bas file (written by Shirish K., TI) but it doesn't have this function in it. 

    I need to calibrate the voltage/current/tempearture at the pack level as well. 

    Thanks,

    -Al

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Jackie Hui
    Posted by Jackie Hui
    on Jun 15 2011 19:50 PM
    Expert3855 points

    Al,

    I need to get some information from you. Please refer to the private message I just sent out.

    Will forward the code to you upon receive of  the requested information.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Al Mighty
    Posted by Al Mighty
    on Jun 16 2011 13:38 PM
    Prodigy45 points

    Jackie,

    How do I send a private message to you?  I did send  you the requested info via the Conversations link. 

    -Al

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Jackie Hui
    Posted by Jackie Hui
    on Jun 16 2011 14:52 PM
    Expert3855 points

    Click my name, go to the Friends tab and click start conversation.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Al Mighty
    Posted by Al Mighty
    on Jun 16 2011 18:31 PM
    Prodigy45 points

    Jackie,

    I have the source code for the bqMtester but I can't find the Function WriteSMBusInteger.  Could you please send me the source code for WriteSMBusInteger. 

    Thanks,

    -Al

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
12
TI E2E™ Community
  • Support Forums
  • Blogs
  • Videos
  • Groups
  • Site Support & Feedback
  • Settings
TI E2E™ Community Groups
  • TI University Program
  • Make the Switch
  • Microcontroller Projects
  • Motor Drive & Control
Other Communities
  • Deyisupport
  • Designsomething.org
  • beagleboard.org
  • TI on Element 14
  • TI on TechXchangeSM
Other Technical & Support Resources
  • WEBENCH® Design Center
  • Product Information Centers
  • Technical Documents
  • TI Design Network
  • TI Technical Articles
  • TI Training

All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
embedded processors, along with software, tools and the industry’s largest sales/support staff.

© Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy Policy | Terms of Use