View Full Version : Battery Voltages in Dashboard
With ever more questions about the Dashboard... :p
I managed to get the two bytes used for the battery voltages to be displayed. Those bytes are nice, they give me a relative idea of how much power I have, but that's not all that useful.
I remember last year IFI had a little formula that was in the PBASIC code or the Dashboard spec sheet, I think, but I can't find it. It gave you the battery voltage based off of the binary number the dashboard port outputs.
If anyone has that formula, or has devised their own that works, care to share? The only formula I've made is off by too much to be useful :(.
Astronouth7303
06-03-2004, 20:32
No Idea, I would assume that either it's tenths of a volt (0 to 120) or it's scaled so that 12v = 255 (254? I'm never sure).
No Idea, I would assume that either it's tenths of a volt (0 to 120) or it's scaled so that 12v = 255 (254? I'm never sure).
It's not tenths of a volt as I'm recieving values too high for that, and why would they waste resolution? Doesn't make sense to use 7 bits in a byte, and leave the other standing alone. Also, look at the old PBASIC code, they have formulas in there which I tried to use, and they went to way above 120, and IFI probably used something similar to those formulas this year, I just can't find it.
Also, it can't be 12 volts is the same as 254, as that would create huge problems when teams charge their batteries up to 13.6 volts, as my team does every year.
Please, if you have no idea as to what I'm asking, don't answer with stupid assumptions that anyone who's dealt with the controllers for more than 5 seconds can shoot down. It wastes time and space, and the community doesn't benefit. I don't go and post answers in the CAD forums, cause I have no idea about CAD, and me posting anything there doesn't help anyone.
Anyways, back to the question at hand, does anyone know how IFI set up the battery voltage bytes on the dashboard stream, or have come up with their own way to correctly display voltage?
Astronouth7303
06-03-2004, 21:08
I can't, this is my first year in FIRST. And I wouldn't call the answers 'stupid'; they were the end result of simple logic. I have not, however looked at the packets themselves.
Even brightest people do things that occasionally make no sense; considering such ideas, for even a short amount of time, can be benefical. I know: I did Odyssey of the Mind for 6 years before this. Thinking out of the box and considering 'stupid' ideas is never bad.
I can't, this is my first year in FIRST. And I wouldn't call the answers 'stupid'; they were the end result of simple logic. I have not, however looked at the packets themselves.
Even brightest people do things that occasionally make no sense; considering such ideas, for even a short amount of time, can be benefical. I know: I did Odyssey of the Mind for 6 years before this. Thinking out of the box and considering 'stupid' ideas is never bad.
When ideas can be shown to be incorrect with about 5 seconds worth of research (http://www.innovationfirst.com/firstrobotics) or by simply turning on the robot after fully charging the battery, they're not exactly considered beneficial at all. If you'd like to argue about "thinking outside of the box" you can email me or contact me through AIM (both are in my signature), but stop posting in this thread if that is all you have to say, as I'm trying to figure out how to get the correct battery voltages on the 2004 dashboard, not the benefits of thinking outside the box.
Astronouth7303
06-03-2004, 21:26
I'm not seeing how the page referenced disproves the sugestion. And I do not have the software and the RC together. For our purposes so far, IFI's Dashboard has worked perfectly. I am currently more concerned with autonomous mode right now. If you know the voltage of the battery and the value recieved for 2 different levels, can't you just figure it out? You sound as though you actually have the RC sitting next to you. And personally, if I'm not sure about something like this, I make theories and check them. Those were starting points.
And I do not apreciate these personnal attacks. Good Night.
I'm not seeing how the page referenced disproves the sugestion. And I do not have the software and the RC together. For our purposes so far, IFI's Dashboard has worked perfectly. I am currently more concerned with autonomous mode right now. If you know the voltage of the battery and the value recieved for 2 different levels, can't you just figure it out? You sound as though you actually have the RC sitting next to you. And personally, if I'm not sure about something like this, I make theories and check them. Those were starting points.
And I do not apreciate these personnal attacks. Good Night.
I do have an RC sitting next to me, but I only have a 9 volt battery and a 7.2 volt backup battery, neither of which have helped me with reference points, hence the question on the forums as to if anyone else has figured it out. I have no urge to kill the only 9 volt battery I have in my house, just to figure out a formula.
Jay Lundy
07-03-2004, 06:57
This is probably what you're looking for. Straight from ifi_aliases.h
/* Formula to calculate voltage in volts:
* current_voltage = battery_voltage * 0.038 + 0.05;
*/
#define battery_voltage rxdata.rc_main_batt*15.64/256
#define backup_voltage rxdata.rc_backup_batt*15.64/256
This is probably what you're looking for. Straight from ifi_aliases.h
/* Formula to calculate voltage in volts:
* current_voltage = battery_voltage * 0.038 + 0.05;
*/
#define battery_voltage rxdata.rc_main_batt*15.64/256
#define backup_voltage rxdata.rc_backup_batt*15.64/256
I thought that'd be it too, but it seems to be off by -0.5 volts on the main battery voltage, and off by at least 0.6 volts on the backup battery voltage. I might try to grab several values while powering up as many motors as I can, so I can grab a high voltage number and a low voltage number and hope they used a linear scale, but that'll most likely have to wait till SBPLI, which is just under two weeks away.
Joe Ross
07-03-2004, 14:10
The formula for previous years was Vin = ((4.7/14.7)* Battery voltage)-0.4
The formula for previous years was Vin = ((4.7/14.7)* Battery voltage)-0.4
Yeah, that gives me voltages about 5 times too high.
Err.
Heh, I think that might work, if I just divide that by 5. A moment of clarity :p.
I'll try that in a little bit, hopefully it works.
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.