Mobile GPS Application Design Based on System-Level Power and Battery Status Estimation †

: Mobile systems such as smartphones require accurate estimation of the battery-related features including the remaining energy and operating time, especially as the the power consumption of user applications is growing continuously these days. We present an energy-aware smartphone application design framework that considers the battery’s state of charge (SOC), energy depletion rate, as well as the service quality of the target application. We use a veriﬁed-accurate battery energy estimation method in an Android-OS-based mobile computing system. The battery model considers the rate-capacity effect. We apply regression-based models for the power estimation of the major subsystems in the smartphone, and then aggregate the result to yield the whole system’s power. We ﬁrst determine the quality of service for the location device (GPS), the display device (LCD), and the overall system (application). Then, we control the error rate of the GPS and the brightness of the display to acquire the maximum service quality of the system for a given car trip. We show the advantage of the proposed method with a case study of a trip. In this case, the smartphone guides a user’s car trip using its GPS navigation capabilities; to do this, we propose an adaptive algorithm that exploits our improved SOC estimation and considers the car’s variable velocity. This proposed adaptive power and service quality control of the GPS application improves the quality of service in this example case and ensures there is enough remaining battery for the trip to be completed. In contrast, conventional approaches to this task provide a lower quality of service and run out of battery before the trip ﬁnishes. In conclusion, if a trip plan is provided, an application using our method delivers the maximum quality of service, such as system endurance time, location error, and display brightness.


Introduction
Modern high-performance mobile computing systems are increasingly consuming more power. These applications simultaneously support various functionalities, including the display, audio, GPS, wireless communication, and higher computing capability with only limited energy stored in the batteries. However, the increases in the energy density of batteries has been much slower, and it merely satisfies the expectations of the users. As a result, it has become critical to utilize the precious energy stored in these batteries. Accurate power modeling and estimation is the starting point of power and energy management.
Extensive studies have been conducted on the power analysis and modeling of mobile embedded systems. Among the models, parameterized power models based on the system parameters are considered a convenient approach to use in a run-time manner.
A measurement-based power estimation model was introduced in [1], where the system activity parameters were collected and evaluated from the viewpoint of the system power consumption. These coefficients of the system power equation were derived by regression analysis.
There have been several efforts to provide system-level power estimation models for smartphone platforms [1], including some battery-information-based models [2,3]. These models are based on the component activities within the system. For accurate online estimation of the battery SOC, combining particle swarm optimization and extended Kalman filter [4], co-estimating load current and SOC without a physical sensor [5], and diagnosing of internal short circuit of the battery [6] have been intensively studied. The dependencies between the system energy models on hardware architectures and configurations were studied in [2]. The possible usage patterns were analyzed at the same time to suggest personalized models for battery-powered mobile systems. An on-chip bus performance monitoring unit was introduced to generate the system power consumption model in [7]. A run-time, feedback-based, full-system energy estimation model for battery powered devices was introduced [8]. A power consumption model for wireless applications with OS-level parameters was constructed [9].
In practice, commercial smartphones are usually equipped with built-in battery voltage sensors. Then, it utilize previously explained battery discharge behavior models to calculates the lifetime. It is a straightforward method that has been introduced for earlier smartphones [3]. It was claimed that the proposed method achieves accurate enough result up to commercial level. An improved method considering the rate capacity effect and battery internal loss was introduced [10].
We introduce an energy-aware application design framework for Android-OS-based mobile systems considering the practical aspects of battery behavior. As a case study, we explored the design through a GPS application from the perspective of service quality and service time based on a battery capacity loss estimator and power consumption model using the Android kernel, which produced accurate subsystem activity data in our prior work [10]. As a trade-off exists between battery lifetime and service quality of the GPS application considering the locating resolution and trip coverage [11,12]. A trade-off between the locating resolution and power consumption was considered when designing the sensor node application in [13,14]. In [15][16][17], a sensor-GPS hybrid location technique was studied. It also an intensively studied topic for electric-or GPS-based autonomous vehicles [18,19].
We consider the other major power consumers in these mobile systems, including the display. We finally construct an adaptive algorithm to maximize the battery lifetime by adjusting the GPS location precision and display brightness according to velocity variations during the trip. The remainder of this paper is organized as follows: We introduce the structure of the proposed method in Section 2. Then, we show that the proposed adaptive power and service quality control of the GPS improves the quality of service in Section 3. We present the formulated service quality optimization problem and its solution method in Section 4. The experimental results are provided in Section 5, and the conclusions in Section 6. Note that the detailed power estimation model on the Odroid-A platform is introduced in Appendices A and B. Figure 1 shows the proposed application design framework to optimize the service quality of GPS applications. In the framework, the system power consumption and the battery SOC of the target platform are estimated using the system and battery models constructed in our previous work [10]. The models are described in Appendices A and B. We characterized the internal battery by measurement as we charged and discharged the battery in constant-current and pulse-current situations. We also considered a ratecapacity effect for accurate modeling. We present the modeled battery parameters in Appendix A. We also performed a regression analysis for the power consumption of each component of the target smartphone and extract the coefficient of the power model. The components of the target smartphone and their coefficients are described in Appendix B. We built a service quality model of the GPS application to maximize the satisfaction of the smartphone user. Since higher performance requires more power, if we set a smartphone in high-performance mode, its battery depletes faster. However, a typical user prefers to have a running smartphone with reduced performance rather than one that is completely turned off. Thus, it may be better to limit performance to make smartphones last last in certain cases. We regard the locating accuracy and display image quality as the performance of the GPS application. The GPS module has a trade-off relationship between its locating accuracy and power consumption. Like the GPS module, the brightness (and thus the dynamic range) of the display device is also proportional to the power consumption in general [20]. We therefore designed the GPS application to balance locating accuracy, display image quality, and service time with the objective of maximizing the service quality.

