Microprocessor-based state of charge gauge for secondary batteries

A state of charge gauge for measuring the state of charge of secondary batteries, such as the type employed in electric vehicles, includes a microprocessor which, when supplied with data varying in accordance with battery discharge current and battery terminal voltage, determines battery resistance. Having determined battery resistance which is a dynamically varying parameter dependent on battery temperature and age, the microprocessor computes the total battery charge capacity. Comparison of the quantity of battery charge already depleted with the previously computed total battery charge capacity yields an accurate indication of remaining battery charge.

BACKGROUND OF THE INVENTION 
This invention relates to apparatus for measuring the state of charge of 
lead acid batteries, such as may be employed in an electric vehicle, and 
for providing output data indicative of battery charge. 
Decreasing supplies of, and increasing prices for, refined petroleum 
products such as diesel fuel and gasoline have prompted increased interest 
in development of an electric vehicle suitable for short distance (i.e. 
less than 125 miles) travel. Because a sizable number of conventional 
internal combustion engine automobiles and trucks are only used to 
traverse such short distances, use of electric vehicles in their place 
could help lessen domestic dependence on expensive imported oil, as the 
energy required for electric vehicle battery charging could be supplied by 
hydroelectric or nuclear power stations. 
The maximum range of the electric vehicle is dependent on the total charge 
capacity of vehicle batteries and battery charge depletion per mile in 
exactly the same manner that the range of a conventional internal 
combustion engine vehicle is dependent on fuel tank capacity and fuel 
consumption per mile. However, unlike conventional petroleum-fueled 
vehicles whose fuel tanks can quickly be refilled in a matter of minutes, 
recharging of electric vehicle batteries usually requires several hours. 
Therefore, an accurate indication of battery charge capacity is required 
to apprise electric vehicle user personnel of remaining battery charge so 
that the electric vehicle is not driven a distance beyond that which would 
permit safe return to a home base, or such other location where battery 
charging can readily be accomplished. To simplify electric vehicle 
operation, it would be desirable to display remaining battery charge in an 
analog fashion much the same way that the quantity of remaining fuel is 
displayed by conventional internal combustion engine vehicle fuel gauge. 
Traditional means for determining the state of charge of secondary (i.e. 
rechargeable) batteries, such as the type used in electric vehicles, have 
included current integrating devices such as the electrochemical 
coulometer. The electrochemical coulometer determines the total charge, 
that is 
##EQU1## 
passing through a shunt circuit, by depositing an amount of indicating 
material, such as silver, at one side of an electrolysis cell proportional 
to the amount of charge passed during a given interval. Resetting of the 
electrochemical coulometer occurs during battery charging as battery 
charge current carries indicator material to the opposite side of the 
cell. 
Electrochemical coulometers suffer from the disadvantage that the 
indication of battery charge capacity they provide does not vary in 
accordance with battery age or temperature. A "full charge" indication by 
the electrochemical coulometer may be particularly inaccurate at low 
battery temperatures, as battery charge capacity decreases substantially 
as battery temperature decreases. Battery charge capacity also decreases 
as battery age increases. 
To remedy the disadvantage of such traditional means for determining 
secondary battery charge capacity, the present invention provides an 
indication of battery charge capacity in accordance with battery 
resistance, a dynamically varying parameter which is dependent on battery 
temperature and age. 
BRIEF SUMMARY OF THE INVENTION 
Briefly, in accordance with the preferred embodiment of the invention, a 
state of charge gauge for measuring the state of charge of secondary 
batteries, such as the lead acid type, and for providing a visual 
indication of remaining battery charge comprises a data circuit coupled to 
a secondary battery under load for providing a first and a second output 
signal proportional to the magnitude of battery discharge current and 
battery terminal voltage, respectively. A processor unit, coupled to the 
data circuit, computes battery dynamic resistance and generates a signal 
indicative of total battery charge capacity. Comparison of total battery 
charge capacity with the quantity of battery charge already depleted 
yields an output signal, which is proportional to remaining battery 
charge. A visual indication of remaining battery charge is provided by a 
display apparatus, typically comprised of an analog meter, in accordance 
with the processor unit output signal. 
It is an object of the present invention to provide apparatus for measuring 
the charge capacity of secondary batteries and for providing a visual 
indication of battery remaining charge. 
It is another object of the present invention to provide apparatus for 
measuring the charge capacity of secondary batteries and for providing a 
visual indication of remaining battery charge which is compensated for 
battery temperature and battery age.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT 
FIG. 1 illustrates an electric vehicle drive system 10 comprising a battery 
12, configured of one or more lead acid cells. Battery 12 is coupled to a 
power converter 14 which supplies electrical energy to a traction motor 16 
connected thereto. The nature of traction motor 16 determines the 
structure of power converter 14. Thus, if traction motor 16 comprises a 
synchronous or induction alternating current motor, power converter 14 
would then be comprised of an inverter. 
A state of charge indicator 20, according to the present invention, for 
on-board electric vehicle use is coupled to the positive and negative 
terminals of battery 12 via conductors 22a and 22b, respectively, and is 
coupled to a current sensor 24, coupled in series with battery 12 and 
power converter 14, via conductor 26. Charge indicator 20 provides a 
visual indication of the remaining charge of battery 12 in accordance with 
battery terminal voltage and discharge current and includes a processing 
unit 28, which, when supplied with data from a data circuit 30 
proportional to the magnitude of battery discharge current and battery 
terminal voltage, computes remaining battery charge and provides an output 
signal indicative thereof to display apparatus 32. 
Determination of remaining battery charge by processing unit 28 is achieved 
by reliance on the relationship between battery terminal voltage and 
discharge current determined empirically by C. M. Shepherd in his paper 
"Design of Primary and Secondary Cells" published in the Journal of the 
Electrochemical Society in July 1965 in Volume 112 at pages 657-664. 
Shepherd states that constant current discharge data for secondary 
batteries, such as the lead acid type, can be given fairly accurately by 
equation (1): 
EQU E=E.sub.s -Ni-(Q/(Q-it)Ki (1) 
where 
E=battery terminal voltage 
E.sub.s =a fitted constant representative of a reference voltage which is 
substantially close in magnitude to the open circuit battery terminal 
voltage 
Q=a fitted constant representative of a reference battery charge capacity 
which is indicative of battery charge capacity at low discharge rates 
N=a fitted constant representative of internal battery resistance 
K=a fitted constant representative of the coefficient of battery 
polarization 
i=battery discharge current 
t=time 
Equation (1) can be rearranged to describe a dynamic resistance r as seen 
by equation (2) 
EQU r=(E.sub.s -E)/i=N+QK/(Q-it) (2) 
which resistance, for a battery in a given condition, that is, at a given 
temperature and age, varies only as a degree of battery discharge. 
Examination of equation (2) yields the conclusion that resistance r is 
independent of the rate of battery discharge and thus, is indicative of 
total battery charge capacity. 
Equation (2) can itself be rearranged to yield 
EQU r=K+N+(it/Q)(r-N) (3) 
In practice, r quickly becomes very much larger than N shortly after 
commencement of battery discharge. With r&gt;&gt;N shortly after commencement of 
battery discharge, 
##EQU2## 
yields a value for Q, the total battery charge capacity. Thus, measurement 
of battery discharge current and battery terminal voltage, and integration 
of battery discharge current with respect to time, allow calculation of 
total battery charge capacity for a given battery temperature and age. By 
subtracting 
##EQU3## 
the amount of charge depleted from the total battery capacity Q during the 
interval commencing from the inception of battery discharge until the 
present, a value Q.sub.r representative of remaining battery charge can be 
obtained. 
At the inception of battery discharge, when the disparity between r and N 
is not as great as during the latter stages of battery discharge, some 
correction for Q may be required. Such correction for Q may be obtained 
from successive values of r and q, where 
##EQU4## 
Substituting the value of 
##EQU5## 
set forth in equation (4) into equation (3) yields 
EQU r=K+N+(q/Q)(r-N) (5) 
Upon examination of equation (5), it is evident that when r&gt;&gt;N, as is the 
case for latter stages of battery discharge, a plot of r vs rq will be 
linear with a slope of 1/Q. Knowledge of this fact allows accurate 
correction of Q from 3 separate values of r and q, such as r.sub.1, 
r.sub.2 and r.sub.3, respectively, and q.sub.1, q.sub.2 and q.sub.3, 
respectively, as follows: 
EQU Q.sub.12 =(r.sub.2 q.sub.2 -r.sub.1 q.sub.1)/(r.sub.2 -r.sub.1) (6) 
EQU Q.sub.23 =(r.sub.3 q.sub.3 -r.sub.2 q.sub.2)/(r.sub.3 -r.sub.2) (7) 
However, the actual total battery charge capacity Q is obtained from a plot 
of r vs (r-N)q so that 
##EQU6## 
and thus 
EQU Q=Q.sub.12 -N(q.sub.2 -q.sub.1)/(r.sub.2 -r.sub.1)=Q.sub.23 -N(q.sub.2 
-q.sub.2)/r.sub.3 -r.sub.2) (9) 
Solving equation (9) for N and substituting the resulting value back into 
equation (8) yields two expressions for Q one of which is as follows: 
##EQU7## 
If q.sub.3 -q.sub.2 =q.sub.2 -q.sub.1 then 
EQU Q=Q.sub.23 -.DELTA.Q(r.sub.2 -r.sub.1)/(2r.sub.2 -r.sub.1 -r.sub.3) (11) 
or 
EQU Q=Q.sub.12 -.DELTA.Q(r.sub.3 -r.sub.2)/(2r.sub.2 -r.sub.1 -r.sub.3) (12) 
where 
EQU .DELTA.Q=Q.sub.23 -Q.sub.12 (13) 
To compute the remaining battery charge, Q.sub.r, that is the difference 
between Q and 
##EQU8## 
in accordance with equations (1) through (13) above, processing unit 28 
comprises a central processor 34 which is typically configured of a 
microprocessor such as the Model 8080A microprocessor manufactured by 
Intel Corporation. Coupled to central processor 34 is a clock 35 
configured to generate an interrupt every 1/60th of a second. A 
bidirectional data bus 36 couples central processor 34 to a 2K read only 
memory (ROM) 38 and to a 1K random access memory (RAM) 40. Read only 
memory 38 contains two programs, a monitor program, described more fully 
below, which schedules the acquisition of battery discharge data and 
execution of a testing program which computes remaining battery charge 
from battery discharge data, and a floating point arithmetic program 
executed in conjunction with the testing program. Random access memory 40 
stores the testing program prior to execution by central processor 34. 
Data bus 36 also connects central processor 34 to data circuit 30, which, 
in the presently illustrated embodiment, comprises a two channel analog to 
digital converter 42, coupled at the first input via conductors 22a and 
22b, to battery 12 and coupled at the second input to current sensor 24, 
via conductor 26. A multiplexer 44 time-multiplexes the digital battery 
discharge data provided by analog to digital converter 42 prior to 
transmission to central processor 34. 
Display apparatus 32 is also coupled to central processor 34 via data bus 
36 and, in the presently illustrated embodiment, display apparatus 34 
comprises a digital to analog converter 48 for converting digital output 
data generated by central processor 34 into an analog voltage which is 
supplied to a meter 50 configured to display remaining battery charge in 
accordance with the magnitude of output voltage supplied by digital to 
analog converter 48. Although not shown, display apparatus 32 could also 
be configured of a data communications terminal or a digital display, 
comprised of either light emitting diodes or liquid crystal display cells 
coupled to suitable amplifier circuitry to drive such devices in 
accordance with output data supplied by central processor 34. 
FIG. 2 is a simplified flow chart diagram of the monitor program contained 
within read only memory 38 which is executed during battery charge 
indicator 20 operation. The monitor program consists of a real time 
scheduler and an idle time scheduler. During execution of the real time 
scheduler portion of the monitor program, scheduling of data acquisition 
and scheduling of the battery testing program and the floating point 
arithmetic program execution is initiated, while during execution of the 
idle time scheduler portion of the monitor program, performance of 
scheduled tasks occurs. 
At the inception of monitor program execution, program variables are each 
initialized at zero and clock 35 is rendered operative to generate an 
interrupt signal every 1/60 of a second. When the clock interrupt signal 
magnitude t.sub.c is unequal to zero, as is the case each time an 
interrupt occurs, battery discharge data is obtained from battery 12 via 
data circuit 30, both shown in FIG. 1, and is stored in RAM 40 memory. 
Execution of both the battery testing program and the floating point 
arithmetic program to compute battery resistance and remaining battery 
charge is then scheduled. Once remaining battery charge is computed, 
display of remaining battery charge is then scheduled. When display of 
remaining battery charge is completed, re-execution of the monitor program 
is commenced. 
During the "idle time," that is the time between the completion of 
execution of the real time scheduler portion of the monitor program and 
the occurrence of a succeeding clock interrupt signal, execution of the 
battery testing program and the floating point arithmetic program is 
commenced and display of the value of remaining battery charge previously 
computed during battery testing program and floating point arithmetic 
program execution, is accomplished. Each time computation of remaining 
battery charge, or display of the computed value of remaining battery 
charge is scheduled, the task is stored in memory. During the execution of 
idle time scheduler portion of the monitor program, these tasks are 
performed and execution of the real time scheduler portion of the monitor 
program is resumed following the occurrence of a clock interrupt signal. 
The charge indicator apparatus of the present invention can also be 
configured with a discharge apparatus to provide a stand alone battery 
tester, as shown in FIG. 3 for discharging secondary batteries and for 
profiling battery charge during battery discharge intervals. The battery 
tester of FIG. 3 comprises a state of charge indicator 20, including a 
data circuit 30, configured identically to data circuit 30 of FIG. 1. Data 
circuit 30 is coupled to a lead acid battery 112 via conductors 22a and 
22b, and is coupled via conductor 26 to a current sensor 114 which is 
coupled in series with battery 112 and the serial combination of a load, 
shown as resistance 115a, and relay the contacts 117aa of a relay 117a. 
Coupled in parallel with resistance 115a and the contacts 117aa of relay 
117a is the serial combination of resistance 115b and the contacts 117bb 
of relay 117b, the serial combination of resistance 115c and the contacts 
117cc of relay 117c, and the serial combination of resistance 115d and the 
contacts 117dd of relay 117d. Typically, resistances 115a-115d are each 
equal in ohmic value, with the ohmic value of each being selected such 
that when each of relays 117a-117d is activated or energized, 30 amperes 
of battery current passes through each of resistances 115a-115d, 
respectively. 
Each of relays 117a-117d is coupled to a relay controller 120, which is 
typically comprised of a solid state stepper relay or the like. Relay 
controller 120 is coupled to processing unit 28 of charge indicator 20, 
which processing unit configured identically to processing unit 28 of FIG. 
1. Processing unit 28 is also coupled to data circuit 30. During 
operation, processing unit 28 supplies relay controller 120 with a 
discharge command signal and, in accordance therewith, relay controller 
120 activates one or more of relays 117a-117d to commence battery 
discharge. In accordance with battery discharge data supplied thereto by 
data circuit 30, processing unit 28 computes remaining battery charge 
which is visually displayed on a display apparatus 32 coupled to the 
processing unit. Typically, display apparatus 32 comprises a data 
communications terminal, such as the General Electric Terminet.RTM. data 
communications terminal. 
Operation of the battery tester of FIG. 3 may best be understood by 
reference to the battery tester timing diagram of FIG. 4. As illustrated, 
the processing unit commences execution of the real time scheduler portion 
of monitor program to command activation of one or more relays once every 
second thereby initiating battery discharge. A predetermined time interval 
after relay activation, battery discharge data is scheduled to be sampled 
N times, where N is greater than 2 e.g. 7 as illustrated. By waiting to 
sample battery discharge data until after a predetermined time interval 
has elapsed following relay activation, the occurrence of spikes or 
notches in the sampled battery discharge current and terminal voltage will 
be greatly reduced. Accuracy of the sampled battery discharge data is 
increased by frequent repeated samplings, as such frequent repeated 
samplings effect digital filtering of battery discharge data, thereby 
reducing any error that may be attributable to extraneous noise. After 
sampling of the battery discharge current and battery terminal voltage, 
execution of the battery testing program and the floating point arithmetic 
program is commenced to compute remaining battery charge capacity, which 
is thereafter visually displayed. The periods of idle time occur during 
data sampling when the central processor does no work. 
The foregoing describes a microprocessor based state of charge indicator 
for providing a visual indication of remaining battery charge in 
accordance with battery discharge current and battery terminal voltage and 
which adjusts for battery temperature and age. 
While the invention has been particularly shown and described with 
reference to several preferred embodiments thereof, it will be understood 
by those skilled in the art that various changes in form and detail may be 
made therein without departing from the true spirit and scope of the 
invention as defined by the appended claims.