Page 1

Online Prediction of Battery Lifetime for

Embedded and Mobile Devices

Ye Wen, Rich Wolski, and Chandra Krintz

Computer Science Department, University of California, Santa Barbara

{wenye,rich,ckrintz}@cs.ucsb.edu

Abstract. This paper presents a novel, history-based, statistical tech-

nique for online battery lifetime prediction. The approach first takes a

one-time, full cycle, voltage measurement of a constant load, and uses it

to transform the partial voltage curve of the current workload into a form

with robust predictability. Based on the transformed history curve, we

apply a statistical method to make a lifetime prediction. We investigate

the performance of the implementation of our approach on a widely used

mobile device (HP iPAQ) running Linux, and compare it to two similar

battery prediction technologies: ACPI and Smart Battery. We employ

twenty-two constant and variable workloads to verify the efficacy of our

approach. Our results show that this approach is efficient, accurate, and

able to adapt to different systems and batteries easily.

1Introduction

Power is a critical resource for battery-powered embedded systems and mobile

devices. As such, battery life must be monitored and managed within these

systems to ensure maximum efficiency and effective prioritization on behalf of

system users. While compile-time optimization of application code can reduce

the battery consumption of individual applications, operating system support is

needed to manage the combined power consumption of multiple programs exe-

cuting in concert. Providing this support at the operating system level requires

the ability to predict, accurately, remaining battery life given a dynamically

changing system workload.

In this paper, we investigate an on-line statistical approach to battery life-

time prediction that combines recently observed power dissipation “history” with

pre-computed off-line benchmark measurements. By dynamically incorporating

on-line measurements, our approach is able to make predictions that take into ac-

count varying workloads, the “recovery effect” that batteries experiences when

they are unloaded, and the charging-cycle effect that changes battery perfor-

mance as batteries are repeatedly recharged.

Much of the prior work investigating battery dissipation and prediction is an-

alytical, simulation based, or both [4,6,1,11]. These systems attempt to provide

accurate dissipation predictions off-line, for use in design or analytical contexts.

Efficient analytical methods such as [14], and [15] consider the problems of on-

line prediction, but do not include the statistical components needed to rapidly

Page 2

analyze dynamically changing workloads and operating conditions. While some

approaches have considered statistical characteristics in combination with ana-

lytical models, they focus exclusively on battery dissipation in isolation [13,16].

To be useful in an operating system resource management context, however, a

battery lifetime prediction technique must be

– fast enough to make predictions so that real-time or near real-time decisions

can be made,

– power-efficient enough to be run on the battery-powered device itself,

– dynamically adaptive so that it can take into account different user work-

loads, and environmental operating conditions (e.g. ambient temperature,

battery recharge count, etc.), and

– portable so that a variety of battery and device combinations can be sup-

ported by the same operating system.

To address these challenges, our approach treats operating system power

measurements from the battery as coming from a “black box.” We use off-line

profiling of the installed battery to establish a reference signature for its observed

dissipation curve. We then use fast, on-line regression to predict deviations from

this signature. Thus, our method uses benchmark data from the battery (in

the form of a reference signature) to parameterize a statistical model that we

evaluate on-line. Because the system uses measurements taken in the operating

system, it is portable between devices and batteries. By using immediate on-line

history, the system adapts to dynamic changes in system conditions.

We investigate the efficacy of our work by empirically evaluating our meth-

ods using the popular HP iPAQ running the Linux operating system. All of the

necessary data for our method is obtained through standard hardware and op-

erating system interfaces provided by Familiar Linux, a commonly used Linux

implementation for iPAQ devices. We compare our results to those provided by

two native Linux battery lifetime prediction systems: the Advanced Configura-

tion and Power Management Interface (ACPI) and Smart Battery [5]. While

considered to provide very rough estimation of battery lifetime, these utilities

nonetheless meet the requirements that we describe above. That is, they im-

