Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Dashboard: how to calculate battery voltages? (http://www.chiefdelphi.com/forums/showthread.php?t=67888)

JBotAlan 29-05-2008 22:47

Dashboard: how to calculate battery voltages?
 
Hello,

I have been hacking on a small VB app to connect to the dashboard port during matches to record every packet into a CSV file for analysis in Excel. It's a handy little tool, but I'm looking to extend its functionality.

For now, I can't figure out how to calculate, given the 1 byte battery voltage, the actual number of volts. Is there some magic formula I must run the byte through to get the proper voltage? :confused:

Thanks.

BTW, I may release this app once it's a bit better. Right now it's just a mash of code I wrote last-minute...I really needed it to figure out why our auto-correction in auton wasn't working.

JBot

AustinSchuh 29-05-2008 23:09

Re: Dashboard: how to calculate battery voltages?
 
I have no way to test if this helps you, but I found this in ifi_aliases.h It leads me to believe that you should scale the readings you get back by the same amount as IFI does in this code.

Code:

/*
 *-----------------------------------------------------------------------------------------------------
 *---------- Aliases for Battery Voltage bytes --------------------------------------------------------
 *-----------------------------------------------------------------------------------------------------
 * 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



All times are GMT -5. The time now is 00:09.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi