Dt 1 Design Fall 2004

Embed Size (px)

Citation preview

  • 8/12/2019 Dt 1 Design Fall 2004

    1/64

    Smart Charger

    Project Design Report

    Design Team #1

    Claudiu Bouruc

    Eric Boyer

    Mike Petrak

    Steven Savage

    Dr. Tom T. Hartley

    November 23, 2004

  • 8/12/2019 Dt 1 Design Fall 2004

    2/64

    Table of Contents

    Table of Contents..iList of Figures..iiList of Tables..iiiList of Equations.....ivTable of Listings..vAbstract1Introduction..2

    Problem Definition: Goals, Objectives, Constraints..2

    Design Requirements.....3Alternative Designs..5

    Hardware Ideas..5System Control and A/D Conversion....5DC Power Supply Alternatives..9Software Ideas: User Feedback....11

    Accepted Technical Design...14DC Power Supply...16

    Microcontroller Power Supply19Voltage and Current Sensing......20System Control: Microcontroller-Based Approach....21

    Proportional Integral Control Algorithm.23Microcontroller Hardware Design Interface...25External A/D Converter...25RS-232 Serial Interface...27

    Pulse Width Modulation..27Liquid Crystal Display Interface.28Precision Temperature Sensing...29Infrared Remote Input.30

    PC Software Application31Battery Connector...44Overall Printed Circuit Board Design.44, 55, 56Final Product Design..45

    Parts List.46Testing Procedures: Validation and Verification...48Financial Budget50

    Team Labor Cost50Material Cost..50Team Funding.51

  • 8/12/2019 Dt 1 Design Fall 2004

    3/64

    List of Figures

    Figure 1 - Switching-type Power Supply Interfaced with a Microcontroller. 9Figure 2 - Linear DC Power Supply with Microcontroller Feedback. .10Figure 3 - Hybrid Switching and Linear Approach. .11Figure 4 - Entirely Microcontroller-based with Added External Memory. ..13Figure 5 - Smart Charger Overall Block Diagram. ...15Figure 6 - Switch-mode DC Power Supply Overview. .16Figure 7 - Switch-mode DC Power Supply Circuit Schematic. 16Figure 8 - Smoothed DC voltage from the rectifier...17

    Figure 9 - Microcontroller Power Supply Overview.19Figure 10 - 5V Voltage Regulator.19Figure 11 - Voltage Sensing Network Schematic. 20Figure 12 - Microchip MCP 607 Precision Operational Amplifier. .20Figure 13 - Current Sensing Network Schematic. 21Figure 14 - High Level Dataflow Diagram. ..22Figure 15 - Feedback Control Loop. .23Figure 16 - Main PI Routine. 24Figure 17 - 40-pin DIL PIC18F452 Package and Schematic25Figure 18 - AD7705 Interface Schematic. 26Figure 19 - Maxim RS-232 Serial Interface. 27Figure 20 - CrystalFontz 40x4 LCD with Backlighting in Operation. .28Figure 21 - LCD with Hitachi Controller Interface. .28Figure 22 - LCD Screen During Battery Charging Mode of Operation. ..28Figure 23 - LM34 Precision Temperature Sensor Package. .29

    Figure 24 - Sharp GP1UM28YK Operational Block Diagram. 30Figure 25 - System Use Case Diagram. 31Figure 26 - Overall Class Diagram. ..32Figure 27 - Charging sequence diagram. ..38Figure 28 - Charging process general state diagram. 39Figure 29 - Example Battery Holders. ..44Figure 30 - Finished Product Design. ...45Figure 31 - Breadboard for Testing During the Design Process49

    Figure 32 - Implementation Gantt Chart Timeline View. .53Figure A1 - Logic Control Board Schematic with Headers to Accessory Devices. .55Figure A2 - Preliminary System Control PCB Artwork. ..56

  • 8/12/2019 Dt 1 Design Fall 2004

    4/64

    List of Tables

    Table 1 - Microcontroller-based with Built-in A/D System Comparison5Table 2 - Microcontroller with External A/D Conversion System Comparison. ...6Table 3 - Successive Approximation Register Converter Comparison. .7Table 4 - Dual Slope Converter Comparison. .7Table 5 - Sigma - Delta Converter Comparison. 8Table 6 - FPGA-based Controller System Comparison. .8Table 7 - Entire Hardware Design with Discrete Components. ..8Table 8 - Switching-type Power Supply Comparison. 9

    Table 9 - Linear-type Power Supply Comparison. ...11Table 10 - Microcontroller with Custom PC Application. ...12Table 11 - Microcontroller-based with Added External Memory. ...13Table 12 - PC-Device Communication Packet Protocol. ..34Table 13 - Device to PC Error codes. ...34Table 14 - Implementation Parts List.46Table 15 - Estimated Labor Cost. .50Table 16 - Estimated Material Cost. .50Table 17 - Implementation Gantt Chart Tasks and Description. ..52Table A3 - Communication Protocol. ...57Table A4 - Device Error Codes. ...58

  • 8/12/2019 Dt 1 Design Fall 2004

    5/64

    List of Equations

    Equation 1 DC Voltage...17Equation 2 Ripple Factor for a Full-Wave Rectifier...17Equation 3 Smoothing Capacitor Value.....17Equation 4 Duty Ratio or Duty Cycle.18Equation 5 Minimum Inductance Value for Switch-Mode Power Supply.18Equation 6 Parameters to Construct the Inductor...18Equation 7 Minimum Filtering Capacitor Value19

  • 8/12/2019 Dt 1 Design Fall 2004

    6/64

    Table of Listings

    Listing 1 - Pseudo code to Communicate with the External ADC. ..26Listing 2 - PWM Signal Pseudo code27Listing 3 - LCD Pseudo code. ...29Listing 4 - Pseudo code to return Desired Temperature Reading. 29Listing 5 - Infrared Receiving Routines. ...30Listing 6 - Example of PSDeviceDriver setVoltage method. ...34Listing 7 - Building a Sample object from packet data. ...35Listing 8 - Pseudo code for data analysis voltage calculation. .37

    Listing 9 - Pseudo code for data analysis battery temperature first derivative..37Listing 10 - Lead acid fast charging algorithm. 40Listing 11 - Nickel Cadmium fast charging algorithm..41Listing 12 - Nickel metal hydride fast charging algorithm42Listing 13 - Lithium Ion fast charging algorithm..43

  • 8/12/2019 Dt 1 Design Fall 2004

    7/64

    Abstract

    With the increase of portable electrical devices, the amount of different types ofbatteries a person owns has greatly increased. In addition to different types, the need forlonger battery life has also increased, which led to the need for a universal batterycharger. The purpose of this project is to design and build a true universal batterycharger. This battery charger will charge various battery chemistries, including lead acid,nickel cadmium, nickel metal hydride, and lithium ion battery types. The charger willcharge a variety of battery sizes with various amp-hour capacities. With a PC, the projectwill give the user the control and feedback necessary to completely charge a battery

    without damaging it from overcharging. The project will also act as a variable switchingDC power supply using either voltage or current regulation capable of powering a varietyof DC loads.

    Features of the Smart Charger:

    A universal battery charger that can charge different sizes of batteries An intelligent and fast battery charging solution for multiple battery chemistries Report all feedback data of the charging process in an easy to interpret fashion Easy to use PC software Variable DC switching power supply Infrared remote control interface to the variable DC switching power supply

  • 8/12/2019 Dt 1 Design Fall 2004

    8/64

    Introduction

    Statement of Need The future of many portable electrical devicescellulartelephones, notebook computers, personal digital assistants, and still others to bedevelopedwill heavily depend upon the use of advanced battery technology. As batterytechnology improves, there is a growing need to give the user more control and feedbackduring the battery charging process while preventing battery damage due to overcharging.Current battery chargers offer little to no control over the charging process. Furthermore,overcharging is a common problem with the simple, inexpensive chargers found in manyconsumer electronics products.

    Problem Definition

    Goals:

    This project will address this need by developing an intelligent and fast batterycharging solution for multiple battery chemistries.

    This solution will improve the charging efficiency and battery life whilepreventing battery damage due to overcharging.

    Implement a DC power supply for the battery charging system that will workindependently of a PC.

    When interfaced to a PC, a software application will take control of the powersupply to implement an intelligent battery charging solution.

    Report all feedback data of the charging process in an easy to interpret fashion verifiable by a survey of potential battery charging solution users.

    Objectives: Output voltage in the range of 0 20 V with a 20 mV resolution. Output current in the range of 0 10 A with a 10 mA resolution. Provide a high level of feedback during the charging process within 20 mV and

    10 mA tolerances for error.

    Have a liquid crystal display (LCD) to provide user feedback this will allow theunit to function as a standalone DC power supply when disconnected from acomputer.

    Have a user friendly graphical interface compatible with Microsoft Windows todisplay the real-time visual feedback.

    Constraints:

    Charge the following types of modern batteries:Lithium Ion (Li On) Nickel Cadmium (NiCd) Nickel Metal Hydride (NiMH)

  • 8/12/2019 Dt 1 Design Fall 2004

    9/64

    Stay within the current budget of the Electrical and Computer EngineeringDepartment - $300.

    Design Requirements

    Output voltage in the range of 0 20 V with a 20 mV resolution.o After performing research on the commonly used rechargeable Li-On,

    NiCd, NiMH, and SLA battery chemistries, it was determined the0 20 V range would support nearly all rechargeable batteries used topower domestic and light industrial electronic equipment.

    o The 20 mV resolution was selected as a reasonable objective mainly dueto the 10 bit analog-to-digital (A/D) hardware built into commonly

    available microcontrollers ( mVVolts

    202

    2010

    ). An accurate and efficient

    charging process and high level feedback depend upon the highestresolution attainable. This resolution must be fine enough to providesupport for charging algorithms that detect subtle voltage changes during

    the charging cycle, yet not so fine that the voltage feedback level ofprecision becomes irrelevant. In addition, a much higher resolution willunnecessarily overburden the hardware and software resources required toimplement the design and will introduce much electrical noise into thesystem. This will be further explored in the Alternative Design section.

    Output current in the range of 0 10 A with a 10 mA resolution.o Research on commonly used rechargeable batteries reveals the currents

    required to fast charge the battery at the 1 C rate1lie within this range

    (fast charging is a charging rate of greater than 0.5C). Too low of a currentrange will not allow fast charging of high capacity batteries, while toohigh a current range will introduce unnecessary design complexity thatwould not be commensurate with the size and type of batteries intendedfor this project.

    o The 10 mA resolution was also determined by considering the 10 bit A/Dhardware embedded in commonly available microcontrollers

    ( mA

    Amps

    102

    1010 ). This is a reasonable estimate to produce a high level

    feedback of the charging current.

    Provide a high level of feedback during the charging process within 20 mV and 10 mA tolerances for error.

    o The intelligent charging system will report the real-time feedback ofpercentage charge time to charge elapsed time while charging voltage

  • 8/12/2019 Dt 1 Design Fall 2004

    10/64

    current, and power during the charging process2. This feedback will bewithin the specified resolution for voltage and current.

    Have a user friendly graphical interface compatible with Microsoft Windows todisplay the real-time visual feedback.o This custom PC application allows the user to select the desired battery

    chemistry and control the charging process. In addition, the user willreceive graphical feedback of the charging process, as mentioned in theprevious objective.

    Have a liquid crystal display (LCD) to provide user feedback this will allow theunit to function as a standalone DC power supply when disconnected from a

    computer.o The LCD will display a text-only user menu selection-type interface.

    The user will be allowed to select the constant voltage- orconstant-current mode of operation. The voltage selection must bewithin the specified limits of 0-20 V and the current selectionwithin the specified limits of 0 10 A.

    When functioning as a DC power supply, the LCD will display theconstant voltage or constant current value.

    This display will also alert the user of any error conditions detectedduring the charging process or when functioning solely as a DCpower supply.

    Implement an infrared remote control interface to allow user interaction with thepower supply while in stand alone mode.

    o An infrared transmitter, combined with the LCD display form acomprehensive user interface.

    o Remote operation allows more freedom in the physical placement of thepower supply.

  • 8/12/2019 Dt 1 Design Fall 2004

    11/64

    Alternative Designs Hardware Ideas

    The alternative design analysis below considers system-level and component-levelalternative designs for both the hardware and software parts of the system. The purposeof this investigation of the advantages and disadvantages of possible alternative designs isto lead to the accepted technical design which will best meet the stated goals, objectives,and constraints. Each alternative includes a brief summary, a table comparison of theadvantages and disadvantages, and a functional diagram, where appropriate. One definiteadvantage in all alternative designs is the designers familiarity with a particularhardware component or software tool. On the other hand, a lack of familiarity with a

    certain hardware component or software tool leads to an important disadvantage to beconsidered. This being said, it is also important not to bias ones decisions on stayingcomfortable and limiting ones selection to only what is familiar. The design teamshould choose the hardware and software tools that are best suited for the application.

    1. System Control and A/D ConversionTo implement a fast-charge algorithm without damaging a battery, the charging

    process must be tightly monitored and controlled. The monitoring system is dependent on

    accurate feedback of the analog voltage and current signals. In order to process thisanalog signal with a digital device, such as a microcontroller or FPGA, an analog-to-digital converter (ADC) is needed. The amount of resolution is a critical decision to thesuccess of this system.

    1a. Entirely Microcontroller-based with Built-in A/D Conversion.To control the DC power supply and report feedback to the user via the LCD

    display and custom PC application, one possible design uses the built-in analog to digitalresources of the microcontroller. This design lowers overall system cost by reducing thenumber of external components. For a scale voltage of 0-20 V, the internal 10-bitconverter will only allow for 20 mV resolution. This is far from ideal when chargingbatteries where the end of charge trigger condition may be dependent on small changes interminal voltage. To overcome this, the sampling rate could be modified or A/Dconversion for different voltage ranges could be spread over two or more (of the eightavailable) analog channels. This design is explored in Table 1.

    Table 1. Microcontroller-based with Built-in A/D System Comparison.

    Advantages Disadvantages

    1. Integrated control and ADC.2. Minimal assembly required.3. Only one component to troubleshoot.

    1. A real-time design may be moredifficult to implement.

    2. Much emphasis on software control of

  • 8/12/2019 Dt 1 Design Fall 2004

    12/64

    1b. Microcontroller with External A/D conversion.

    Instead of using the onboard 10-bit ADC with the microcontroller, consider anexternal converter that will support a higher resolution. External ADCs are commonlyavailable in the 12 to 17-bit range of resolutions. This improves the resolution toapproximately 5 mV to .2 mV for the given 0-20 V range. A 16-bit (15-bit + 1 sign bit)external A/D converter provides approximately a .6 mV resolution, which is sufficient forthis system and much better than the 20 mV resolution. Too high of a resolution, such as0.2 mV, is unnecessary as the output could easily become indistinguishable from noise.

    Since the PWM used to control the MOSFET is set at 10 bits of resolution, this

    alternative can take advantage of the coarse built-in ADC with a fast sample frequency asfeedback to control the PWM, while the fine external ADC can be used at a slowersampling frequency to control the charging algorithm. This alternative is considered inTable 2.

    Table 2. Microcontroller with External A/D Conversion System Comparison.

    Advantages Disadvantages

    1. Much higher resolution: a 16-bitexternal ADC (including a sign bit) willprovide about a .6 mV resolution.

    2. The design is more modular thismakes troubleshooting easier.

    3. The coarse (10-bit) built-in ADC canbe used for other purposes, such asfeedback to control the PWM at a fastsampling frequency.

    1. More components to implement, test,and debug.

    2. Higher cost.3. Lack of student experience with

    external A/D converters; this may notbe a major issue since the digital signalwill simply be sent to themicrocontroller.

    Types of External A/D Converters:

    When discussing the alternative of using an external ADC, it is useful to compareand contrast the various types available, namely: Successive Approximation Register,Dual Slope, and Sigma-Delta.

    1b (i) Successive Approximation Register converters.Successive approximation register (SAR) converters use a single comparator tocompare the voltage being measured with a reference voltage produced by an internaldigital to analog converter (DAC). The comparison is performed in successive operationin which a single bit of the representation is resolved during each comparison operation.A comparison of the SAR converter is shown in Table 3.

  • 8/12/2019 Dt 1 Design Fall 2004

    13/64

    Table 3. Successive Approximation Register Converter Comparison.

    Representative Device: Advantages: Disadvantages:

    MicroChip MCP3301 8-pin DIP singlechannel

    Same type as the 10-bitADC built into the18F452 microcontroller

    Up to 100k conversionsper second

    High sample frequency Most common type ofconverter

    Low(er) resolution;maximum of 13 bits May be subject to

    excessive error in noisyenvironments

    1b (ii) Dual Slope converters.Dual slope converters utilize integration and de-integration components to

    determine the output. After a pre-sample initialization, the input is fed to an integrator.The output of the integrator is a ramp with a slope proportional to the input voltage, andperformed for a fixed period of time. Immediately following the integration period aprecision timer is started and a de-integration is performed using a known internalvoltage reference. The sampled voltage can then be determined with a mathematicalformula based on the reference voltage value and the time required to de-integrate. Acomparison of the Dual Slope converter is shown in Table 4.

    Table 4. Dual Slope Converter Comparison.

    Representative Device: Advantages: Disadvantages:

    Microchip TC500 16 pin DIP package

    An inherent benefit isnoise immunity. Input

    noise spikes areintegrated (averaged tozero) during theintegration periods.Integrating ADCs areimmune to the largeconversion errors thatplague successive

    approximationconverters in high noiseenvironments.

    3

    High precision; up to 17bits plus the sign bit.

    Front End only,performs the

    integration, de-integration andcomparison. Externaltiming of the de-integration processdetermines themeasured voltage.

    Requires external,

    specializedpolypropylenecapacitors and otherexternal componentssized to a particularapplication

  • 8/12/2019 Dt 1 Design Fall 2004

    14/64

    1b (iii) Sigma - Delta converters.Sigma - Delta converters perform a series of fast, low-resolution samples that are

    summed and averaged with a digital filter. A comparison of the Sigma Delta converteris shown in Table 5.

    Table 5. Sigma - Delta Converter Comparison.

    Representative Device: Advantages: Disadvantages:

    MicroChip TC3400- 16bit (15 bit and sign bit)

    8 pin DIP single channel

    High resolution(effective 15 bit)

    microPort 2 wire

    serial interface

    sample frequency 8conversions per second

    2. Alternatives to the Microcontroller-Based Designs

    2a. FPGA-based Controller.Instead of using a microcontroller to primarily control the system, a Field

    Programmable Gate Array (FPGA) is another possible solution. This possibility, which isexplored in courses such as Programmable Logic, is explored in Table 6.

    Table 6. FPGA-based Controller System Comparison.

    Advantages Disadvantages

    1. Low cost.2. Utilizes knowledge and experience

    gained in Switching and Logic andProgrammable Logic courses.

    1. Software design and VHDLimplementation require much time andeffort.

    2. Debugging with simulation and system

    verification may become too difficultbased on the students lack of expertise.3. External A/D conversion is required.

    2b. Entire Hardware Design with Discrete Components.Instead of using a microcontroller or FPGA, the entire design can be implemented

    in hardware with discrete components. In the place of a microcontroller, a control circuitis used with a LM3524. It contains a voltage reference, oscillator, pulse width modulator,

    error amplifier, current sense amplifier, flip-flop, and driving circuitry. It will sense theoutput voltage and current levels and control the power transistors. The control circuitwill contain capacitors and resistors to implement a Proportional Integral (PI) controlloop. Some of the advantages and disadvantages of this alternative design are presentedin the Table 7.

  • 8/12/2019 Dt 1 Design Fall 2004

    15/64

    This design has a quick response and is inexpensive to implement. However,

    since the main objective is to charge batteries, this design is not practical. When chargingbatteries, the process is slow and the fast response of the LM3524 may be unnecessary.

    3. DC Power Supply Alternatives

    3a. Switching-type Power Supply.There is a number of switching power supply designs including boost, buck, and

    phase-controlled types, among others. Our design focuses primarily on the direct connect

    buck type switching converter. This type of DC power supply rectifies and filters theincoming AC voltage to produce a high-voltage DC signal. It uses a power MOSFET orbipolar transistor connected in series with an inductor. The MOSFET acts as an on-offswitch and cycles at a set frequency, typically in the range of 30-150 kHz. While theMOSFET is conducting, the magnetic field in the inductor increases. When theMOSFET is switched off, the built up magnetic field collapses causing current tocontinue to flow to the load. The average DC voltage supplied to the load is dependentupon the duty cycle, or the on-vs.-off time of the switching element. This timing is

    typically controlled by a pulse width modulator (PWM). By sampling output parameters,such as Voutand Iload,the PWM period can be varied dynamically to produce a desiredoutput. A block diagram of a switching power supply is shown in Figure 1.

    Figure 1. Switching-type Power Supply Interfaced with a Microcontroller.

    A switching-type supply comparison appears in Table 8.

    Table 8. Switching-type Power Supply Comparison.

    Advantages Disadvantages*

    Unregulated DCpower supply

    Output

    SamplingCircuit

    Error

    Amplifier VoltageReference

    PWMOSC

    Switching

    ElementEnergyStorage

    (Inductor)

  • 8/12/2019 Dt 1 Design Fall 2004

    16/64

    *Note: Early switching-type power supplies included the disadvantages of reducedreliability and radiated electromagnetic interference (EMI) due to the discrete

    components used to control the pulse width and the transistors used as switchcomponents. Modern advances in PWM circuits and the use of MOSFETs havesignificantly decreased these disadvantages.

    3b. Linear-type Power Supply.A linear-type DC power supply takes the incoming AC voltage and steps it down to a

    lower AC voltage. This voltage is then rectified through a full-wave bridge rectifier andfiltered. The output is then passed to the load via a power transistor that is used to control

    the output to the load. This transistor is controlled by a circuit that senses the output andmodifies the transistor bias voltage in order to maintain the desired output. The common7805 integrated circuit is a three terminal device with terminals for input, ground, andoutput that effectively combines a power transistor and feedback sensing loop into asingle device.

    A linear power supply can be interfaced with a microcontroller by coupling themicrocontroller to a power bipolar transistor or power FET (field effect transistor) thatacts as the linear regulating device. The bipolar device is current controlled, and the field

    effect device is voltage controlled. Some specialty microcontrollers have built in DACs,but this is more common with PSoc (Programmable system on chip) mixed signal arraydevices. External DA converters are commonly available that interface to amicrocontroller via a synchronous serial port (I2C, SPI, Dallas one wire, etc) or parallelport. A high-level diagram of this interface is shown in Figure 2.

    LinearControl

    Element

    Unregulated DCpower supply

    Figure 2. Linear DC Power Supply with Microcontroller Feedback.

    The linear supply system comparison is shown in Table 9

    Output

    SamplingCircuit

    ErrorVoltageAmplifier

    Reference

  • 8/12/2019 Dt 1 Design Fall 2004

    17/64

    Table 9. Linear-type Power Supply Comparison.

    Advantages Disadvantages

    1. Easy to design.2. Inexpensive.3. Relatively free of noise and EMI.4. Superior regulation performance with

    minimal ripple.

    1. Low efficiency: typically 50% or less.The power loss is mostly in the form ofheat dissipated by the power transistor.This heat must be dissipated by somemeans, and may necessitate the use ofheat sinks, fans, or some other coolingmethod.

    2. Typically heavy and bulky due to the

    large transformers and other powercomponents needed compared to asimilar switching supply of the sameoutput power.

    3c. Hybrid Switching and Linear Approach.The final design could incorporate both the switching and linear-type power

    supplies. The switching power supply can be used to supply a coarsely regulated input to

    a final linear stage. This design attempts to leverage the advantages and minimize thedisadvantages of each type of regulation scheme by a combination of both. Theswitching supply provides high efficiency and an output that minimizes the voltage dropacross the linear section, which minimizes the continuous power dissipation of the linearsection. This hybrid approach is illustrated in Figure 3.

    LinearControlElement

    Figure 3. Hybrid Switching and Linear Approach.

    Alternative Designs Software Ideas

    1. User Feedback.

    Unregulated DC

    power supply

    SamplingCircuit

    Error

    Amplifier VoltageReference

    PWMOSC

    Switching

    ElementEnergyStorage

    (Inductor)

    SamplingCircuit

    ErrorOutputVoltageAmplifier

    Reference

  • 8/12/2019 Dt 1 Design Fall 2004

    18/64

    power during the charging process. The big advantage of using a PC application is theenormous amount of processing power and hard drive space provided on modern PCs

    this can be used to display rich graphical data plots and even log the charging process forfurther engineering study. The PC is also capable of processing high precision floatingpoint numbers that are generally beyond the capabilities of a microcontroller and canonly be implemented in slow software algorithms (i.e. the microcontroller has nohardware floating point unit). For example, some complex charging algorithms requirefirst and second derivative voltage computations. Percent charge information mayrequire a numeric integration computation. The complex instruction set microprocessorin modern PCs, combined with the extensive mathematic libraries accessible by high

    level languages forms a highly capable platform to implement even the most complexalgorithms. The PC is the tool to implement Smart in the Smart Charger design. Thissolution is considered in Table 10.

    Table 10. Microcontroller with Custom PC Application.

    Advantages Disadvantages

    1. Can display numerical data and richgraphical data plots of the charging

    process.2. Much processing power for

    computationally intensive algorithms.3. Plotting and storage capability for data

    logging.4. Gives the average user and the

    experienced engineer a robust tool formonitoring and analyzing purposes.This allows the product to be used in anindustrial setting as well.

    1. Requires a computer and an appropriatesoftware and interface.

    1b. Entirely Microcontroller-based with Added External Memory.This alternative was based on todays need for portability. For that reason, a

    microcontroller with added external memory could be used to store all the softwareneeded for charging batteries and displaying pertinent data. The microcontroller should

    be smart enough to know what software to load from the memory depending on the typeof battery needed to be charged, or depending on the input of the user. The capability ofhooking this assembly to a computer is still present for various purposes likereprogramming the microcontroller, or adding new software to the external memory.Given the fact that the unit can be built professionally in a very small size, this could be avery compact independent battery charger, or a variable power supply, as needed. A

  • 8/12/2019 Dt 1 Design Fall 2004

    19/64

    Figure 4. Entirely Microcontroller-based with Added External Memory.

    PIC

    Microcontroller

    External Memory

    UnregulatedDC powersupply

    SwitchingElement

    PWMLC FilterNetwork

    EMI Filter

    LCD Display

    Current Sensing

    Temperature probes Temperature Sensing

    Voltage Sensing

    DC output

    Infrared Remote

    PC Workstation

    Some of the advantages and disadvantages of this alternative design are presented in theTable 11:

    Table 11. Microcontroller-based with Added External Memory.Advantages Disadvantages

    1. Very compact unit that could be easilycarried anywhere.

    2. Same battery charging capabilities asthe unit connected to a computer

    3. Focuses the design on themicrocontroller.

    4. No need to develop a custom PCapplication.

    1. An alphanumeric LCD could notdisplay graphical data plots of thecharging process.

    2. A more robust display would be muchmore difficult to program and debug.

    3. Limited processing power (compared toa PC) for numerical data manipulationand severely limited storage capabilityand data logging.

    4. Overall programming and debuggingeffort would become quite complex.

  • 8/12/2019 Dt 1 Design Fall 2004

    20/64

    Accepted Technical Design: High-Level

    After performing a detailed alternative design analysis, the Smart Charger group hasdecided to design the battery charging system using a microcontroller, an externalanalog-to-digital converter, a switch-mode power supply, and an LCD and custom PCapplication for high-level user feedback. In the process, the group extracted a clearerunderstanding of the problem definition and how to meet this definition in an actualtechnical design. As the core of the Smart Charger design, this section will discuss allhardware and software components of the accepted technical design and is a major steptowards successfully implementing the design in the spring semester.

    A good initial understanding of the design can be obtained by carefully examiningthe overall high-level block diagram shown in Figure 5 on the following page. In order toprevent the propagation of electrical noise from the switch-mode power supply to theintegrated logic control components, the system is divided into two boards: a powerelectronics board and a system control board. As the core source of power to the battery,the design will begin with the switch-mode power supply, proceed to the logic controlcircuitry, and finally progress to the custom PC application design. The resulting detailedhardware design will combine the system components into a full schematic illustrating

    the interfaces between the components

  • 8/12/2019 Dt 1 Design Fall 2004

    21/64

    120V AC

    DC output

    Figure 5. Smart Charger Overall Block Diagram.

    Control Board

    PC Workstation

    PIC Microcontroller

    Step-downtransformer

    SwitchingElement

    LCD Display

    IR Detector

    +5V GND

    Temperature probes(ambient, battery)

    External A/DSPI PWM

    A/D

    IR Remote

    Power Board5 VoltRegulator

    Rectifier,Filter

    Inductor

    CatchDiode

    Filter

    CurrentSense

    Voltage and CurrentSense, Scaling

    Load

    Step-downtransformer,Rectifier,Filter

    RS 232 Level Converter

    15

  • 8/12/2019 Dt 1 Design Fall 2004

    22/64

    DC Power SupplyThe core of the Smart Charger design is the DC power supply. This power supply

    must operate in a constant voltage or constant current mode. With these two modes, thepower supply can recharge most common types of batteries using the correct algorithms.From the knowledge gained through the Alternative Design Analysis process, the powersupply will be a switching type. A switching power supply will allow for high efficiency,about 80 90 %, and high reliability. A switching power supply will also be smaller andlighter than a linear type. The switching power supply will have two converters: anuncontrolled full-wave bridge rectifier to obtain an unregulated DC voltage that will befed into a buck converter to get the desired output. With the two converters, a range of 0

    to 20V could be obtained at the output, which should be enough to charge most batteries.An overview of this supply is shown in Figure 6.

    Figure 6. Switch-mode DC Power Supply Overview.

    A detailed view of the power supply is shown in Figure 7. The unregulated DC comesfrom a full wave bridge converter. The switching element is a power MOSFET and theenergy storage element is an inductor. All these parts are explained below.

    Unregulated DCpower supply

    Load:batterySamplingCircuit:

    Vdiff, IdrainPWM

    Switching

    OSC

    ElementEnergy Storage

    (Inductor)

    to microcontroller

  • 8/12/2019 Dt 1 Design Fall 2004

    23/64

  • 8/12/2019 Dt 1 Design Fall 2004

    24/64

    capacitor, the better, since an increased level of smoothing of the input voltage will resultin a nearly constant DC input voltage.

    The buck converter will decrease the input voltage to the desired value by turning aswitch on and off. In order to control the supply, the microcontroller will dynamicallysend a PWM signal to the gate of an n-channel power MOSFET. When the MOSFET isturned on the diode will not work since it is reversed bias, and the inductor will begin tostore energy. When the transistor switches off, the diode becomes conductive, and theinductor releases energy to the load, and then the cycle repeats. The purpose of this diodeis to direct current flow in the circuit and to ensure that there is always a path for thecurrent to flow into the inductor. The Schottky diode was chosen because of the very fast

    switching times that the diode is capable of, and also the low forward-voltage drop givenby its construction (a metal-semiconductor barrier, rather than a semiconductor-semiconductor barrier found in most of the other diodes). To determine the voltage, thePWM will have a duty ratio or duty cycle given by Equation 4.

    DV

    V

    IN

    O = Equation 4

    The duty cycle D will change depending on the desired output voltage V0.An inductor is also used in the buck converter to store energy when the switch is

    on and to supply energy when the switch is turned off. Equation 5 was used to determinethe required minimum inductance value:

    TRD

    Lcrit *

    2

    1= Equation 5

    In this equation D is the duty cycle, T is the period and R is the maximum resistance. Fora PWM switching at a frequency of 32 kHz, the period T is 31.25s and the maximumresistance R is 2. For the minimum duty cycle, the largest critical inductor value iscalculated to be 31.25H. Since the value of the needed inductor is known, the followingformula can be used to determine how to properly build it:

    l

    ANL

    2

    = Equation 6

    Here, N is the number of turns,is the permeability of the core material,Ais the area ofthe coil, and lis the average length of the coil. Given a regular size core with an area of

  • 8/12/2019 Dt 1 Design Fall 2004

    25/64

    ILf

    DC

    =

    )8(

    12

    Equation 7

    L is the inductance and is the frequency at which the PWM operates. Given the

    desired ripple

    f

    I as 0.1, the minimum filtering capacitor value is 40.96 .F

    Microcontroller Power Supply

    The microcontroller is the brain of the design. It requires a constant 5V input that hasto be as clean as possible, meaning that it is desired to have as small ripple voltage aspossible. Since the current requirements are rather small (less than 1A), it was proposedthat a commercial transformer will be used to power up the microcontroller. This willensure the proper voltage will be supplied at all times, making the overall project morereliable. Figure 9 shows a general schematic of the power supplies:

    Figure 9. Microcontroller Power Supply Overview

    The schematic in Figure 10 shows the basic construction of the 5V supply. It is based on

    the inexpensive 7805 voltage regulator.

  • 8/12/2019 Dt 1 Design Fall 2004

    26/64

    Voltage and Current SensingIn order to accurately and efficiently charge a battery and deliver feedback to the

    user, voltage and current sensing networks must be built into the switch-mode powersupply circuitry. To monitor the voltage across the battery, the 0-20 V output will bescaled using two precision resistors. The voltage output will be sent to Channel 0 on theinternal PIC ADC to control the PWM for the battery charging algorithm and thestandalone power supply modes of operation. This signal will also be sent to Channel 1on the external ADC. This signal will be for the high-precision feedback to themicrocontroller and PC for user feedback purposes. The voltage sensing network in thecontext of the power supply circuitry is shown in Figure 11. As can be seen from this

    schematic, a simple voltage-divider branch will scale the outputs to achieve compatibilitywith the PIC ADC and external ADC input voltage requirements.

    Figure 11. Voltage Sensing Network Schematic.

    These signals will be isolated from the power supply circuitry using a voltage followeroperational amplifier stage. The purpose of this is to prevent an over voltage condition onthe ADC pins and to isolate the ADC input impedance requirements from the rest of thecircuit. For this application, the Microchip MCP 607 op-amps were chosen because of

    their precision low power operation and rail-to-rail output swing capability. Thesedevices, which are shown in Figure 12, are available in dual packages, which will reservean additional op-amps for the current sensing network.

  • 8/12/2019 Dt 1 Design Fall 2004

    27/64

    In order to sense the current flowing through the battery, a low-side current sensingnetwork will be used. Low-side current monitoring consists of measuring the voltageacross a small current sense resistor connected in series with the ground path and dividingby the known value of the sense resistor. This technique is illustrated in Figure 13. Sincethe voltage measured across this 0.01 resistor is small, it is amplified before being sentto the two A/D converters.

    Figure 13. Current Sensing Network Schematic.

    System Control: Microcontroller-Based ApproachAfter evaluating the options for system control, the embedded microcontroller-based

    approach was determined to be the most suitable alternative for this smart design. Asthe core controller, the integrated microcontroller will serve many purposes:implementing the proportional integral (PI) control loop to change the voltage or current

    output, processing the serial digital voltage and current sensing signals from the externalADC, processing the temperature sensor feedback signals, transmitting these sensingsignals to the PC application via the RS-232 serial interface, processing the infrared-remote input, and driving the LCD for user feedback. This overview is illustrated in thehigh-level block diagram of Figure 14.

    Start

  • 8/12/2019 Dt 1 Design Fall 2004

    28/64

    Initialize SystemInit PIC, ADC, LCD and PWM=0

    Wait for Command

    From the computer or IR (polling)

    CommandReceived

    No

    Yes

    Parse Command

    Source

    IR remote

    Output Defaults

    Parse command

    1. Mode2. Set point

    PISet the PWM

    Computer

  • 8/12/2019 Dt 1 Design Fall 2004

    29/64

    Proportional Integral Control AlgorithmA very important part of this design is developing a control algorithm that will

    accurately modify the output voltage or current in response to an input voltage or currentsetpoint. Most algorithms for charging batteries require different charging stages thatoutput a certain amount of current depending on the stage in the charging process.Control is also vital to the DC power supply mode of operation, for if a user decides tochange the voltage from 5 to 10 V, or the current from 2 to 3 A, for example, the systemmust respond to perform this change.

    To accomplish this control, the design will use a simplified form of the well-knownProportional, Integral and Derivative (PID) technique that is used to control many

    continuous processes in a feedback system. This control algorithm consists of a simpleproportional gain (KP) that is multiplied by the present error, an integral term that looks atthe sum of past errors and has an integral gain (KI), and a derivative term that works onthe present and past error to forecast a future response of the system. The derivative termis useful in situations where the time response to reach the setpoint is required to besmall. Since this application does not require fast changes in the system output, thegroup was advised that Proportional, Integral, or PI, control would be sufficient.

    A basic feedback control loop for this system is shown in Figure 15. In this figure,

    Figure 15. Feedback Control Loop.

    the userthe computer charging algorithm or DC power supply usersignals a desiredcurrent or voltage setpoint. This is the value that the system will drive towards. Thedifference in the desired setpoint and current system output is calculated and is called theerror. The PI Controller will take this error and attempt to correct it by modifying thed i f h PWM i l h l i b d Th l h i l

    setpoint + error

    (t)(PWMduty ratio)

    systemoutputPI

    ControllerPlant

    Feedback

    -

  • 8/12/2019 Dt 1 Design Fall 2004

    30/64

    The proportional term is the proportional gain multiplied by the error. The amount ofcorrection necessary is directly proportional to this error, hence the term proportional.Proportional control alone will drive the error to a small value, leaving a steady-stateerror. The integral control is used to determine the sum of all past errors at fixed timeintervals. The actual constants themselves must be tuned along with the plantsimplementation, and this will be done in the spring semester. For now, the main PIcontrol routine will be implemented based on the design shown in the flowchart in Figure16.

    error

    error = 0?YES

    PI action notnrequired, retur

    NO

    Calculateal termProportion

    KP* error

    Calculate

    m

    KI* Proportional

    Integral ter Term

    Proportional +Integral

    Figure 16. Main PI Routine.

    To perform the system control functions mentioned above the Microchip

    PI Output: sentto plant

  • 8/12/2019 Dt 1 Design Fall 2004

    31/64

    including all connected design accessoriesand proceed to the detailed software desigGiven that the microcontroller design is primarily implemented in software, the softwaredesign portion will include the function, input/output description, data flow charts, andpseudo code procedural definitions of each of the stated control functions.

    n.

    icrocontroller Hardware Design Interface

    The 40-pin Dual In Line PIC18F452 and 8 MHz clock oscillator that will be used as

    M

    input to pins 13 and 14 is shown in Figure 17. The microcontroller will actually operateat 32 MHz by setting a 4x phase lock loop multiplier.

    Figure 17. 40-pin DIL PIC18F452 Package andS

    Pin 17 will be used as output for the PWM signal (through a logic board to power supply

    xternal Analog-to-Digital Converterlearly revealed that the high-quality feedback

    chematic (including the 8 MHz clock oscillator).

    board header), input / output (I/O) pins 18, 23, and 24 for the SPI communication to theexternal ADC, I/O pins 25 and 26 for the Maxim RS-232 interface, and output pins 19-21and 27-30 of PORTD for the liquid crystal display controller command and data bus. The

    final design will also include an LED for testing and verification purposes (although notshown to the user). Each of these subcomponents will be considered separately.

    E The Alternative Design Analysis c

    i d l h b h i l i h i i l f hi d i A l

  • 8/12/2019 Dt 1 Design Fall 2004

    32/64

    result, the Analog Devices AD7705 16-bit Sigma-Delta ADC was chosen. This deviceyields a resolution of 20V/2

    16= 0.305 mV over a 0-20 V design constraint. The AD7705

    features no missing codes, two fully-differential analog input channels, a differentialreference input, 4.75 V to 5.25 V operation, a three-wire Serial Peripheral Interface (SPI),and many more features. Particularly attractive is the high degree of compatibility withthe microcontroller: the flexible serial interface and SPI protocols are fully compatiblewith the PIC18F452 and the supply voltage range allows for the microcontroller andADC to be powered on the same system logic board

    For this battery monitoring application, one input channel will be used todifferentially measure the voltage across the battery. The other input channel will be used

    mto onitor the current to the battery. The AD7705 device and input / output schematic isshown in Figure 18. The external ADC will be placed on the system logic board which ispowered by the 5 V supply (VDD). This particular device requires a 2.4576 MHzoscillator as clock for MCLK, and communication is done on the (active low) data readyor DRDY signal. There will be a logic header attaching the ADC to the other integratedboard components.

    Figure 18. AD7705 Interface Schematic.

    To communicate troller, the pseudocode driver shown in Listing 1 will be imple ented. The embedded C pseudo codedisplay

    ) ; / / I ni t i al i zat i on rout i ne: conf i gures cl ock, chi p/ / sel ect , reset pi ns , del ay; cal l s

    / / St t A/ D

    with the external ADC from the microconm

    ed for all listings uses the actual functions and variables provided in the CCS Ccompiler.

    adc_i ni t (

    / / set up_adc_devi ce( ) t o set up t he/ / devi ce paramet ers

    i

  • 8/12/2019 Dt 1 Design Fall 2004

    33/64

    RS-232 Serial InterfaceThe bi-directional feedback between the microcontroller and PC application will be

    axim RS-232 serial interface. This device performs a levelmade possible via the Mconversion from the TTL level signals of the microcontroller to the RS-232 levels of thecomputer. This hardware interface is shown in Figure 19.

    Figure 19. Maxim RS-232 Serial Interface.

    The communicatio iscussed in Tables A3the Appendix.

    The Pulse Width Modulation (PWM) signal will be generated by the microcontrollerrent output of the DC power supply. A change in pulse width

    in

    set up capt ure compare modul e f or PWM;f r equency;

    I_i ni t ( ) ; / / I ni t i al i ze PWM t o zer o wi dt h

    n protocol and impromptu error codes are dand A4 inPulse Width Modulationto adjust the voltage or cur

    is itiated by either a change in the desired voltage or current from the infrared remote orfrom the PC charging application. This signal will be sent to the base of the powerMOSFET in order to perform this function. In order to isolate the system control boardfrom the power electronics board, the signal will be passed through an isolation buffer(TC1141N). The PWM signal will be sent on pin CCP1 (pin 17) and generated with thepseudo code shown in Listing 2:

    voi d pwm_i ni t ( ) {

    conf i gur e PWM}

    n the endl ess l oop, use:/ /

    wmp

  • 8/12/2019 Dt 1 Design Fall 2004

    34/64

    L(L

    iquid Crystal Display InterfaceA central component to the user feedback of this system is the liquid crystal display

    CD). The LCD will be used to display the load voltage, load current, and battery

    mperature (ambient, etc.) to the user during both the battery charging and theply modes of operation. For this design, the 40x4

    testandalone programmable power sup(40 columns x 4 rows) CrystalFontz alphanumeric LCD with the built-in Hitachi 44780controller and LED backlighting will be implemented for this important purpose. Themanufacturers sample picture of this LCD is shown in Figure 20 below.

    Figure 20. CrystalFontz 40x4 LCD with Backlighting in Operation.

    The LCD display and controller hardware interface is shown in Figure 21. Themicrocontroller will communicate with the LCD using a four-bit bus consisting of D00-D03a n wn in the

    gure are used for command / data, enable, and read / write signals, respectively.ibble mode operation. In addition, the RS, E, and R/W lines sho

    fi

    Figure 21. LCD with Hitachi Controller Interface.

    A sample screen during operation of the Smart Charger system is illustrated in Figure 22.

    M o d e : P C T e m p .

    V o l t a g e : 1 0 . 0 0 0 V B a t t e r y : 8 0 . 3 F

  • 8/12/2019 Dt 1 Design Fall 2004

    35/64

    The pseudl cd_ i ni t ( ) ; / / the di spl ay.

    cd_got oxy( l ef t - most col umn, t op r ow) ; / / posi t i on ( 1, 1)

    D.

    ct er on di spl ay

    D Pseudo code.

    PrecisiThe LM des a

    voltage output in linear propo ut of the device is 10mv perdegree Fahrenheit, referenced from 0 degrees Fahrenheit. The device has a guaranteed

    ample, 0F outputs 0mV, 70F outputs 700mV. Thedevice

    o code to communicate with the LCD is included in Listing 3 below.

    I ni t i al i ze

    l/ / Def aul t screen speci f y desi r ed put c f unct i onr i nt f ( l cd_put c, Mode: V Temp. , t emp) ;p

    i f ( di spl ay t o be updat ed) {l cd_got oxy( x l oc. , y l oc. ) ; / / Go t o l ocat i on on LCpr i nt f ( l cd_put c, Message to Di spl ay, t emp) ;

    / / Cal l s l cd_put c( ) t o pl ace each char a}

    Listing 3. LC

    on Temperature Sensing

    34 precision temperature sensor is a 3 terminal device that provirtion to temperature. The outp

    accuracy of 1F at 70F . For excan be powered from a 5-30 volt source. The device comes in multiple packages,

    including a TO-92 plastic package that will be used in this design. The LM34 package is

    shown in Figure 23. The function to read the temperature is displayed in Listing 4 below.

    Figure 23. LM34 Precision Temperature Sensor Package.

  • 8/12/2019 Dt 1 Design Fall 2004

    36/64

    Infrared Rem The Infrared detection is implemente with the Sharp GP1UM28YK infrared

    etecting unit. This unit combines a number of signal processing functions in a compact

    terminal device. The operational block diagram of the device can be seen in Figure 24.

    ote Inputd

    d

    3

    Figure 24. Sharp GP1UM28YK Operational Block Diagram.

    The device discriminates between a plethora of extraneous infrared noise sourcesand locks in on the modulated 38 kHz source produced by an infrared remote control.The device im ring inactive

    eriods, and 0 volts when in the presence of the 38 kHz source. The device is connectedto the

    / / Don t process anot her command unt i l/ / l ast command i s r ead

    ast Ti me;

    t o_

    r ecei veBi t 0

    && I RFr ameVal i d)E }

    plements negative logic, and outputs approximately 5 volts dup

    microcontroller via an external interrupt pin that is configured to interrupt onfalling edge signals. The microcontroller interprets the command from the infraredremote control by timing the interrupts, or falling edges of the signal, in the interruptservice routine. The C code to implement this function is show in Listing 5.

    I ni t i al i zat i on;voi d I R_ i sr( ) {

    i sr _ i ni t i al i zat i on;i f ( I Rhi t )

    r et ur n;

    del t aTi me = t i mer ( ) l l ast Ti me = t i mer ( ) ;

    i f ( del t aTi me_ o smal l | | del t aTi me_too_l arge) {

    = ;r et ur n;

    }set_dat abi t _based_on_del t aTi me;shi f t _l ef t ( I RFr ameAddr ess, shi f t _amount , dat abi t ) ;i f ( ent i r eFrameRecei ved

    I Rhi t TRU

  • 8/12/2019 Dt 1 Design Fall 2004

    37/64

    PC Software Application

    ge, such as Visual Basic

    his is an object orien ft Windows developers.The application will be enginee ing the notion ofclass modules and objects. These class modules implement data encapsulation byproviding a public interface while hiding the internal data and implementation.

    Because the application is object oriented, it makes sense to model much of theapplication using UML (unified modeling language). This is an open standard modelinglanguage managed by the Object Management Group (OMG), and used extensively inindustry. One benefit of using a graphical modeling language is that the computingsystem can be understood by the computer programmer as well as client users of thatsoftware. The use of UML in documenting Object Oriented (OO) software design hasbecome the de-facto standard, and in fact the UMLs importance comes from its wideuse and standardization within the OO development community. The UML has becomenot only the dominant graphical notation within the OO world but also a populartechnique in non-OO circles.4

    This document will primarily utilize UML diagrams to provide a general, overall

    software system description with supplemental descriptions for those not familiar withUML syntax. The use of pseudo code will also be utilized to provide more focus on theunderlying details.

    Figure 25 represents the general system use case with respect to the user. Theuser may interact with the Power supply hardware directly to power a general DC load.The user may also interact with a personal computer (PC) that will extend thefunctionality of the power supply to act as a battery charger, which connects to a battery.This section primarily describes the PC interface with the user and the implementation of

    the charger.

    The PC application will be written in a high-level langua

    6. T ted language very popular with Microsored using an object oriented style by us

    Charger

    Power SupplyDC Load

  • 8/12/2019 Dt 1 Design Fall 2004

    38/64

    The operation of object oriented programs is determined by the class objects used toreate the application and the interaction of these class objects. Figure 26 shows the

    overall

    Figure 26. Overall Class Diagram.

    ain FormThe main form implements the main user interface when the application starts. This

    rm provides all the control and feedback necessary to operate the power supplyanually. This form interacts with the Powe anual operation ofe power supply. The main form is t in opening other application forms

    ia a menu bar control or command button. From the main form configuration data that

    stored in the Windows registry can be edited.

    c class diagram of the application. Each class object is further described in the

    discussion.

    Mfom r Supply class to allow m

    he starting pointthv

    is

    MainForm

    PowerSupply PS DeviceDriver

    MS CommControl

    ChargerChargingForm

    Timer

    Sample Data Graph

    DataAnalyzer

    Configuration

    Device

    Timer*

    Association multiplicities are 1

    unles

    Lead Acid NiCad Li IonNiMh

    Create

    s specified otherwise

    Store Sample

    *

    Primary AttributesC S tti St i

    Primary MethodsL d()

    Primary ResponsibilitiesL d fi ti d t

    Confi uration Class Summar

  • 8/12/2019 Dt 1 Design Fall 2004

    39/64

    The configuration class contains initialization information used by various

    component classes of the application. This includes communication port and baud rate

    setting, update rates, and sampling frequency settings. The Configuration class stores theconfiguration data in the operating system registry.

    The PowerSupply class is a high level representation of the power supply. Public

    methods of this class include those that a power supply user would typically invoke,includ ltage and setCurrent. These parameters are stored as data members of theclass. The PowerSupply class sends messages to PSDeviceDriver, which is a class in thechain that implements communication between the PowerSupply class and the physicalhardware. PowerSupply periodically queries the hardware as a response to an eventtrigger (typically once a second) from mer object. The device then sends a statusmessage indicating t age, d Temp . This in on is stor in instance of a Sample object, with the time appended to the data, and then stored in the

    Data container class.

    Primary AttributesMode:MODETYPEVoltSet:double

    CurrentSet:double

    Primary MethodssetVoltage(double)

    rrent(double)

    mple():SamEvent()

    ing setVo

    the TiCurrent,anhe Volt eratures formati ed as

    Primary Attributes Primary MethodssetVoltage(double)setCurrent(double)getSample():Sample

    recEvent():Event

    Primary Responsibilities Data conversion between

    higher level PowerSupplyclass and device

    Package monitoredparameters (voltage,current, temperature,time) into Sample object

    PSDeviceDriver Class Summar

    setCu

    getSatimer

    ple

    Primary Responsibilities Direct power supply

    hardware in response to

    us s

    PowerSu l Class Summar

    er interaction

  • 8/12/2019 Dt 1 Design Fall 2004

    40/64

    Table 12. mmunication Packet Protocol.

    sumed

    Table 13. Device to PC Error codes.

    The main function of h level commands (like setth 3 v streams (0x56, 0x1D, 0x71) sent via RS-232 serial communications ation is a coPowerSupply represents voltages and currents in floating pointutilizes unsigned 16-bit inte um supply t. With

    a maximum output voltage bit integer 0xFrepresents 10 volts, and 0x0000 represents 0V. This type of conversion is represented inListing 6 pseudo code.

    unct i on set Vol t age( doubl e ar g)i n

    PC-Device Co

    Error CodesCode Description Notes

    0 Power on reset Normal message during a power up

    1 Watchdog reset Watchdog timer timed out

    2 reserved

    3 reserved

    4 ADC consistency check failed AD7075 and internal AD differ too much

    5 PWM at max imum PWM is at maximum and the supply cannot achieve the set point

    6 PWM at m inimum PWM is a m inimum and the supply cannot achieve the set poin t7 Over Voltage fault Voltage exceeds max outpu t fo r the desired cur ren t set po in t

    8 Over Current fault Cur rent exceeds max ou tput fo r the desi red voltage se t po int

    9 reserved

    10 communications timeout During PC control, device must receive a message every 10 seconds or a loss of communication is as

    11 UART frame error

    12 UART error

    13 SPI error

    14 communication failure to AD7075

    15 reserved

    16 reserved

    17 reserved

    18 reserved

    19 reserved

    20 reserved

    PSDeviceDriver is to convert hige output voltage to 2. olts) into byte array

    . The main interpret nversion in data types. Thenumbers, while the devicevoltage, or currengers scaled to the maxim

    of 20 volts, the 16 FFF represents 20V, 0x7FFF

    ft v= arg / 20 * ( 2 16- 1)

  • 8/12/2019 Dt 1 Design Fall 2004

    41/64

    the Data container class. Listing 7 shows the pseudo code function for building a Sampleobject from a communications packet received from the device.

    f unct i on getSampl e(byt e[ ] m) as Sampl eS=new Sampl e/ / i nt make16( byte Hi Byt e, byte LoByte)/ / r et var = f r act i on of max x f ul l scal e val uedoubl e V = make16( message[ 1] , message[ 2] ) / ( 2 16- 1) *20doubl e I = make16( message[ 3] , message[ 4] ) / ( 2 16- 1)*10doubl e TA = make16( message[ 5] , message[ 6] ) / ( 2 10- 1) *500doubl e TB = make16( message[ 7] , message[ 8] ) / ( 2 10- 1) *500doubl e t i me = Syst emTi mer ( )

    r et urn Samplend f unct i on

    Listing 7. Building a Sample object from packet data.

    MS Comm ControlThis is a control built into Visual Basic. The control has an input() method that

    returns a byte array of buffered data received on a serial port. The control also has anoutput() method that transmits data in a byte array to a device on the serial port. Thecontrol is set up from configuration data, such as port number and baud rate, from theConfiguration class.

    e( V, I , TA, TB, t i me)

    The Sample class is a container class for monitored voltage, current, temperature ,and time. A sample represents a snapshot of these monitored parameters at a particularinstant of time.

    Primary AttributesVoltage:doubleCurrent:doubleAmbientTemp:doubleBatteryTemp:doubleTime

    Primary MethodsgetVoltage():doublegetCurrent():doublegegetBTemp():double

    Primary Responsibilities Container class for

    monitored parameters

    Sam le Class Summar

    tATemp():double

    getTime():doubleSample(V,C,AT,BT,TS):Sample

    Stamp:double

  • 8/12/2019 Dt 1 Design Fall 2004

    42/64

    cGraph class to di also used by the

    which processes queries from the Charger class during charging

    r clas y the Charger class to query theData class. Recall that th ection of Sample objects, andthese Sample objects represent a data set of voltage, current, temperature and time. The

    used by the DataAnalyzer class. The

    ta collection. The default value is the sampling rate per minute, so ifmples are obtained every second, getVoltage() returns the average voltage over the last

    minute. This averaging is advantageous because the charging process is slow and the

    The data lass is a storage class that holds an array of samples. It is used by thesplay data and trends over time. The Data class is

    DataAnalyzer classoperations.

    The DataAnalyze s is a utility class that is used be Data class is an ordered coll

    Data class provides the raw history dataDataAnalyzer exposes a number of public methods that is necessary information to

    implement a charging algorithm. Some of the more direct methods, such asgetVoltage(s) are quite simple. It simply returns the average of the latest n voltageamples in the das

    sa

    Data MembersData DataSet (byRef)

    MethodsgetVoltage(int n=60)getCurrent(int n=60)getTe

    mp(int n=60)getDVdt(int n=60)getD2Vdt2(int n=60)getDTdt(int n=60)

    getDeltaT(int n=60)

    Responsibilities Data Analysis

    DataAnalyzer Class Summary

    Primary Attributes

    DataSet:Sample[]

    Primary Methods

    getSample(int index)addSample()

    Primary Responsibilities

    Provides History ofcharging process

    es raw data toalyzer class

    Data Class Summary

    Container class forSample data

    id ProvDataAn

  • 8/12/2019 Dt 1 Design Fall 2004

    43/64

    f unct i on get Vol t age( n) as do / / DS i s a r ef er ence t o t he ys FI FO t ype

    v=v+DC[ 0] . get Vol t ag next i

    r et ur n v/ nend f unct i on

    Listing 8. Pseudo code for data analysis voltag

    f unct i on getDTdt ( n) as doubl e/ / r et ur ns t he f i r st der i vat i ve of bat t er y t emper at ur e wi t h

    ct t o t i me of n sampl es

    t o n- 1T1=T1+DC[ i ] . getBTemp( )

    next iT1=T1/ n / / average t emp

    BTe next j

    T2=T2/ n / / average t emperat ure of previ ous n sampl es

    r et ur n ( T1- T2) / ( ( DC[ 0] . get Ti me( ) - DC[ 2*n- 1] . get Ti me( ) ) / 2)end f unct i on

    Listing 9. Pseudo code for temperature first derivative

    Charging FormThe charging form is called by the main form when the user selects charging from

    ubl eDat a col l ect i on

    / / i ndex 0 i s al wa t he l at est dat a ( dat a st ruct ur e)v=0f or i =0 t o n- 1

    e( )

    e calculation.

    / / respe / / DS i s a r ef er ence t o t he Dat a col l ect i on

    / / i ndex 0 i s al ways t he l at est dat a (FI FO t ype dat a str uct ur e)T1=T2=0

    f or i =0

    erat ur e of n sampl es

    f or j =n t o 2*n- 1T2=T2+DC[ i ] . get mp( )

    data analysis battery

    the tools menu. This form accepts user input regarding a particular battery a user wishesto charge. This information is passed to the Charger class. The primary informationnecessary to implement a charging algorithm include battery chemistry, Amp Hourcapacity of the battery, and number of cells. A sequence diagram for a typical chargingscenario can be seen as Figure 27.

  • 8/12/2019 Dt 1 Design Fall 2004

    44/64

    Figure 27. Charging sequence diagram.

    Main Form

    SettingsForm

    ChargerForm

    begin charging

    User updates

    settings

    close form

    ChargerClass

    User enters battery

    parameters

    chargingcomplete

    close form

    Data MembersChemistry:BATTYPEAhCapacityNumberOfCells:Int

    Methodstimer()

    Responsibilities Process data from charger

    form Determine appropriate

    Charger Class Summary

  • 8/12/2019 Dt 1 Design Fall 2004

    45/64

    ger class implements the functionality of a battery charger by directingPowerSupply to apply voltage or current to the battery as directed by a chargingalgorithm. The Charger class receives information about the battery to charge from the

    Charging Form. From this information a battery chemistry class (Lead Acid, NiCad,NiMh, L hich implements the charging algorithm for the particularbattery chem h rger class enables a Timer object that acts as a free runningperiodic event trigger. The Timer object calls a public method of Charger that dispatchesthe associated chemistry class.

    The following battery che sses implement the charging algorithm for thatparticular chemistry. The battery charging process is modeled as a state machine, wherethe entire ch may contain many states.

    As a minimum, at least two charging algorithms will be implemented for eachchemistry class. As a g neral rule, a fast charging algorithm require ore stringent,more compl than a slow charg thm. For ex the chargingprocess is not terminated when a battery is fu rged, excess energy can cause gas tobe produced in the cell, as well as heat. At slow charge rates the gas can be safelyvented and the heat can safely be dissipated. During a fast charge, the cell may not becapable of dissipating the e gy, and a cell could rupture. For the user withenough information about a particular battery, the fast charge algorithm will be an option.If the user does not know much about the battery ( mp hour capacity) aslow charge algorithm will be available to charge the battery. Figure 28 represents thestate diagram for the charging process in a general sense.

    The Char

    i-Ion) is refeistry. T

    renced, we Cha

    mistry cla

    arging process

    eex algorithm

    s a mample, ifing algori

    lly cha

    xcessive ener

    particularly the A

    PerioEvent

    dic

    absoluteconditions

    Trigconditionachieved

    ger

    H

    trickle

    Triggerconditionachieved

    conditionfailed

    conditionsOK

    History state

    memorizes the internalstate between calls

    Conditions includevoltage, current,

    temperature and time

  • 8/12/2019 Dt 1 Design Fall 2004

    46/64

    harge( )i f DA. get Del t aTemp( ) > 10F cal l t er mi nateCharge( )i f DA. get Del t aTi me( ) > 60 cal l t ermi nateCharge( )

    sel ect case ( st at e)case (0)

    PS. set Vol t age( Cel l s * 2. 45 vol t s)st at e=1

    cas i f DA. get Cur r ent ( ) < . 2 * C_r ate

    e( Cel l s ol t s st at e=2

    end i fcase (2)

    / / t r i ckl e char ge unt i l t i me expi r esend sel ect

    end f unct i onListing 10. Lead acid algorithm.

    The lead acid battery is charged using voltage regulation with current triggers.Listing 10 is an example of a fast charge algorithm for lead acid batteries.

    f unct i on char ge( )st at i c st at e=0 / / st or e st at e i nf or mat i on bet ween cal l s/ / DA i s t he dat a anal ysi s obj ect/ / PS i s t he Power Suppl y obj ect

    / / pr ocess gener al condi t i ons t hat ar e stat e i ndependenti f DA. get Temper atur e( ) < 0F cal l t er mi nateCharge( )i f DA. get Temper atur e( ) > 113F cal l t ermi nateC

    Data Members

    C_rate:DoubleCells:IntTerminalVoltage

    Methods

    fastCharge()slowCharge()

    Responsibilities

    Implement chargingalgorithm for lead acidbattery types

    Lead Acid Class Summary

    e ( 1)

    PS. set Vol t ag * 2. 25 v )

    fast charging

  • 8/12/2019 Dt 1 Design Fall 2004

    47/64

    NiCad batteries are charged at a constant current. Many end of chargermination conditions exist based upon voltage and temperature. Inflection pointetecti

    ing process.for NiCad cells is endothermic, and the battery temperature can

    ly charged level,and battery temperatures rise. Other voltage

    gers can be used as a backup to the primarytteries.

    l s

    di t i ons t hat ar e stat e i ndependent

    mper ature( ) < 41F cal l t ermi nat eCharge( )mi nat eChar ge( )har ge( )

    l t aTi me( ) > 90 mi nut es cal l t er mi nateCharge( )cal l t er mi nat eChar ge( )

    ent ( C_r ate amps)

    DVdt ( ) 104F cal l t ert aT( ) >15F cal l t er mi nat eC i f DA. get Del

    i f DA. get De i f DA. get Vol t age( ) >= ( 1. 5V * Cel l s) sel ect case ( st at e)

    case (0)r r PS. setCu

    st at e=1case (1)

    D2Vdt 2( ) =0 eoc=t r ue / / i nf l ect i on poi nt ori f DA. get i f DA. get

    ( ) >=1. 8F/ mi n eoc=t r ue / / dT/ dt ( bacchar ge

    Data Members

    oltage

    Met

    ()C_rate:DoubleCells:IntTerminalV

    hods

    fastChargeslowCharge()

    Responsibilities

    ging

    ry

    NiCad Class Summar

    Implement charalgorithm for NickelCadmium (NiCad) battetypes

  • 8/12/2019 Dt 1 Design Fall 2004

    48/64

    Data Members

    C_rate:DoubleCells:IntTerminalVoltage

    Methods

    fastCharge()slowCharge()

    Responsibilities

    Implement chargingalgorithm for NickelMetal Hydride (NiMh)battery types

    NiMh Class Summar

    Nickel Metal Hydride batteries are charged at a constant current in a similarfashion as the Nickel Cadmium battery. The voltage termination characteristics aretypically not as pronounced as the NiCad battery. Temperature indicators for the NiMhbattery are also more difficult to determine because the charging reaction is exothermicthroughout the charging cycle, although heat is more rapidly generated when the cell isbeing overcharged. As with the NiCad cell, a comprehensive charge termination strategyincludes multiple trigger conditions, or backup conditions, and many of these conditions

    are identical to those used with NiCad batteries. Listing 12 is an example of a fast chargealgorithm for NiMh batteries.

    f unct i on f ast Char ge( )st at i c st at e=0 / / st or e st at e i nf or mat i on bet ween cal l s/ / DA i s t he dat a anal ysi s obj ect/ / PS i s t he Power Suppl y obj ect/ / pr ocess gener al condi t i ons t hat ar e stat e i ndependenti f DA. get Temper atur e( ) < 41F cal l t er mi nateCharge( )

    i f DA. get Temper atur e( ) > 104F cal l t er mi nateCharge( )i f DA. get Del t aT( ) >15F cal l t er mi nat eChar ge( )i f DA. get Del t aTi me( ) > 90 mi nut es cal l t er mi nateCharge( )i f DA. get Vol t age( ) >= ( 1. 5V * Cel l s) cal l t er mi nat eChar ge( )sel ect case ( st at e)case (0)

    PS. setCur r ent ( C_r ate amps)st at e=1

    case (1)i f DA. getDVdt ( ) = . 9F/ mi n eoc=t r ue / / dT/ dt ( backup) t hen endi f eoc / / f ast char ge

    ckl e chargePS. set Cur r ent ( C_r at e*. 025) / / set up t r i st at e=2

    end i fcase (2)

  • 8/12/2019 Dt 1 Design Fall 2004

    49/64

    Lithium Ion (Li Ion) batteries are the most advanced types in this group. Thesebatteries are charged at a constant current at a particular cell terminal voltage. Thisvoltage level varies among manufacturers, typically 4.1 or 4.2 volts/cell. A unique aspectto proper charging of Li Ion batteries is monitoring battery terminal voltage, and notcharging voltage, while charging in current regulation mode. To perform thismeasurement, the supply must be effectively turned off during the measurement.

    Some manufacturers do not recommend a float or trickle charge after charging.

    If trickle charging is desired, it should be done in a similar manner to the fast charge, butt a greatly reduced rate or .0

    Data Members

    C_rate:DoubleCells:IntTerminalVoltage

    CellVoltage

    Methods

    fastCharge()slowCharge()

    Responsibilities

    Implement chargingalgorithm for Lithium(LiIon) battery types

    Ion

    LiIon Class Summary

    a 25C or lower, and terminated after a fixed time period.a fast charge algorithm for Li Ion batteries.

    ormat i on between cal l s

    t

    = ( Cel l Vol t age * Cel l s) cal l t er mi nat eChar ge( )

    r ent ( C_r ate amps)

    l l Vt age( Cel l Vol t age*Cel l s)

    Listing 13 is an example of

    f unct i on f ast Char ge( )st at i c st at e=0 / / st or e st at e i nf

    / / DA i s t he dat a anal ysi s obj ect/ / PS i s t he Power Suppl y obj ect

    / / pr ocess gener al condi t i ons t hat ar e stat e i ndependenrge()i f DA. getTemper ature( ) < 41F cal l t ermi nat eCha i f DA. get Temper atur e( ) > 104F cal l t er mi nateCharge( )

    i f DA. get Del t aT( ) >15F cal l t er mi nat eChar ge( )> 90 mi nut es cal l t ermi nat eCharge( )i f DA. get Del t aTi me( )

    l t age( ) > i f DA. get Vo sel ect case ( st at e)

    case (0)PS. set Cur

    st at e=1

    case (1)PS. set Cur r ent ( 0) / / t ur n of f suppl yPS. get Sampl e( ) / / get a sampl e wi t h suppl y of f

    l t age( 1) =Cel l s*(Ce ol t age- 50mv)i f DA. get Vool PS. set V

    st ate=2

  • 8/12/2019 Dt 1 Design Fall 2004

    50/64

    Battery connectorPerhaps the simplest part of the projec

    G iety of b ay, it is difficult to ha nector that

    w ttery to th me of the most comAA type and D type, have standard battery holders types that can be used to charge an tteries simultaneously as seen in Figure twoprongs sticking out, or even flat metal contacts as it is often seen in cellular telephonebatteries. For those reasons, the team decided to fit the charging system with the mostcommon types of connectors. Thus, some standard AAA, AA, C and D type connectorsalong with some alligator clips for the prongs, and a clamp system for the metal contacts,will be provided with the charger. This should accommodate most types of batteries.

    t may prove to be the hardest to achieve.iven the wide var atteries tod ve a universal con

    ill attach the ba e charger. So mon types of batteries, like

    29. Others may haveumber of these ba

    Figure 29. Example Battery Holders.

    ign:Overall Printed Circuit Board (PCB) Des The design is based on a two-board design. The control board contains the

    ents such as thegital signals (5 voltsircuit voltages) are

    atic for thise

    n in Figure A2.uits that implement the main switching power

    ply, along with the voltage and current sense

    circuits have been shown in Figures 7, 9, 10, 11, and 13. The boards willthe control board and

    the boards.

    microcontroller, accessories, and various headers to peripheral componLCD display and IR remote detector. Only low power analog and di

    el shift cor less, with the exception of low power RS-232 levtransmitted and received on this board. The comprehensive circuit schemboard is shown in the Appendix as Figure A1. The preliminary PCB artwork for thsystem control board is show The power board contains the circ

    rocontroller linear supsupply and mic

    circuits. Thesebe connected by an interconnecting cable that supplies power to

    eentransmits PWM signals and voltage/current sense signals betw

    Fi l P d t D i

  • 8/12/2019 Dt 1 Design Fall 2004

    51/64

    Final Product Design After integrating all of the components described above, the finished design productis envisioned to appear as shown in Figure 30.

    Mode : PC Temp.Voltage : 10.000 V Battery: 80.3 FCurrent : 1.520 A Ambient: 70.0 F

    Batter Com Temp. Sensors

    Mode : PC Temp.Voltage : 10.000 V Battery: 80.3 FCurrent : 1.520 A Ambient: 70.0 F

    Figure 30. Finished Product Design.

    P ts List

  • 8/12/2019 Dt 1 Design Fall 2004

    52/64

    Parts ListThe finalized parts list shown in Table 14 includes all parts necessary to implement the

    echnical Design discussed above.

    Qty.

    T

    Table 14. Implementation Parts List.Refdes Part Num. Descript ion

    1 IC1 PIC18F452-I/P PIC ntrollerMicroco

    1 IC2 MAX el converter232 S 232 levR

    1 IC3 AD7705BN Analog to digital converter 16 pin dip

    1 IC4 M rochip precision rail-to-rail op amp 8pin dipCP607-I/P Mic

    1 IC5 TC1411NCPA Microchip power mosfet driver 8pin dip1 Q1 ECS-80-20-4 CRYSTAL 8.00MHZ 20PF HC-49/US

    1 Q2 MP024S CRYSTAL 2.4576MHZ HC-49, 32PF

    2 R1 3296Y-1-103 Bourns 3296Y 10K pot .5W top adjust 3/8" SQ CERM SL MT

    1 R2 3296Y-1-200Bourns 3296Y 20 ohm pot .5W top adjust 3/8" SQ CERM SLMT

    1 R3 ERD-S2TJ222V 2.2K 1/4W 5%

    1 R4 ERO-S2PHF4703 470K 1/4 W 1% metal film

    2 R5,R7 3296Y-1-203 Bourns 3296Y 20K pot .5W top adjust1 R6 MFR-25FBF-10K0 10K 1/4W 1%

    2 R8 CFR-25JB-1K0 1K 1/4W 5%

    1 ERD-S2TJ470V 47ohm 1/4W 5%

    1 Z1 LM4040AIZ-2.5 LM4040AIZ-2.5 precision 2.5V reference TO92 package

    1 2-640379-4 S DIP 15AUCONN IC SOCKET 40PO

    2 2-640358-4 OS DIP 15AUCONN IC SOCKET 16P

    2 2-640463-4 CO N IC SOCKET 8POS DIP 15AUN

    2 C1,C2 1206CG200J9B200 20pf disk cap1 C3 ECA-1EM100 10uF Electrolytic 25VDC

    5 C4,C5,C6,C7,C8 ECA-1HM010 1uf cElectrolyti

    2 C9,C10 GRM0335C1E300JD01D 30pf disk cap

    1 EEU-FC1E470 47uF

    1 D1 1N4148 1N4148

    3 LM34DZ-ND IC SENSOR TEMP PREC FAHR TO-92

    1 CFAH4004A-YYB-JP CrystalFontz 40x4 LCD

    1 GP1UM27XK Sharp GP1UM28XK IR remote control receiver

    1 351-43-0201 molex RC car battery connector plug

    2 357-28-0201 molex RC car battery connector socket pin

    4 rs232,temp,pb 22-23-2091 molex 9 pin .100 pin header

    4 22-01-3097 molex 9 pin .100 connector

    3 ICSP LCD1 22-23-2061 molex 6 pin 100 pin header

    1 747904 2 9 pin D sub Male

  • 8/12/2019 Dt 1 Design Fall 2004

    53/64

    1 747904-2 9 pin D-sub Male

    1 03-09-2022 molex .093 2 cir Plug 12A

    5 03-09-1022 molex .093 2 cir Receptacle 12A

    1 molex .093 male terminals 14-20 crimp02-09-21031 02-09-1104 molex .093 female terminals 14-20 crimp

    1 02-09-211 18-22 crimp8 molex .093 male terminals

    1 BH48A AA 8 cell battery holderAL

    1 BH26CW C 6 cell battery holder

    1 BH24DL D 4 cell battery holder

    1 364-1042-ND Power Line EMI Filter, 10A

    1 12FR010 RES CURRENT SENSE .010 OHM 2W

    1 IRFP244 HEX/MOS N-CH 250V 15A TO-247AC3 10CTQ150-1-ND DIODE SCHOTTKY 150V 10A TO-262

    2 LM7805CT-ND Voltage Regulator, 5V,1A

    4 493-1079-ND CAP 0.33uF, 35V Elec Radial

    3 P11214-ND CAP 27UF 25V ELECT FC RADIAL

    1 688CKS035M 6800uF 35V Elect RadialCAP

    2 P11855-ND CAP 2700UF 200V ELECT TS-UQ

    1 182S12 Power Toroid Transformer 225W [email protected]

    Testing Proced fication and Vures: Veri alidation

  • 8/12/2019 Dt 1 Design Fall 2004

    54/64

    Testing Proced fication and Vures: Veri alidation

    A vital part to a successful implemen er design is the

    ability to test individual components and i thealternative desig echnical desig hases.Beginning with on and detaile as agreedto modularize th d test each com er it has been verifiedthat each component functions alone, the erfaced with localsubsystem components and eventually em of the entire design.The entire desig that the listesection will discuss the testing procedures the more

    formal testing p ll be used beenprototyped.

    Hardware Testin

    tation of the entire Smart Charg

    nterfaces between components duringn analysis, t n, and especially the implementation pthe concepti d definition of this design, the team he design an ponent separately. Aft

    component will be interge as a functioning partd requirements specificatin must verify ons are met. Thisthat have already been performed and

    rocedures that wi when the hardware and software has

    g:

    Power Supply: Since the switch-mode p sign, thegine built a prototype ith

    these supplies, to determine the voltage and current outputs under varying parameters andWM signals, and determine what is necessary to proceed with the power supply design.his prototype was first tested with digital multimeters and an oscilloscope. The pulseidth modulation signal was driven by a pulse generator and varied with respect toequency and duty ratio.

    The final power supply design will be tested to verify that can output a voltage in thenge of 0-20 V and a current in the range of 0-10 A. The PWM signal will be adjusted to

    etermine the voltage and current resolutions of 20 mV and 10 mA, respectively.

    icrocontroller and Accessories: The microcontroller and control board accessoriesecessary for high-level feedback have been tested during the actual design phase toecide what can be feasibly implemented given the time, budget, and experienceonstraints. In addition, the group individually tested these logic components in areadboard circuit to compare the compatibility of interconnected devices and decidehich devices should be purchased for the actual implementation. The breadboardrototype is shown in Figure 31.

    ower supply is the core of this deelectrical en ers have power supply in order to gain experience w

    PTwfrrad

    Mndcbwp

  • 8/12/2019 Dt 1 Design Fall 2004

    55/64

    Figure 31. Breadboard for Testing During the Design Process.

    Software Testing:

    Microcontroller software: The microcontroller software will be tested with theMicrochip MPLAB IDE and In-Circuit Debugger-2 (ICD-2). The microcontroller andvarious parts of the logic system can be easily tested with a development board, such asthe LAB-X1 board, before it is implemented in the actual design. The software routines

    e

    r-

    ers of the public to rate the ease of use of thisapplication.

    System Testing:

    will be individually tested with test scripts with varying input parameters to determine ifthey return accurate results. In addition, the scripts will test the communication protocolsbetween the logic system interfaces.

    The final logic board design will also be tested with the ICD-2 module to make sure

    that the voltage and current feedback signals are accurate to within 20 mV and 10 mA tolerances for error.

    Visual Basic Custom PC application: The PC application will be tested anddebugged with the Microsoft Visual Basic.NET environment. It will be tested on thcommon Microsoft Windows XP and Windows 2000 operating systems to ensurecompatibility with Microsoft Windows users. In order to test the requirement for a usefriendly interface, the design group will create a survey allowing their engineeringolleagues, professors, and membc

    As each component passes the preliminary testing procedures, it will then be

    interfaced ith the rest of the s stem on its board (po er board and control / logic

  • 8/12/2019 Dt 1 Design Fall 2004

    56/64

    2 357-28 molex RC car battery connector socket pin $0.10 $0.20-0201

  • 8/12/2019 Dt 1 Design Fall 2004

    57/64

    4 22-23-2091 molex 9 pin .100 pin header $0.87 $3.48

    4 22-01-3097 $2.68molex 9 pin .100 connector $0.67

    3 22-23- $1.802061 molex 6 pin .100 pin header $0.602 22-01- in connector $0.48 $0.963067 molex 6 pin .100 p

    2 22-23-2041 molex 4 pin .100 pin header $0.47 $0.94

    2 22-01-3047 molex 4 pi $0.35 $0.70n .100 connector

    2 22-23-203 molex 3 pin .100 pin h $0.781 eader $0.39

    2 22-01-3037 molex 3 pin .100 pin con $0.58nector $0.29

    100 08-50- molex Crimp terminals for . gs $5.340114 100 housin $0.05

    2 747905 9 pin D-sub $4.94-2 Female $2.47

    1 747904 9 pin D-sub $1.82-2 Male $1.821 03-09- molex .093 2 cir Plug 12A $0.332022 $0.33

    5 03-09- molex .093 2 cir Receptacle 12A $1.801022 $0.36

    1 02-09- molex .093 male terminals 14-20 crimp $0.792103 $0.79

    1 02-09-1104 molex .093 female terminals 14-20 crimp $0.78 $0.78

    1 02-09-2118 molex .093 $0.81 $0.81male terminals 18-22 crimp

    1 H48AAL A 8 cell battery holderB A $1.46 $1.46

    1 BH26C C 6 cell battery holderW $1.60 $1.60

    1 BH24DL D 4 cell battery holder $1.71 $1.71

    1 364-1042-ND 0A $ $Power Line EMI Filter, 1 18.53 18.53

    1 12FR010 RES CURRENT SENSE .010 OHM 2W $1.56 $1.56

    1 IRFP244 HEX/MOS N-CH 250V 15A TO-247AC $3.16 $3.16

    3 10CTQ150-1-ND DIODE SCHOTTKY 150V 10A TO-262 $0.88 $2.64

    2 LM7805CT-ND Voltage Regulator, 5V,1A $0.53 $1.06

    4 493-1079-ND CAP 0.33uF, 35V Elec Radial $0.23 $0.92

    3 P11214-ND CAP 27UF 25V ELECT FC RADIAL $0.28 $0.84

    1 688CKS035M $10.00 $10.00CAP 6800uF 35V Elect Radial

    2 P11855-ND CAP 2700UF 200V ELECT TS-UQ $$8.12 16.24

    1 182S12 Power Toroid Transformer 225W [email protected] $ $54.66 54.66

    To $2 tal 49.92

    Team Funding

    e teams member.gn team m or this de

    ct.

    dule

    Th material funding has been set at $75 per design team

    embers, this yields a total material funding of $300 fWith

    four desi signproje

    Project Sche

    Th S t Ch d t t f l ti f l d it h d l

    Table 17. Implementation Gantt Chart Tasks and Description.

  • 8/12/2019 Dt 1 Design Fall 2004

    58/64

    52

  • 8/12/2019 Dt 1 Design Fall 2004

    59/64

    Figure 32. Implementation Gantt Chart Timeline View.

    53

    Design Team Information

  • 8/12/2019 Dt 1 Design Fall 2004

    60/64

    Steven Savage

    Computer EngineerTeam Leader, PC Software Design

    Claudiu BourucElectrical Engineer, Hardware Design

    Eric BoyerElectrical Engineer, Hardware Design

    Mike PetrakComputer