BQ24297 Thermistor (NTC) resistors - Hot fault


ouzle

Very Active Member
Joined
Jun 3, 2019
Messages
127
Location
England
@hns @EvilDragon I've tried to measure the thermistor resistors on the BQ24297 battery manager chip on my board. The board was removed with no battery or CPU installed.

On my board R710 (TS to GND) reads 18K (with the chip in place) but the schematic says 31k6? This is the resistance from battery middle pin to ground pin with the battery not installed. I'm reluctant to de-solder R710 to check definitively but if you think there is a chance of a mix-up I can verify. This would cause the NTS hot fault to trigger before the battery is hot.

BQ24297-resistors.png

Schematic_BQ24297.png
 
Last edited:

ouzle

Very Active Member
Joined
Jun 3, 2019
Messages
127
Location
England
The battery thermistor BTEMP also goes to the CPU module, pin P2001:38. The schematic shows another potential divider (R2001 and R2002, 100K + 33k) at the CPU module. This is in parallel with R710 but should be significantly higher resistance.

Screenshot at 2021-04-11 23-40-14.png


At BQ24297:
BTEMP to R710 to GND should be 31k6

At the CPU module:
BTEMP to R2001 to R2002 to GND should be 133k

Rtot = 1 / (1/31.6e3 + 1/133e3) = 25K5.

[EDIT for clarity] After putting everything back together but battery removed I still read 18K at the motherboard BTEMP to GND. After powering up for an hour I removed the battery, but then see 16K. This gradually increased back to 18K

Have I overheated the chip when I resoldered or is this the same on other boards?
 
Last edited:
  • Like
Reactions: rSl

levi

Still fresh, damnit!
Joined
Oct 6, 2008
Messages
14,132
Location
Somewhere off the coast of the EU
How is the board warming up if it's unpowered? Resistors or resistor networks measurements should be correct if the board is unpowered, anything else isn't guaranteed. The only complexity I guess is if there's a route through gnd and two pins on the chip that are connected together, but usually it's pretty obvious if that's happening.
 

ouzle

Very Active Member
Joined
Jun 3, 2019
Messages
127
Location
England
How is the board warming up if it's unpowered? Resistors or resistor networks measurements should be correct if the board is unpowered, anything else isn't guaranteed. The only complexity I guess is if there's a route through gnd and two pins on the chip that are connected together, but usually it's pretty obvious if that's happening.
Apologies, the resistor value change was after putting everything back together and running for a while. I shutdown, removed the battery and measured the resistance off the battery contacts on the motherboard (not the battery).

I saw 16K but it was smoothly changing and increased gradually to 18k as the motherboard cooled.

EDIT: This was more likely from not waiting long enough for C708 to discharge, rather than motherboard cooling
 
Last edited:

ouzle

Very Active Member
Joined
Jun 3, 2019
Messages
127
Location
England
I've done a few more tests (with motherboard removed and CPU disconnected):
* R710 is definately 31K in isolation
* With R710 removed, the resistance on the R710 board contacts is 37K5.
 
Last edited:

ouzle

Very Active Member
Joined
Jun 3, 2019
Messages
127
Location
England
I do not plan to leave the Pyra charging unattended with the hot cut-off by-passed!

My plan is to calculate a different resistance value for R710 to set the battery hot cutoff to something more practical. I'll try to make sense of the formula in section "9.3.3.3 Thermistor Qualification" of the BQ24297 datasheet and account for the parallel resistances from the connection to the CPU module. I don't want to set my pockets or house on fire.
 

ouzle

Very Active Member
Joined
Jun 3, 2019
Messages
127
Location
England
OK, its not so difficult to choose the resistor to give a hot battery charging cut-off.

I've confirmed that the battery has a standard "103AT NTC" 10K thermistor by measuring the resistance as the battery cooled for a few minutes. This means that the example values given on page 26 of the BQ24297 datasheet are correct for R709 and R710 if we didn't have extra parallel resistances.
1618344659923.png