plement fast, on-line, portable prediction method at the operating system level.

Our method combines the attractive online features of ACPI and Smart Battery

with prediction accuracy, and thus constitutes an fast, accurate, and adaptive

prediction mechanism that can be used as the basis for “power-aware” operating

system design.

To describe this work in greater detail, the remainder of this paper is orga-

nized as follows. In Section 2, we describe the methodology more completely.

Section 3 provides an empirical evaluation of our method through direct exper-

imentation and in Section 5 we draw brief conclusions from our investigation.

2History-based Battery Lifetime Prediction

Our methodology consists of three components: a reference signature from the

battery, a curve transformation function that changes coordinates to make fast

Page 3

prediction possible, and a fast linear fitting technique that makes predictions in

the transformed space. The baseline observation that makes this methodology

possible is that for constant but differing workloads, the “shape” of the battery

dissipation curve is similar. Thus, using the trajectory produced by one workload,

the lifetime implied by other constant workloads, can be predicted accurately. By

transforming the coordinate space into one where simple linear fitting techniques

are applicable, the predictions can then be made using computationally efficient

techniques.

2.1Linearity, Reference Curve and Voltage Curve Transformation

To determine the reference signature of a battery, we execute constant-power

workloads on a quiescent system. A constant-power workload consists of repeated

executions of single program instance from full battery charge until battery ex-

piration. We describe the individual program instances in Section 3, but for the

purpose of describing our methodology, the salient feature is that the power

drain is constant with respect to the application workload, e.g., there is only a

single program in each workload.

Linux permits application access to the voltage level reported by the battery

on the iPAQ. During each complete benchmark run, the power level is recorded

periodically to produce a drain trajectory. This trajectory can be expressed by

function F : t → v, mapping time t to battery voltage level v. v’s value is

between the open circuit voltage (approximately the voltage when the battery

is fully charged) and the cut-off voltage (the voltage when the battery dies).

In Figure 1(left), we show two typical voltage curves, which are obtained by

repeatedly running benchmark programs (“IMem” – a memory read benchmark

– and “IMemWC” – a cache-write benchmark – in this case) on an HP iPAQ until

the battery dies. The x-axis represents the time and y-axis represents the voltage

level. We describe the full experimental setup and benchmark information more

completely in Section 3.

The voltage curves in the left graph of Figure 1 are inherently non-linear due

to the internal electrochemical characteristics of the battery. This non-linearity

limits our ability to predict remaining battery life efficiently. If we treat the

trajectories as invertible continuous functions, however, we can make the obser-

vation that

V = F1(t1) = F2(t2)(1)

for voltage V , and dissipation functions F1and F2. If we use Γ1,2to represent

the relationship between t1and t2under F1and F2for any voltage level V , we

have:

F1(Γ1,2(t2)) = F2(t2)(2)

Furthermore, we can see that the voltage curves of constant workloads have very

similar shapes. Based on this shape-similarity, we make the further simplifying

assumption that the timing relationship Γi,jfor any two constant workloads, Fi

and Fj, is a series of functions with the same form but different parameters,

Page 4

0 50001000015000 20000

Time (seconds)

3200

3400

3600

3800

4000

4200

Voltage (mV)

F1(IMem)

F2(IMemWC)

open circuit voltage

cut-off voltage

t1t2

F1

F2

V

0 5000

Time of F2(seconds)

100001500020000

0

5000

10000

15000

20000

Time of F1(seconds)

Transformed curve

t1

t2

Fig.1. Timing relationship between two voltage curves of constant workloads. F1 is

the curve of the workload that is generated by repeatedly running benchmark “IMem”.

And F2 is the curve of benchmark “IMemWC”. The left graph shows that for some

voltage value V , F1 reaches V at time t1 and F2 reaches V at time t2. The right graph

shows the linear relationship between t1 and t2 for any V .

denoted as Γ(φi,j,t), where φi,jis a specific set of parameters for Fiand Fj. For

