![]() |
||||||||
|
Electronics Reviews |
Electronic Projects |
Electric R/C Planes |
General Aviation |
Hammond Organs |
Calculator Collection |
Slide Rule Collection |
My Blog: Stefanisms |
|
BattMan II is a computer controlled battery manager, intended for typical rechargeable batteries used by R/C and electronics hobbyists, as well as various consumer product batteries. BattMan II has the following capabilities:
†Maximum voltage and current limits depend on the power supply used. Values shown are for the prototype. BattMan II is a fairly complex project, and this article assumes that you have some electronic project building experience. If you're reasonably careful in construction and follow the testing and calibration instructions closely, you should have no problems getting it to work. Your success with this project will benefit from an understanding of how it works, so please read the next section carefully before you plug in the soldering iron. If you don't want to build this project but need a device like this for your consumer electronics batteries, you might consider the La Crosse Technology BC-900 AlphaPower Battery Charger or Maha Powerex MH-C9000 WizardOne Charger-Analyzer. This performs many of the same functions as BattMan II, but only for AA and AAA NiCd or NiMH cells (up to four at a time). The La Crosse charger also comes with adapters to let you use AAs in devices requiring C or D sized cells. The CircuitBattMan II consists of five subsystems: power supply, current control, battery connection, voltage measurement, and logic power.
Power SupplyThe power supply I used is a commercial off-the-shelf model that can supply 18 Volts at 2.2 Amps. I purchased mine at a surplus store. Any similar power supply will do, so long as it produces 18 to 20 Volts, and enough current for the maximum charge rate you want to be able to use. Points labeled V+ in the schematic are connected to the positive terminal of the power supply. Current ControlCMOS buffers Z2a through Z2d together with resistors R26 through R34 form an R-2R ladder digital-to-analog converter. R34 is used to adjust the output voltage range so that it spans 0 to 0.2 Volts (which can be measured at test point TP2). The input to the converter is taken from the four low-order data bits (D0 to D3) of the parallel printer port that BattMan is connected to.
Battery ConnectionTransistor Q1 and relay K1 are used to connect or disconnect the positive terminal of the battery being charged. Q1 is controlled by bit D5 of the parallel port. When this bit is low, the battery is disconnected; when it's high, the battery is connected. Whereas K1 controls if the battery is connected, relay K2 controls how it is connected. When parallel port bit D4 is low, Q2 does not conduct and K2 is not energized. This connects the positive battery terminal to the collector of Q3 (the current sink), and the negative battery terminal to ground. Any current flowing through Q3 will come from the battery, thus discharging it. When D4 is high, Q2 conducts and energizes K2. Now the positive battery terminal is connected directly to the positive power supply voltage, and the negative terminal is connected to the current sink. Current flowing through Q3 now will come from the power supply and pass through the battery, thus charging it. Voltage MeasurementBy far the majority of the components in the circuit are dedicated to accurate measurement of the battery voltage. Because the battery is connected between V+ and Q3 when charging, we can't measure the battery voltage by just measuring the positive terminal voltage relative to ground. Instead, we have to measure the positive and negative terminal voltages (relative to ground) separately, and then subtract to determine the actual battery voltage. One way to do this would be with an analog-to-digital conversion chip, but these aren't exactly easy to find (especially with the resolution we need). Instead, BattMan II uses a digital-to-analog converter controlled by the computer, and compares its output with the voltages being measured. Z1 is a 12-bit CMOS counter, and together with R1 through R25, forms another R-2R D-to-A converter that covers a range of 0 to 3 Volts. The converter is controlled by the two high-order bits (D6 and D7) of the parallel port. Setting D6 momentarily high clears the counter, and restores the D-to-A output (VDAC) to 0V. Then, pulsing D7 causes the counter to increment, and thus the output voltage to increase (the output voltage can be monitored at TP1). The positive battery terminal is connected to a voltage divider made up of R35, R36, and R37. During initial calibration, R35 is adjusted so that the maximum possible input voltage (the power supply voltage) is divided down to a voltage just slightly less than the maximum possible VDAC voltage (about 3V). Comparator Z3a compares the divided positive terminal voltage with VDAC. The output of Z3a is high when the divided voltage is greater than VDAC, and low when it's less. It is connected to the ERR input pin of the parallel port. Voltage divider R39, R40, and R41, together with comparator Z3b perform a similar function for the negative battery terminal. The output of Z3b is connected to the SEL input pin of the parallel port. The way the computer determines the battery voltage is to first reset Z1, and then start incrementing it while monitoring the SEL and ERR inputs of the parallel port. When SEL changes state, the current count is recorded (the computer can't read the output of the counter, but since it is controlling the counter, it can perform it's own internal count and use that). When ERR changes state, the current count is recorded again. Next, the voltage corresponding to each of the two counts is computed (using a table of values supplied during initial calibration). The two voltages are then subtracted to arrive at the battery voltage. Logic Power Supply and Spare PartsA 7805 voltage regulator steps down and regulates the 18 Volt power supply to provide a steady 5 Volt supply to the CMOS chips, the voltage comparators, and the relay coils.There are a few parts left over, namely two CMOS buffers from Z2, and an op-amp from Z4. After designing and building the prototype, I realized that these could have been used to implement a fail-safe that would monitor parallel port bit D7, and turn off the relay after 10 seconds or so of inactivity. This would detect cases of the computer "falling asleep at the wheel" (i.e. it has crashed and is no longer paying attention to running the BattMan device). I may design such a failsafe in the future, but in the mean time, never leave BattMan II unattended while it is turned on and connected to a battery! SoftwareThe BattMan II software is implemented using Borland's C++ Builder. It is available to download and install, and includes both the ready-to-run software (requires calibration), and complete source code in the form of a C++ Builder project for those of you who like to tinker with software as much as with hardware. Reading the source code is also helpful in understanding the operation of the hardware.
Nickel-Cadmium and Nickel-Metal-Hydride Charging Algorithm
Charging begins at the selected constant current. BattMan II monitors the voltage and keeps track of the highest voltage achieved so far during the charge. If the voltage then drops below the highest seen by a specific amount (0.5% for NiCd, 0.25% for NiMH) for some length of time (5 seconds), the battery is assumed to be fully charged and charging is terminated. The graph shown above illustrates the discharging and then charging of a NiMH battery. Lithium and Lead-Acid Battery Charging Algorithm
BattMan II cannot do constant-voltage charging, so a modification of this method is used. Initially, charging proceeds at the selected constant current, as in the CC/CV method. When the threshold voltage is reached (4.17V/cell for LiPo and Li-Ion, 3.57V/cell for LiNP, and 2.45V/cell for PbAcid), BattMan II will reduce the current to the next lower setting (the charge rate displayed at the top of the graph remains the initially selected rate). This will cause the voltage to drop, and charging continues until the threshold is reached once again. The process of reducing the current and resuming charging continues until the current is reduced to zero, at which point charging is terminated. This algorithm is equivalent to CC/CV, except that the current reduction is done in large steps instead of gradually and continuously. The end result is the same, and at no time is the battery allowed to exceed its charge cut-off voltage. ConstructionThe circuit is best built on a printed circuit board. Refer to my article on the subject, Making Excellent Printed Circuit Boards. Here is the printed circuit layout for BattMan II:
The following diagram illustrates component placement on the board:
Note that not all components are on the board. Specifically, power transistor Q3 is mounted to a heat sink outside the enclosure, and power resistor R45 is mounted inside the enclosure near Q3. On-board ComponentsBegin by installing jumpers J1 through J7 and the sockets for all the ICs. Then install all the resistors. I suggest installing all the 20.0kΩ 1% resistors (red-black-black-red) first, followed by all the 10.0kΩ 1% resistors (brown-black-black-red). Be careful, because they look very similar and the circuit won't function correctly if you mix them up. Next install all the remaining resistors and the capacitors. Also install pins into the test point (TP) holes. Install the two relays next. I don't advise using sockets for these because the pins will have to handle fairly high currents (higher than IC sockets are meant for). Then install the diodes, transistors Q1 and Q2, and the 7805 voltage regulator. A small heat sink on the regulator will keep it sufficiently cool. Finally install the three insulated jumpers, shown in green on the component placement diagram and in the photo.
The lead to the battery consists of two heavy gauge (#14) conductors to carry the charge/discharge current and two lighter conductors for measuring voltage (the voltage is not measured through the power leads because there can be a voltage drop along their length). Connect the sense leads to the power leads at the battery connector end. At the circuit board, solder the power leads to BAT+ and BAT- and the sense leads to SEN+ and SEN-. Next attach leads from the E, B, and C connections on the board to the emitter, base, and collector Q3. The C lead should be heavy gauge because it has to carry the full charge current. The B and E leads can be lighter because they only carry the low base current, and the current sense feedback voltage respectively. When connecting the the E lead to Q3's emitter, also connect a shorter heavy gauge wire to the emitter. The other end of this wire goes to current sense resistor R45. Connect the other side of R45 to GND on the circuit board, again with heavy gauge wire. Attach Q3 to a fairly large heat sink (in some cases, Q3 has to dissipate about 30 Watts of heat). Mount a small 5 Volt fan to the heat sink, and connect it to the points marked FAN+ and FAN- on the circuit board.
For connection to the computer, obtain a DB-25M solder-type connector. Prepare an 11-conductor cable and use it to connect the appropriate pins to the circuit board as shown by the numbers in parentheses along the bottom of the component placement diagram. EnclosureI installed the BattMan II prototype into a plastic project box. Q3 and its heat sink and fan are bolted to the back panel on stand-offs, while current sense resistor R45 is glued to the inside of the case. I made up a very short parallel port cable that just reaches the back panel, and then connected that to the computer with a 25-pin straight-through M-F extension cable (available at any computer store). I used a Deans Ultra Plug on a short lead for the power supply connection on the back panel. The battery lead comes out the front panel for ease of use.
Testing and CalibrationStart by double checking all your work, making sure the components are installed the right way around, and that you haven't inadvertently created any solder bridges (a magnifying glass is helpful). Do not insert any of the ICs into their sockets yet. Initial TestingConnect and turn on the power but do not connect BattMan II to a computer or battery yet. Insert a piece of solid hookup wire (telephone wire works well) into pin 16 of Z1's socket. Momentarily touch the other end of the wire to the the point where parallel port line D4 connects to the board. You should hear relay K2 turning on as you do this. Repeat for D5 and relay K1.
In the Relay Control panel, click the Charge radio button. Once again, K2 should turn on. Clicking Discharge should turn it off. Repeat using Connect and Disconnect to test K1. If this doesn't work, you've either got a cable wiring problem, or you've selected the wrong parallel port base address. Voltage Measurement CalibrationConnect a digital voltmeter between test point TP1 and ground (a handy place to connect to ground is the tab of the 7805 regulator). In the D-to-A Control panel, set the Count To field to 0 and click the Set button. The voltmeter should read very close to zero. Change the Count To field to 4095 and click Set again. The voltage should jump to about 3V. Record the exact voltage, which we'll call VDACmax.
Set Rate to Hex 00, set Mode to Charge, and Battery to Connect. Connect your voltmeter between TP3 and ground. Now connect the BAT+ and BAT- terminals (and thus also the SEN+ and SEN-) terminals together. Adjust R35 until the reading is just slightly less than VDACmax (an ideal setting is about 99.5% of VDACmax). Record this voltage as SEN+max. Move the voltmeter positive lead to TP4, adjust R39 until the voltage is as close as possible to SEN+max, and record this as SEN-max. Then move the voltmeter positive lead to the positive battery terminal (which is currently connected to the positive power supply line through K1 and K2) and record the power supply voltage (V+). Disconnect BAT+ and BAT- from each other and set Mode and Battery to Discharge and Disconnect respectively. In the Configuration File, edit the two lines labeled "sensor low-side and high-side multipliers" (highlighted in blue in the image) as follows:
Current Control CalibrationConnect a fully charged 8.4V to 12V NiCd, NiMH, or Lead-Acid battery to the BAT+ and BAT- terminals, with an accurate digital ammeter (rated for at least 5 Amps) in series with the BAT+ connection (positive ammeter lead to the battery). Set Mode to Discharge and Battery to Connect. The current flow should be close to zero.
Record all the rates by editing the sixteen entries in the right hand column (highlighted in red in the image) of the "charge and discharge rate pairs" table in the Configuration File. Set the Rate back to 00, disconnect the fully charged battery, and connect a discharged one. Set Mode to Charge, and once again slide the Rate control to each of its sixteen settings. Record the charging rates as the first value of each pair (highlighted in green in the image) in the aforementioned table. These should be within about 2% of the corresponding discharge rates (since the same circuit is regulating the current in both cases). When you've completed this step, select Disconnect and unplug the battery. Click the Save button to save all the changes you've made to the Configuration File and exit the Setup Assistant. Number of Charge RatesIf you want to allow for higher discharge rates than charge rates, you can use the "number of charge rates" setting to limit the maximum charge rate. For example, if you adjust R34 for a maximum current of 2A, but your power supply can provide only 1.4A, you can set the number of charge rates to 11 so that none of the rates above 1.4A are available for charging. I had to do this because my power supply, although rated for 2.2A, could only provide up to 1.4A with reasonable stability. Other SettingsThe remainder of the Configuration File contains additional settings that govern operation of BattMan II. The comments in the file describe each of these settings so I won't go into any further detail here. If you don't understand what some of these settings do, it's probably best to leave them set as they are. Testing and Using the FunctionsWith calibration completed, you're now ready to try the various functions BattMan II provides. The sections below describe each function. Monitor progress carefully the first few times to make sure everything is working as it should.
Connect a partially or fully charged battery and click the Discharge button. In the Discharge Settings dialog, select the type of cells, the rated capacity (in mAh), the number of cells in the battery, and the desired discharge rate. Click the Start button to begin discharging. The first thing BattMan II will do is measure the internal resistance of the battery so that it knows how much the discharging current affects the measured voltage. It will then begin discharging the battery, and plotting a graph as it progresses. The following information appears at the top of the graph:
None of the above will change during the discharge. The bottom of the graph shows progress information:
When the battery voltage (under load) has reached VMin, discharging will stop
and the information at the bottom of the graph will reflect the total
discharged capacity. A summary of the discharge operation will also be written
to the log file "
After you click Start, BattMan II will begin charging the battery and plotting a graph. The following information appears at the top of the graph:
BattMan2.csv".
The Auto Cycle function sets BattMan II apart from other battery chargers and dischargers. Cycling a battery can quickly tell you its capacity, yet leave it fully charged at the end of the operation. Tired NiCd (and to some extend NiMH) batteries can be rejuvenated by cycling, and new NiCd and NiMH batteries can be cycled a few times to achieve their full rated capacity. Connect a battery in any state of charge and click the Auto Cycle button. The first three sections of the Auto Cycle Settings dialog are a combination of the Discharge and Charge dialogs (since cycling does both). There's also a section where you can specify:
The information displayed at the top and bottom of the graph during the discharge part of a cycle operation is the same as that displayed during a discharge operation, except that the word "Discharge" on the top is followed by "n of m" indicating the current cycle number. Likewise, the same information appears after the word "Charge" during the charge portion of the cycle. Also, the capacity charged so far, as indicated at the bottom of the graph, is followed by a slash and the capacity that was discharged previously (e.g. "Charge: 1234mAh/2375mAh"). Between alternating discharge and charge phases, there is a delay to allow the battery to stabilize (to avoid problems like false peak detection). By default, this delay is 60 seconds.
To measure the internal resistance of a battery, connect it and click the Resistance button. BattMan II measures both charging and discharging resistance, at the currents that you specify in the Internal Resistance Test Settings dialog. The measured resistances, and their average, are displayed in the graph pane (which will be otherwise blank). Voltage MonitoringClicking the Monitor button lets BattMan II operate as a voltmeter that plots the voltage on a graph as time progresses. This is useful for monitoring the self-discharge of a battery, or perhaps monitoring the battery voltage while it is being charged by a stand-alone charger (such as the charger you might use on the flying field). The following information is displayed and updated at the bottom of the graph:
It is important to note that during monitoring, the negative terminal of the battery is connected to ground. This means that the voltage monitoring feature cannot be used if the battery being monitored is connected to a charger that connects the negative terminal to something other than ground. Otherwise, current will flow between BattMan II and the external device, and may damage one or the other (or even your computer). An example of such a problem would be monitoring the operation of a field charger that's getting its power from a power supply. However, if the external device is completely isolated from the AC power system your computer is plugged into, there will be no problem (for example, a field charger that is getting its power from a 12V deep cycle battery that is not itself connected to a charger). Saving GraphsAfter a discharge, charge, cycle, or monitor operation has completed (or has been interrupted by clicking the Stop button), you can save the displayed graph in Windows Bitmap format (.BMP) by clicking Save. You can convert the resulting file to other formats (e.g. GIF, JPEG) using image editing software such as Adobe® PhotoShop®. Parts ListThe following table lists all the parts needed. These can be obtained at any electronic supply house, such as DigiKey. None of the parts are uncommon or hard to find, so you may already have most of them in your personal inventory. All resistors are ¼W unless otherwise noted. Capacitors should be rated at least 10V unless otherwise noted.
ModificationsThere are a number of modifications that will make BattMan II even better. Here are some ideas: Fail-SafeCurrently, if the computer that is controlling BattMan II should crash while it is charging or discharging, there's no guarantee that it will stop. If left unattended, this could have serious consequences. A fail-safe circuit could monitor line D7 from the parallel port, which is used to increment the D-to-A converter counter. When the BattMan II software is operating normally, it is constantly pulsing this line in order to take voltage readings. If no pulses are seen on this line for some period of time (five seconds perhaps), the fail-safe can assume that the computer has crashed and could turn off relay K1, thus disconnecting the battery from the charger. It's probably possible to construct the fail-safe circuit using a few resistors and capacitors, and the unused buffers Z2e and Z2f. There might even be room to modify the existing circuit board layout without having to completely rearrange it.
Parallel ports are still quite common on desktop computers, but they are becoming rare on laptops, having been supplanted by USB. A USB-based interface would allow BattMan II to be used with such PCs. Rather than adding USB support directly to the circuit, it would be simpler to use a USB Interface experimenter board such as this one or this one. These provide a number of input and output lines that could be connected directly to the parallel I/O pins of BattMan II. The software could then easily be modified to drive the experimenter kit instead of a standard parallel port. Higher CurrentWith a sufficiently large power supply and a proportionally larger heat sink and cooling fan for Q3, there's no reason that the charge and discharge current limits couldn't be increased to 5 Amps or so. However, at these higher levels, the aforementioned fail-safe is more important than ever.Other R/C Electronic ProjectsIf you are interested in building more of your own R/C equipment, you may also want to look at these articles:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SubscribeShare |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||