Adaptive Control of Service Quality and Power Consumption
Mobile devices should remain turned on until they are connected to wall power. sSometimes, they cannot remain on because the energy capacity of mobile devices' batteries is limited. Limiting the performance of mobile devices can save the remaining energy of the batteries. In general, it could be beneficial to limit the performance of the device to prolong operation time since users prefer using mobile devices with limited performance rather than being unable to use them. We suggest an energy-aware application that limits the performance of GPS and reddisplays to make mobile devices work longer.

Service Quality of GPS Module
When its host system has a limited energy budget, a GPS application should have lower power consumption remaining enough accuracy. Note that in this paper, lifetime denotes a duration lasting until the system is turned off because of battery depletion. Under certain circumstances, lifetime is more important than locating accuracy. For example, if a user is in an emergency in a strange area, a longer service time is required. If a user travels on a long-distance trip, the required accuracy may be less. Note that the locating accuracy may be critical such in systems such as aeronautical navigation systems, but we do not target that system here. We evaluated the the service quality of a GPS application considering both the locating accuracy and service time. Table 1 explains the symbols used in this work. Faster GPS tracking of an object increases the error. S longer fixing period of the GPS also results in increased error. We model the maximum locating error of the GPS [10] as: where v, t f ix , and 0 are the velocity of tracking object, th fixing period of the GPS, and the fundamental GPS error, respectively. Figure 2a,b shows that tshe longer t f ix has larger error per Equation (1). We normalized the error when we evaluated the service quality error of th GPS application. We also considered service time when we evaluated the quality of service. If the installed battery of the mobile device is not depleted until a given trip is finished, the normalized trip coverage (Coverage) is the maximum. We set the maximum value of Coverage to 1, and we set Coverage proportional to the covered trip time if the internal battery is depleted before the trip is complete; thus, we formulate the normalized trip coverage as: where t service and t trip are the service time and the given trip time, respectively. We calculate the energy used when the GPS application is running from Equations (A4) and (A5). We denote the power consumption of the other devices as E other . The used energy is estimated as:  The Android API requestLocationUpdate() supports various fixing periods of the GPS. We analyze power consumption and duration depending on the state of the GPS, as shown in Figure 3. We model the state duration ratio proportional to t total as: We assume that t f ix is always longer than t goo f f or t active . t active and t gosleep are the time duration of the ACTIVE state and SLEEP state, respectively. The t service in Equation (2) is obtained by dividing the battery capacity by ∆E GPS .