the curves in Figure 1, we now have:

F1(Γ(φi,j,t2)) = F2(t2)(3)

So:

Γ(φi,j,t2) = F−1

1(F2(t2)) (4)

We plot the Γ function for curves F1and F2in the right graph of Figure 1.

The x-axis is the time of F2and the y-axis is the time of F1. In this graph, the

Γ curve appears very close to a linear function. Our experiments show that this

strong linearity actually exists between any pair of constant workloads. Figure

2(left) shows another three Γ curves for pairs of constant workloads. The axes

are similar to those in the right graph of Figure 1.

If we use one specific voltage curve of constant workload as the reference,

denoted as Fref, the Γ function between any curve F and the reference curve

Fref can be expressed by:

Γ(φ,t) = F−1

ref(F(t))(5)

Since Γ can be approximated by linear function, let φ = (a,b), and we have:

F−1

ref(F(t)) = a ∗ t + b(6)

Note that here a and b vary for different constant workloads. The Γ function

actually shows not only the timing relationship between two workloads, but also

indicates the size of the load: the larger the slope of the curve, the higher is the

power consumption and the shorter does the battery lifetime extend. We refer to

the Γ function as the transformed voltage curve. Using a reference voltage curve,

we can transform any non-linear voltage curve of constant workload into a linear

Page 5

0 5000

Time of three benchmarks (seconds)

1000015000 20000

0

5000

10000

15000

20000

Time of IMem (seconds)

T1(Reg vs. IMem)

T2(dijkstra vs. IMem)

T3(video vs. IMem)

T1

T2

T3

010000 20000 30000

Time (seconds)

3200

3400

3600

3800

4000

4200

Voltage (mV)

Voltage curve

Transformed voltage curve

voltage curve

0

5000

10000

15000

20000Time in terms of reference benchmark (seconds)

transformed curve

Fig.2. Timing relationship (Γ function). The left graph plots the timeing relationship

for three pairs of constant loads: “Reg” vs. “IMem”, “dijkstra” vs. “IMem”, “video”

vs. “IMem”. The right graph shows both the voltage curve and the transformed curve

(also based on “IMem”) for “real.load.5”.

form, which is friendly to fast statistical methods, e.g., linear curve fitting, for

remaining battery lifetime prediction.

In real life, workloads may not be constant. We can approximate the power

consumption of a variable workload with a piecewise constant curve. Such an

approximation is reasonable since the tasks of a workload are composed of con-

secutive execution of a sequence of operations, whose power consumption can

be regarded as constant. Given this assumption, the transformed voltage curve

for a variable workload should appear as a piecewise linear curve under ideal

conditions.

However, the actual voltage curve of a variable load also exhibits the recov-

ery effect. The recovery effect refers to the phenomenon that a battery regains

some capacity when the load decreases. Through observation, we find that the

recovery effect occurs whenever the load changes. If the load decreases, the volt-

age will “jump up” to a higher value instead of monotonically decreasing. If

load increases, the voltage will “jump down” sharply. On the transformed curve,

the “jumping” direction is inverted because an advance in time equates to a

drop on voltage. Figure 2(right) shows the original voltage curve (from top-left

to bottom-right) of a variable workload “real.load.5” and its transformed curve

(from bottom-left to top-right) in the same graph. Both curves share the same

x-axis, which represents the workload execution time. The left y-axis shows the

voltage level for the voltage curve; the right y-axis shows the corresponding time

for the transformed voltage curve given the reference curve. Both curves exhibit

fluctuations due to the recovery effect.

Despite the recovery effect and the use of piecewise linear estimation, simple

statistical methods can still achieve accurate prediction on the transformed curve

for variable workloads. We present this data as part of our empirical evaluation

in Section 3. In addition to the recovery effect, our curve transformation method-

ology also captures a number of other challenging battery characteristics that

often limit prediction accuracy performance in other techniques [9], e.g., the rate