Anda di halaman 1dari 8

2014 International Conference on the IMpact of E-Technology on US (IMPETUS)

A Machine Learning Approach to Predict Future Power


Demand in Real-time for a Battery Operated Car
Somnath Pradhan, Joydeb Roychaudhury
Embedded Systems Laboratory
CSIR-Central Mechanical Engineering Research Institute
Durgapur, West Bengal, India
som9543@gmail.com, jrc@cmeri.rest.in
regression model and its outcome to predict the power demand
in next 10 seconds are also demonstrated in this paper. The
lessons learned from different difficulties we faced to validate
the model with real-time data and the pitfalls to develop the
model are also discussed in this paper.
With the extensive use of Li-Ion batteries in
automotive, the development of prognostic health management
system for those batteries become new field of research in
modern scientific communities. Use of Kalman filters [1],
Adaptive Kalman Filter [2],Extended Kalman Filters [3],
Artificial Neural Networks [4] are very popular methods in the
field of prediction of battery SoC and SoH. These methods
provide very accurate prediction but the computational
overhead is also very high for a standalone controller to
compute. The internal computer system of a car may become
unstable due to large calculation overhead in real-time
operation. On the other hand Current Integration Methods like
Coulomb Counting, Enhanced Coulomb Counting [5] provide
very less mathematical computation, however accuracy of
prediction is not perfect. In the field of SoC estimation use of
lookup tables for open circuit voltage (OCV) to SoC mapping is
also very popular [6]. This method needs extensive testing and
data collection to make proper data mapping in lookup table.
Compared to the above discussed method, data driven and
model based approaches [7][8] are more popular in this regard.
This paper proposes the implementation of data
driven self-corrective and predictive model using polynomial
regression method. To estimate the runtime of battery, this
model balances the computational overhead and the accuracy.
In the initial stage data-driven algorithms like polynomial
regression needs large number to training dataset, but allows
very
fast,
easy
and
computationally
inexpensive
implementation. This algorithm requires continuous changes of
its initial hypothesis with the varying complexity of the
problem like dynamic loading discharge profile of a battery in a
battery operated car.
The algorithms discussed above provide good
result on the similar data set or where the model is trained.
The scope of this paper is not only limited to the development
of data driven self-corrective and predictive model but it also
focuses on development of data acquisition system and
implementation of it on a prototype car.

Abstractfor any battery-employed system, it is essential for


the battery management system to correctly predict the
present operational condition of the battery. The fail safe
operation of a safety critical system like battery operated car
or any other lifesaving systems are heavily depend upon
earlier prediction of battery life. SOC or State-of-Charge
estimation is one of the well-known method to predict the
runtime of a battery.
Various approaches are adapted by automotive
society to correctly predict the runtime or the SOC of a
battery like Kalman filter, UKF and many others. This
paper proposes a new approach, the method of regression to
predict the future power demand of a car while running on
the road. The aim is to identify that, the battery will support
the run of the car in next 10 seconds or not.
The runtime prediction of a battery, not only
depends upon the starting SOC but also depends upon other
factors like battery health and road profile imposed. To
overcome this type of difficulties the self-corrective
regression model is proposed and implemented.
Experiments performed on different road profiles, validate
demanded power by the car in up-coming 10 seconds of its
run.
The major problem of SoC estimation is to
determine initial SoC of a battery. Extensive experiments
needed to calculate the initial SoC and which may also vary
with the life of the battery. The novelty of this work shows,
the method to predict the future power demand by updating
its model parameters and without any initial SoC
calculation.
Model parameters are updated by the
introducing new current and voltage sample in the model.
Keywords- Data Driven Prognostic Model; End of Discharge(EoD),
State Of Charge (SOC)

I.INTRODUCTION
In the field of prognostic and BHM, data-driven models are
very popular due to their intuitive nature and very easy
implementation in real-time systems. Regression is one such
example of data-driven model. With the development of these
new algorithms the field of prognostic under battery
management system is growing very rapidly.
This paper summarizes the development process
of a data-driven approach for a dynamic load discharge
scenario, like a battery operated car moving on haphazard road
profiles. In our work, Li- Ion battery was used to run the
prototype car on road. The development of polynomial

II. DEVELOPMENTOF DATAACQUISITION SYSTEMS


Figure 1, represent the block diagram of the Car control unit.
The car is powered with 7.4V, 4.4AH Li-Ion battery. Current
Sensor is used to collect the current drawn by the motors and