Display Image Quality
Display devices are some of the major power consumers in mobile electronics. An LCD is not a self-illuminating device; therefore, the light intensity is determined by the backlight intensity and its transmissive efficiency. The backlights of LCDs have been implemented with CCFL or LED. Nowadays, LED backlights are more popular due to their low power consumption, long lifetime, and excellent stability.
The light intensity from an LED backlight is basically proportional to the current that flows through the device, where the number of emitted photons per time is the same as the number of charges per time, in other words, the current. The LED has an internal resistance and a threshold voltage in the equivalent circuit model. We need to supply enough voltage to flow the required current to illuminate the device as we want. Therefore, theoretically, the power consumption of the backlight is proportional to the square of the maximum required light intensity.
However, the LCD consumes power linearly proportional to brightness because the relationship between physical light intensity and human-perceived brightness is nonlinear. Thus, the brightness value of the image data is tuned by a gamma table. The power consumption becomes proportional to the brightness after the gamma tuning is applied, as shown in Figure 4. This figure shows the measured power consumption and the plot produced by the model when we change the brightness parameter in the Android OS. The maximum brightness determines the dynamic range of the display, which is directly related to the displayed image quality. We normalize the displayed image quality using the maximum brightness by: where max(X lcd brit ) is the maximum brightness.

Adaptive Energy-Aware Service Quality Control
In practice, the velocity of a vehicle changes over time. Figure 5a shows the speed limit along the route from San Diego to Sacramento. Different speed limits are applied in residential areas urban freeways, and rural freeways. We assume that the velocity changes randomly within the speed limit. We model the trip in a discrete manner using t f ix intervals. The next fixing time interval, t i+1 f ix , is determined at each fixing time, as shown in Figure 5b. We define the combined service quality Q service as a weighted sum of the GPS trip coverage, GPS location error, and displayed image quality, which is given by: where ω 1,2,3 represent the weight values, and the definition of each service quality metric is presented in Sections 3 and 3.2.

Problem Formulation
We maximize the service quality for the given trip time, power model, and battery model. The problem statement is as follows: This problem can be regarded as an integer programming problem where (t i f ix ,X lcd,i brit ) is regarded as a tuple of discrete values. If the velocity profile is given in advance, we can find the global sub-optimum by using a branch-and-bound algorithm or integer-linear programming. Otherwise, we should make a decision considering service time as well as the service quality in a heuristic way. The decisions made at each epoch are dependent on each other through a nonlinear dependency among the battery internal resistance R total , battery output voltage v OC , and battery SOC. The current battery status and energy consumption are dependent on the previous decision.
We propose the heuristic algorithm presented in Algorithm 1 based on a relaxed solution in a continuous domain with iterative hill climbing. The location determines the velocity at any given point during the trip. We assume that the driver obeys the speed limit, then the velocity at the ith decision epoch varies with the upper and lower speed limit. The SOC of the battery is also discretely calculated using Equations (A3)-(A5), where ∆t is determined by t i f ix .
Algorithm 1: Adaptive service quality and power control algorithm with variable velocity.
Input: Trip distance D trip , battery capacity Capacity, speed limit limit() Output: (t i f ix , X lcd,i brit ) Data: Voltage variance of remaining charge in the battery (v SOC ), Open circuit voltage of battery (v OC ), Power consumption of each device (P), OC with the models Obtain minimum power budget P * = Capacity · v SOC /t remain Obtain P * lcd and P * gps for maximum Q service by linear programming where P * lcd ≥ P 0 lcd + P ctrl lcd , P min gps ≤ P * gps < P max gps , and P * lcd + P * gps = P * Set t i f ix = t active C GPS active +t go f f C GPS active P * gps −C GPS sleep and X lcd,i brit =

Experimental Methods
We set up an environment to extract the coefficients for the system power consumption model with Hardkernel's [21] Odroid-A platform. We measured the current of the Odroid-A platform using shunt resistors and Texas Instrument's INA194 [22] current sense amplifier. We collected the measured current data with National Instrument's [23] DAQPad-6016 and LabView. Agilent's E3631 [24] provided the power of the Odroid-A platform and the current measurement module. We double-checked the measurement data using a digital multimeter. Figure 6 shows the experiment setup. We present the battery and target system power model in Appendices A and B. All the coefficients extracted from the experiments are listed in Table A3.

Accurate Energy Budget Considering Battery Internal Loss
We first show why we should consider battery internal loss for power-related calculations of mobile devices using an example case shown in Figure 2c. We assume that we travel the 523 mile road from Sacramento to San Diego with a fixed velocity of 60 mph. The estimated trip time is 8 h and 20 min when we check with Google maps. The battery and target system model used in this calculation are presented in Appendices A and B. In this example comparison, we simplify the energy consumption other than GPS as 3.5231 J. We also assume that t active and t goo f f are 10 and 5 s, respectively. We depict that the GPS application's quality of service Q service depends on t f ix . Coverage and (1 − ) are the estimated normalized trip coverage and the normalized accuracy, respectively. Figure 2a shows a higher Q service than Figure 2b, but it is unrealistic since there is no mobile device that does not use a battery. In other words, if the battery internal loss is not taken into account, the wrong power budget is expected, which makes the mobile device's usage time prediction wrong as shown in Figure 7. For example, if we set t f ix to 80 without considering the internal battery loss, it seems that the mobile device can run until the trip is finished as shown in Figure 7a. However, this is not true. If we consider the realistic conditions, Figure 7b shows that the battery depletion forces the mobile device off when t f ix is 80.

