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.

Current calibration with BQ20z95

Other Parts Discussed in Thread: BQMTESTER

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

  • 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.

  •  

    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 ? 


     

  • 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.

  • 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

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

  • 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?

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

  • 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 ?

     

     

  • 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 ?

  • 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.

  • 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

  • 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.

  • Jackie,

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

    -Al

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

  • 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

  • Hi Jackie,

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

    Thanks,

    -Al

  • You can refer to ReadSMBusWord() and WriteSMBusWord(). That should be the same - writing/reading SMBus word.