A20 on battery?

Started by jess, August 09, 2013, 04:34:23 AM

Previous topic - Next topic

fab

Hi Dave,

QuoteHi FAB

Do you have a debug cable you can connect to UART0?

On my Android system I get a message when the system is about to shutdown. Maybe you can track it down that way?

Just tried with my UART0 debug cable, then check that connection is ok by making simple bash commands, then wait around 3 minutes sourcing from the LIPO...and got no messages, no warning, nothing when the LIPO switched off!!


dave-at-axon

I discovered something interesting today and you might want to check if similar.

I started up my system from the battery and everything was fine. When I then switched on the 15V step up supply, the system immediately switched off and would not switch on again. My +15V is powered from 5V and is a step up supply to power sensors. There was nothing connected to the output so no current drawn.

When I checked the battery voltage it was ZERO.

I had to unplug the battery and reconnect it to get the system to power back up. I then checked the voltage and it was 4.1V

I have nothing connected to the +15V output during these tests.

I know the batteries have a current limit but should be able to handle at least 6.6A according to the specs.

fab

Also found out something nice today...
If I unplug the LIPO, then powering ON the A20 board, I got 100% for the /sys/class/power_supply/battery/capacity, and the LIPO is powering up the board many hours without any issues.
However If I switch OFF the A20 board, and immediately after switch it ON, without UNPLUGING the LIPO, the /sys/class/power_supply/battery/capacity fall below 30% !! :-(
If again, I unplug the LIPO, and boot up again, I am recovering the 100% capacity :-)

It seems that Debian is monitoring this "capacity" parameter and switch off when in a low state, but because this "capacity" parameter is wrongly setup by the onboard PMU, I got all this troubles.

Fabien

PaceyIV

Quote from: PaceyIV on August 10, 2013, 12:05:03 AM
How can you see charge level?


cat /sys/devices/platform/sunxi-i2c.0/i2c-0/0-0034/axp20-supplyer.28/power_supply/battery/capacity


or


upower -d

dave-at-axon

Can you check the LiPo voltage as soon as it switches off? Keep it connected to the board and check it at the connector.

I found with my power spike issue that the battery voltage went to zero indicating that it has safety shutdown. Pulling it out would reset it.

jess

Quote from: dave-at-axon on May 01, 2014, 04:47:16 AM
... Pulling it out would reset it.

I wonder if it's the same dreaded "feature" reported multiple times by plenty of android tablet users reporting how they had to open the case and physically disconnect the battery to re-start their otherwise dead tablet :)


dave-at-axon

Quite possibly.

I am running with a 6600mA battery so for this to auto shutoff it must be taking one hell of a voltage drop and must be for long enough that the auto cutoff circuit comes into effect.

Funnily enough, I don't see this with a 4000mA VARTA battery that I have. My only issue with that battery is that the voltage drop to the 3.3V regulator drops too low and the touch controller freaks out.

It must be something to do with the design of this battery protection circuit. Sadly VARTA don't do these batteries anymore otherwise I would get some more. Mind you, they were 3 times the price :)

codifies

I think I have probably seen this issue to

I had assumed that below about 40% the battery couldn't supply enough current for all the junk I have hanging off my a20

However I always seem to see smooth power levels (not random) before a shutdown below 40%

Is a large capacitor accross the lipo likely to help with this? Batteries are a bit of a black art to me!

pete_l

#23
Quote from: jess on August 09, 2013, 04:34:23 AM
Did anyone here use A20 on LiPo battery power supply and could confirm that it worked without ANY problems?
I'm running an A20 with an Olimex 6600mAh LiPo.
The O/S is Debian and its kernel is 3.4.61+ #2 SMP PREEMPT

