Section SEPIC DC to DC Converter NUI Galway

Document Sample
Section SEPIC DC to DC Converter NUI Galway Powered By Docstoc
					       Department of Electronic Engineering
             4th Year Electronic & Computer

         Final Year Project Progress Report

               Supervisor: Dr Maeve Duffy
             Co- Supervisor: Dr Peter Corcoran
                  Student: Noel Walsh

Noel Walsh                 Page 1                29/03/2012
Declaration of Originality

I hereby declare that this thesis is my original work except where stated.

Signature: _________________________________ Date: ______________

Noel Walsh                           Page 2                          29/03/2012
This report documents the work undertaken for my final year project at N.U.I Galway.
The aim of the project was to design an intelligent back-up battery system capable of
recharging a back-up battery from the primary battery source. The primary power
source also comes from a battery as the system is designed to operate remotely on a
truck. The proposal for the project came after my time spent working in Blue Tree
during my 3rd year PEP work experience. It is hoped that the back-up system can be
integrated into their dry trailer set-up to provide a secondary power source for their
R:COM device.

The complexity of battery charging systems can vary depending on the number of
battery chemistries you wish the circuit to charge, and also how the system will be
controlled and monitored. A general recharging battery system is composed of a
power source, secondary battery, DC to DC converter and a charge controller. The
project examines each of these components individually to try and determine the best
possible candidate for the design, as many options exist for each.

As regards commercial products that are available in the market, most IC’s are
generally just designed for one batteries charging algorithm, although some IC’s do
incorporate various chemistries charge algorithms, they often are limited by the
operating conditions such as the maximum allowed voltage and current, Therefore it
was decided to design the full system from scratch. This procedure allowed us to
source components specifically rated for the application, and also give us completed
control for the charging algorithm design, such as when to start a charge cycle
depending on a batteries capacity, how to terminate a charge cycle, and also setting
the operating limits for the circuit with regards to the voltage and current.

Noel Walsh                             Page 3                             29/03/2012

I would like to take this opportunity to thank the many people who helped me during
the year as regards to personnel support and also technical advice with the project.

Firstly to the projects supervisor Dr Maeve Duffy, I would like to extend a sincere
thank you for all her help and advice, as without this the project would have been
unsuccessfully. Also to the co-supervisor Dr Peter Corcoran, who offered experienced
advice and guidance.

I would also like to give my appreciation to all the staff at the electronics department
at N.U.I Galway and also the technical staff at the electronics lab, Mr Martin Burke
and Mr Myles Meehan.

I would also like to thank all staff at Blue Tree systems, Dangan, Galway, which
includes a great deal of gratitude and thanks to Ben Kinsella for all his assistance
through the year.

Finally I would like to thank my family and friends for all their help and support over
my time spent at college, I would especially like to thank my girlfriend Helen as this
did require a special effort on her part as we have just been blessed with the birth of
our first baby boy Matthew, who I would also like to sincerely thank

Noel Walsh                              Page 4                              29/03/2012
Declaration of Originality .............................................................................................. 2
ABSTRACT ................................................................................................................... 3
Acknowledgements ........................................................................................................ 4
TABLE OF CONTENTS ............................................................................................... 5
Section 1: Background ................................................................................................... 6
  Introduction ................................................................................................................ 6
  Research ..................................................................................................................... 7
  Battery properties and characteristics ........................................................................ 7
  Battery Chemistries .................................................................................................... 8
  DC-DC Converters................................................................................................... 10
  Hardware .................................................................................................................. 11
  Software ................................................................................................................... 12
  Pulse Width Modulation (PWM) ............................................................................. 13
Section 2: Battery charging methods and Profiles ....................................................... 15
  Guidelines for designing a charger system: ............................................................. 15
  Sealed Lead Acid Charge Profile:............................................................................ 16
  Lithium Polymer Charge Profile:............................................................................. 22
  Lithium Charge Algorithm: ..................................................................................... 24
Section 3: SEPIC DC to DC Converter ....................................................................... 25
  SEPIC circuit operation ........................................................................................... 25
  Designing a SEPIC .................................................................................................. 28
  Simulating the SEPIC .............................................................................................. 33
Section 4: MSP430x2xx Microcontroller .................................................................... 38
  Architecture.............................................................................................................. 38
  Hardware Development Tools ................................................................................. 39
  Software Development Tools .................................................................................. 39
  Micro-controller Peripherals and registers............................................................... 39
Section5: MSP430x2xx Firmware ............................................................................... 50
  Configuring the Microcontroller:............................................................................. 51
Section 6: The Proposed system .................................................................................. 54
Conclusion ................................................................................................................... 58
References .................................................................................................................... 59
Appendix 1 battery definitions..................................................................................... 61
Appendix 2 list of figures ............................................................................................ 63
Appendix 3 list of formulas ......................................................................................... 64
Appendix 4 list of tables .............................................................................................. 65

Noel Walsh                                                  Page 5                                               29/03/2012
Section 1: Background


My final year project proposes to design an Intelligent Battery Back-up system in
conjunction with the hardware department at Blue Tree Systems, under the
supervision of Ben Kinsella, Head Engineer. The project is also carried out under the
supervision of Dr Maeve Duffy, Department of Electronics N.U.I Galway.

The aim of the project is to design an Intelligent Battery Back-up System for Blues
Trees R:COM unit capable of operating with different batteries chemistries. The back-
up system itself will be developed as an additional sub system implemented in their
dry trailer system. The R:COM mentioned above is an electronic device developed by
Blue Tree for the Haulage industry, the unit can be configured to provide many
features depending on a vehicles requirement, but for this project we are only
concerned with configurations relating to a dry trailer system. A dry trailer system
denotes an articulated trailer unit that has no actual power source available on the
trailer, any power requirements can only be provided when a tractor is connected to
the trailer.

The proposal is based on customer requests for an alternative power source to enable
the operation of an R:COM device, installed on a trailer in the dry trailer
configuration. With this set-up the R:COM hardware is unable to operate when a
tractor unit is disconnected, resulting in a loss of communication with the fleets base
station at the vehicles depot. This situation decreases the performance capabilities of
the R:COM and could also increases the risk of theft for the trailers owner. To resolve
this problem the battery system could be implemented to provide extra security
allowing the R:COM to function for a limited time period when the trailer is detached.
The time limit mention is determined by the battery type, power requirements of the
R:COM, and also time to next recharge cycle.

An analysis of the dry trailer system and customers requirements allowed us to outline
certain criteria for the design. The system once installed had to offer low maintenance
for the end user by using rechargeable battery chemistries. These chemistries require a
high level of control to monitor the operating conditions during any recharge cycle.
Temperature, current and voltage must be constantly monitored to ensure the
procedure is carried out safely and accurately. A degree of intelligence must also be
employed by the circuit to allow the system detect if a tractor unit is connected, the
capacity of the battery (determine if charge cycle is required), and also regulate a
charging cycle. It is essential the system can identify all of the above parameters to
ensure proper operation and prevent serious damage to the battery or hardware.

It must also be decided how the Back-up system will be installed in the current dry
trailer system, care must be taken not to interfere with any units normal operation, or
decrease their performance. The architecture of the system must be designed to allow
the back-up circuit interface between the power supply of the tractor unit and the

Noel Walsh                              Page 6                             29/03/2012
R:COM hardware, therefore the components used must be designed to meet the
circuits operating specifications.

Prior to the design of the system information was gathered relating to the relevant
sections of the project. The information allowed us to make informed decisions on the
systems requirements and also helped to develop a greater understanding of each
element and its characteristics. The research was carried out in the following areas,

      Battery properties and characteristics
      Battery Chemistries and charge cycles.
      DC-DC Converters
      Hardware
      Software
      Pulse Width Modulation (PWM)

Battery properties and characteristics

A battery is a device composed of one or more electrochemical cells, which store
chemical energy. This energy can be discharged from the battery in the form of an
electric current at a certain voltage, depending on the chemical used. The chemical
compounds in batteries allow for greater storage of energy in chemical form as
electrical energy is difficult to store. Capacitors do permit some storage of electrical
energy but this is in small quantities.

Batteries are classified in two types, primary (disposable) and secondary
(rechargeable), both of which convert chemical energy to electrical energy. The main
difference between the two types is that primary batteries can only be used once due
to the chemical reaction been irreversible. Secondary batteries on the other hand can
have their chemical reactions reversed to recharge the battery.

The purpose of a battery is to provide electrical energy to any load connected across
the batteries terminals, therefore the chemical reaction that leads to the discharge of a
battery causes a chemical compound of a higher energy to convert into a lower energy
compound. In general this reaction would result in the release of heat but in batteries
two electrodes are used to extract the energy in electrical form. Figure 1 shows a basic
battery electrochemical cell during a charge or discharge cycle.
Figure 1: Battery Structure

Noel Walsh                               Page 7                              29/03/2012
The anode and the cathode are completely isolated from each other by the separator to
prevent a short circuit. The electrolyte surrounds both the anode and the cathode and
can permeate the separator. A discharge cycle results in positive ions flowing from the
anode to the cathode, while negative ions flow in the opposite direction, during this
cycle electrons flow from the anode to the cathode through the external load. This
process is reversed during a charge cycle.

Battery chemistries are available in many forms and for this project we have chosen to
use lead acid and lithium ion, their properties and characteristic are explain later. The
properties and definition relating to most battery types can be found in appendix 1.

Battery Chemistries

In order to select the battery chemistries to use in the project certain performance
criteria had to be outlined. These ranged from,

      Rechargeable
      Cost
      Capacity
      Physical Size
      Customer requirements

With the above criteria in mind sealed lead acid and lithium ion chemistries were
chosen to provide the performance characteristics for the system. The different
chemistries offered separate operating conditions depending on customer requests.

Sealed Lead Acid

The lead acid battery system is a low-cost secondary battery that is available in a
variety of sizes and designs. It performs reliably over a wide range of temperatures
and has a good performance life. The efficiency of the battery is 70% and charge
retention is good since they are sealed. Lead dioxide is used in the positive electrode
and metallic lead in the negative electrode. The electrolyte is a sulphuric acid
solution. During discharge both the positive and negative electrodes convert to lead
sulphate and water is generated. During charge the process is reversed The main
disadvantages to the lead acid battery is its low cycle life (typically between 50 and
500 cycles), its limited energy density ( 30-40 Wh/kg ) and its weight.

Lithium Ion (Li-ion)