The datasheet says for Tcold=-10C and Thot=45C we need R709=5K3 and R710=31K2.

With R710 removed there should be a resistance of 133K from BATTTEMP to GND because of R2001 + R2002. So we should need R710 to be 1 / (1/31.2e3 - 1/133e3) = 40K7 ohm.

However, I've probably broken something on my board as I read 37K5 rather than 133K at the R710 pads. I don't understand how that can happen but all is working fine?!

I've worked out what cut off temperatures I expect on my Pyra having removed R710 (with 37K5 BATTEMP to GND). T_cold is +6C and T_hot is +43C, so 2C safer than the design! I can live with that!

With R710 installed (RT2=18K) T_hot is only 38C, so its not surprising the charging stopped early.

So, my plan is to carry on without R710 installed. YMMV alot!

Battery cutoff equation.png

V_REGN is 0.2V less than VBUS , so 4.8V
V_LTF is 73.5% of VREGN, so 3.53V
V_TCO is 44.7% of VREGN so 2.15V
 

Attachments

  • BatteryThermalCutoff.zip
    62.6 KB · Views: 20
Last edited:

pyrat

Very Active Member
Joined
May 20, 2016
Messages
578
However, I've probably broken something on my board as I read 37K5 rather than 133K at the R710 pads. I don't understand how that can happen but all is working fine?!
I don't know circuit theory and I can hardly follow but can you somehow have imperfectly shorted R2001 so that you lowered its resistance a lot ? No idea where it physically sits, though.
 

ouzle

Very Active Member
Joined
Jun 3, 2019
Messages
127
Location
England
There's a chance I've shorted a pin on the BQ24297 as I reflow soldered it. I've not had much practice judging exactly how much solder to apply. If I find the Pyra is not working I might try to resolder it but its all working right now. I've still got one spare chip too.

I plan to check that the battery hot trigger is still working soon. I'll wire a potentiometer to the battery contacts in the pyra and connect the battery from outside the pyra.

I improvised an external LiPo charger for the battery already because of the problems with the NTC overheat triggering. I'll use the wiring from that with some test leads to connect the battery from outside the pyra.
 

ouzle

Very Active Member
Joined
Jun 3, 2019
Messages
127
Location
England
I don't know circuit theory and I can hardly follow but can you somehow have imperfectly shorted R2001 so that you lowered its resistance a lot ? No idea where it physically sits, though.
I don't think I've been near R2001. With metal to metal contacts its normally all or nothing, or shorted to something else.

Static, heat and overvoltages can cause a CMOS chip Latch-up. That could cause another current path to be wired in where it isn't expected.

I'm not a professional, so who knows what I've done (shrugs).
 

ouzle

Very Active Member
Joined
Jun 3, 2019
Messages
127
Location
England
I've made some more measurements now. I'm not sure I understand the results but I'm now happy that I've not got a Pyra-technic...

Anyway, without R710 installed, my pyra won't charge when the battery is hotter than 39C (ok), or below -15C (that's too cold).

To measure this, I left the battery outside of the Pyra and connected it with jump-leads to the contacts. I also attached a small potentiometer from the middle-pin to ground. After booting up and connecting the charger, I turned the pot until the Pyra's power light flashed. I then used the bqdump24297 script to see if the fault signal was for hot or cold.

I saw the hot fault when BTEMP to GND is <2.2V and cold fault when >3 35V. This confirms V_LTF and V_TCO in the equation.

After powering off and measuring the potentiometer in isolation, I see the trigger points at R_thhot=6k75 and R_thcold=17K00. Looking those resistances up from the 103AT NTC resistance temperature graph I see that means -15C and 39C.
 

ouzle

Very Active Member
Joined
Jun 3, 2019
Messages
127
Location
England
With the battery back in, I've not yet managed to trigger the hot battery fault when charging at full CPU load. So it looks like when I first received the Pyra, the hot trigger must have been less than 39C. The thermal gap I added between CPU and battery might be working and/or the hot trigger was originally too low.