978-9332-9026-40/14/$31.00 2014IEEE

49

method is used to find the relation between error and


measured sensor data and experimentally it is found that the
relation is linear and can be expressed by linear equation
like

the battery voltage is continuously sampled by the internal


ADC of ATMEGA2560 in every one seconds.

y = mx + c ..

(1)
In this equation y is the measured error and x is the
collected current data sample form the sensor.

Fig : 1 Bolck Digram ofData Acquisition System

The motors are connected with processor via 12V, 16A


motor drivers and controlled using PWM. Figure-2, shows
the schematic representation of the motor driver connection.
Opto-interrupter connected above the motor shafts is used to
measure the RPM of motor. Collected voltage and current
samples are used to calculate the power delivered by the
battery to run the car. Information related to velocityacceleration is very useful to find out the energy
requirement by the car to achieve a final velocity.

Fig 3: Plot of Error And Current Sensor Output

Algorithm-1, describes the Pseudo Code for


calibration and figure-3, shows the regression curve for
sensor calibration.
B. Calculation of Motor Speed :Motor speed or the RPM of wheel is sampled by optointerrupted with a slotted disc connected on the motor shaft. In
our experiment 60 slotted disc is used. With one full rotation
(3600) of motor the connected opto-interrupt generates 60
pulses which is fed in the controller so that in every high rise of
the pulse, it can interrupt the controller. One scheduling
algorithm was used to monitor the total number of interrupt
(Tp).

A. Calibration Of Current Sensor :The current sensor is calibrated with standard calibrated
multimeter. To calibrate the sensor, data is captured and

RPM = (Tp / 60) * 60. =Tp.

(2)

From the above equation -2, it can be observed that the RMP is
same as the total number of pulse generated in one seconds.

Fig 2: Connection of Motor Driver.

compared with the multimeter. Table 1 shows the


comparison between sensor data and the multimeter reading
and difference between them. For the next part, regression

50

Algorithm 1:
Calibration

establish the mathematical relation between the (response and


explanatory) variables. To define a best relation, a class of
acceptable formulas are chosen and then the best coefficients
are calculated so that the error becomes very less. The function
depends upon the hidden mathematical model and the model
depends upon the collected data or the physical situation. It
may be a linear dependency like

Pseudo Code for Current Sensor

loop
INITILIZE amp = 0 //reading current sample
for i=0 to 100do
amp = amp + readSen();// reading sensor
//data and adding with past sample
end for
amp = amp / i; // taking average
error = 9 * amp - 0.6;// Y = MX+C
// Y is error, values of M = 9and C = -0.6 calculated from
experiment
amp = amp + error;
end loop

Sl. No.
1

M
9

y = f (x) = Ax + B
Or nonlinear

y = f ( x ) = Ax 2 + Bx + C

(8)

A successful polynomial interpolation depends upon


the accuracy of dataset, up-to a certain digit. Most of the time
datasets contains error because of the sensors or data collection

C
-0.6

Table:2 coefficients of stright line for current sensor calibration

The RPM is converted in Radian per seconds (q) and


finally liner velocity (Vl) is generating by multiplying it with
the radius (r) of the wheel.