Adaptive Power and Service Quality Control of a GPS Application with Variable Velocity
The behaviors of (t f ix , X lcd brit ) with the proposed adaptive control method in the battery SOC estimation and power estimation only case are illustrated in Figure 8. We randomly generated a velocity within the upper and lower speed limit range for each time slot for the experiment. We used 2.2139 J for ∆E other , while the other simulation parameters were the same as in Section 5.1. Figure 8 shows the advantage of adaptive control. The battery SOC would be exhausted earlier than the trip end time when we fix t f ix and X lcd brit using only the average velocity, as shown in Figure 8a. Figure 8b,c shows that the algorithm tends to decrease t f ix and X lcd brit at high velocities in order to maintain the location accuracy. t f ix and X lcd brit increase when the velocity is low, and sufficient locating accuracy can be achieved with a relatively long t f ix . Unless we consider the rate-capacity effect of the battery, the phone also fails to complete the trip, as shown in Figure 8b, even if we control t f ix and X lcd brit . The proposed algorithm with the battery estimation completes the trip while achieving better service quality. We integrate Q service over time to compare the results, which is given by: We set all weight values, ω 1,2,3 , to 1 in this experiment. The integrated Q service for a fixed value was 31.38 over time, where 8.9% of the trip was not covered by GPS service time. The integrated Q service of adaptive control in the power estimation only case was 33.61 over time where 4% of the trip was not covered by the GPS service time. The proposed adaptive control method with battery SOC estimation achieved a 34.53 integrated Q service score, where the full trip was covered by the GPS service time. The proposed algorithm with the battery estimation achieved a 10.3% and 2.7% Q service improvement compared with the fixed case and power estimation only cases, respectively.

Conclusions
This paper introduced a mobile GPS application design using accurate power estimation and accurate remaining battery charge estimation. The application considers the power consumption of the units of the mobile device such as the CPU, cellular, Wi-Fi, LCD, audio, GPS, vibration motor, and more. We more accurately calculated the power consumption of certain units such as the cellular, Wi-Fi, and GPS components by considering their states. We verified our model by comparing it with real platform measurements using commercially available devices. The result showed that our model provides a much more accurate duration time estimation of mobile devices that use a battery.
We performed a service quality and battery lifetime tradeoff analysis. The results showed that our power-aware design framework helps to achieve maximum service quality while ensuring the task will be completed. We also proposed an adaptive algorithm that deals with velocity variations during a trip monitored by GPS. The proposed adaptive control method that uses our battery SOC estimation ensured that the mobile device fully covers the trip while achieving a 10.3% Q service improvement compared with the same task where a fixed velocity was assumed. In a future study, we hope to extend the proposed battery-aware GPS control design framework to electric vehicles with GPS-based navigation or autonomous driving. We want to increase the accuracy of the estimation given the recent progress in battery SOC estimation, sensor fusion technique, and traffic prediction in future work. We will also compare the evaluation results with conventional techniques and hybrid approaches.

Appendix A. Battery Model
There are many analytical battery models based on electrochemical knowledge [25][26][27][28][29]. However, the complicated analytical battery models are not easy to use for estimating a handheld device's battery SOC in a real-time environment. Thus, we used circuit-based battery models such as [30][31][32]. We adopt the battery model from [10]. We measured the internal resistance of the target battery as about 100 mΩ, which is not negligible in [10]. In this section, the constructed equivalent circuit model and its parameters are introduced to prevent the overestimation of the remaining battery SOC.