I wish I'd done the battery jump lead and potentiometer measurement when I'd first received the Pyra.
 
Last edited:

ouzle

Very Active Member
Joined
Jun 3, 2019
Messages
127
Location
England
Now that I'm happy that:
  • the battery charging cuts out when the actual battery temperature >39C (measured using a pyrometer)
  • I have thermally separated the CPU from the battery with an air gap
  • My cold-finger and heat-sink on the back of the CPU is working well (it gets hot when the battery doesn't)

As received, EvilDragons thermal script throttles both CPU and charging rate based on how hot the BQ27421 chip gets, not the actual battery temperature. The BQ27421 chip has no connection to the battery thermistor and is not in thermal contact with the battery, so its actually reporting the motherboard temperature. The motherboard gets hot because its in good thermal contact with the CPU.

So, I've decided to modify /usr/share/pyra/scripts/pyra-thermal.sh to:
  1. First, throttle the charge rate depending on the coarse BQ24297 thermistor reading (cold=-10C, normal=22C, hot=60C)
  2. Then, throttle the CPU depending on the core temperature only.
Note, the "60C" reading happens before the BQ24297 thermal fault cuts charging in hardware. When it says "60C" it really means nearly "hot fault" so 39C (see the bq2924x_battery_temperature function in the driver)

The modified script is as follows:
Bash:
#!/bin/sh
# Read core and battery temp and pick approperiate cpu freq and charging rates

interval=20
core="core_thermal"
battery="bq24297"

maxFreq=1500
maxCharge=3000000

setMaxFreq()
{
        if [ "$1" -lt "$maxFreq" ]
        then
                current_maxFreq=$1
        fi
}

setMaxCharge()
{
        if [ "$1" -lt "$maxCharge" ]
        then
                current_maxCharge=$1
        fi
}

doThermal()
{

    current_maxFreq=${maxFreq}
    current_maxCharge=${maxCharge}

    core_temp=$(cat "${core_dev}")
    battery_temp=$(cat "${battery_dev}")


    #Check Battery, from hottest to coldest
    if [ ${battery_temp} -gt 50000 ]
    then
        setMaxCharge 500000
    else
        setMaxCharge ${maxCharge}
    fi

    #Check Core, from hottest to coldest
    if [ ${core_temp} -gt 97000 ]
    then
               setMaxFreq 250
    # Also throttle the CPU if the battery is hot
    elif [ ${core_temp} -gt 92000 ] || [ ${battery_temp} -gt 50000 ]
    then
            setMaxFreq 500
    elif [ ${core_temp} -gt 87000 ]
    then
            setMaxFreq 750
    elif [ ${core_temp} -gt 82000 ]
    then
            setMaxFreq 1000
    elif [ ${core_temp} -gt 77000 ]
    then
            setMaxFreq 1250
    else
            setMaxFreq ${maxFreq}
    fi

    if [ "$daemon" -eq 0 ]
    then
            echo ${core}:${core_temp} ${battery}:${battery_temp}
            echo MaxFreq: ${current_maxFreq} MaxCharge: ${current_maxCharge}
    fi

       cpufreq-set -u ${current_maxFreq}MHz
       echo ${current_maxCharge} > /dev/usb_max_current

}

if [ "$1" = "daemon" ]
then
    daemon=1
    shift
else
    daemon=0
fi

for i in /sys/class/thermal/thermal_zone*
do
    name=$(cat ${i}/type)
    if [ "${name}" = "${core}" ]
    then
        core_dev="${i}/temp"
    fi

    if [ "${name}" = "${battery}" ]
    then
        battery_dev="${i}/temp"
    fi
done

if [ -z "${core_dev}" ]
then
        echo could not find ${core}
        exit 1
fi

if [ -z "${battery_dev}" ]
then
        echo could not find ${battery}
        exit 1
fi

#echo $core_dev
#echo $battery_dev

if [ "$daemon" -eq 1 ]
then
    while true
    do
        doThermal
        sleep ${interval}
    done
else
    doThermal
fi
 
Last edited:
Top