Get the SoR Robotics Android App on Android Market for FREE. See this forum post for details.
0 Members and 1 Guest are viewing this topic.
Unfortunately that will not be very accurate, as under load the battery voltage will drop, so a true reading of charge level can't be read.
There are two ways to approach this.A 'coulomb counter' method, basically track current flow out of the battery. You know your battery has X Amp hours, and has been drawing Y current for Z hours. Battery left = X - YZ. This method does not have to worry about voltage drop under load, but it means you have to store the amount of current 'used' in non-volatile memory to keep the number between MCU power cycles. Also, you will eather have to write to memory often (and burn out the memory space) or have a 'controlled shutdown' button on your robot that stores the variable before you turn it off. The other method is to model the voltage vs time curve of your battery as it discharges. Once you have that model, you can read the present voltage of your battery, and compare it to the curve for capacity remaining. To account for voltage drop because of load, you can also measure current at the same time, and (assuming you know / can measure the internal resistance of your battery) account for the voltage drop by adding Internal Resistance * current to your measured voltage.
Just a quick question, what do you measure the outputs at when the LED is on or off? Does it give levels that are easily converted to digital?
Your model for the coulomb counter will not work because the battery capacity is affected by many factors including self discharge, temperature, and current draw.
Quote from: galannthegreat on May 05, 2010, 11:49:16 AMJust a quick question, what do you measure the outputs at when the LED is on or off? Does it give levels that are easily converted to digital?Why in the world would you want to do this? Just use a voltage divider and a ADC pin.
With transformers you get the change in current consumption... and if you ask me quite accurate with multi windings....
Playing around with inductance is like a quad encoder... Quite difficult to install, more program lines but better results... Basically... it's a quad encoder for current...And it's "Ideas" for determining the charge.... so on...And that's not a bad idea at all... complicated yes... Already implemented yes... Commercialized yes...What else???
It's all fine with low current and moderate voltages. You could stick a 5W resistor, measure the current drop, and there's your current. But what about larger currents? What about 15V and 10A? A 1 ohm resistor would need to dissipate 100W. That's big and it's a waste of power. What to use then? Or is the resistor wired in some other way, not in series with the consumer?
I ask this because, while looking over current choppers, they all seem to use a series resistor to measure a current drop. When that gets too big, it starts an oscillator that switches a series transistor on/off. Like i said, all fine for low power, but what about bigger power?
But... I KISS nobody