Battery Minder and code for Propeller
Gamekiller
Posts: 5
Well i am back again to see if the public can help me. I first want to thank those that help me with the serial problem i was having. We got that all working.
Now on to a new topic "Battery Minding" and how it may be done.
We are looking at having the propeller monitor how much power it has left on its power supply and on the main drive unit batteries. I am new to a lot of this but i know it can be done.
I wanted to see what people have done out there so i do not have to reinvent the wheel.
Cheers,
Andy
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
to mod or not mod. That is the qestion.
www.jambot.com
Now on to a new topic "Battery Minding" and how it may be done.
We are looking at having the propeller monitor how much power it has left on its power supply and on the main drive unit batteries. I am new to a lot of this but i know it can be done.
I wanted to see what people have done out there so i do not have to reinvent the wheel.
Cheers,
Andy
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
to mod or not mod. That is the qestion.
www.jambot.com
Comments
Short answer: It can't be done.
Long answer: You need to measure the current drawn out of the battery and integrate it over time. If the load is varying a lot, you also need correction factors (high load, less consumable capacity).
Just measuring the voltage is not enough because batteries are designed to have a as much as possible constant output voltage over their live.
There are special chips available to do the job. Formerly they were from Benchmarkq ("bq") and are now from TI? Sorry, no part numbers in my brain.
Nick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never use force, just go for a bigger hammer!
The DIY Digital-Readout for mills, lathes etc.:
YADRO
Each type of battery has a characteristic discharge curve of voltage over time that's affected by the internal resistance
of the battery and the temperature (and the internal resistance interacts with the discharge rate). In your case, you
know what kind of battery you're using (probably either lead-acid or NiMH) and what its rated capacity is. You can
create a table for your battery based on the characteristic curve of voltage vs capacity and estimate where along the
curve you are. Because the battery load will affect the voltage and you have no current sensor, the estimated charge
will vary with load, but since the Propeller is controlling much of the load, you will know when there's a light load and
you can measure the voltage at that point. You can also estimate the drain based on the amount of time the large
loads are on. Once the Propeller sees the "knee" in the curve that occurs when the battery is nearly exhausted, it
can correct its estimates for next time (and go into a low power mode asking for a recharge).
It can't be done.
Allone the influence of the temperature is so big that it is simply useless. Also, the time between end of charge and measuring the voltage has a huge influence.
For the relation between capacity and voltage (depeding on storage time after a charge): Between 20% and 80% of remaining capacity, you have a voltage drop of as little as 0.05V.
Ergo: Forget it!
<http://us.sanyo.com/batteries/pdfs/twicellT_E.pdf>
Nick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never use force, just go for a bigger hammer!
The DIY Digital-Readout for mills, lathes etc.:
YADRO
The diagram I enclose is from some Duracell NiMH cells..
See, Li-ion battery voltage vs. discharge from what I understand is quite more unstable than the conventional types of cells.· Some recommend a buck-boost dc/dc converter to keep the voltage more "linear" or "regulated".··The·in line 3.3v regulator on the protoboard is quite inefficient and should only be viable when·wall power is available.· You might have to worry about the voltage ripple at the output, but most·modes can be snubbed with a rc branch. These sili chips hate noise and get scrambled.·and check out Maxim-ic.com's "power supply cookbook" for a slew of small switched power supplies of all sorts.·
I actually like TI's tps61081 charge pump·for "regulation".· You can use 1 or 2 li-ion cr-123a cells from parallax's accessory page (very cheap by the way, and rechargable). With the TPS and a few small external components you can get 50v @ 50mA from 2 Li-ions , with efficiencies of about 80% +.· The output of the TPS can also provide 24v, 12v, 6v, and anywhere inbetween with just a few resistors in the circuit to change.· Get a good bulk cap for the output , matched to your instantaneous current demands,· And if your batteries (2 in series) start to lose voltage , the pump will take 3 to 6 volts and can·produce the same output voltage if you can actively change its resistors. Try using a digital pot from the parallax accessory page. ·If you use this method, you can get alot of flexibility out of your battery pack .·
Theres also a zillion app notes on stuff like this on all kinds of sites.
i think maybe some experts are floating around in this area.· You can consult maxim-ic's 24hr turnaround design advisors thru email.· They wont respond unless you sound knowledgeable.
·
Ryan O'Hara
We were trying to determine battery power levels based on rechargeable batteries. How do you measure your own battery voltage? A voltage divider based on 2 resistors always gave the same readings as the voltage decreased. Why? The A/D converter is based on percentage of the supply voltage. If a voltage divider based on 2 x 10k resistors was used, the mid-point always showed 1/2 of the supply voltage, no matter what the supply voltage was at any point.
The problem was solved by using a zener diode and a resistor as the divider. Since the diode always had a constant drop voltage, the resistor showed what ever was left over and decreased in step with the batteries. At a certain point we are able to put the micro into sleep mode or at least stop using the high powered devices (which were LEDs).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheers,
Simon
www.norfolkhelicopterclub.co.uk
You'll always have as many take-offs as landings, the trick is to be sure you can take-off again ;-)
BTW: I type as I'm thinking, so please don't take any offense at my writing style
That's why it is common practice to supply the ADC with a regulated voltage, use one with an internal reference or build an external reference.
Nick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never use force, just go for a bigger hammer!
The DIY Digital-Readout for mills, lathes etc.:
YADRO
I've looked at this issue of battery "health" and "capacity" monitoring in the past. It is a difficult subject. But in doing so, I started to ask some basic questions:
What is needed? I believe what is most often needed is a way to store data to non-volitile storage before a battery fails. By "fails", I mean voltage is dropping below the point where the system's voltage regulator can't supply the proper voltage and current necessary to keep the system up. In this case you need to sample the system's battery voltage before any regulators and make a decision when to store data to non-volitile memory and either shut the system down in an orderly way or just let it die on its own without adding possible bad data to non-volitile storage in the process.
If the system is exposed to anything other than room-temperature environments, then you need to reference your A/D or comparator to a temperature compensated voltage reference. There are lots of parts out there for this and some A/D's include them on-chip. Yes there are sophisticated battery managment application-specific parts out there, but I'm talking in a more general sense here...
For "Human life-critical" systems that have to be "in the field" the battery health is typically determined at the charger. The "Smart" chargers test the batteries for discharge characteristics against battery time in-use and even "recondition" the batteries when needed. Smart chargers have methods that can predict when a battery needs to be changed/serviced, hence warning the user before a system is taken out to the field if battery failure is pending. This kind of strict battery management typically requires predictable battery types and chemistry, not user changeable generic AA-like cells.
However, there is another approach that is somewhat risky, comparatively simple, but relatively costly: If you're willing to spend more money on batteries, supply enough cells to always supply enough voltage in-case one (or more) batteries fail so the system keeps running. Then do a simple battery voltage test and monitor what happens to the battery voltage over "power on-time" and code an algorithm based on a trigger voltage that decides: ok, we were up for six hours on battery yesterday, but today we're up only three hours - result being: "Alert Will Robinson, Battery Pack May Be Bad!" You need non-volatile storage for this, but not necessarily a real-time clock.
This approach tells you when your battery pack is failing, not when your battery pack is so low failure is about to happen. This approach doesn't work well with higher current systems that use linear regulators, the higher battery voltage just ends up as heat dissipated in the linear regulators, use switchers instead.
Another consideration: These days, relatively efficient step up switchers are available that can take every last drop out of a lower voltage battery pack and keep your system up. As always complexity = cost, and you still have to manage things as described herein.
I suggest you make a decision-tree that outlines exactly what you expect from your "Battery Minder". This will help you & help us help you.
When you get close to defining what you want to do in power management, I suggest you look at parts from www.linear.com and dowload Linear's completely free LTSpice/SwitcherCADIII general purpose Spice simulation application (of-course Linear's excellent devices come pre-packaged as models in the simulator). There's a good user forum for LTSpice/SwitcherCADIII at tech.groups.yahoo.com/group/LTspice/. I try not to push one vendor's general solutions over another, but Linear Technology has given so much back to the the electronics engineering community with the free LTSpice/SwitcherCADIII, that it deserves mention.
Best Regards,
David
Post Edited (Drone) : 12/6/2007 3:28:49 PM GMT