The board is normally powered from a mains supply - about 12V and the LiPo is there for times when the power goes off. I have a small script (see below) that monitors the status of the battery and logs it both to a file and to a remote website. As a teston Thursday (it's Saturday morning now) I pulled the power and ran the device on battery until it ran out of juice. After I started it up again, off the external PSU, I found the LiPo was very slow at accepting charge, as recorded by the script. I also found that overnight the battery status changed from Health: Good to Health: Dead and charging stopped at about 18% capacity.
Pulling the plug once again and reapplying it after a few seconds restored the battery status to Health: Good and Status: Charging 226 mA, Capacity: 18 which is the capacity it was reporting when the charging stopped during the night.

So I would count that as a problem although so far, it's not one I've investigated. I do have one question for the team:
Should I allow the battery to be completely run down to zero, or should I be monitoring its discharge state and shutting down the board at some threshold?

Here's my battery monitoring script:


#!/bin/bash

# script to monitor the state of the battery


PROG=`basename $0`
date "+%d-%b-%Y %H:%M:%S $PROG" >> /var/log/programs

LOG="/var/log/battery.log"
DIR="/sys/devices/platform/sunxi-i2c.0/i2c-0/0-0034/axp20-supplyer.28/power_supply/battery"

MAXV=`cat $DIR/voltage_max_design`
MINV=`cat $DIR/voltage_min_design`

# Run until just before midnight so the log rotator can run
# Have the process restarted from cron

while [ `date "+%H%M%S"` -lt 235930 ] ; do

    DATE=`date "+%d-%b-%Y %H:%M:%S"`
    MICROVOLTS=`cat $DIR/voltage_now`
    HEALTH="`cat $DIR/health`"
    STATUS="`cat $DIR/status`"
    CAPACITY="`cat $DIR/capacity`"
    CURRENT="`cat $DIR/current_now`"
    T="`cat $DIR/temp`"
    V=`echo "scale=3; $MICROVOLTS / 1000000.0" | bc`
    TEMP=`echo "scale=1; $T / 10.0" | bc`
    MA=`echo "scale=0; $CURRENT / 1000.0" | bc`

    echo "$STATUS" > /var/log/battery-status
    if [ "$STATUS" == "Full" ] ; then
        printf "$DATE Voltage is $V Temp: $TEMP Health: $HEALTH Status: $STATUS not charging, Capacity: $CAPACITY\n" >> $LOG
    else
        printf "$DATE Voltage is $V Temp: $TEMP Health: $HEALTH Status: $STATUS $MA mA, Capacity: $CAPACITY\n" >> $LOG
    fi
    sleep 15
done


and this is what the log file looks like (there are double entries, I think 2 instances of the script are running):

10-May-2014 11:32:45 Voltage is 3.716 Temp: 30.0 Health: Dead Status: Charging 0 mA, Capacity: 18
10-May-2014 11:32:46 Voltage is 3.716 Temp: 30.0 Health: Dead Status: Charging 0 mA, Capacity: 18
10-May-2014 11:33:00 Voltage is 3.716 Temp: 30.0 Health: Dead Status: Charging 0 mA, Capacity: 18
10-May-2014 11:33:01 Voltage is 3.716 Temp: 30.0 Health: Dead Status: Charging 0 mA, Capacity: 18
10-May-2014 11:33:16 Voltage is 3.716 Temp: 30.0 Health: Dead Status: Charging 0 mA, Capacity: 18
10-May-2014 11:33:17 Voltage is 3.716 Temp: 30.0 Health: Dead Status: Charging 0 mA, Capacity: 18
10-May-2014 11:33:31 Voltage is 3.716 Temp: 30.0 Health: Good Status: Discharging 0 mA, Capacity: 18    ### Started running on battery
10-May-2014 11:33:32 Voltage is 3.716 Temp: 30.0 Health: Good Status: Discharging 0 mA, Capacity: 18
10-May-2014 11:33:46 Voltage is 3.729 Temp: 30.0 Health: Good Status: Discharging 567 mA, Capacity: 18
10-May-2014 11:33:47 Voltage is 3.729 Temp: 30.0 Health: Good Status: Discharging 567 mA, Capacity: 18
10-May-2014 11:34:02 Voltage is 3.724 Temp: 30.0 Health: Good Status: Discharging 554 mA, Capacity: 18
10-May-2014 11:34:03 Voltage is 3.707 Temp: 30.0 Health: Good Status: Charging 225 mA, Capacity: 18    ### resumed mains power
10-May-2014 11:34:17 Voltage is 3.708 Temp: 30.0 Health: Good Status: Charging 226 mA, Capacity: 18
10-May-2014 11:34:18 Voltage is 3.708 Temp: 30.0 Health: Good Status: Charging 226 mA, Capacity: 18
10-May-2014 11:34:32 Voltage is 3.708 Temp: 30.0 Health: Good Status: Charging 228 mA, Capacity: 18
10-May-2014 11:34:33 Voltage is 3.707 Temp: 30.0 Health: Good Status: Charging 223 mA, Capacity: 18
10-May-2014 11:34:47 Voltage is 3.710 Temp: 30.0 Health: Good Status: Charging 222 mA, Capacity: 18
10-May-2014 11:34:48 Voltage is 3.710 Temp: 30.0 Health: Good Status: Charging 222 mA, Capacity: 18


LittleScarabee

Dear all,

I use this topic because I recently bought a LiPo battery (6600 mah) for my Olimex A20 Lime 2 4Gb. I use the distribution Jessie with kernel 3.14 and I have got a problem :

* I use this script. When I only use my battery, I lost around 20% after 15 minutes, see below an extract of my log :
  - Voltage is : 1,5V instead of 3,xV ; it's strange
  - I lost 1% every 1 minute

2016-07-12 07:51:39 Voltage: 1.50 V | Temp: 30.0°C | Health: Good | Status: Discharging 269 at mA | Capacity: 80%
2016-07-12 07:51:54 Voltage: 1.30 V | Temp: 30.0°C | Health: Good | Status: Discharging 219 at mA | Capacity: 80%
2016-07-12 07:52:09 Voltage: 1.30 V | Temp: 30.0°C | Health: Good | Status: Discharging 220 at mA | Capacity: 79%
2016-07-12 07:52:24 Voltage: 1.40 V | Temp: 30.0°C | Health: Good | Status: Discharging 227 at mA | Capacity: 79%
2016-07-12 07:52:39 Voltage: 1.30 V | Temp: 30.0°C | Health: Good | Status: Discharging 227 at mA | Capacity: 79%
2016-07-12 07:52:54 Voltage: 1.30 V | Temp: 30.0°C | Health: Good | Status: Discharging 227 at mA | Capacity: 78%
2016-07-12 07:53:09 Voltage: 1.40 V | Temp: 30.0°C | Health: Good | Status: Discharging 232 at mA | Capacity: 78%
2016-07-12 07:53:24 Voltage: 1.40 V | Temp: 30.0°C | Health: Good | Status: Discharging 237 at mA | Capacity: 78%


* After shutdown my Olimex (after 1 hour) and connected external power supply (5V 2A ; battery still connected) I've got this status :

2016-07-12 08:27:19 Voltage: 0 V | Temp: 30.0°C | Health: Good | Status: Charging 0 at mA | Capacity: 0%
2016-07-12 08:27:34 Voltage: 0 V | Temp: 30.0°C | Health: Good | Status: Charging 0 at mA | Capacity: 0%
2016-07-12 08:27:49 Voltage: 0 V | Temp: 30.0°C | Health: Good | Status: Charging 0 at mA | Capacity: 0%
2016-07-12 08:28:35 Voltage: 0 V | Temp: 30.0°C | Health: Good | Status: Charging 0 at mA | Capacity: 0%
2016-07-12 08:28:50 Voltage: 0 V | Temp: 30.0°C | Health: Good | Status: Charging 0 at mA | Capacity: 0%
2016-07-12 08:29:05 Voltage: 0 V | Temp: 30.0°C | Health: Good | Status: Charging 0 at mA | Capacity: 0%
2016-07-12 08:29:20 Voltage: 0 V | Temp: 30.0°C | Health: Good | Status: Charging 0 at mA | Capacity: 0%
2016-07-12 08:29:35 Voltage: 0 V | Temp: 30.0°C | Health: Good | Status: Charging 0 at mA | Capacity: 0%
2016-07-12 08:29:50 Voltage: 0 V | Temp: 30.0°C | Health: Good | Status: Charging 0 at mA | Capacity: 0%
2010-01-01 01:00:08 Voltage: 0 V | Temp: 30.0°C | Health: Good | Status: Charging 0 at mA | Capacity: 0%
2016-07-12 08:30:57 Voltage: 0 V | Temp: 30.0°C | Health: Good | Status: Charging 0 at mA | Capacity: 0%
2016-07-12 08:31:12 Voltage: 0 V | Temp: 30.0°C | Health: Good | Status: Charging 0 at mA | Capacity: 0%
2016-07-12 08:31:27 Voltage: 0 V | Temp: 30.0°C | Health: Good | Status: Charging 0 at mA | Capacity: 0%
2016-07-12 08:31:42 Voltage: 0 V | Temp: 30.0°C | Health: Good | Status: Charging 0 at mA | Capacity: 0%


>> After check the voltage on my battery I've got : 3,6V , but this value it's never identify on my Olimex.

Do you have any idea on this problem ?
Thanks for your help.