The demand for lithium ion batteries in the secondary consumer market has grown
dramatically in the last 10 years. This is mainly due to their use in applications such
as laptops, mobile phones and camcorders. Lithium ion cells employ lithium
intercalation compounds as the positive and negative materials. The positive electrode
material is typically a metal oxide with a layered structure, such as lithium cobalt

Noel Walsh                               Page 8                              29/03/2012
oxide, or a material with a tunnelled structure, such as lithium manganese oxide, on a
current collector aluminium foil. The negative electrode material is typically a
graphitic carbon, also a layered material, on a current collector. As the battery is
cycled lithium ions exchange between the positive and negative electrodes.

Polymer Li-ion

Polymer Li-ion batteries provide the performance characteristics of Li-ion batteries,
including their high specific energy and high energy density, in a thin, high aspect-
ratio form factor. The technology is implemented in devices which require a thin,
large footprint rechargeable battery. Polymer Li-ion cells utilise the same active
materials as standard Li-ion, in the polymer cells, flat, bonded electrodes are used to
enable the fabrication of thin cells packaged within a barrier film, in contrast to the
steel or aluminium cell case used in other Li-ion technologies. Polymer Li-ion cell
structure shown in figure 2.

Figure 2: Polymer Li-ion cell structure

The main difference between lithium-ion and lithium polymer battery structures is the
lithium-salt electrolyte is not held in an organic solvent but in a solid polymer
composite such as polyethylene oxide or polyacrylonitrile. This enables Lithium
polymer batteries to be manufactured at a lower cost and also gives them a more
robust characteristic to prevent physical damage.

Noel Walsh                              Page 9                             29/03/2012
DC-DC Converters

DC to DC converters are used in circuits where a dc source voltage (possibly from a
battery) may require its voltage level raised or dropped to another dc voltage level.
There are several alternative DC-DC conversion topologies available to choose from,
but the requirements for our selection were based on cost, complexity and
performance. The buck-boost and SEPIC topologies were both analysed as possible
converters to implement in the circuit, and the advantages of each topology are listed

Buck-Boost advantages

          Step-up and step-down capability.
          The output stage rectifier diode can be used as a reverse blocking diode.

Buck-Boost disadvantages

          Discontinuous or chopping current typically requires additional input filtering.
          In the event of a shorted high-side switch, there is no way limit the current into
           the battery. This situation is hazardous and should be avoided by using a
           protection device(fuse)
          Two switches and two diodes necessary for buck-boost capability without
           inverting output polarity.

SEPIC advantages

           Low-side switch and low-side current sense simplify the drive scheme and
            peak current sense circuitry.
           The blocking diode necessary for battery charger applications is inherent in
            the SEPIC topology.
           Input voltage can be greater or less than the output voltage.
           The input current to the SEPIC converter is continuous, similar to a boost
            regulator. For topologies giving continuous input current, the input EMI
            filtering can be significantly reduced (or not even necessary). The amount of
            noise generated at the input of the SEPIC is much lower than in the case of
            the buck-boost.
           The SEPIC converter provides capacitive primary-to- secondary isolation. In
            the event of a main switch short, the output voltage is not shorted to the input
            voltage. This provides a level of protection for the load
           The coupling capacitor clamps the winding leakage inductance energy, no
            snubber circuit is necessary.

SEPIC disadvantages

          The main disadvantages of the SEPIC converter are the higher switch current
           and the addition of the coupling capacitor.

Due to the possible better performance of the SEPIC it was chosen for the circuit and
is analysis in section 3.

Noel Walsh                                 Page 10                               29/03/2012

The hardware elements required in the system were outlined to get a basic view of
how the system would operate. This process gave us an idea of the building blocks the
system would need to function. An obvious element was a micro-controller, its
function would be to monitor and control the systems operation, and also determine
which battery source would power the R:COM. The MSP430x2x24 processor from
Texas Instruments ( TI ) was recommended by the hardware dept. at Blue Tree as they
had experience with this device from a pervious project, and knew it provided all the
necessary built-in modules, PWM output, A/D converter etc. The configuration and
operation of the micro is discussed further in chapter 4. A DC-to-DC converter was
another component required to convert the DC voltage from the trucks battery to the
relevant DC level to charge the back-up battery, the SEPIC converter was selected for
this purpose and is discussed in chapter 3. The battery itself is also part of the circuit
and provides the secondary power source for the R:COM, charging cycles and
operating conditions are outlined in chapter 2. As the R:COM can be powered from
either the truck or back-up battery a switching mechanism to select the source must be
included, this process is controlled by the micro-controller and is implemented using
MOSFETS as gates. Other considerations for the hardware was to ensure that all
components sourced for the project could operate in the require voltage, current and
temperature ranges. A basic sketch of the system is shown is figure 3.
Figure 3: Hardware Layout
        +       --
       Truck              Voltage         R:COM
            Output Voltage                           Back-up Battery System

                                                R:COM Power lines

    Switches                     Switch Select

               Output Voltage PWM Signal                Micro
        +       --

      Battery          Voltage   SEPIC
                                                Charge control

Noel Walsh                              Page 11                               29/03/2012

The software required for the system was to develop firmware that would be
embedded in the micro-controller to control its operation. The behaviour and
functionality of the micro is completely managed by the code it runs and therefore it
is essential to understand the sequence of events you wish to complete in order to
process the task. The micro’s main function is to regulate any charge cycles that have
been initiated, in order to achieve this process the voltage, current and temperatures
ranges must be define in the code and the present values continuously feedback to the
micro for processing. From this data received the micro can execute code to establish
if everything is within limits, if any parameter is reading to high or to low the micro
can adjust the duty cycle of its PWM output signal to control the voltage or current
supplied to the battery via the SEPIC. This process is explained further in chapter 4. A
simplified flowchart for the sequence of events the processor implements is shown in
figure 4.

Figure 4: Simplified Firmware flowchart


                         Configure Micro

                          Check Battery

                         Select R:COM
                         Power source

                        Charge Back-up
                         Monitor Sensor

The complete code, required functionality, emulation board and development tools for
the micro-controller are also discussed in detail in chapter 4.

Noel Walsh                              Page 12                             29/03/2012
Pulse Width Modulation (PWM)

PWM of a signal or power source is the process of modulating the duty cycle,
allowing either information to be sent over a communication channel or regulating the
power received by a load.
The square wave used in PWM has its pulse width modulated to vary the average
value of the waveform. The formula F1 shows how the average value of the
waveform is calculated, with f(t) representing a square wave with a minimum value
ymin, a maximum value ymax, and also a duty cycle D.
F1: Average value PWM waveform

Due to f(t) been a square wave the maximum value ymax is represented by:

F2: y max value

And therefore ymin is shown by:

F3: y min. value


Placing these values into the above equation results in

This can be simplified if ymin = 0 to


From this, it is obvious that the average value of the signal ( ) is directly dependent
on the duty cycle D.

There are various methods of generating a PWM signal, but the most simplest is the
inter-sective PWM method. This process compares the voltage level of a sine-wave
(reference waveform) against that of a saw-tooth waveform (modulation waveform) ,
when the amplitude of the sine-wave is greater than that of the saw-tooth waveform

Noel Walsh                              Page 13                              29/03/2012
the output PWM signal will be in its high state, and when these levels are reversed it
will be in its low state. Figure … represents this process.

Figure 5: PWM Waveforms.

Many microcontrollers now come with the capability of generating PWM signals, it
uses a counter which is continuously incrementing for the period of the PWM signal
(this represents the saw-tooth waveform) , once this is greater than the reference
value, the PWM output waveform changes from its high state to its low state ( this
process can also operate to change the PWM from low to high) . The counter is reset
at the end of every PWM period as this process is synchronised by the systems clock.

PWM is also useful in power applications, and can be used to control the amount of
power distributed to the load without losses, as these can be incurred when the power
source is limited by resistive means. The reason for this is due to the fact that the
average power delivered is proportional to the modulation duty cycle

PWM power systems generally operate at high frequency and implement
semiconductors ( MOSFET) as switches, the high and low levels of the modulated
waveform control the on/off state of the switches, the switches in turn control the
voltage across or current through the load. When the switch is off they have no
conducting current through them, but when they are on the voltage drop across them
is minimal. As the power dissipated by the switch is a product of the current and
voltage, it can be assumed no power is dissipated by the switch.

This method of power regulation is implemented in switched-mode power supplies,
the value of the duty cycle controlling the switch regulates the voltage and current to
the load, which is then used to generated the required output voltage/current level

Noel Walsh                             Page 14                             29/03/2012
Section 2: Battery charging methods and Profiles

The major benefit of secondary batteries is their ability to be recharged. The
recharging process greatly extends the life of the battery as it can be re-used again
once recharged, but the process must be carried out with caution. There are different
methods of charging batteries depending on their chemistry and guidelines are
outlined by manufactures as to how these should be carried out. The process of
recharging a battery is to apply electrical energy back through the battery reversing
the chemical reaction and restoring the batteries energy levels.

Designing charging systems for batteries requires 3 main steps:
1) How will you charge the battery?

All rechargeable battery chemistries have a charging profile defined to indicate how
the process should be carried out, this profile summarise the voltage and current levels
to be applied to the battery and also operating temperature range. The profile also
states the rate at which the battery can be charged, either slow, quick or fast, and can
recommend a method as to how the process should be carried out.

2) How to monitor the process?

Monitoring the batteries condition is essential to the charging system, control signals
should be used to assess the voltage, current and temperature levels and also
determine the current state of charge of the battery. Without this process a battery
cannot be recharged within the safe limits required and may result in serious damage
to the hardware or battery.

3) When to terminate the charge cycle.

The system must also be able to verify when a battery is fully charged and implement
a method of stopping the process. Charge termination techniques can vary between
chemistries, but most are based around defined voltage, current and temperature limits
or implementing timing constraints.

Once all the above questions have been analysis the design of the charger can begin,
some basic guidelines for this process are outlined below.

Guidelines for designing a charger system:

      The design of the charger must be appropriate for the battery chemistry and
       capable of operating within the required specifications.
      Protection against overcharging must be implemented in the circuit.
      The charger design should match the intended profile of the battery and be
       capable of executing the charge method.
      The charge time must be specified.
      The capacity of the charger should be sufficient to charge the battery within
       the desired time

Noel Walsh                             Page 15                              29/03/2012
      The power source must be specified and sufficient to charge battery.
      Is there a design trade-off between efficiency and cost.
      Decide between voltage regulators such as switch mode, linear or buck.