q (i) = ((2 * * Rpm(i)) / 60 (3)

Vl (i) = q(i)*r (4)


1
Ek (i) = * M * Vl 2 (i) (5)
2
III. PROGNOSTIC FRAMEWORKAND REGRESSION USING
CURVE FITTING

Sl
no

Measured
Data(mA)

Sensor
Data(mA)

Difference(
ma)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

0.7
0.8
0.9
1
1.1
1.2
1.3
1.4
1.5
1.6
1.7
1.8
1.9
2
2.1
2.2
2.3
2.4
2.5
2.6
2.7
2.8
2.9
3

0.13
0.14
0.15
0.16
0.17
0.18
0.19
0.2
0.21
0.22
0.23
0.24
0.25
0.26
0.27
0.28
0.29
0.3
0.31
0.32
0.33
0.34
0.35
0.36

0.57
0.66
0.75
0.84
0.93
1.02
1.11
1.2
1.29
1.38
1.47
1.56
1.65
1.74
1.83
1.92
2.01
2.1
2.19
2.28
2.37
2.46
2.55
2.64

Table:1 Collected Current Sample for Sensor Calibration

systems. Say, for N number of collected data set of xk and yk


the exact value of the function can be realized as

In this section the approach to predict the future power demand


is presented. Prognosis means something to predict. Regression
can be defined as a process which estimates the relation
between variables. The experimental results produces set of
data points (x1,y1) ..(xN,yN).Where y is the dependent
parameter(Response Variable) and x is the independent one
(Explanatory Variables). For example temperature is varying
with time or in a close circuit one battery power is getting
dissipated in a variable load profile scenario. The dependent
parameter depends upon the independent parameters with some
mathematical function like-

y = f (x)

(7)

f (x k ) = y k + ek , where ek is measurement error or residuals.


ek = f (xk) yk .

(9)

A best fitting line can be plotted by selecting a proper


order of the polynomial, for which sum of square of residuals
are minimum. This can be done by an iterative algorithm which
plots the curve in different orders and finds the best fit.
Finding Least Error Polynomial And Regression:Regression is a statistical method which estimates the
relation between response variable (dependent) and input and
explanatory variables (Independent) on observational database.

(6)

Curve fitting method is one of the very popular methods to

51

The relation is such that, the output can be predicted based on


the observed input dataset. Regression analysis helps to
understand the behavior of dependent variable when there is
some change in one of the independent variable, while other
independent variables are fixed.

A[], B[] uses to store temporary calculation values


A[]- coefficient Matrix
Degree<-m//degree of polynomial
//Degree of Polynomial will change in auto regression model
// Starting win Degree 1(Linear Plot)

The method of Polynomial regression provides


polynomial to describe the relation between inputs and its
corresponding output. It is one of the best methods which
balance the accuracy and efficiency. The accuracy increases upto a certain point, with the increased order of fitted polynomial.
But the computational time and memory used also increase.
Avery high degree of polynomial may make the Polynomial
Regression numerically unstable, whereas very low order of
polynomial may not describe the complexities of the function
being learned. The main objective of polynomial fitting is to
find a best polynomial of allowable degree which interpolates

If length(XT[n])==length YT[n]do
loop
INITILIZE f (x) //fitting algorithm
n = Find The Length of Dataset.
F = zeros(n, Degree + 1)
for i=0 to Degree do
// fill the columns of F with the power of XT
F[:, i]=XT[i]^(i) // Ref Equation 13
End

the dataset of N points, say {(xk, yk)} K =1 Equation-8showsan


N

FTtans[] = Transpose of F[]

example of cubic polynomial. A, B and C are the coefficient of


the polynomial. For least-square fitting the optimum values of
A, B and C needs to be identified.

B[]=FTtans[] *F[];
B[] = FTtans[]* Y[];

Starting with 1st degree polynomial, to find the best fitted


equation is given as

y = a0 + a1 x + a2 x 2 + ..... + an x n

A[] = B[] / C[];


end loop

(10)

end if

For the above equation residuals can be calculated as


k

E = ( yi (a0 + a1 xi + a2 xi 2 + ..... + an xi n ))2

(11)

A. Updating of Model Parameters with Sensor Data:Starting with de-noising, final training dataset was
created by removing some incomplete and corrupted runs. This
training dataset was collected over time by running the car on
different haphazard road profile. The noisy and de- noised
training data is shown in figure -8 and 9 respectively.
In the next part of the experiment, our focus is on,
learning this dataset based on Polynomial Regression and
update the model with new data sample to predict power
demand.

i =1

The Coefficient of the polynomial can be determined by the


solving the matrix given below.

y1 1 x1

y2 = 1 x2
# # #

yk 1 xk

" x1n a0

" x2n a1
(12)
% # #

" xkn ak

In the matrix notation the above equation is given by

Y = XA

(13)

To solve the equation and find the coefficient matrix A both


side of equation 17 is multiplied with the transpose of X.

X T Y = X T XA
A = ( XX T ) 1 X T Y [9]

(14)

The coefficient Matrix is generated by solving equation no 14.


Figure 6 : Sefl Corrective Model

The Regression Model takes the pair of inputs Xi


(Time) and Yi (Power demanded by the car) and generates the
coefficients for best-fitted polynomial. The operation of
developed self-correcting model is explained in figure - 6. The
model which automatically changes its parameter to correct its

Algorithm2: Pseudo Code for construction of


polynomial with fixed degree
Given: XT[n] and YT[n] //Training Dataset

52

Better the data acquisition system, more robust the


model. The training dataset was obtained after running the car on
an irregular road profile. Dataset required to validate this model,
was collected by running the car on the same and on a different
road profile. Raw Training dataset is shown in figure 8. It can be
observed from the figure that there is significant noise in data,
which makes it difficult to learn the pattern of data.

output is a self-corrective model.

Fig 9: Collected Data Sample filtered with 21 point


moving average filter

To overcome this problem, the data was filtered with


the help of a developed 21 point- moving average filter. After
filtration, the dynamics of the data pattern can be identified and
shown in figure -9.

Figure 7 : Flow Chart For Best Polynomial Fitting Algorithm

To generate the best fitted Polynomial, the algorithm starts


plotting the curve on the dataset, with 1st degree polynomial. It
starts with a linear plot and continuously monitors the residuals
converging to a minimum predefined value or not. Next this
process repeats itself with an incremented degree and continues
till the convergence point reached.
The operation of the developed recursive algorithm is
explained with the flowchart in figure-7 and algorithm -2.
IV.

EXPERIMENTAL RESULTS

The heart of the entire experiment is to develop a data driven


model to predict the power need of a battery operated car in
every 10 seconds interval. Precise prediction result depends on
the correctness of the collected data to develop the
model.

Fitted Curve
Dataset

Fig 10: Figure Shows The Best Fitted Polynomila on


The collected Data Sample

Next part of the experiment is to fit the data in a


nonlinear regression model based on the developed algorithm.
The data was normalized for the training in order to improve the
performance of regression. This normalization was done by
subtracting the sample mean and dividing it with its standard
deviation.
The iterative algorithm tries to fit the data with a
polynomial such that the residuals between the actual power
demand and the predicted Power demand is very less, to a
predefined allowable error. The algorithm starts to fit the data
with linear plot and increases the order of fitting till the
convergence point reached.

Fig 8: Collected Data Sample on road to develop the model

53

The green curve in figure 10, tracking the training


dataset in black dots, is the best fitted polynomial. The
convergence of residuals is shown in figure 11 with coefficients
of polynomial in table 3.

to four degree (a0 to a4). Coefficients a5 to a18 are of order of 10-5


to 10-36. So the effect of these coefficients can be neglected. The
high order coefficients are generated as the point of convergence
was very less below 0.1, shown in figure - 11.Regression method
balances the accuracy and efficiency by adjusting the proper
order of the polynomial, can be concluded form the observed
data. For a real-time operation, the degree of polynomial can be
kept low to avoid very high computational overhead which does
not affect the accuracy of the model.

y = a0 + a1 x + a2 x 2 + ..... + a18 x18 .. (15)


The polynomial is of 18th order and given by equation -18.In
this equation y is the predicted output and a0 a18 are
coefficients.

Table:3 coefficients of best fitted polynomail

Predicted power demand


Actual power demand

Fitted Curve
Dataset

Fig 11: Convergence of residuals for best ffitted curve

Fig 13: Updatation Of Model with New Data Sample

In practice 18 degree polynomial is not a good choice, but from


table -3 it can be observed that the effects of high order
polynomials are very less. The coefficients shows best result upOrd
er

Coeff.

Ord
er

Coeff.

Or
de
r

Coeff.

a18

3.9e-36

a11

-1.071e-16

a4

0.000474

a17
a16
a15
a14
a13
a12

-1.073e-32
1.337e-29
-1.016e-26
5.19e-24
-1.91e-21
5.2e-19

a10
a9
a8
a7
a6
a5

1.67e-14
-1.99e-12
1.79e-10
-1.19e-08
5.86e-07
-2.02e-05

a3

-0.00702
0.05922
0.05922
6.46

a2
a1
a0

Fig 14: Comparison between actual power demand by car and


predected power demand
Fig 12: Time vs Real Time Sample for validation

After generation of the model, next job is to test its


effectiveness by validating it with test dataset. This dataset is
collected by running the car on various road profiles.
The old data in the model is replaced by the new data
and the parameters of the model are updated accordingly. And
the power demand in next 10 second is predicted by the model,
after updating its parameters.
Experiments for the validation of the model are done on
two types of road profile, one where the car is trained and in
untrained surface.

54

At the begening of the the experimnent, speed of the


car was kept constant. But it is observed that the car was
producing dynamic turque and velocity as the road profile was
random. Power Consumed by the car, while running on the
uneven road surface (shown in figure 9 ), is dyanamic due this
dynamic road profile.

Average Error
Error

Fitted Curve
Dataset

Fig 17: Fitted Curve On the New Dataset to Track its


Dynamics

Fig 15: Percentage of Average Error

First dataset for model-validation is shown in figure 12.


The dynamics of this dataset is somewhat similar to the
dynamics of training dataset, as both the datasets are collected
on the similar road profile.
Predicted power demand
Actual power demand

Fig 18: Comparison Between Actual Data And Predicted


Data

Average Error
Error

Fig 16: Data with different synamics with training set used to
validate the model

Updated model after fusing all data-set is shown is


figure 13. This model provides predicted power demanded by
the car. Comparison between actual power demand (green line)
and predicted power demand (red line) is presented in figure
14.The percentage of average error between actual power
demanded by the car while running on the road and predicted
power demand varies between 1.5 - 5.5% is shown in figure 15.
Fig 19: Error Between Actual And Predicted Power Demand

The average errors are very high (nearly 50%) when 2nd dataset
is used for validation, reflected in figure 20. Pattern of this
dataset, updated prediction model and comparison between
actual and predicted power demands are presented in figure 16,
17 and 18 respectively.

V.

CONCLUSION

The algorithm has been found to be working efficiently


if the dynamics of road is known or the model is trained with

55

very good training dataset. In the figure 18, maximum error


lies in the range of 0-30 percent. But the average error curve
increases to 50% due to few data points with very high
amplitude.
In the figure -20 the picture of prototype car is shown.
This car is used to collect the data on the various road profiles
and used for validation.

[5]

[6]

[7]

[8]

[9]

Kong Soon Ng, Chin-Sien Moo, Yi-Ping Chen, Yao-Ching


Hsieh,Enhanced coulomb counting method for estimating state-ofchargeand state-of-health of lithium-ion batteries, Journl of Applied
Energy, September 2009.
Lee, S.J. Seoul Nat. Univ., Seoul Kim, J.H.; Lee, J.M.; Cho, B.H. The
State and Parameter Estimation of an Li-Ion Battery Using a New OCVSOC Concept Power Electronics Specialists Conference, 2007. PESC
2007.
Wint Thida Zaw, Thinn Thu Naing, Modeling of Rainfall Prediction over
Myanmar Using Polynomial Regression, 2009 International Conference
on Computing Engineering and Technology.
Eugene Kim, Jinkyu Lee, and Kang G. Shin. 2013. Real-time prediction of
battery power requirements for electric vehicles. In Proceedings of the
ACM/IEEE 4th International Conference on Cyber-Physical Systems
(ICCPS '13). ACM, New York, NY, USA, 11-20.
Douglas M. Bates and Donald G. Watts, Nonlinear Regression Analysis
and Its Applic ations- JOHN WILEY & SONS, INC. Singapore - 2003.

Fig 20: Prototype Car On Road Profile

As seen in figure 8 and 9, the collected data from real


world are always noisy and without suitable de-noising
scheme it is very difficult to learn meaningful
relationships from this data. In case of random loading
profile like the battery operated car running on
haphazard road profiles, the effect of noise may be
non-linear which is very difficult to identify and filterout. A very good filter may also destroy the correct data
pattern. In the experiment 21- point moving average
filter is used to de- noise the dataset and found to be
efficient. Designing of a robust adaptive filter is one of
the open challenges for this kind of experiment.

ARMA model can be used to predict the more


accurately as the errors are also consider in this model.

In future scope more experiments can be done on


different terrains and different velocities.
VI.

[1]

[2]

[3]

[4]

REFERENCES

"Probabilistic duration of power estimation for Nickel- metal- hydride


(NiMH) battery under constant load using Kalman filter on chip," in
International Conference onAdvances in Engineering, Science and
Management (ICAESM), 2012, pp. 641-646, 30-31 March 2012.
Dai Haifeng , Wei Xuezhe, Sun Zechang , State and Parameter
Estimation of a HEV Li-ion Battery Pack Using Adaptive Kalman Filter
with a New SOC-OCV ConceptInternational Conference onMeasuring
Technology and Mechatronics Automation, 2009. ICMTMA '09.
Chen, Xue-Guang; Xia, Fangzhen; Xiang, Jianfeng "Research on SOC
hybrid estimation algorithm of power battery based on EKF, Power and
Energy Engineering Conference (APPEEC), 2011 Asia-Pacific,
Cai, Cheng-Hui H. , Du, Dong; Liu, Zhi-Yu; Ge, Jingtian State-ofcharge (SOC) estimation of high power Ni-MH rechargeable battery with
artificial neural network, Proceedings of the 9th International Conference
on Neural Information Processing, 2002. ICONIP '02.

56

Anda mungkin juga menyukai