Appendix A.1. Battery Circuit Model
In our previous work [10], we adopted an equivalent circuit battery model from [30] . The equivalent circuit model is depicted in Figure A1. This model enables the run-time and real-time estimation of battery SOC. The remaining charge in the battery is modeled as a capacitor C b , which shows the voltage variance v SOC based on the remaining charge in the battery. v SOC is expressed as follows: where C b, f ull is the capacity of the battery and C b is the currently stored charge. The opencircuit voltage of a relaxed battery (v OC ) only relates to its SOC. Thus, vOC is calculated by using v SOC . We ignore the internal capacitance (C ts and C tl ) of the battery in the handheld device since the typical charge/discharge current is relatively small. The internal resistances R s , R ts , and R tl are also simplified as R total using the heuristic. We model the battery using v OC and R total as follows: where b 11 -b 17 and b 21 -b 23 are coefficients extracted by experiments. We also consider the battery discharge current i b , since there is the rate capacity effect where a larger amount of battery discharge current decreases the battery discharging efficiency η(i b ). We approximate η(i b ) as (i b ) −k d using Peukert's law [33]. We also extract k d by measurement. KPL6072196 Li-ion cell coefficients, b 11 -b 17 , b 21 -b 23 , and k d are denoted in Table A1. Figure A1. Li-ion battery equivalent circuit model.
The consumed energy ∆E is calculated as: ∆E = ∆t(P cpu + P lcd + P gps + P audio + P cellular + P w f + P vm ) + E loss .
The power-consuming unit of the smartphone when the GPS application is running consists of a CPU (P cpu ), display (P lcd ), positioning (P gps ), audio (P audio ), cellular (P cellular ), Wi-Fi (P wi f i ), and vibration motor (P vm ). The energy consumption in a certain period (∆t) is calculated by ∆tΣP + E loss as in Equation (A4), where E loss denotes the internal energy loss of the battery. E loss is derived from Equation (A2) by summing the ohmic and rate-capacity effect loss as follows:

Appendix B. Target Platform Model
Hardkernel's [21] Odroid-A platform is a high-end smart device development platform that has similar functionalities to Samsung Galaxy S2. We used Odroid-A platform model from [10]. The component units, which compose the Odroid-A platform, are listed in Table A2. We used the activity profiler of Android OS to extract the activity of each unit. We model the power consumption of the CPU using its execution frequency and utilization as: where C cpu f req and P CPU 0 are coefficients. The CPU execution frequency is denoted in X cpu f req . The CPU utilization of kernel and user program are denoted by X cpu kernel and X cpu user , respectively.

Appendix B.2. Cellular Module
The power consumption of the cellular module heavily depends on its running state, which consists of IDLE, FACH, and DCH. Thus, we use the time use rate of each state within a certain period of time.
where X cellular on is 1 when the cellular module is activated, or 0 otherwise. The use rates of each state are denoted by X cellular idle , X cellular f ach , and X cellular dch when C cellular idle , C cellular f ach , and C cellular dch are the coefficients, respectively.

Appendix B.3. Wi-Fi Module
The Wi-Fi module's power consumption also heavily depends on its running state. Unlike the cellular module, it only has LOW and HIGH running states, representing its wireless link speed. It is modeled using the time use rate of each state as: We assume that the Wi-Fi module only consumes power when it is turned on (X w f on ). The LCD consists of a display device and its control module. The control module always consumes electricity even the display is fully turned off. The display device typically consumes electricity proportional to its brightness. The constant value P lcd ctrl denotes the consumed electricity of the control module. As a fully turned off display device does not consume electricity at all, we set a variable X lcd on to represent this. When the display device is at full brightness, it consumes much more electricity than when it is at other brightness levels. Thus, we use the time utilization rate when it is in full brightness or not (X lcd f ull and X lcd brit , respectively). We consequently model the LCD as: P lcd = P lcd ctrl + X lcd on (C lcd f ull X lcd f ull + C lcd brit X lcd brit ) + P lcd 0 , where C lcd brit , C lcd f ull , and P lcd 0 are the coefficients.

Appendix B.5. Audio Device
We assume that the audio device does not consume power at all when it is not activated (X aud on is 1 or 0). Otherwise, it consumes power proportional to the volume. We model audio devices as: P aud = X aud on (C aud vol X aud vol + C aud on ), X aud vol , C aud vol , and C aud on are coefficients.

Appendix B.6. GPS Module
As with a cellular module, the GPS module has OFF, SLEEP, and ACTIVE states. Each state consumes a different amount of power. Thus, we adopt the time utilization rate for each state (X The vibration motor consumes different amounts of power depending on its vibration strength and patterns. Still, we assume it consumes average constant power when activated since its vibration strength and patterns are typically fixed. We describe the power model of vibration motor as: where C motor on is the coefficient. X motor on denotes whether the motor is activated or not. We finally present the extracted coefficients of the Android system power model in Table A3.