The overview above allowed me to breakdown the design of the charger into stages,
the first of which was to understand the charge profiles for both the sealed lead acid
and lithium polymer batteries.

Secondary cells contain chemicals that are the active components which make up the
positive and negative active materials, and the electrolyte. These materials for both
positive and negative are different, with the positive showing a reduction potential
and the negative a oxidation potential, the sum of which is the cell voltage. Also in
rechargeable cells the positive electrode is the cathode on discharge and the anode on
charge, with the opposite true for the negative electrode.

Sealed Lead Acid Charge Profile:

The Sealed lead acid (SLA) battery used in the project is manufactured by Panasonic
Model number LC-X1220P/LC-X1220AP. The battery itself is a combination of 6
cells connected in series to achieve the 12 volt DC output. The actual lead acid cell
itself has generally around a 2V DC per cell output and combining these cells gives
the 12 volt potential. The positive active material is lead dioxide, the negative is
spongy lead and the electrolyte is diluted sulphuric acid. The charging process for the
lead acid battery is to supply direct current from an external power source to the
active materials to change the chemical process and store energy. Figure 6 shows a
picture of the lead acid battery.
Figure 6: Sealed Lead Acid Battery

Battery charging is generally separated into two categories, fast charging which can
recharge a battery in about one to two hours or slow charging which may take 8 hours
or more depending on chemistry. The lead acid battery itself has a capacity of
20Ahours and a nominal output voltage of 12V DC. Both methods are now
considered for the sealed lead acid battery.

Noel Walsh                             Page 16                             29/03/2012
Lead Acid Fast charge

Charging methods for the lead acid battery are classified by application as shown

Standard charging methods

There are many methods available to charge the SLA battery, all of these are
explained in full detail in the manufactures application note for charging the Seal
Lead Acid battery (Panasonic Sealed Lead-Acid Batteries technical Handbook 2000 ).

Charging Methods:

Constant voltage/ constant current method (CV/CC)

This method requires a control current of 0.4Ahour capacity of the battery = 0.4 * 20
= 8 amps @ 2.45v/cell. As we are restricted to a maximum output current of 2 amps
this method will not be possible to implement.

Rapid Charging

To rapidly charge a battery a large charge current is required in a short time, therefore
this method cannot be used.

Two-step constant voltage charge control method

This method requires similar operating conditions as the CV/CC method, and as result
is also not a possibility.

Stand-by/back-up use (trickle use)

Stand-by/back-up use is to maintain the battery system at all times so that it can
supply power to the load.

Constant voltage method

This method is often used in standard charging applications and enables the battery to
exert full performance. This method is carried out by applying a constant voltage of
2.45 volts per cell across the batteries terminals. The process is complete when the
charge current is stable for over three hours. There is a risk of overcharging the
battery with this method but proper controls method should prevent this from
happening, such as voltage control and charge time implementation.

Noel Walsh                              Page 17                              29/03/2012
Trickle charge:

This system keeps the battery disconnected from the load with a small charge current
from the power source to compensate from discharge, if the power source fails or is
disconnected the battery is reconnected to the load to supply power.

Figure 7:

Precautions on charging:

1. As the battery continues to be charged over a long period, a small difference in
charging voltage may result in a significant difference in the battery life. Therefore,
charge voltage should be controlled within a narrow range and with little variation for
a long period.
2. As charge characteristics of the battery are dependent on temperature,
compensation for temperature variation is required when the battery is used over a
broad temperature range, and the system should be designed so that the battery and
the charger are kept at the same temperature

Float charge:

A float charge system connects the battery and the load in parallel with the rectifier
that can supply a constant-voltage current. Figure 10 shows a model for this system
Figure 8:

Noel Walsh                              Page 18                              29/03/2012
Considerations for deciding on a charging method:

After considering all of the above information it was decided to either implement the
trickle charge method or constant voltage method for the lead acid battery, most of the
other methods were not possible due to restrictions with the charging hardware. These
restrictions only allowed us to design the DC to DC converter to operate with a
maximum output current of 2 amps, this limitation was put in place due to the
physical size of the box to house the system, and a higher current would result in
larger components.

Current level

In constant voltage charging (cycle use) initial current should be 0.4C or smaller.
In constant voltage charging (trickle use) initial current should be 0.15 C or smaller.

Constant voltage charging and temperature

Relation between standard voltage value in constant voltage charging and temperature
is given in the Table 1.

Table 1: SLA constant voltage charging and temperature

Charging time

The charge time depends on factors such as depth of discharge of the battery,
characteristics of the charger and ambient temperature. The following formulas can be
used to estimate the charge time:

(1) When charge current is 0.25 CA or greater:
         F4     Tch = Cdis / I + (3 to 5)
(2) When charge current is below 0.25 CA:
          F5 Tch = Cdis / I + (6 to 10) ,where

Tch : Charging time required (hours)
Cdis : Amount of discharge before this charging (Ah)
I : Initial charge current (A)

Time required for trickle charge ranges from 24 to 48 hours.

Noel Walsh                              Page 19                              29/03/2012
Determine battery capacity:

Table 2 lists the voltage rating per cell to determine the state of charge for a 12v SLA
Table 2: SLA state of charge figures.

It is recommended for best performance to always keep the battery operating in the
zone highlighted by green, although occasional drops into the yellow zone will not
cause any major damage to the battery letting it continuously drop into this zone or
below will cause permanent damage to the batteries cells and reduce the operating life
of the battery.

Charging temperature

The preferred ambient temperature for charging the SLA is in the range from 0°C to
40°C. The Optimum range for charging is 5°C to 35°C. Charging at 0°C or below and
40°C or higher is not recommended:


Overcharge is an additional charge after the battery is fully charged. Continued
overcharging shortens the battery life. Select a charge method which is specified or
approved for each application.

Charging before use

Recharge the battery before use to compensate for capacity loss due to self-discharge
during storage.

Lead Acid Charge Algorithm:

The charging algorithm was designed with the above information in mind, the circuit
dose not implement any temperature measurement so therefore this figure is obsolete
in the charging algorithm. The process begins when the cell voltage drops below 2

Noel Walsh                              Page 20                              29/03/2012
volts (around 1.98 from table 2 to start charging @ 40% capacity) per cell with a
voltage below 12v (11.9 from table 2) on the batteries terminals. The charge current is
estimated at 1.5 amps ( 7.5% of C, has to equal 40% or less), but this figure has not
been tested as I am unsure about the variation in charging current during the charge
process, this is due to charge termination been determined by a stable current for over
three hours. The charge time is estimated at: ( 60% C 12amps => Cdis = 12)
                        Time = 12/1.5 + ( 6 to 10) = 14 to 18 hours

Figure 9 : SLA charging algorithm flowchart

          Check Battery Capacity
           Check Battery

        No         Is V less than
                    12v (cell<2)


                Start charge cycle
                Charge V = 14.7v
                   (2.45 v/cell)
               Start charge timer

        Test Cell voltage 2.12 = 100%

                  Ic stable 3 hrs?
                   Charge time?

             Terminate Charge cycle

The trickle charging method could also be implemented by applying the same voltage
but maybe a current rate of 2 amps to the battery, this is also a long process and could
take upwards of 24 hours. Termination for this method can be carried out by
determining the batteries capacity by the voltage level across its terminals. Both
methods must ensure not to overcharge the battery as this will reduce its overall

Noel Walsh                             Page 21                              29/03/2012
Lithium Polymer Charge Profile:

The lithium polymer (Li-Poly) battery used in the project is manufactured by
WorleyParsons Model No. AES 555072. Li-Poly batteries have evolved from lithium
ion batteries and give the added advantages of being more robust and have no
requirement for any metal case, therefore are lighter and easy to shape. The battery
itself is a 3 cell battery with the nominal voltage of 3.7 volts per cell, this voltage rises
to 4.2 volts when fully charged, the capacity of the battery is rated to 2Ah. Li-Poly
cells may also have to implement a pre-charge condition if the nominal voltage is less
than 2.7 volts, and also an overcharging limit of no more than 4.235 volts per cell to
prevent any damage to the cells. This sets the operating range of the Li-Poly to 4.2
and 2.8 volts.

Charging methods

The preferred method for charging Li-Poly batteries is a constant current/ constant
voltage algorithm, which is composed of three stages, trickle charge, fast or bulk
charge and constant voltage.

Stage 1: Trickle Charge:
This stage of the charge process is used to determine if the per-condition is required.
It has to be implemented if the cell voltage is less than 2.8 volts, the process is to
charge the cell with a current of approx. 0.1C maximum until the cell voltage rises
above the 2.8 threshold.

Stage 2: Fast Charge
When the cell voltage is greater than the trickle charge voltage threshold the charge
current can be raised to the fast charging level. The fast charge current rate is equal to
1C and this process is continued until the cell voltage reaches 4.2 volts.

Stage 3: Constant Voltage
Once the voltage level is 4.2/cell the charging current is reduced and a constant
voltage is applied. This procedure is maintained until the charge current is below
approx. 0.07C.

Figure 10: Li-Poly charging profile

Noel Walsh                                Page 22                               29/03/2012
Considerations for designing the Charging algorithm:

Charge Time

The three charge stages listed above do not really have a specific charge time under
which they should be complete, but it is generally considered that the charging
process should be stopped after a specified time if the charging conditions aren’t
reached. The first stage can have a timer implemented to stop the charging if the cell
voltage does not reach the 2.8 volt threshold after one hour, also the second stage can
be stopped by this timer after one and a half hours from start of stage if the cell
voltage hasn’t reached the 4.2 volts specified. The final stage generally takes around
two hours and therefore a deeply discharged Li-Poly battery can be recharged within
approx. three hours.

Temperature Monitoring

 The operating temperature range for charging Li-Poly is in the range from 0°C to
45°C. The discharge range for the battery is -20°C to 60°C. Charging at 0°C or below
and 45°C or higher can generate heat inside the battery causing damage to the cells.

Charge current

The constant current for the second stage should be 1C (= 2amps for battery), the
End-of-charge current should equal 0.02C (= 0.02 amps). The numbers for current
values are taken from datasheet.

Charge Voltage:

The standard voltage level to initiate a charging process is 3.0 volts per cell. This can
be reduced to 2.75 with the pre-condition. The only other voltage condition is the
constant voltage of 4.2 per cell for the final charging stage.

Charge Termination

