Supervisors:
prof.dr.ir. P.P.L. Regtien
ir. M. Pop
A.P. de Vries
July 2006
Report nr. 018CE2006
Control Engineering
EE-Math-CS
University of Twente
P.O.Box 217
7500 AE Enschede
The Netherlands
Control Engineering
ii
Abstract
Every user of battery-powered devices would like to know exactly how many minutes of
usable talk-time is left in his cellular phone battery, video cam-recorder, laptop computer or any other
device used. Portable devices continually rely on an accurate reading of the remaining battery
capacity, so the system won't lose data or, worse, suddenly shut down during operation.
Until now, the solutions that have been offered range from the simple bar light, indicating
when the power supply reaches a certain level of discharge, to the sophisticated power management
software present on laptop computers.
The developed design in this report aims to give a more accurate SoC and remaining run-time
estimation under a variety of loads, temperatures and aging effects. This new system focuses on SoC
indication for mobile phone applications.
The parameters of the battery used for the SoC estimation are the voltage, the current and the
temperature. There are written drivers for several ADCs, used for the on-line measurements of the
three parameters, which need to be completed.
The first and main step was to update one of the ADC drivers for measuring the current
through the battery. In the beginning, these measurements were performed with a not so accurate
Analog-to-Digital converter.
A second step was to update one of the ADC drivers for measuring the temperature of the
battery. At the beginning there was no temperature sensor and function to calculate the temperature
present. So these two parts needed to be implemented.
The last step was to design a Graphical User Interface (GUI) to communicate with the system.
The GUI needs to receive the measurements and show these in a graphical way on the screen. It is also
needed to control the system, for example to start or stop the measurement.
University of Twente
iii
Contents
1
4
5
Introduction ........................................................................................................................1
1.1
State-of-Charge Importance.......................................................................................1
1.2
Hardware Support......................................................................................................1
1.2.1 The Evaluation Board (STEED) .............................................................................2
1.2.2 The General Evaluation Controller Board (4ARM) ...............................................2
1.3
Software Support .......................................................................................................3
1.3.1 The Real-Time Operating System (FreeRTOS)......................................................3
1.3.2 The Integrated Development Environment (CrossWorks) .....................................4
1.3.3 The Development Environment Borland Delphi ....................................................4
Theoretical Fundamentals ..................................................................................................5
2.1
SoC Theory................................................................................................................5
2.1.1 SoC Indication Methods .........................................................................................5
2.1.2 SoC Indication used method ...................................................................................6
2.1.3 SoC Indication during Initialization........................................................................8
2.2
Serial Peripheral Interface .........................................................................................9
2.2.1 Inside the box........................................................................................................10
2.2.2 At a higher level....................................................................................................11
2.3
Analog Devices Measurement IC (ADE7759) ........................................................12
2.3.1 Introduction...........................................................................................................12
2.3.2 The Analog-to-Digital Conversion .......................................................................13
2.3.3 The Analog Inputs Circuit ....................................................................................13
2.3.4 The Interrupt Controller........................................................................................14
2.3.5 The Serial Peripheral Interface (SPI) ....................................................................15
Current Measurement .......................................................................................................17
3.1
Hardware of the Current Measurement ...................................................................17
3.1.1 Connections of the Measurement Circuits ............................................................17
3.1.2 Hardware Main Issues ..........................................................................................18
3.1.3 Hardware Results ..................................................................................................19
3.2
Software of the Current Measurement.....................................................................20
3.2.1 Software Implementation of the real-time evaluation system...............................20
3.2.2 Main Issues of the Software..................................................................................22
3.2.3 SPI Driver .............................................................................................................23
3.2.4 ADE7759 Driver...................................................................................................26
3.2.5 Software Results ...................................................................................................29
Temperature measurement ...............................................................................................31
4.1
Temperature sensor..................................................................................................31
4.2
Temperature calculation ..........................................................................................32
The Graphical User Interface ...........................................................................................33
5.1
User Manual.............................................................................................................33
5.1.1 Getting started.......................................................................................................33
5.1.2 Settings Tab ..........................................................................................................34
5.1.3 Measurements Tab ................................................................................................35
5.1.4 SoC Tab ................................................................................................................35
5.2
The Log-File ............................................................................................................36
5.3
Software implementation of the GUI.......................................................................37
5.3.1 Comport ................................................................................................................37
5.3.2 Data.......................................................................................................................37
5.3.3 Interface ................................................................................................................37
5.3.4 Control ..................................................................................................................37
5.3.5 Timer.....................................................................................................................38
5.3.6 Log ........................................................................................................................38
Results ..............................................................................................................................39
Control Engineering
iv
6.1
Problems ................................................................................................................. 39
6.2
Measurements Results............................................................................................. 40
6.2.1 Current Measurements Results ............................................................................ 40
6.2.2 Temperature Measurement Results...................................................................... 41
6.2.3 Graphical User Interface Results.......................................................................... 41
7
Conclusions and Recommendations ................................................................................ 42
7.1
Conclusions............................................................................................................. 42
7.2
Recommendations................................................................................................... 42
Appendix I Communication Protocol.................................................................................... 43
References ................................................................................................................................ 49
University of Twente
List of Figures
Figure 1.1: The evaluation board (STEED)---------------------------------------------------------------------- 2
Figure 1.2: The controller board (4ARM)------------------------------------------------------------------------ 3
Figure 2.1: Measurement principle of a SoC indication system based on direct measurement----------- 5
Figure 2.2: Measurement principle of a SoC indication system based on book-keeping------------------ 6
Figure 2.3: The possible states of a battery ---------------------------------------------------------------------- 7
Figure 2.4: Diagram of the SoC algorithm states --------------------------------------------------------------- 7
Figure 2.5: SPI implementation of single master and single slave ------------------------------------------10
Figure 2.6: SPI implementation of single master and multiple slaves --------------------------------------10
Figure 2.7: Functional block diagram of ADE7759 [10] -----------------------------------------------------12
Figure 2.8: First order sigma-delta ADC [10] ------------------------------------------------------------------13
Figure 2.9: Analog gain register [10] ----------------------------------------------------------------------------13
Figure 2.10: Interrupt management [10] ------------------------------------------------------------------------14
Figure 2.11: Addressing ADE7759 registers via the communications register [10] ----------------------15
Figure 2.12: Reading data from the ADE7759 via the serial interface [21] --------------------------------15
Figure 2.13: Writing data to the ADE7759 via the serial interface [21] ------------------------------------15
Figure 3.1: Schematic of the measurement circuits connections---------------------------------------------17
Figure 3.2: Chip select ADE7759 --------------------------------------------------------------------------------18
Figure 3.3: TI/AD ADC block schematic -----------------------------------------------------------------------19
Figure 3.4: Crystal oscillator--------------------------------------------------------------------------------------19
Figure 3.5: General diagram of the software implementation of the evaluation system------------------20
Figure 3.6: Reserving and freeing the SPI bus -----------------------------------------------------------------23
Figure 3.7: SPI flowchart------------------------------------------------------------------------------------------25
Figure 3.8: ADE7759 driver --------------------------------------------------------------------------------------26
Figure 3.9: ADE7759 task-----------------------------------------------------------------------------------------28
Figure 4.1: NTC circuit --------------------------------------------------------------------------------------------31
Figure 5.1: GUI startup screen------------------------------------------------------------------------------------33
Figure 5.2: Comport settings--------------------------------------------------------------------------------------34
Figure 5.3: Measurements tab ------------------------------------------------------------------------------------35
Figure 5.4: SoC tab-------------------------------------------------------------------------------------------------35
Figure 5.5: GUI log-file -------------------------------------------------------------------------------------------36
Figure 5.6: General diagram of the software implementation of the GUI ----------------------------------37
Control Engineering
vi
List of Tables
Table 1.1: Report structure----------------------------------------------------------------------------------------- 4
Table 2.1: Maximum Input Signals Levels for Channel 1 [10] ----------------------------------------------14
Table 4.1: NTC resistance ----------------------------------------------------------------------------------------31
Table 6.1: Leakage current measurements----------------------------------------------------------------------39
Table 6.2: Voltage measurements with an offset --------------------------------------------------------------39
Table 6.3: Current measurements of the battery during the equilibrium state -----------------------------40
Table 6.4: Current measurements of the battery during discharging with -100 mA ----------------------40
Table 6.5: Current measurements of the battery during charging with 100mA ---------------------------41
Table 7.1: UART Abbreviation list ------------------------------------------------------------------------------44
Table 7.2: PC Protocol Send list ---------------------------------------------------------------------------------47
Table 7.3: PC Protocol Receive list------------------------------------------------------------------------------48
University of Twente
1 Introduction
The main goal of this project is to develop the software drivers for a real-time State-of-Charge
(SoC) evaluation system. The real-time SoC evaluation system uses as input the voltage, temperature
and current measurements to calculate the SoC and the remaining run-time of a portable application
powered by a Li-ion battery.
The voltage, temperature and current measurements are performed by different Analog-toDigital Converters (ADCs) of the real-time SoC evaluation system. In order to understand the realtime SoC evaluation system functionality, basis of the SoC calculation will be further given in this
chapter.
1.1
State-of-Charge Importance
Due to the fact that people want to have a more mobile life, there is an increasing demand for
mobile devices. When main power supply isnt available for power delivery of these devices they have
to rely on a portable power supply such as a battery. From that point of view it becomes important that
users can trust the indicated remaining run-time and the SoC, which is defined as the percentage of
charge that is present inside the battery. Otherwise, users will charge the battery more often resulting
in a faster wear out of the batteries [1].
Almost as long as rechargeable batteries exist there are systems that are able to give some
indication about the amount of charge that is available in a battery. These systems were mostly simple
volt-gauges and they gave only a little clue about the charge that is present in the battery. Especially at
low SoC, the indicated SoC was very inaccurate.
Nowadays there are better SoC indication systems that measure more properties of the battery,
than only the voltage, such as current, impedance and relaxation time that are dependent on the
temperature. This results in more accurate systems. Other systems measure and integrate the current
and compensate for self-discharge and discharge efficiency of the battery [2].
The present SoC evaluation system contains SoC algorithm that combines the book-keeping
with the Electro-Motive Force [1]. In order to deal with the aging affect, adaptive systems are also
implemented on the SoC algorithm.
1.2
Hardware Support
Two boards are used for the SoC evaluation system: an evaluation board, i.e. STEED, and a
general evaluation controller board, i.e. 4ARM. These boards are connected to each other by a
connectivity block.
The evaluation board contains different circuits which some of them have the same purpose.
These circuits need to be analyzed and compared, in order to decide which one is the best to use for
future demonstration boards or for a direct implementation in a mobile phone.
The controller board is used to control the evaluation board and to make the communication
possible between the circuits and a computer. The controller board is also used for powering the
circuits on the evaluation board.
Control Engineering
1.2.1
The evaluation board [3] has multiple measurements circuits to measure the voltage, the
current and the temperature of a battery. The evaluation board has also a circuit to charge and
discharge a battery. The evaluation board is shown in Figure 1.1
The Advanced RISC Machine (4ARM) [4] controls the hardware of the evaluation board, via
two connectors on the backside of the board. These connectors are connected with the connectivity
block of the evaluation board.
The controller board is controlled by a microcontroller, the LPC2292 [5]. This is a
microcontroller suited for control applications. It has two UART interfaces, two SPI busses and one
I2C bus. These busses give the controller board the ability to communicate with a computer and to
communicate between the component blocks of the evaluation board. The controller board has also a
power supply used for the board self and for some circuits on the evaluation board. A debugging
device is also present i.e. JTAG (Joint Test Action Group), Macraigor Wiggler.
University of Twente
Introduction
1.3
Software Support
Several software and development tools are used for writing the software for the SoC
evaluation system and for the PC. An introduction of these will be given in the next sections.
1.3.1
For implementing the software of the SoC evaluation system, real-time programming is
needed, because of the time constraints and of the complex design of the hardware. Almost all the
circuits on the boards need to be executing at the same time, leading to the need of a multitasking
implementation mechanism. The simplest way would be to use a real-time operating system and after
analyzing more options the Operating System FreeRTOS [6] was chosen. FreeRTOS is a portable
open source real-time operating system for embedded devices. Besides the fact that FreeRTOS is
royalty free, it also provides the following features:
Two types of scheduling policies: pre-emptive (always runs the highest available task)
and cooperative (context switches only occur if a task blocks).
Free development tools for ARM7 port.
Free embedded software source code.
Cross development from a standard Windows host.
Message queues.
Semaphores.
Trace visualization ability.
Another argument for using FreeRTOS is that nearly all the code is written in C, which makes
the code readable, maintainable and easy to port. FreeRTOS allows tasks (pieces of code that do
specific duties) to run quasi-concurrently. This means that tasks will seem to run all at the same time,
doing many specific jobs simultaneously. The responsible for deciding which task should be executing
at any particular time is the scheduler. The kernel can suspend and later resume a task many times
during the tasks lifetime.
Control Engineering
FreeRTOS allows a task of higher priority that is able to run (whether starting or resuming) to
preempt the lower priority running task. This will cause the scheduler to save the context of the
running (lower priority) task and restore the context of the higher priority task so that it is now
running. As a truly preemptive RTOS, FreeRTOS allows interrupts to cause an immediate task switch.
This means that the interrupts now have the added ability of using the RTOS functions. For More
information about the FreeRTOS features, see [6].
1.3.2
CrossWorks for ARM is a complete C development system for ARM 7 microprocessors, like
the LPC2292 [5]. It is comprised of the ARM C compiler, the CrossWorks C Library and the
CrossStudio integrated development environment.
CrossWorks is able to flash the software directly into the microprocessor by using JTAG, to
visualize input/output registers and to debug in flash. In the present application, CrossStudio is used
for debugging and building the project. More information about the CrossWorks features and about
how it is used can be found at [7].
1.3.3
For the design and implementation of the Graphical User Interface (GUI) the development
environment of Borland Delphi is used. The programming language Delphi, a next generation version
of the language Pascal, is used. In Borland Delphi a comport-component is used to communicate via
the comport of a PC with the controller board. For more information about Borland Delphi, see [8].
The source and install files for the comport-component can be found at [9].
The structure of this report is as follows:
Chapter Title
Theoretical Fundamentals
Current Measurement
Temperature Measurement
The Graphical User Interface
Results
Conclusions and
Recommendations
Chapter Description
The theoretical aspects regarding the SoC evaluation system
implementation are presented.
The hardware and software design, to make the current
measurement to work, will be described here.
An overall view of how the temperature of the battery is measured
and calculated will be given here.
An explanation about the usage, the Log-file and the
implementation of the code of the Graphical User Interface (GUI).
The results on the end of this project will be handled here.
This chapter will give some conclusions and recommendations
about the real-time evaluation system.
Table 1.1: Report structure
University of Twente
2 Theoretical Fundamentals
The theoretical aspects regarding the SoC evaluation system implementation are presented in
this chapter. The order and the content of the next sections have been chosen so that the reader could
make a good idea about the project.
The first section presents two possible methods for estimating the SoC of a battery and, in the
end, the method used for this project. Most of the information regarding the SoC estimation algorithm
is confidential, but still, a brief description of the algorithms states will be given.
The next two sections of this chapter concern the communication protocol between the
ADE7759 [10] (used for the current measurements) and the LPC2292 [5] (microcontroller) and
detailed information about the ADE7759 [10].
2.1
SoC Theory
At this moment there are different battery powered devices that use a certain SoC indication.
There are several classical methods, which can be used for estimating the SoC of a battery. Two of
them will be presented in this section.
The SoC estimation method used for designing this evaluation system is a new method,
described in [11], which basically combines the advantages of the two methods. A short description of
the new SoC indication method will be done in Section 2.1.3.
2.1.1
In literature there are two main known methods for SoC indication: one based on direct
measurements and another based on book-keeping [11]. The concept of the two methods is described
in the next paragraphs.
Direct Measurement Systems
There exist several measurable properties of a battery that can give an indication about the
SoC of that battery. Examples of such properties are the OCV (Open Circuit Voltage), the current (I),
the impedance (Z) and the voltage relaxation time () after application of a current step. Most
measurable properties are very dependent on the temperature (T) of the battery and, therefore, the
temperature should also be measured. With the measured data an according SoC value can be obtained
with the aid of look-up tables or other relations. These systems are referred to as direct measurement
systems ([11], [12]) since they can give a SoC indication immediately after the first taken
measurement sample. Thus, there is no historical information required.
One of the cheapest systems is based on OCV measurements, but these systems are very
inaccurate under normal conditions [13]. Therefore, a more intelligent system is required, which takes
in consideration the discharge current and the temperature also. Unfortunately, even then, there is still
not enough information available to obtain high accuracy. The basic principle of direct measurement
systems able to indicate the SoC is shown in Figure 2.1.
I
V,T,I,Z,
SoC= f (V,T,I,Z,)
Figure 2.1: Measurement principle of a SoC indication system based on direct measurement
Control Engineering
Book-keeping Systems
Coulomb Counting (CC) also referred to as Ampere hour counting, is based on current
measurement and integration. CC could give a good accuracy of the SoC, only if the battery equals a
linear capacitor. However not all the charge that flows into a battery can be retrieved under all
conditions and thus the battery is a non-linear capacitor [11].
Fortunately, some information is known about the non-linear behaviour of the battery, such as
the discharge efficiency that is smaller than 100% and the fact that the battery suffers from selfdischarge. If this knowledge is combined with information about the CC, the temperature and the
cycle life a system is obtained which is referred to as a book-keeping system [11].
Besides the fact that this knowledge might be inaccurate, also the CC suffers from propagated
inaccuracies, due to the integration. Therefore the book-keeping system is only able to maintain
accuracy if its calibrated at certain moments. Another disadvantage is the fact that the inaccuracy of
the whole algorithm is difficult to be specified.
The principle of book-keeping systems is depicted in Figure 2.2 [11], [14].
I
I dt = CC
SoC= f ( CCV,T,I)
V,T,I
2.1.2
A good estimation of the SoC of a battery, used for mobile applications, requires a method
able to give an accurate indication. The real-time evaluation system described in this thesis is based on
a new method that predicts the SoC of a battery, mainly described in [11].
This method aims at eliminating the main drawbacks of the SoC estimation methods, by
combining the advantages of the two methods described before. More information about SoC
indication method could be found in [11], [12]. By combining the two methods, the diagram in Figure
2.3 on page 7 is created.
Since a battery shows a different behaviour for the several states, different methods are
required in order to estimate the SoC in each state. In short, the algorithm uses current measurements
and integration during charge and discharge and voltage measurement during transition and
equilibrium states. Therefore the total system is controlled by a state-system that determines which
method should be used [1].
University of Twente
Theoretical Fundamentals
Control Engineering
2.1.3
The SoC indication system starts up when a battery is connected to it. The system will enter
the initial state of the algorithm and its assumed that the current flow is small and the voltage is
relaxed. Since there is yet no other information available, the system considers the battery in
equilibrium and estimates the SoC using the voltage measurement and a relation between the EMF
(Electro-Motive Force) and the SoC [1]. First, the resulting SoC information is shown to the user, until
a more accurate SoC is known. Thereafter, the system shifts to the transition state to determine if the
system is in equilibrium.
SoC Indication during Equilibrium
When the absolute current flow is smaller than Ilim, SoC calculation is based on the EMF of
the battery that can only be measured accurately if the battery is relaxed.
If the battery is fully relaxed, the EMF equals the OCV according to ( 2.1 ).
( 2.1 )
It has been also proven that the EMF gives a good indication about the SoC of a battery,
without a large dependence on other factors, such as aging [11]. This is an important advantage of the
EMF that can be used into the SoC indication system for adaptation of the parameters.
For calculating the SoC during equilibrium, a physical mathematical model, that
represents the relation between the EMF and the SoC, is used [11], [17]. Another option could be to
use a look-up table, but that requires too much memory, in case an accurate indication is needed. For
mobile applications, the size of the memory is limited. Also, the values stored in a table are only valid
for specific conditions (meaning that for each particular set of conditions a look-up table needs to be
defined).
The algorithm should go into equilibrium state if the battery voltage is fully relaxed. It is
important that the system can enter the equilibrium state, because in that case there is less calculation
required and thus the power consumption of the SoC indication system will decrease. Besides, if the
system is in equilibrium the indicated SoC values have more certainty and thus are more accurate [1].
SoC Indication during Transition
Since the relaxation of the voltage can take a long time and since the battery is not in
equilibrium state for that time, a method is required to estimate the SoC during that relaxation period.
With the available knowledge about the state of the battery, three general methods exist to obtain an
estimate of the SoC in the transition state. For more information about this methods, consult [1].
SoC Indication during Discharge
Estimation of the SoC during discharge is mainly based on current measurements, since it has
been found that observation of the battery voltage has many disadvantages [18].
The first SoC indication, before the start of discharge, equals the SoC estimation in the
previous state (e.g. charge, transition, equilibrium or initial state). Based on this initial SoC, which is
converted to the absolute Qn (nominal available charge), expressed in Coulombs, the next Qn
indication can be calculated with the aid of Coulomb Counting. Having this Qn, relative SoC can
easily be calculated as the fraction Qn of Qmax (maximum charge), multiplied by 100. The relative SoC,
expressed as a percentage, can directly be shown to the user.
University of Twente
Theoretical Fundamentals
Coulomb Counting delivers an updated Qn after each period of sampling time for discharging,
when the current through the battery is almost constant over time.
Qn, might be used to calculate the remaining talk-time and standby-time under the actual
conditions. Unfortunately, due to the overpotential, under normal conditions not the whole amount of
Qn is available for discharging. Therefore, a certain compensated amount of charge, Qc, that is
available to the user under actual conditions, must be calculated. Qc is a function of the current, time
of discharging, temperature and aging.
The accuracy of the standby-time and talk-time indication is dependent on the estimation of
the discharge efficiency. The discharge efficiency is lower than 100% due to the overpotential, which
represents the difference between the fully relaxed voltage and the actual OCV.
SoC Estimation during Charge
The SoC estimation during charge is always based on Coulomb Counting. Since the Coulomb
Counting during the charge state adds charge to the already available charge, only an estimation of the
initial available charge is required ( 2.2 ). This initial amount of charge is always copied from the SoC
estimation in the previous state.
Qn =
SoC prevstate
100
Qmax + QCC
( 2.2 )
Having this Qn, relative SoC can be calculated, as in the discharge state, as the fraction Qn of
Qmax, multiplied by 100 .( 2.3 ).
SoC[%] =
Qn
100
Qmax
( 2.3 )
Directly after disconnecting the charger, the algorithm comes into the transition state (if the
mobile isnt consuming too much power because of a phone call, case in which the algorithm will go
into discharge state). After a certain time, the SoC estimation as function of the EMF has less
uncertainty than the estimation based on the Coulomb Counting process. At that moment, the
algorithm switches the indication of the SoC to an estimation based on the EMF-SoC relation [1].
2.2
Serial Peripheral Interface (SPI) provides good support for communication with slow
peripheral devices that are accessed intermittently. EEPROMs and real-time clocks are examples of
such devices. But SPI is suited for applications that are naturally thought of as data streams (as
opposed to reading and writing addressed locations in a slave device). An example of a "stream"
application is data communication between microprocessors or Digital Signal Processors (DSPs).
Another example of stream application is data transfer from Analog-to-Digital Converters.
SPI can achieve high data rates. SPI-compatible interfaces often range into the tens of
megahertz. SPI gains efficiency in applications that take advantage of its duplex capability, such as the
communication between a "codec" (coder-decoder) and a digital signal processor, which consists of
simultaneously sending samples in and out.
SPI devices communicate using a master-slave relationship. In this case a single master can
control multiple slaves.
Control Engineering
10
2.2.1
SPI is a serial bus standard established by Motorola and supported in silicon products from
various manufacturers. SPI interfaces are available on popular communication processors such as the
MPC8260 and microcontrollers such as the LPC2292 [5]. It is a synchronous serial data link that
operates in full duplex (signals carrying data go in both directions simultaneously).
Devices communicate using a master/slave relationship, in which the master initiates the data
frame. When the master generates a clock and selects a slave device, data may be transferred in either
or both directions simultaneously. In fact, as far as SPI is concerned, data are always transferred in
both directions. It is up to the master and slave devices to know whether a received byte is meaningful
or not. So a device must discard the received byte in a "transmit only" frame or generate a dummy
byte for a "receive only" frame.
The master generates SS signals using general-purpose discrete input/output pins or other
logic. This consists of old-fashioned bit banging and can be pretty sensitive. Make sure the Chip Select
will not change during a data frame to prevent data corruption.
University of Twente
Theoretical Fundamentals
11
While SPI doesn't describe a specific way to implement multi-master systems, some SPI
devices support additional signals that make such implementations possible. However, it's complicated
and usually unnecessary, so it's not often done.
The parameters called Clock POLarity (CPOL) and Clock PHAse (CPHA) determine the
edges of the clock signal on which the data are driven and sampled. Each of the two parameters has
two possible states, which allows for four possible combinations, all of which are incompatible with
one another. So a master/slave pair must use the same parameter pair values to communicate. If
multiple slaves are used that are fixed in different configurations, the master will have to reconfigure
itself each time it needs to communicate with a different slave.
2.2.2
At a higher level
SPI does not have an acknowledgement mechanism to confirm receipt of data. In fact, without
a communication protocol, the SPI master has no knowledge of whether a slave even exists. SPI also
offers no flow control. If the hardware need flow control, there need to do done something outside of
SPI.
Slaves can be thought of as input/output devices of the master. SPI does not specify a
particular higher-level protocol for master-slave dialog. In some applications, a higher-level protocol
is not needed and only raw data are exchanged. A possible example is an interface to a simple codec.
In other applications, a higher-level protocol, such as a command-response protocol, may be
necessary. Note that the master must initiate the frames for both its command and the slave's response.
SPI's full duplex communication capability and data rates (ranging up to several megabits per
second) make it, in most cases, extremely simple and efficient for single master, single slave
applications. On the other hand, it can be troublesome to implement for more than one slave, due to its
lack of built-in addressing; and the complexity only grows as the number of slaves increases.
Control Engineering
12
2.3
The main scope of this project is to measure the current that flows into and out of the battery.
In the SoC evaluation system presented in this report the ADE7759 IC [10] is used for this
measurement. As a result the ADE7759 will be introduced in this section.
2.3.1
Introduction
The ADE7759 is an accurate active power and energy measurement integrated circuit, with a
serial interface and a pulse output. The ADE7759 incorporates two second-order sigma-delta ADCs, a
digital integrator, a reference circuitry, a temperature sensor and all the signal processing required to
perform active power and energy measurement.
The digital integrator eliminates the need for an external analog integrator and provides
excellent long-term stability and precise phase matching between the current and the voltage channels.
The integrator can be switched off if the ADE7759 is used with conventional current sensors [10].
The interrupt request output is an open drain, active low logic output. The interrupt status
register indicates the nature of the interrupt, and the interrupt enable register controls which event
produces an output on the IRQ pin.
The functional block of ADE7759 is shown in Figure 2.7.
University of Twente
Theoretical Fundamentals
2.3.2
13
The Analog-to-Digital Conversion in the ADE7759 is carried out using two second-order
sigma-delta converters. The block diagram in Figure 2.8 shows a first-order (for simplicity) sigmadelta converter [10].
ADE7759 has two fully differential voltage input channels. The maximum differential input
voltage for input pairs is 0.5 V. In addition, the maximum signal level on analog inputs is 0.5 V
with respect to AGND (Analog GrouND) [10].
Each analog input channel has a PGA (Programmable Gain Amplifier) with possible gain
selections of 1, 2, 4, 8, and 16. The gain selections are made by writing to the gain register, see Figure
2.9.
Bits 0 to 2 select the gain for the PGA in Channel 1 and the gain selection for the PGA in
Channel 2 is made via bits 5 to 7.
14
In addition to the PGA, Channel 1 also has a full-scale input range selection for the Analog-toDigital Converter. The converters analog input range selection is also made using the gain register.
As mentioned previously the maximum differential input voltage is 0.5 V. However, by using bits 3
and 4 in the gain register, the maximum analog input voltage can be set to 0.5 V, 0.25 V or 0.125 V.
This is achieved by adjusting the converters reference. Table 2.1 summarizes the maximum
differential input signal level on Channel 1 for the various ADC range and gain selections.
2.3.4
ADE7759 interrupts are managed through the Interrupt Status Register (STATUS [7:0]) and
the Interrupt Enable Register (IRQEN [7:0]). When an interrupt event occurs in the ADE7759, the
corresponding flag in the status register is set to logic 1. If the enable bit for these interrupts in the
interrupt enable register is logic 1, then the IRQ (Interrupt ReQuest) logic output goes active low.
The flag bits in the status register are set irrespective of the state of the enable bits [10].
If an interrupt on a new current measurement needs to be given, the WSMP bit of the IRQEN
register need to be set at 1.
To determine the source of the interrupt, the system master should perform a read from the
status register with reset (RSTATUS [7:0]). This is achieved by carrying out a read from address 05h.
The IRQ output will go logic high on completion of the interrupt status register read command. When
carrying out a read with reset, the ADE7759 is designed to ensure that no interrupt events are missed.
If an interrupt event occurs just as the status register is being read, the event will not be lost and the
IRQ logic output is guaranteed to go high for the duration of the interrupt status register data transfer
before going logic low again, to indicate the pending interrupt [10].
Figure 2.10 shows a timing diagram with a suggested implementation of ADE7759 interrupt
management using a Micro Controller Unit (MCU).
Theoretical Fundamentals
15
read from the status register with reset is carried out. This will cause the IRQ line to be reset logic high
(t2) [10].
The status register contents are used to determine the source of the interrupt(s), and thus the
appropriate action will be taken. If a subsequent interrupt event occurs during the ISR, that event will
be recorded by the MCU external interrupt flag, by being set again (t3). On returning from the ISR, the
global interrupt mask will be cleared (same instruction cycle) and the external interrupt flag will cause
the MCU to jump to its ISR once again. This will ensure that the MCU does not miss any external
interrupts [21].
2.3.5
All ADE7759 functionality is accessible via several on-chip registers, as seen in Figure 2.11
the contents of these registers can be updated or read using the on-chip serial interface. After poweron, toggling the RESET pin low or a falling edge on CS, ADE7759 is placed in communication mode.
In communication mode the ADE7759 expects a write to its communication register. The data written
to the communication register determines whether the next data transfer operation will be a read or a
write and also which register is accessed. Therefore, all data transfer operations with the ADE7759,
whether a read or a write, must begin with a write to the communications register [10].
Figure 2.11: Addressing ADE7759 registers via the communications register [10]
The communications register is an 8-bit wide register. The MSB determines whether the next
data transfer operation is a read or a write. The five LSBs contain the address of the register to be
accessed. Figure 2.12 and Figure 2.13 shows the data transfer sequences for a read and write
operation, respectively [10].
Figure 2.12: Reading data from the ADE7759 via the serial interface [21]
Figure 2.13: Writing data to the ADE7759 via the serial interface [21]
Control Engineering
16
University of Twente
17
3 Current Measurement
In this chapter the hardware and software design, to make the current measurement to work,
will be described. Most of the hardware and software where already implemented but some of them
doesnt seem to work correctly. Therefore the problems at the beginning of this project shall be given
and explained first. Next the new implemented hardware and software and the results will be given.
The parts that are relevant for the current measurement with the ADE7759 will be handled.
3.1
This section will give a description and explanation of the hardware. First a schematic of how
the measurements are done will be presented. Next a list of the Issues and their explanation will be
given. At the end of this section the results of the hardware needed for the current measurements are
presented.
3.1.1
18
The circuit works as follows: between pins 3 and 4 a battery should be connected and between
pins 1 and 2, a battery charger. The charger can be implemented as a current or a voltage source.
Instead of the battery, a resistor can be connected, especially for testing.
For voltage measurement, the Philips Semiconductors and the Texas Instruments circuits are
used. The two circuits measure the voltage in different ways: PCF50606 measures only the potential of
Batt +, while ADS1256 [19] measures the differential voltage between Batt + and Batt -. Even if
PCF50606 [13] doesnt measure the differential voltage, a software function can be implemented so
that the value of the voltage is displayed as the difference between the potential measured at
BATVOLT input and the one measured at ADCIN1 input.
For current measurement, the Philips Semiconductors and the Analog Devices circuits are
used. It is important to specify the fact that the two circuits dont measure actually the current, they
measure the voltage drop across a sense resistor (Rsense2, in this case).
The calculation of the current value is done by a software function (by dividing the measured
value of the voltage with the value of the sense resistor).
There are also some differences between the two measurements. While PCF50606 measures
only the value of the current, ADE7759 [10] measures the value of the current and can also detect the
sense of the current. This makes ADE7759 a more useful measurement circuit than PCF50606,
because it can sense if the battery is charging or discharging.
An important aspect for current measurement is the fact that a current flow is present in the
circuit, so the displayed value of the current represents a real current, not a potential one. It can be
easily noticed that a voltage will always be present at the inputs of the circuits, but that would not
mean a current is also flowing.
3.1.2
As shown in Section 2.3.5 on page 15 a chip select signal is needed to let the ADE7759
communicate with the SPI bus. The hardware for making the Chip Select signal is shown in Figure
3.2.
University of Twente
Current Measurement
19
As discussed in Section 2.3.2 on page 13, the ADE7759 [10] needs to be attached to an
external clock (sampling clock) to let the ADE7759 work. Because there was no clock, the ADE7759
didnt work. The clock could be delivered by the ADS1256 [19]. The ADS1256 and the ADE7759
circuit are connected as Figure 3.3 illustrates.
Hardware Results
By replacing the parts which were causing the problems, handled in Section 3.1.2, the
hardware is perfectly working now.
1. The ADE7759 can be selected for SPI communication.
2. The ADS1256 generates a digital clock and delivers it to the ADE7759. Writing to and
reading from the ADE7759 is possible now.
Control Engineering
20
3.2
In this section the design of the software to make the current measurement work is given. The
focus will be relying on the software parts relevant for the work of the current measurement. First a
general diagram is introduced and explained shortly. Next the main issues that were present will be
handled, followed by the description and explanation of some software parts. At the end of this section
the results of the software will be given.
3.2.1
Figure 3.5: General diagram of the software implementation of the evaluation system
As showed in Figure 3.5, the schematic diagram software application is divided in four parts:
PC Communication Driver, Application Layer, Device Drivers and Hardware Communication
Drivers.
These parts consist of one or more modules, which have their own task(s). The next section
will shortly explain the purpose of every module. Further on, the explanations of the important
modules for this report will be handled in more detail.
University of Twente
Current Measurement
21
General Control
This module is the hart of the software application. General Control receives the notifications
of all the important events in the system: PC User input, ADE7759 measurement ready, etc. If an
event is received General Control determines what action should be taken (e.g.: calculate SoC).
Uart
The Uart gives the ability to communicate with an external system, like a PC, via a RS232
connection.
PC Communication Receive
This module receives the commands given from the PC via the Uart. Based on the validity of
these commands the PC Communication Transmit module will reply (ACK) or not reply (NAK). If a
valid command (see Appendix I) was received it notifies general control of the input.
PC Communication Transmit
Any input given by general control or PC Communication Receive, will be transmitted via the
Uart to the PC. For example: if general control gets a notification of a measurement that is ready, it
notifies PC Communication Transmit so that the measurement can be send to the PC.
SoC
Based on the state of the battery (equilibrium, charging etc.), SoC will calculate the new Stateof-Charge and Talk Time.
Charge / Discharge Control
This controls the function to discharge or charge a battery.
Obelix
This module contains all the functions to setup and control the PCF50606 [13] on the 4ARM
and on the STEED board.
ADE7759 / ADS1256
This module controls the ADE7759 [10] and ADS1256 [19] measurement circuit via the SPI
module. It will read the current measurement of the ADE7759 circuit. Because the SoC algorithm also
needs an average and an integral of the current, this will be calculated each second. If a measurement
or calculation is ready, it will notify General Control about it.
Batman
Batman contains all the functions to setup the P89LPC932 [20] on the STEED board.
SPI
This is the driver for the SPI communication. The ADS1256 [19], ADE7759 [10] and the
P89LPC932 [20], controlling the Batman, communicate with the 4ARM board [4] via this bus.
Control Engineering
22
I2C
This driver will handle the I2C communication. Obelix and Spinoza (not implemented yet)
communicate with the 4ARM board via this bus.
3.2.2
As could be read in the errata sheet of the LPC2292 [21], this problem is a deviation of the
LPC2292. The following information is presented in this errata sheet:
Introduction: The VPBDIV register controls the rate of the VPB clock in relation to the
processor clock. EXTPOLAR and EXTMODE determine the operating parameters of the external
interrupts.
Problem: A write to either the external interrupt polarity register (EXTPOLAR) or the
external interrupt mode register (EXTMODE) will corrupt the VPBDIV register. A read of either
EXTPOLAR or EXTMODE will be corrupted BY the VPBDIV register. If VPBDIV is 1 or 2
prior to any write to EXTPOLAR or EXTMODE, the CPU will hang up on the write to EXTPOLAR
or EXTMODE.
Work-around: If VPBDIV is non-zero, write all zeroes to VPBDIV before reading or writing
EXTMODE or EXTPOLAR, then write the proper value back to VPBDIV. In most applications this is
a known and fixed value, but if there is a possibility of dynamic changes in VPBDIV, software will
need to read VPBDIV, write zero to VPBDIV, read or write EXTMODE and/or EXTPOLAR, and
then rewrite the value previously read from VPBDIV.
Code sample:
VPBDIV
EXTMODE
VPBDIV
VPBDIV
EXTPOLAR
VPBDIV
VPBDIV
= 0x0;
= 0x1;
= 0x1;
= 0x0;
= 0x0;
= 0x1;
= 0x0;
/*EXTMODE */
/* EXTPOLAR */
/* Setting VBPDIV */
University of Twente
Current Measurement
3.2.3
23
SPI Driver
Note modes
Because the SPI has only one register for reading and writing data as well as only one
interrupt source for both transmission complete and data received, it is needed to keep track of the SPI
status internally. Therefore three modes are defined for the SPI driver: Read, Write and Idle. More
information about these modes is provided in the text below.
Reserving the SPI bus
Because the SPI bus is used by multiple devices, some control need to be done, to prevent that
two tasks are using the SPI bus on the same time. The reserved and available modes are further
introduced in this report. These modes can be true or false. The available mode gives the used status of
the SPI bus. If available is true, there is no other task using it so the bus can used directly. If not, the
task wanted to use the bus needs to wait until the bus is available again.
The reserve mode is used to prevent releasing the bus while a task is still using the SPI bus. If
the reserved mode is false the bus can be freed (set available to true) without any corruptions. If the
bus wants to get freed, but a task has still reserved the bus, it needs to wait till it is not reserved
anymore. A graphical representation of this process is given in Figure 3.6.
Control Engineering
24
University of Twente
Current Measurement
25
Control Engineering
26
3.2.4
ADE7759 Driver
In Figure 3.8 the implementation of the ADE7759 driver is shown.
University of Twente
Current Measurement
27
Control Engineering
28
ADE7759 Task
The ADE7759 task will measure the flowing current, and will calculate every second the
average and the integral of the measured current. A detailed flowchart is shown in Figure 3.9.
University of Twente
Current Measurement
3.2.5
29
Software Results
By implementing the SPI and ADE7759 driver as handled in the two sections before, the
ADE7759 and SPI driver are working correctly now.
The driver can read from or write to the ADE7759. It will read the current flowing through the
battery and calculates every second the average and integral of this current. When the current, the
average or the integral has been measured or calculated, the ADE7759 task will notify General control
about it.
Control Engineering
31
4 Temperature measurement
This Chapter will give a view of how the temperature of the battery is measured and
calculated. Because the task to get a temperature measurement was already implemented correctly in
the software, this part will not be handled. There are two new things implemented to make the
temperature measurement work.
1. Implementation of a temperature sensor in the hardware.
2. Implementation of a function in the software to calculate the temperature.
4.1
Temperature sensor
To measure the temperature, a NTC resistor (thermistor) is used. This resister has a resistance
depending on the temperature. If the temperature is high, the NTC has a low resistance. If the
temperature is low, it has a high resistance. The following figure will show how a NTC resister could
be used.
Resistance ()
55050
42160
32560
25340
19870
15700
12490
10000
8059
6535
5330
4372
3606
Control Engineering
32
4.2
Temperature calculation
Two things need to be known to calculate the temperature:
The resistance of NTC.
A function to calculate the Temperature, given the resistance.
To calculate the NTC resistance, Vref and Vout need to be known. The voltage of Vref is
delivered by the PCF50606 [13] and has a fixed value. In this case Vref is 2.923V. Vout is connected
to the Analog-to-Digital Converter of the PCF50606, so could be measured. The formula for
calculating the resistance of the NTC, knowing these two values, is given below.
Rntc =
R1 * (Vout / Vref )
1 (Vout / Vref )
( 4.1 )
Rntc = R25C * e
1
1
B*
T + 273 298
( 4.2 )
R25C is the thermistor's nominal resistance at room temperature, B (beta) is the thermistor's
material constant in Kelvin, and T is the thermistor's actual temperature in Celsius.
If the resistance is known but the temperature needs to be calculated, this formula ( 4.2 ) is
used the other way around. Formula ( 4.3 ) follows:
T=
1
273
ln( Rntc / R25c )
1
+
B
298
( 4.3 )
The values of B and R25c of the NTC applied in this system are 3977 and 10 kOhm,
respectively (see [22]).
University of Twente
33
5.1
User Manual
5.1.1
Getting started
When the GUI (GUI.exe) is started the following mobile phone will appear on the PC screen.
Control Engineering
34
Before the measurements can be started, two steps are needed to be done.
1. Make sure the Comport settings are correct (see Figure 5.2 ).
Settings Tab
As already shown in Session 5.1.1 on page 33 the settings of the comport could be set here.
There are three more settings or options which could be set. These settings can set the measurements
on or off. By checking, the specific measurement will be set on. By unchecking, the measurement will
be set off. Note that first the current measurement has to be set on before the rest of the
measurement are set on.
University of Twente
5.1.3
35
Measurements Tab
This tab will show the values of the measurements.
SoC Tab
This tab will show the data of the State-of-Charge of the battery.
Control Engineering
36
5.2
The Log-File
As already noticed at the introduction of Chapter 5 on page 33, it is possible to store the
voltage, the current and the temperature measurements each second in a log-file. This logging could be
set on or off with the button on the upper left of the mobile (see Figure 5.1 on page 33). The
measurements will be stored in the log-file called Log.txt. The log-file could be found in the same
directory as the GUI. An example of a log-file is shown in Figure 5.5.
University of Twente
5.3
37
In this section a description is given of the software implementation of the GUI. The general
diagram of the software implementation is illustrated in the figure below.
Comport
This module will communicate with the 4ARM board [4] via the RS232 connection. A
comport component [9] for Borland Delphi [8] is used to implement this module.
5.3.2
Data
If data is received by the comport module, the data is send to the Data module. The data will
be examined and the module will check if a measurement is present in the data. If a measurement is
present, the measured value(s) of this measurement(s) will be extracted and passed to the module
Interface.
5.3.3
Interface
Interface controls the data that will be shown to the user on his PC screen. It puts all the
measurements, received from Data, on the right location of the GUI. Interface will also notice the user
if a measurement is running or not.
5.3.4
Control
This module will decide which action should be taken if the user pushes a button on the
screen. It communicates with Comport to send data to the STEED board and it communicates with
Log to make a Log-file or not.
Control Engineering
38
5.3.5
Timer
This module will keep track off the measurements if they are received or not by data. If a
measurement is not received within some period time, it will notify Interface about this. Interface then
will turn the measurement off (the specific label turns red, see Section 5.1.3 on page 35).
5.3.6
Log
This module will take care of all the logging that needs to be done. The last received value of
every measurement will be written in the log-file (Log.txt) each second.
University of Twente
39
6 Results
In this chapter the results on the end of this project will be presented. But before the
measurements are shown some problems needs to be discussed first.
6.1
Problems
1. Too high leakage current
In the hardware of the evaluation board there is measured a leakage current, greater then
expected. At a battery voltage of 3.69V and in the equilibrium state a current of -3mA is measured..
These measurements are shown in the table below.
Time [ms]
1254487
1255489
1256491
1257493
1258495
1259497
1260499
SoC [%]
13
13
14
14
14
13
13
Voltage [V]
3.69
3.693
3.693
3.69
3.69
3.693
3.693
Current [mA]
-3
-3
-4
-3
-4
-3
-3
Temperature [K]
297
297
297
297
297
297
297
SoC [%]
18
18
18
18
18
18
18
Voltage [V]
3.732
3.756
3.775
3.864
3.887
3.906
3.936
Current [mA]
18
34
40
73
83
100
110
Temperature [K]
297
297
297
297
297
297
297
Control Engineering
40
6.2
Measurements Results
Although the first problem handled in Section 6.1 on page 39 still occur, the current could be
measured correctly. It is not the current that is expected to be measured, but it is the current of the
battery caused by the charger and the evaluation system. The value of the current through the battery
differs from the expected value, but the measurements are still correct.
6.2.1
The main goal of this project was to measure the current through a battery, using the
ADE7759 [10]. The ADE7759 is working correctly now. It measures the current (in milliamps) by
measuring the voltage drop on a sense resister of 20 m and dividing it by the value of the sense
resistor. In the next 3 tables some measurements are shown. The first table will show the
measurements in the equilibrium state of the battery. The second table shows the discharge state and
the third table will show the charge state of the battery.
Time [ms]
140548
141550
142552
143554
144557
145558
146560
147562
148564
149566
SoC [%]
12
12
12
12
12
12
12
12
12
12
Voltage [V]
3.700
3.702
3.700
3.700
3.700
3.700
3.700
3.700
3.700
3.700
Current [mA]
-3
-3
-3
-3
-4
-3
-3
-3
-3
-4
Temperature [K]
297
297
297
297
297
297
297
297
297
297
Table 6.3: Current measurements of the battery during the equilibrium state
Table 6.4 displays the measurements of the battery during its discharging state. As mentioned
in Section 6.1 on page 39 a leakage current of -3 mA is present which is shown in Table 6.1. So the
measured current of the battery, with a discharge current of -100mA, will be -103 mA. These
measurements are shown in Table 6.4.
Time [ms]
173012
174014
175016
176018
177020
178022
179024
180026
181028
182030
SoC [%]
12
12
12
12
12
12
12
12
12
12
Voltage [V]
3.660
3.660
3.660
3.660
3.660
3.660
3.657
3.655
3.657
3.657
Current [mA]
-103
-104
-103
-103
-104
-104
-104
-104
-104
-104
Temperature [K]
297
297
297
297
297
297
297
297
297
297
Table 6.4: Current measurements of the battery during discharging with -100 mA
Table 6.5 on page 41 displays the measurements of the battery during charging with a current
of 100 mA. As mentioned in Section 6.1 on page 39 a leakage current of -3 mA is present. So the
measured current of the battery will be 97 mA.
University of Twente
Results
Time [ms]
281128
282130
283132
284134
285136
286138
287140
288142
289144
290146
41
SoC [%]
12
12
12
12
12
12
12
12
12
12
Voltage [V]
3.730
3.730
3.730
3.730
3.730
3.735
3.732
3.735
3.735
3.735
Current [mA]
97
97
97
97
97
97
97
97
97
97
Temperature [K]
297
297
297
297
297
297
297
297
297
297
Table 6.5: Current measurements of the battery during charging with 100mA
6.2.2
Another goal that was introduced later on during this project was to make the temperature
measurement, using the PCF50606 [13], to work. The temperature measurement is working now. A
NTC resistor is implemented in the hardware and a function for calculating the temperature is
implemented in the software. The temperature is calculated by measuring the resistance of the NTC
and getting the temperature that represents this resistance. The temperature measurement can be found
in the tables given in Section 6.2.1 on page 40. The measurements were taken at a temperature of 25
C which is the same as 297 K
6.2.3
To control the real-time SoC evaluation system, a GUI has been designed. The GUI gives the
opportunity to start the voltage, current and temperature measurements and display the measured
values in a graphical way on the PC screen. The GUI gives also the opportunity to store a log-file,
with all the measured values each second, so that a history of the measurements can be saved. The
results of the GUI could be found at Chapter 5 on page 33.
Control Engineering
42
7.1
Conclusions
All the parts that were handled in this report are working now. The ADE7759 driver can
communicate with the ADE7759 so it can receive current measurements. The only problem is that first
the current measurements need to be set on before some other measurements could be set on. This has
probably something to do with incomplete implementation of the software. The hardware and the
function to measure the temperature of the battery are also implemented correctly now. And the design
of the GUI is finished. The GUI can start and stop measurements and it can receive the measurements
given from the 4ARM board [4] to show this in a graphical way on a PC screen.
The final conclusion is that all the goals of this project have been met.
7.2
Recommendations
A recommendation for future work is to solve the problem why the current measurement
needs to be set on first before other measurements. Also another recommendation is to solve the
problem of the too high leakage current of the evaluation system.
University of Twente
43
Control Engineering
Description
0.1-kilo samples per second.
0.5-kilo samples per second.
10 samples per second.
14-kilo samples per second.
15-kilo samples per second.
15 samples per second.
1-kilo samples per second.
2.5 samples per second.
25 samples per second.
27.9-kilo samples per second.
2-kilo samples per second.
3.5-kilo samples per second.
3.75-kilo samples per second.
30-kilo samples per second.
30 samples per second.
50 samples per second.
5 samples per second.
60 samples per second.
7.5-kilo samples per second.
7-kilo samples per second.
Binary read Analog most recent measurement
Binary read Analog average measurement
Binary read TI most recent measurement
Binary read TI average measurement
Ack (short to save chars)
Analog to digital
Automatic backwards transmission (errors etc)
Analog devices IC (ADE7759)
Prints information in the GUI. The string is obtained
from the Text parameter.
Info: is added to indicate that it is just information.
Return on 1-4
Batman
Boost charging
Indicates that the system is in BOOST CC mode.
Indicates that the system is in BOOST CV mode.
Calibrate / calibration register
Constant current
Pulse charging
Charge
Clamp level
Com speed
Current
Constant voltage
DCDC
Discharge
External
44
I
LBX
LED
LOG
M
OBX
OFF
ON
OUTP
PING
R
RD
READY
REG-RTE
S
SET
SOC
SOCE
SOFTWARE BUILD
SPEED
SPX
STATUS
STOP
T
TARGET BOARD ID
TARGET BOARD SERIAL
TERM
Text
TI
Time
TIMEE
TT
ST
V
VE
Value
VER
VEND
VOLT
WR
University of Twente
Mode
CHG
Select
BAT
OBX
SPX
DCX
EXT
STOP
SET
DIS
BAT
Option 1
CV
CC
BOOST
CV
CC
CV
CC
CV
CC
CV
CC
PING
Control Engineering
Option 2
CCBOOST
Equal to
CURR
VEND
TERM
CVBOOST
CURR
TIMEE
SOCE
VE
CLAMP
TERM
CC
VOLT
TIMEE
SOCE
CLAMP
TERM
CV
CURR
TIMEE
SOCE
VE
CLAMP
TERM
PRECC
GSM
CC
STOP
RD
45
REG01
REG02
REG03
REG04
Option 3 / Description
LOD STOP
value in I
value in V
V
TIME
SOC
value in I
value in sec
value in SoC
value in V
value in V e.g. 4.2
TIME
SOC
value in V
value in sec
value in SoC
value in I
V
TIME
SOC
value in V
value in sec
value in SoC
value in V
value in V e.g. 4.2
TIME
SOC
VOLT
TIMEE
SOCE
CLAMP
value in I
Equal to
CHG STOP
46
OBX
ON
OFF
A2D
WR
A2D
LBX
WR
LED
A2D
LD
ANA
RD
A2D
WR
A2D
SPEED
LOG
TI
SOC
LOG
CALIB
ON
OFF
WR
ON
OFF
SPEED
RD
A2D
SET
V
I
RD
T
SOC
T
I
IA
V
T
I
V
T
RES (BIT)
value led number
RES
value led number
I
IA
I
27.9K
14K
7K
3.5K
value 0 up to +- 31
ON/OFF
ON/OFF
ON/OFF
8/10
value patron number
value 8 or 10
value patron number
ON/OFF
0.1K
0.5K
10S
15K
15S
1K
2.5S
25S
2K
3.75K
30K
30S
50S
5S
60S
7.5K
V
VA
I
IA
OBX
TI
TI
ANA
OBX
University of Twente
47
PING
ABACK
ON
OFF
RTE
LF
CRLF
COMSS
ascii int
value
VER
OUTP
WR
1
2
3
4
Table 7.2: PC Protocol Send list
Keep in mind that there are logical dependencies. For example you cannot turn on the logging
using the ADE7759 if you have not defined the speed rate for the ADE7759. These dependencies are
not listed here as they are logical and the application will report any mistakes made (if reporting is not
turned of).
Return data: Data returned by the 4ARM always starts with an { and ends with an }. After the
} the 4ARM always send a carriage return and line feed unless this is turned off. Also, the 4ARM can
always send data unless this is turned off.
Control Engineering
48
Mode
M
Select
TI
Option 1
V
VA
ANA
OBX
BAT
SoC
TT
ST
REG1
REG2
REG3
REG4
REG5
CHG
Text
BAT PING
ACK
BAT PING
NAK
Text
value of
CRC16
B1
B2
raw 40 bits
c double
format
raw 24 bits
c double
format
B3
B4
I
I
IA
IINT
I
IA
V
T
value in %
Value in h:m
Value in h:m
Option 2
value in V e.g.
0.2
value in V e.g.
0.2
value in I
value in mA
value in mA
value in mA
value in mA
Value in mA
Value in V
Value in C
Time
Time
Time
Option 3 / Description
Time
Time
Time
Time
Time
Time
Time
PRECC
CC
CV
CCBST
CVBOOST
OFF
PULSE
READY
University of Twente
References
49
References
[1]
[2]
[3]
[4]
[5]
[6]
[7]
[8]
[9]
[10]
[11]
[12]
[13]
[14]
[15]
[16]
[17]
[18]
[19]
[20]
[21]
[22]
Control Engineering