Two charge termination methods can be employed to safely ensure the Li-Poly battery
is not overcharged. The first method is monitoring the charge current level once the
constant voltage phase of the charge cycle is entered the current should naturally
reduce to the 0.02C level, after this point is reached the charge cycle can be
terminated. The second method is a introduce a timer as the average recharge cycle
from a deeply discharged Li-Poly battery should take three hours, the time limits for
each stage were mention earlier.

Top-up charge
A top-up charge cycle can also be introduced to counter act the self-discharge of the
Li-Poly battery. This cycle can be initiated when the voltage across the cells drops to
4.05 volts and terminate when this had regained its 4.2 volt level, the charge current is
similar to the constant voltage stage. This process can be repeated once every twenty

Noel Walsh                              Page 23                              29/03/2012
Lithium Charge Algorithm:

Figure 11: Li-Poly charge algorithm flowchart

            Check Battery
           Check Battery Capacity

                                    Yes        Start Pre-condition
                   Is V less than
                    8.4v (cell<                       Stage


        No         V >= 8.5                              Start Charge Cycle
                   or <= 9.6                              Constant Voltage
                   cell 2.8/3.2
               Start charge cycle
                Constant current                             I charge =
              I charge = 2 AMPS                               0.02C
               Start charge timer                              Timer?       No

        No           V = 12.6       Yes
                     cell 4.2                             Terminate Charge cycle

The process begins by checking the capacity of the battery, if this is less than
2.8V/cell the pre-condition stage is started, otherwise if the voltage is not below this
range but between 2.8 and 3.2V/cell a charging cycle commences, if none if these
ranges apply the algorithm just continuously loops until the battery requires

Noel Walsh                                Page 24                           29/03/2012
Section 3: SEPIC DC to DC Converter
SEPIC circuit operation

The SEPIC (Single-Ended Primary Inductance Converter) is classified as a Switched-
mode power supply as it incorporates a switching regulator to control its operation. It
is a non-inverting dc to dc converter that is capable of generating output voltages
either above or below the input. A circuit diagram is shown in figure 12 with the
voltages and currents highlighted.

Figure 12: SEPIC circuit diagram

The circuit is composed of three storage elements which are two inductors L1 and L2,
and a capacitor C2. The other components in the circuit are a switch S1, a diode D1,
an input capacitor Cin, and a coupling capacitor C1. The SEPIC is designed as a
switched-mode power supply and exchanges energy between the storage elements to
produce an output voltage greater or less than the input voltage. This exchanged of
energy is controlled by the switch S1 and is typically a MOSFET.

Switched-mode power supplies operate in two modes, either continuous mode or
discontinuous mode, for our circuit configuration we are only concerned with
continuous mode as the current through inductor L1 never falls to zero. In steady-state
operation the average of Vc1 is Vin and since C1 blocks DC current, the average of
Ic1 is zero, therefore IL2 is the only source for the average load current, resulting in
the average current through L2 being the same as the average load current and
independent of the input voltage. The average voltages give the following equation

F6: SEPIC average voltages       VIN = VL1 + VC1 + VL2

                                 As VC1 is equal to VIN, VL1 = −VL2

This result for the inductor voltages allows you to have the two inductors wound on
the same core if you wish, since the magnitudes are equal and the effect of mutual
inductance will be zero. As results of the inductor magnitudes been equal, the ripple
currents from the two inductors will also be equal in magnitude. The average currents
can be summed as follows:

F7: SEPIC Average currents        ID1 = IL1 − IL2

Noel Walsh                              Page 25                             29/03/2012
The behaviour of the currents in the inductors are controlled by turning the switch S1
on and off, when S1 is on the current in L1 increases and decreases in L2, The energy
required to increase the current in L1 comes from the input and the energy to
decreased the current in L2 comes the capacitor C1. Figure 13 highlights the currents
when the switch is on.

Figure 13: SEPIC circuit S1 on


Turning S1 off results in the current in L1 becoming the same as the current in C1 and
as inductors prevent instantaneous change in current the current in L2 remains in the
negative direction. From Kirchoff's Current Law, it can be shown that

F8: SEPIC diode current         ID1 = IC1 - IL2.

Therefore when S1 is off the power delivered to the load is from L1 and L2. Through
the off cycle L1 charges C1 which then charges L2 during the off cycle. The capacitor
CIN is required to reduce the effects of the parasitic inductance and internal resistance
of the power supply.

Figure 14: SEPIC circuit S off

The components C1 and L2 allow the SEPIC to buck or boost the input voltage level.
L1 and S1 create a standard boost converter which generates a voltage Vs1 whose
magnitude is related to the duty cycle of the S1. The voltage generated by Vs1
determines the magnitude of the output voltage and they are related by the formula

Noel Walsh                               Page 26                             29/03/2012
F9 :SEPIC Vout Vout = Vs1 – Vin ( Vin equals average voltage across C1)

When the voltage Vs1 is less than double Vin , Vout will be less than the input
voltage, but if Vs1 is greater than double Vin, Vout will be greater than the input

The diode D1 is also very important in the circuit as the switching times need to be
extremely fast to prevent high voltage spikes across the inductors that could damage
the components, therefore Schottky diodes are recommended. Another factor to
consider is the internal resistances in the inductors and capacitors, to ensure the
majority of power is transferred to the load and not dissipated as heat, low series
resistance inductors should be used. Capacitors C1 and C2 should also have low ESR
(Equivalent Series Resistance) to minimise ripple and prevent heat build up, as the
current in C1 changes direction frequently. The theoretical voltage and current
waveforms from the SEPIC are shown in figure 15.

Figure 15: SEPIC waveforms

Noel Walsh                            Page 27                           29/03/2012
Designing a SEPIC

Before the design can begin the operating conditions must first be outlined in order to
determine the correct component values. Operating conditions are shown in table 3

Table 3: SEPIC operating conditions

                          Value              Unit                  Note
US Truck Battery          12                 Volts DC              Range 9-14
EU Truck Battery          24                 Volts DC              Range 20-28
Vin minimum               9                  Volts DC
Vin maximum               36                 Volts DC
Vout range                14.5-14.9          Volts DC              For lead Acid
Vout range                12.3-12.6          Volts DC              For Lithium
I out                     2                  Amps
Switching Frequency       330                KHz

All the components must also be rated to 36V as this will prevent any damage by
voltage spikes from the trucks battery. For the purpose of the calculations Vout is
taken as the maximum possible output voltage and Vin the minimum possible input

Duty Cycle (D)

A duty cycle D is defined as the length of time a pulse is in its high state for the
duration of a pulse period, a general formula for a duty cycle is given by F 10.
F 10: Duty cycle

       τ is the duration that the function is non-zero;
       Τ is the period of the function.

In the SEPIC application the duty cycle determines the amount of time the switch is
on, it is defined by the relationship between the input voltage and the output voltage
plus the diode voltage drop, and is given buy the formula 11.
F 11: SEPIC duty cycle

    = forward voltage drop across diode. = 0.61v
SLA Vout = 14.9V
  Dmax = 0.6328 calculated at Vin = 9volts.
  Dmin = 0.3565 calculated at Vin = 28volts.
Li-Poly Vout = 12.6V
  Dmax = 0.5948 calculated at Vin = 9volts.
  Dmin = 0.3206 calculated at Vin = 28volts

Noel Walsh                              Page 28                            29/03/2012

Inductors are passive electronic components and are used in the circuit as energy
storage elements. The schematic symbol for an inductor is shown in figure 16.
Figure 16: Inductor schematic symbol

The SEPIC configuration uses two inductors L1 and L2, we have also chosen not to
use inductors wound on the same core as with this set-up the circuit will be far from
optimum. Both the inductance value and the current ripple is the same for each
inductor in the circuit, it is also recommended to allow the peak-to-peal ripple current
in the inductors be approx. 40% of the maximum input current at the minimum input
voltage, formula F12 gives the inductor current ripple.
F12: Inductor current ripple

                           = 1.32 Amps
The inductance value for inductors not wound on the same core is given by F13.
F 13: Inductance value for inductors

                        => L = 13.1uH

To prevent the inductors from saturating the peak allowable current in each inductor
is given by the two formulas F14 for L1 and F15 for L2.

F14: L1 peak current

                                  = 4.136 amps

F15: L2 peak current

                                  = 2.4 amps

The inductor selected for the circuit was a 15uH component manufactured by EPOS
part number B82477G4153M. The inductor is recommended for DC-DC applications

Noel Walsh                               Page 29                            29/03/2012
as it has a high current rating of 4.5 amps and a low DC resistance. The inductance
tolerance of +/- 20% allows the component to vary 3uH, rating it between 12-18uH.


The power MOSFET (Metal Oxide Semiconductor Field-Effect Transistor) is used in
power applications (DC to DC converter) to implement a switch that can handle large
amounts of power at low voltages (less than 200v). It performs well at high speeds as
it is able to switch quickly, and provides good voltage blocking and current carrying
capabilities. The schematic symbol for an N-Channel MOSFET is shown in figure 17.

Figure 17: N-channel MOSFET

G = Gate, D = Drain, S = Source.

Before deciding on which MOSFET to use in the circuit you must consider the
following parameters, the minimum threshold voltage ( Vth ), the on resistance ( Rds
), the gate-drain charge ( Qgd0), and the maximum drain to source voltage ( Vds ).
The peak switch voltage (Vps) is equal to Vin + Vout => 36 + 14.9 = 50.9v, the peak
switch current is given by formula F16.
F16: SEPIC switch peak current

                                          = 6.54 amps

The RMS current through the switch is given by formula F17
F17: RMS current in S1

                                         = 4.19 amps rms

Noel Walsh                               Page 30                         29/03/2012
After the above analysis was carried out, the MOSFET chosen for the circuit was the
Si4450DY-T1-E3 manufactured by vishay-siliconix. A summary of its basic operating
conditions are shown in table 4.

Table 4: MOSFET operating conditions

The MOSFET is more than capable of dealing with the peak and RMS current, and
also the drain voltage is greater than 50.9v as required, it also offers low resistance
making it a good selection for the circuit.
Output Diode

A diode is an electronic component whose function is to pass current in one direction
(forward biased) and block it (reversed biased) in another. The diode in the circuit is
also required to be capable of switching between bias states quickly, therefore a
schottky diode is used. The schottky diode provides low forward voltage drop and a
fast switching action. The schematic symbol is shown in figure 18.
Figure 18: Schematic symbol schottky diode

The output diode must be rated to handle a current value which is the same as the
switches (Q1) peak current, this value is equal to 6.536 amps, it must also be rated to
withstand a peak reverse voltage which is given by formula F18.
F18: SEPIC diode peak reverse voltage

                                    = 50.9v

The diode chosen for the circuit is manufactured by vishay product
No.6CWQ06FNPbF, typical applications recommended for the diode include battery
charging and switching power suppliers. The diode is rated for a reverse voltage of
60v and forward current of 7 amps, with a voltage drop of 0.61v.

Noel Walsh                             Page 31                             29/03/2012
The Coupling Capacitor (Cs)

The factors to consider when selecting the coupling capacitor are the RMS current
which is given by formula F 19.
F19: SEPIC coupling capacitor RMS current

                                = 2.6255 amps rms

Therefore the capacitor must be rated for a large RMS current relative to the output
power. The capacitor must also be callable of withstanding the maximum input
voltage ( = 36v ) . Tantalum and ceramic capacitors are considered to be the best type
of SMT for this application as they have high RMS ratings relative to their size. The
peak voltage ripple on Cs (assuming no ESR) is given by formula F20.
F20 SEPIC coupling capacitor voltage ripple

                              = 3.835v

Output Capacitor ( Cout ):

The output capacitors function in the circuit is to provide current to the load when the
switch Q1 is turned on, due to this the output capacitor operates with large ripple
currents. As result Cout must be able to handle the maximum RMS current, the
formula to calculate this is given by F21
F21: SEPIC output capacitor RMS current

                                  = 2.6255   amps rms

The output ripple voltage on Cout is assumed to as result of the ESR and the bulk
capacitance, each is considered to be responsible for half the voltage ripple. The
formulas for calculating these figures are given by F22 and F23.
F22: SEPIC ESR output capacitor

                        ESR <= 22.7m ohms

The voltage ripple was calculated at 2% of the maximum output voltage, but this
figure was changed to 5% when deciding on the actual capacitors to use.

Noel Walsh                               Page 32                            29/03/2012
F23: SEPIC output capacitor capacitance

                        Cout >= 25uF

The selection of the output capacitor depends on the RMS current, ESR, capacitance
requirements and operating frequency.

Input Capacitor (Cin)

The inductor at the input of the SEPIC ensures that Cin sees a low ripple current, the
waveform for the current here is continuous and triangular. The RMS current in the
input capacitor is given by formula F24.
F24: SEPIC input capacitor RMS current

                                       = 0.3811 Amps rms

Although it is suggested that the input capacitor is not critical in the SEPIC
application, when it is used it must withstand the RMS current. Also a good quality
one must be chosen which will prevent impedance interactions with the input supply.

I would like to thank Dr. Maeve Duffy for her help in selecting the capacitors for the
SEPIC application as there was a few considerations to take into account when
making the selection, these ranged from the operating frequency, RMS current and
ESR ( Equivalent Series Resistance ) at the operation frequency.

The capacitors selected for the circuit were

Cs = 1 uF @ 50v Part No. 12105C105KAT2A
Cin = same as Cs
Cout = 22uF Part No. 1210YC226MAT2A

The capacitors are manufactured by AVX, and have a ceramic multi layer dielectric.

Simulating the SEPIC


Pspice (Personal Simulation Program of Integrated Circuits Emphasis ) is computer
software that can be used to simulate the behaviour of analogue circuits. The main
advantage of Pspice is its ability to verify a circuits operation through simulation, to
confirm the correct component values have been chosen, saving possible time and
money. The simulation process may be carried out in two ways, either by creating a
net-list for the circuit or importing a schematic from orcad. The process of simulation
offers the user a simple way to test circuits and also allows them to make any changes

Noel Walsh                              Page 33                             29/03/2012
Figure19: Pspice SEPIC circuit diagram:
                              L1                           C2               D3

                              13.1uH                       1u               D1N4148

                                                   D                                           2
                                                                  L2                               R1
        V1                                         4
24Vdc          C1                                                  13.1uH                          7.35
                                                                                        22uF   1
                1u                        G

                     V1 = 0            SI4450DY
                     V2 = 10                       S
                     TD = 0
                     TR = 10n
                     TF = 10n
                     PW = 1.9u
                     PER = 3.03u

The circuit was simulated with an output resistor R1 = 7.35 ohms (14.9v/2A)
representing the output load, the DC input voltage represents the trucks battery. The
PWM signal was generated with a square-wave which is defined by the following

V1 = 0 volts Off voltage
V2 = 10 volts On voltage
TD = 0 sec     Time delay
Tr = 10n sec Rise time
Tf = 10n sec Fall time
PW = 1.9u sec Pulse width at maximum duty cycle
PER = 3.03u sec Pulse period

Testing the circuit was carried out by varying the duty cycle to determine the
relationship between the output voltage and current levels in relation to the on time of
the pulse. Table 5 shows the results attempting to generate the 14.7 voltage level for
the sealed lead acid with an input voltage of 24volts. All numbers from graphys are
taken as approximate figures.

Table 5: SLA Vout @ 24V DC input

Vin DC volts                Duty cycle (usec)              Duty Cycle %               Vout DC volts
24                          0.5                            17                         4.5
24                          1                              33                         9.9
24                          1.2                            40                         14.7
24                          1.3                            43                         15
24                          1.5                            50                         19.8

The table shows that the ideal duty cycle to achieve the 14.7V DC output is at 40%.
The test was carried on further to highlight the relationship between the output
voltage and the duty cycle, as the duty cycle is increased so to does the output voltage.
Figure 20 On the next page illustrates the output voltage at 14.7volts with a duty cycle
of 1.2usec, the average current through the diode D3 is also shown.

Noel Walsh                                             Page 34                                 29/03/2012
Figure 20: SLA Vout at 24V DC input Duty cycle 1.2usec.

The same process was carried out to determine the required duty cycle with a 12V DC
input, table 6 shows the results.

Table 6: SLA vout @ 12V DC input

Vin DC volts         Duty cycle (usec)    Duty Cycle %          Vout DC volts
12                   0.5                  17                    2
12                   1                    33                    4.5
12                   1.5                  50                    9.5
12                   1.8                  59                    14
12                   1.83                 60                    14.7

Figure 21: SLA Vout at 12V DC input Duty cycle 1.83usec.

Noel Walsh                           Page 35                            29/03/2012
The same procedure was done for Li-Poly to achieve the 12.6 voltage level for the
constant voltage stage. Table 7 shows the results for input voltage equal to 12V, table
8 at 24V..

Table 7: Li-Poly Vout @ 12V DC input.
Vin                 Duty Cycle usec          Duty Cycle %          Vout
12                  1.7                      56                    12.3
12                  1.75                     58                    13
12                  1.72                     57                    12.6

Figure 22: Li-Poly Vout at 12V DC input Duty cycle 1.72usec

Table 8: Li-Poly Vout @ 24V DC input.

Vin                   Duty Cycle usec        Duty Cycle %          Vout
24                    1.1                    36                    11.5
24                    1.15                   38                    12.2
24                    1.17                   39                    12.6

Figure 23: Li-Poly Vout at 12V DC input Duty cycle 1.72usec

Noel Walsh                              Page 36                             29/03/2012
The above procedures, demonstrates the relationship between the duty cycle and the
output voltage, as the duty cycle is increased so does the output voltage. The
relationship the output current shares with the duty cycle is given by equation F25.


This formula displays that increasing the duty cycle results in a smaller output current
and decreasing it produces a larger current. I was unable to show this with Pspice as I
couldn’t measure the current at the output resistor. This figure for the output current is
taken as an average across the inductor L2.

Noel Walsh                              Page 37                               29/03/2012
Section 4: MSP430x2xx Microcontroller
The MSP430x2xx microcontroller from Texas Instruments (TI) is an ultra low power
16-bit RISC (Reduced Instruction Set Computer) mixed-signal processor, the
component itself is designed specifically for battery powered measurements
applications. The mixed-signal and digital technologies implemented in the MSP430
allow for simultaneous interfacing to analogue signals, sensors and digital
components while maintaining low power.


Figure 24 shows the internal architecture of the MSP430x2xx microcontroller.

Figure 24: MSP430x2xx Architecture

The CPU, peripherals and clock system are combined using a von-Neumann (one
memory location for both instructions and data) common memory address bus (MAB)
and memory data bus (MDB).The CPU has been designed for modern programming
techniques such as calculating branching, table processing and the use of high-level
languages such as C. It can address a 1M byte range without paging and provides 12
general purpose registers with also program counter, stack pointer, status, constant
generator registers. The basic clock module allows the user to select from the three
available clock signals, ACLK, MCLK and SMCLK. The flash memory is bit, byte
and word addressable or programmable with an integrated controller that controls
programming and erase operations. The ADC10 is a 10 bit analog-to-digital converter
and implements a 10 bit SAR core, sample select control, reference generator, and

Noel Walsh                            Page 38                           29/03/2012
data transfer controller (DTC). The op-amps are provided to implement signal
conditioning for analog-to-digital conversions. The 4 ports (P1/P4) available have
eight I/O pins, each single pin can be configured for either input or output direction
and also is capable of been individually read or written to, ports one and two provide
interrupt capabilities. The brownout module monitors the supply voltage and can
generate a reset if this falls below the required level. The watchdog timer can generate
a reset if a software problem occurs after a specific time limit, or can be used as a
general interval timer. Timer A/B is a 16-bit timer/counter and can support multiple
capture/compares, PWM outputs, and interval timing. The final module provides
various interfaces to the micro.

Hardware Development Tools
The hardware development kit provided by TI includes everything required to
develop projects, it contains a target board, debugger and programming interface, free
Kickstart software and cables, and is shown in figure

Figure 25: MSP430 hardware development tools

Software Development Tools
Integrated Development Environments (IDE) can be downloaded on the TI website
from TI and third party developers. The IDE chosen for the project was the IAR
Embedded Workbench Kick-start for MSP430. This IDE allows you to build and
debug applications for the MSP430, it includes a code size limited C-Compiler,
unlimited assembler, FET debugger and a simulator. The code size limit of the C-
Compiler is set to 4K bytes

 The TI website provides tutorials and code examples to help you become familiar
with the development tools, from here the first step I took was to run a basic program
to flash the LED on the target board, this allowed me to assume all the tools were
operating as they should.

Micro-controller Peripherals and registers

The various modules and peripherals provided by the micro need some adjusting
before they can function as required. This process involves writing software to set the
various bits in the modules control and operation registers, once set the peripherals
should function correctly to control the operation of the micro. The peripherals and
registers in question are now explained.

Noel Walsh                             Page 39                              29/03/2012
Digitally Controlled Oscillator (DCO)

The DCO is an integrated oscillator that can have its frequency adjusted by software
using the DCOx, MODx, and RSELx bits. A block diagram of the DCO layout is
shown in figure 26
Figure 26: DCO layout

Once a PUC ( Power Up Clear) has occurred, the DCO is automatically set to a mid-
range frequency as RSELx and DCOx and pre-programmed to equal 7 and 3. The
main clock ( MCLK) and sub-main clock (SMCLK) can both be sourced from the
DCO, as the CPU executes from the MCLK this is sourced from the fast starting
DCO, code typically begins in less than 2u seconds.

Setting the DCO frequency:

The four RSELx bits allow you to choose between one of sixteen nominal frequency
ranges for the DCO. These frequencies are then broken down further into 8 frequency
steps ( separated by approximately by 10% ) controlled by the three DCOx bits. The
five MODx bits allow you to switch between the frequency selected by the DCOx bits
and the next higher frequency set by DCOx + 1. If the DCOx bits = 07h the MODx
bits have no effect as the DCO is at its highest level for the selected RSELx range.

Figure 27: DCOx range and RSELx steps

An external resistor (Rosc) may be used to source the DCO current, this option
provides an alternative method to tune the DCO frequency by varying the resistor
value. With this method RSELx is limited from 0 to 7.

Noel Walsh                            Page 40                           29/03/2012
Configuring the DCO

The DCO control register allows you to set the values for the DCOx and MODx bits.

DCOx (bits 7 to 5) sets the DCO frequency.
MODx (bits 4 to 0) controls the modulator selection.

The three basic clock system control registers configure the micro-controllers clock
system. These register allow you to select between the different options for the system
clocks, and also select the frequency range for the clock.


XT2OFF (bit 7)       This bit turns off the XT2 oscillator
XTS    (bit 6)       LFXT1 mode select
DIVAx (bits 5 to 4) Divider for ACLK
RSELx ( bits 3 to 0) Range select

Basic clock system control register 2

SELMx (bits 7 to 6)   Select MCLK source
DIVMx (bits 5 to 4)   Divider for MCLK
SELS ( bit 3 )        Select SMCLK source
DIVSx (bits 2 to 1)   Divider for SMCLK
DCOR ( bit 0 )        DCO resistor select

Basic clock system control register 3

    Noel Walsh                          Page 41                            29/03/2012
XT2Sx (bits 7 to 6)     Select frequency range for XT2
LFXT1Sx (bits 5 to 4)   Low frequency clock select and LFXT1 range select
XCAPx ( bits 3 to 2)     Oscillator capacitor selection
XT2OF (bit 1)            XT2 oscillator fault
LFXT1OF (bit 0)         LFXT1 oscillator fault

The DCO was configures to operate at 3.84MHz and also provide the MCLK for the
CPU and the SMCLK for the peripherials.

Timer A
Timer_A is a 16-bit timer/counter which can be configured with software. Depending
on the mode the 16-bit TAR register increments or decrements with each rising edge
of the clock signal. The TAR register also allow you to read or write a value to/from
the register with software. The operating clock for the timer can be sourced from the
ACLK, SMCLK or externally via the TACLK or INCLK. The timer has four modes
of operation stop, up, continuous and up/down. Generating a PWM signal with the
timer is carried out in compare mode when CAP = 0, each capture/compare block
contains an output unit, this unit is used to generate the PWM signal. The units have
eight modes of operation capable of generating signals based on the EQU0 and EQUx

Timer_A control register

TASSELx (bits 9 to 8) Timer_A clock source select
IDx     ( bits 7 to 6) Input divider, these bits select the for the input clock
MCx     (bits 5 to 4) Mode control, stop,up,continuous,up/down.
TACLR (bit 2)          Timer_A clear, resets TAR register
TAIE    (bit 1)        Timer_A interrupt enable.
TAIFG   ( bit 0)        Timer_A interrupt flag

Timer_A Register, TARx 16-bit count register.

Noel Walsh                              Page 42                              29/03/2012
Timer_A Capture/Compare Register x

TACCRx 16-bit capture/compare register,
       In compare mode TACCrx holds the data for the comparison to thr timer
       value in the TAR register
       In capture mode the TAR value is copied into the TACCRx register to
       capture value

Timer_A Capture/Compare control register

CMx   (bits 15 to 14) Capture mode
CCISx (bits 13 to 12) Capture/Compare input select, select TACCRx input signal
SCS       (bit 11)      Synchronise capture source
SCCI     (bit 10)      Synchronise capture/compare input
CAP      (bit 8)       Capture mode 0 = compare mode 1 = capture mode
OUTMODx (bits 7 to 5) Output mode.
CCIE      (bit 4)       Capture/Compare interrupt enable
CCI      ( bit 3)      Capture/Compare input
OUT       (bit 2)       Output for mode 0, controls the state of the output
COV      (bit 1)        Capture overflow, highlights overflow
CCIFG    (bit 0)        Capture/Compare interrupt flag.

Timer_A provides the PWM signal to drive the MOSFET in the SEPIC, its duty cycle
can be varied to allow the SEPIC to control the voltage and current to the load.

Noel Walsh                           Page 43                         29/03/2012
Digital I/O

Configuring the 4 ports on the micro-controller is carried out by writing software to
change the values of the various registers associated with the ports. The following
figure lists the registers assigned to each port.

Figure 28: MSP430 Port Registers.

Input                  : reflects the input value at each pin for the input, 1= high 0 =
Output                 : reflects the output value at each pin for the input, 1= high 0 =
Direction              : Selects the direction of pin 1=output 0=input
Interrupt Flag         : Interrupt flag on pin
Interrupt edge select : Select edge for interrupt to become active
Interrupt enable      : Enables associated interrupt flag
Port select           : These allow pin to be multiplexed with other peripherals
Port select 2         :
Resistor enable       : Enable/Disable pull-up/pull-down resistor at pin

It is also recommended to configure I/O pins to the output direction if they are
unused, to prevent a floating input and reduce the power consumed.

The ports provide the input for the voltage and current control signals from the SEPIC
and batteries, they are also used for the PWM output and JTAG interface.

Analog-to-digital Converter ADC

The ADC converts analogue input signals into 10-bit digital representations which are
then stored in the ADC10MEN register. Two voltage levels (Vr+ and Vr-) are used by
the core to define the upper and lower limits of the conversion. The conversion results
can be in binary or 2s-complement format, in binary format the conversion formula is:

F26: ADC conversion results in binary

Noel Walsh                               Page 44                               29/03/2012
Two control register configure the ADC10 core and these bits can only be generally
modified when the ENC bit = 0, when ENC = 1 a conversion can be performed. The
ADC clock is selected using the ADC10SSELx bits and possible sources are SMCLK,
MCLK,ACLK and an internal oscillator ADC10OSC. Selecting the channel for
conversion either the 8 external or 4 internal analog-signals is controlled by the
analogue input multiplexer. Two internal voltage references can be selected using the
REF2_5V bit, if this equals 1 the reference voltage equals 2.5v otherwise 1.5v. This
reference can also be supplied externally through the V ref pins. The ADC10 has four
conversion modes enabled with the CONSEQx bits, these include single channel,
sequence of channels, repeat single channel, repeat sequence of channels.

ADC10 control register 0

SREFx     (bits 15 to 13) Select reference
ADC10SHtx (bits 12 to 11) ADC sample and hold time
ADC10SR (bit 10)          ADC sampling rate
REFOUT    (bit 9)          Reference out
REFBURST (bit 8)          Reference burst
MSC       (bit 7)         Multiple sample and conversion
REF2_5V (bit 6)           Reference generator voltage 0 =1.5 1=2.5 REFON has =1
REFON    (bit 5)          Reference generator on
ADC10ON (bit 4)           ADC10 on
ADC10IFG (bit 2)          ADC10 interrupt flag
ENC      (bit 1)          Enable conversion
ADC10SC ( bit 0)          Start conversion

Noel Walsh                            Page 45                            29/03/2012
ADC10 control register 1

INCHx     (bits 15 to 12) Input channel select
SHSx       (bits 11 to 10) Sample-and-hold source select
ADC10DF    (bit 9)         ADC data format
ISSH       ( bit 8)        Invert signal sample and hold
ADC10DIVx (bits 7 to 5) ADC10 clock divider
ADC10SSELx (bits 4 to 3) ADC10 clock source select
CONSEQx     (bits 2 to 1) Conversion sequence mode select
ADC10BUSY ( bit 0)          ADC10 busy

ADC10 analog enable control register 0

ADC10AE0x (bits 7 to 0) ADC analog enable, Enable corresponding input pins

ADC10 analog enable control register 1

ADC10AE1x (bits 7to 4) ADC10 analog enable

Noel Walsh                           Page 46                         29/03/2012
ADC10MEM Conversion memory register, binary format

Conversion Results ( bits 9 to 0) Conversion results 10-bit binary format

ADC10MEM Conversion memory register, 2s complement format

Conversion Results (bits 15 to 6) Conversion results 10-bit 2’s complement

ADC10 Data transfer control register 0

ADC10TB   (bit 3) ADC10 two block mode
ADC10CT   (bit 2) ADC10 continuous transfer
ADC10B1    (bit 1) ADC10 block 1
ADC10FETCH ( bit 0) ADC10 This bit should normally be reset

ADC10 Data transfer control register 0

DTC Transfers (bits 7 to 0) Define No. transfers in each block

Noel Walsh                               Page 47                            29/03/2012
ADC10 Start Address register for data transfer

ADC10SAx (bits 15 to 1) ADC10 start address for DTC

The analog-to-digital converter process the analogue voltage and current signals from
the SEPIC and batteries into digital signals, allowing the micro to process the values
and determine if any changes need to be made to the PWM output signal.

Operational Amplifier OA

The two op-amps provided by the micro-controller are, low current, rail-to-rail output
op-amps. It is possible to configure these op-amps to implement the following
functions by set the OAFCx bits.

Figure 29: Op amp modes.

The op-amps have two control registers associated with them to control operational
modes, and input/output signals.

Op-amp Control Register 0

OANx      (bits 7 to 6) Inverting input select, select the input signal for the inverting

Noel Walsh                               Page 48                               29/03/2012
OAPx   (bits 5 to 4) Non-inverting input select, select signal to non-inverting input
OAPMx (bits 3 to 2) Slew rate select, select the slew rate Vs current consumption
OAADCx ( bits 1 to 0) Output select, including the OAFCx bits these control the
                     routing of the op-amp output.

Op-amp Control Register 1

OAFBRx (bits 7 to 5)   Feedback resistor select
OAFCx (bits 4 to 2)    Function control, select the function of the op-amp
OANEXT (bit 1)         Inverting input externally available
OARRIP (bit 0)         Reverse resistor connection in comparator mode

The voltage and current measurements in the circuit are first passed through the op-
amp which is set-up in unity gain buffer mode. These signals are then routed to the
analog-to-digtal converter. The op-amps provide low output impedance to the ADC to
help prevent any noise on the signals.


 Noel Walsh                            Page 49                               29/03/2012
Section5: MSP430x2xx Firmware
The microcontroller firmware is downloaded to the flash memory for execution, as
none of the interfaces have been developed yet such as JTAG SPY-BI-WIRE the
development tools are used to download to the micro. The firmware controls the
operation of the micro, and the required tasks it has to run are monitoring a charging
process, and determine which power source should be used to power the R:COM. The
flowchart for the firmware is shown in figure 30.

Figure 30: Firmware flowchart




                No              Yes

           Check                      Truck
          Battery                     supply
          Capacity                    R:COM

      No Battery                      Battery
         Charged                      Capacity

                  Yes                             Yes
           Battery                     Charged
           R:COM                               No
                                  Charge algorithm

Noel Walsh                              Page 50                           29/03/2012
Configuring the Microcontroller:


Setting the ports to the output direction with the PxDIR register (output = 1 with bits),
P1DIR |= 0x0F; sets port 1.2 as an output.
P4DIR |= 0x0F; set port 4 pins 0 and 1 as outputs

Clear the PxOUT registers. Each bit in the PxOUT reg. corresponds to the pin on the
port and the value to be written out.
P1OUT = 0;
P4OUT = 0;

PxSEL is set to multiplex pins with other peripherals module functions.
P1SEL = 0x04; port 1.2 TA1
P4SEl = 0x03; port 4.0 and 4.1 TB


Basic clock system control register 1
BSCCTL1 = DIVA_3; 00001100, ACLK divided by 8

Timer A capture/ compare control register 2 ( CCTL2) is set up as follows
CM_1 = 01; capture on rising edge;
CCIS_1 = 01; select the TACCR input signal, CCIxB, capture/compare input 1.
CAP    = 1; 1 = capture mode; 0 = compare mode.

Timer A control register TACTL
TASSEL_2 = 10; Timer A clock source select, SMCLK
MC_2      = 10; Mode control, continuous mode counts up to 0xFFFF;
TACLR     = 1; setting this bit resets the TAR, clock divider and the count direction.

CCR2 Timer_A capture/compare register 2. In capture mode TAR is copied here
when a capture is performed

TAR Timer_A register, this register is the count of Timer_A (16 bits)

DCO control register, DCOCTL
DCOx bits 7 to 5 select between These bits select which of the eight discrete DCO
frequencies within the range defined by the RSELx setting is selected
DCOMOD bits 4 to 0 These bits define how often the fDCO+1 frequency is
used within a period of 32 DCOCLK cycles

BCSCTL1 also set the RSELS bits for the DCO.

The DCO is set-up to operate at 3.84Mhz.

Noel Walsh                              Page 51                              29/03/2012
Analog-To-Digital converter (ADC)

First set ENC bit to 0 to disable the ADC and allow the peripheral to be configured.
The pins on port 2 are then enable for analogue input, ( pin 2.0, 2.2, 2.3, 2.4 ) by
setting ADC10AE to equal 1D hex. The control register ADC10CTL0 has the
following set-up,

SREF_1 = 001          (Vr+ = Vref and Vr- = Vss)
ADC10SHT_3 = 01       (sample and hold time = 8* ADC10CLKs)
REFOUT = 1             ( reference output on)
REF2_5V = 1            ( reference voltage = 2.5volts)
REFON = 1              ( reference generator on)
ADC10ON = 1            ( ADC10 on)
ADC10IE = 1            (ADC10 interrupt enable)

Control register ADC10CTL1 is set as follows
INCH_4 = 0100 selects A4 as the highest channel for a sequence of inputs.
SHS_3 = 11        sample and hold source select, TimerA.OUT2
CONSEQ_3 = 11 repeat sequence of channels

ADC10DTC0 data control register 0
ADC10DTC0 = ADC10CT; continuous transfer, data is transferred continuously.
DTC operation is stopped only if ADC10CT cleared, or ADC10SA is written to.

ADC10DTC1 data control register 1
The bits in this register define the number of transfers in each block.
ADC10DTC1 = 4; 4 transfers in each block

These bits are the start address for the DTC
ADC10SA = (unsigned int)AdcData; start address of the ADC data array.

Reset ENC to 1 to enable a conversion.


The op-amps are configured as unity gain buffers, circuit diagram shown in figure 31.
Figure 31: Unity Gain Buffer

OAxCTL1 register controls the configuration of the op-amps, ( x selects op-amp)

OAxCTL1 = OAFC_1 ; OAFC bits 4 to 2 = 001, unity gain buffer mode.

OAxCTL0 register controls the inputs and outputs to the op-amps

Noel Walsh                              Page 52                           29/03/2012
OAxCTL0, OAN bits selects the inverting inputs, OAP bits select the non-inverting
input, OAADC bits select the output.

ADC interrupt service routine

The interrupt service routine executes when the interrupt flag is set and a valid
reading is on the ADC input channel. This task reads in the various voltage and
current levels from the charging circuit, it then compares these reading to the required
operating conditions for the charging process. If it is determined that these reading are
not in the required operating range, the duty of the PWM output signal is either
increase or decreased. The CCR1 register is used to set the duty cycle of the PWM
signal, this is a 16 bit register, the code CCR1++ and CCR1—increases or decreases
the value in this register, adjusting the PWM signal.


Timer_A is set up in the main function of the firmware, the capture/compare control
registers CCTL1 sets up the output mode for the CCR1 register.

CCTL1 = OUTMOD_7 = bits 7 to 5, =111, mode equals Reset/set. The output is reset
                                      when the timer counts to the TACCRx
                                      value. It is set when the timer counts to
                                      the TACCR0 value.

The Timer_A control register TACTL is set to.

TASSEL_2 = 10; selects SMCLK for the clock source
MC_1     = 01; Timer_A mode control counts up to CCR0.

The CCR0 register is used to set the period of the PWM signal, the timer counts up to
the value in this register and then resets to begin another cycle, the time during this
period that the output is high is set by the CCR1 value. When the value in the CCR0
register is less than the value in the CCR1 register the output is high, once the CCR0
value is higher than CCR1 the output is low. The value in the CCR1 register is
adjusted during the ADC interrupt routine occur to the input voltage and current
readings to alter the duty cycle of the PWM signal.

The firmware for the battery was developed from an application note from the TI
website for charging lithium ion batteries.

Noel Walsh                              Page 53                              29/03/2012
Section 6: The Proposed system
The microcontroller is set up as discussed in section 4 The operation of the circuit is
to either control and monitor a charging cycle and also to select a power source for the

The microcontroller requires a 3.3 DC voltage level to enable its operation and this
power is supplied via the back-up battery, as the truck may not always be present to
power the micro. The 3.3V is achieved through a buck converter and the layout is
taken from a previous project developed by Blue Tee for the MSP430

The SEPIC function is to convert the DC voltage level from the trucks battery to the
required voltage/current to charge either of the batteries. Monitoring this process
requires the voltage and currents in the circuit to measured, but these levels in the
circuit are far to high for the micros ADC, therefore they are reduced through voltage
dividers to a maximum of 2.5volts, as the Vref for the ADC is a 2.5v.

Measuring the input voltage from the truck is read through the voltage divider
provided by R3 and R4. The maximum reading from these batteries is 28v (European
24v battery), although this can spike to 36v, therefore we will set the maximum
reading on the ADC ( 2.5v) to correspond to a voltage of 35v on the input from the
battery. The set-up for the voltage divider is shown in figure 32.

Figure 32: Voltage divider for input voltage



 To pin 8           2
 Of micro               R3
                    1                              L1


     Vdc                           C1

Noel Walsh                               Page 54                            29/03/2012
35/ 2.5 = 14 => ratio of R4/R3+R4 = 1/14 R3= 13k R4 = 1k

F27: Voltage Divide             Vout = Vin*R4/(R3+R4)
                                      = 35 * 1k/14k
                                      = 2.5

For Vin = 9 Vout = 0.64v
For Vin = 12 Vout = 0.86v
For Vin = 14 Vout = 1v
For Vin = 20 Vout = 1.43v
For Vin = 24 Vout = 1.71v
For Vin = 28 Vout = 2v

Reading the current through the SEPIC converter is achieve by the voltage developed
over the Rsense1 resistor, the value for the resistor is calculated by R = V/I, where V
is equal to 2.5 volts ( Vref 2.5) and I = peak current in the inductor = 2.4. The value
for the peak current is assumed as the circuit has not been tested. Set the max . current
reading to equal 2.5 => 2.5/2.5 = 1 ohm. This figure can determine the output current
from the SEPIC and depending on the speed of the micros ADC this may have to be
taken as an average, if the micro is fast, but if the micro is slow it will return an
average reading. The layout of this configuration is shown in the following circuit and
the R sense resistor is connected to the low side of inductor 2.


                               To pin 30
                               Of micro


Reading the output current from the battery is achieved with the resistor Rsense2, its
layout is shown in figure 33.

Noel Walsh                              Page 55                              29/03/2012
Figure 33: R sense to battery
        1       2

                                      Back-up Battery

                       To pin 29
                       Of micro

This sense resistor is just set up to read the maximum output capacity of the 2Ahr Li-
Poly battery, its value is calculated with ohms law.
F28: Ohms Law                R = V/I
                                = 2.5/2 = 1.25

From this reading the current output from the battery can be measured, which in turn
can determine how much capacity is left in the battery.

The output voltage from the SEPIC is determined by the voltage divider formed by
the resistors R1 and R2, this reading must compensate for the sense resistor Rsense2
and also the voltage ripple of the output. The maximum reading of the ripple voltage
is 5% of 14.9volts = 0.745v. Therefore the maximum reading of Vout equals,
                       Vout = 14.9 + (Ibat * Rsense2) + 0.745
                            = 14.9 + (2 * 1.25) + 0.745
                            = 18.145v
Set the maximum voltage reading to equal 20volts. 20/2.5 = 8 ratio of R2/R1+R2 = 8,
R1 = 1k and R2 = 7k. The circuit diagram is shown in figure…
Figure 34: Vout SEPIC


       To pin 10
       Of micro                      2


                    C2                    7k       D3
                    1u                             D1N4148


Noel Walsh                             Page 56                            29/03/2012
Switching between the trucks or the back-up battery is accomplished with two N-
channel MOSFETS connected to pins 17 and 18 of the micro. Pin 17 is Timer B
output 0 and controls the MOSFET that is connected to the back-up battery. Pin 18
Timer B output 1 connects to the MOSFET to control the trucks battery. The
MOSFETS are manufactured by international rectifier product No. IRLML2402, they
are capable of been driven from the logic level 3.3volts and are rated for a continuous
drain current of 1.2amps and gate to source voltage of +/- 12volts.

The choice of the MOSFET SI4450DY proved to have some difficulties as this could
not be driven from the logic level output from the micro of 3.3volts. Although a driver
IC could be implemented to solve this problem most of these required a power source
of around 4.5v to 10volts. Therefore a logic level 3.3v power MOSFET with the same
operating characteristics was source, a possible solution to this problem is to use the
MOSFET STD12NF06L manufactured by STMICROELECT|RONICS, as this can be
driven from a 3.3v logic source.

Noel Walsh                             Page 57                             29/03/2012
The overall aim of the project was to design and build an intelligent back-up battery
charging system, although I was unable to build a complete system I do think the
design has come some way in making this task possible. The failure to actually test a
complete system was due to the majority of the time spent researching the
background. This process took quite some time as I was unfamiliar with a lot of the

Battery charging and the related algorithms proved difficult to finalise as some
information available on the internet did contradict other sources. A lot of data was
available for the sealed lead-acid battery from the manufacture, but this did give
various different methods for charging which had to be decided on. The manufacture
of the Li-poly battery WorleyParsons did not provide this information available over
the internet, and when I e-mailed them, they responded to say that the battery was an
old model and the data is no longer available. Therefore the charging characteristics
for the Li-Poly battery are taken as general characteristic for Li-Ploy batteries. Ben
has since e-mailed the manufacture to recommend a suitable replacement battery but
hasn’t received a response as yet.

Coming from an electronic and computing background I had no knowledge of power
electronics, as result I had no experience with DC to DC converters. Therefore I
began my introduction with a simple buck converter, after this was designed and
simulated I moved on to understanding the SEPIC. This converter is far more
complex than the buck converter and required a lot of research to understand its
operation. Selecting and sourcing the components for this circuit was also a long
process as the voltage and current ratings didn’t allow for many options. The SEPIC
was also simulated using Pspice to confirm its operation, and becoming familiar with
this software package also delayed the process.

Configuring the microcontroller proved to be a difficult task as it required a complete
knowledge of all the registers before any operation could take place.

As the project was unfinished it does provide a lot of further work to be completed.
Firstly a test plan should be designed to test the operation of the SEPIC and confirm it
can produce the needed voltage and current levels. Although it was simulated with
Pspice translating this to a physical circuit is not quite as simple, as component
tolerances or even an unforeseen design mistake may change its operating
characteristics. The firmware for the microcontroller must also be developed to
include the correct voltage and current levels, and also the JTAG and I2C interfaces.
Temperature measurements may also be included in the firmware. Research could
also be carried out to see if any other battery chemistries or safety measures could be
implemented in the circuit.

In general I do feel the project was a success as it has introduced me to many subjects
where I had no previous knowledge and hope that this will stand to me in the future. I
now understand that battery charging systems are not just simple circuits and require
quite some time to design, test and verify.

Noel Walsh                             Page 58                              29/03/2012


Battery Chemistries

Handbook Of Batteries third Edition David linden and Thomas B. Reddy

Sealed Lead Acid charge capacity voltages:

Sealed Lead Acid Charging Methods:
Manufacture Application Note:
Panasonic Sealed Lead-Acid Batteries technical Handbook 2000

Polymer lithium ion charging:

DC to DC converter:

Switch mode power supply

Excellent Design Guidelines from National Semiconductor in Application Note 1484

Battery charge methods and charge profiles

Pulse-width modulation

Noel Walsh                           Page 59                           29/03/2012
Download from Texas Instruments Website:

MSP430x2xx Datasheet
MSP430x2xx User Guide

Noel Walsh                         Page 60                          29/03/2012
Appendix 1 battery definitions

The anode of a cell during discharge is the negative electrode. During charge, the
anode is the positive electrode. The anode supplies electrons to the load.

C Rate

The C Rate is the batteries charge or discharge current expressed as a multiple of the
capacity. For example, if a battery has a capacity of 500 mAhr, a charge rate of 2C
would imply a charge current of 1 amp.


Capacity is measured in units of amp-hours and can be described as the discharge
necessary to reach the end voltage after one hour.


The Cathode of a cell during discharge is the positive electrode. During charge, the
cathode is the negative electrode. The cathode accepts electrons from the load.

Charge Acceptance

Charge Acceptance is the ability of a battery to accept charge by converting provided
electrical energy into stored chemical energy.


The basic element of each battery is the cell, the term battery often refers to several
cells being connected in series or in parallel, but sometimes also single cells are called

Cell Voltage

Cell voltage is the voltage potential between the anode and the cathode in each cell.
The voltage is determined by the active material in the cell, the cell voltage can also
be dependent on concentration and temperature.

Environmental Concerns

Environmental concerns classify batteries according to hazardous mental content.
Disposing of batteries should therefore be carries out with caution.


The Electrolyte conducts ions inside the cell between the anode and the cathode. The
electrolyte must be a good ionic conductor but not be electrically conductive, since

Noel Walsh                              Page 61                               29/03/2012
this would cause short circuiting. Most electrolytes are liquids, although some are

Memory Effect

Memory Effect is a temporary failure of a battery due to repeated incomplete
discharge. This causes the battery to lose capacity. Capacity can be restored by a few
repeated cycles of full discharge and charge.

Self Discharge

Self Discharge is the loss of charge of an unloaded cell due to internal chemical

Service Life

The Service Life of a secondary battery is defined as the length of useful performance
in years, called floating life, or the number of times it can be usefully charged and
discharged, called the cycle life.

Trickle Charge

Trickle Charge is a low charge rate used to maintain a battery in a full charged

Operating Temperature Range

Operating Temperature Range defines the temperature range where battery can
operate without risk of failure.

Internal Resistance

The Internal Resistance characterises the capability of the battery to handle a certain
load. It determines the batteries power output. Batteries capable of a high-rate
discharge must have a low internal resistance.

Energy Density

Energy Density relates the energy content of a given battery either to its weight or to
its volume. Weight related energy is given in units of Watt-hours\kg. The volume
related energy density is given in units of Watt-hours\cm^3.

Noel Walsh                             Page 62                             29/03/2012
Appendix 2 list of figures
Figure 1      Battery Structure
Figure 2      Polymer Liion all structure
Figure 3      Hard layout
Figure 4      Simply firmware flowchart
Figure 5      PWM waveforms
Figure 6      Scaled load acid battery
Figure 7      SLA Trickle Charge System Model
Figure 8      SLA Float Charge System Model
Figure 9      SLA Charging Algarithm Flowchart
Figure 10     Li-Poly charging profile
Figure 11     Li-Poly charge algorithm flowchart
Figure 12     SEPIC Circuit Diagram
Figure 13     SEPIC Circuit S1 on
Figure 14     SEPIC Circuit S1 off
Figure 15     SEPIC Waveform
Figure 16     Inductor Schematic Symbol
Figure 17     N-Channel MOSFET
Figure 18     Schematic Symbol Schottky Diode
Figure 19     Pspice SEPIC Circuit Diagram
Figure 20     SLA Vout @ 21 NDC
Figure 21     SLA Vout @ 12 VDC
Figure 22     Li-Poly Vout @ 12VDC
Figure 23     Li-Poly Vout @ L4DC
Figure 24     MSP430x2xx Architecture
Figure 25     MSP430 Hardware development tools
Figure 26     DCO Layout
Figure 27     DCOx range and RSELx steps
Figure 28     MSP430 part registers
Figure 29     Op-amp Modes
Figure 30     Firmware Flowchart
Figure 31     Unity gain buffer
Figure 32     Voltage divider from input voltage
Figure 33     R sense to battery
Figure 34     Vout SEPIC

Noel Walsh                  Page 63                29/03/2012
Appendix 3 list of formulas
F1           Average value PWM waveform
F2           Y Max maximum value
F3           Y min
F4           SLA Charge Time (charge I >0.25 CA)
F5           SLA Charge Time (charge I < 0.25 CA)
F6           SEPIC Average Voltages
F7           SEPIC Average Currents
F8           SEPIC Diode Current
F9           SEPIC Output Voltage
F10          Duty Cycle
F11          SEPIC Duty Cycle
F12          Inductor Current Ripple
F13          Inductance Value for Inductors
F14          L1 Peak Current
F15          L2 Peak Current
F16          SEPIC Switch Peak Current
F17          SEPIC RMS Current in Swithc
F18          SEPIC Diode Peak Reverse Voltage
F19          SEPIC Coupling Cap. RMS Current
F20          SEPIC Coupling Cap. Voltage Ripple
F21          SEPIC Output Capactor RMS Current
F22          SEPIC Output Capactor ESR
F23          SEPIC Output Capactor Capacitence
F24          SEPIC Input Capactor RMS Current
F25          SEPIC Iout m relation to Duty Cycle
F26          ADC conversion result in binary
F27          Voltage divider
F28          Ohms Law

Noel Walsh                        Page 64           29/03/2012
Appendix 4 list of tables
Table 1       SLA Constant Voltage Chargeing and Temp.
Table 2       SLA State of Chareg Figures
Table 3       SEPIC Operation Conditons
Table 4       MOSFEF Operating Conditins
Table 5       SLA Vout @ 24VDC input
Table 6       SLA Vout 12VDC
Table 7       Li-Poly Vout @ 12 VDC
Table 8       Li-Poly Vout 24VDC

Noel Walsh                  Page 65                      29/03/2012

Shared By: