Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   Returning battery voltage into user program (http://www.chiefdelphi.com/forums/showthread.php?t=103295)

zrem 19-02-2012 16:22

Returning battery voltage into user program
 
Hey is there anyway to return the battery voltage to the user program, our team was noticing that we need to aim slightly differently in order to compensate for the drop in voltage caused from running our motors. So I was hoping there was someway to return the voltage and compensate for it in order to be more accurate any help on this would be awesome.

Thanks: 2130 Alpha+

jase728 19-02-2012 16:36

Re: Returning battery voltage into user program
 
uhmm in Java the battery voltage can be returned as a get method in the driverstation class

zrem 19-02-2012 17:15

Re: Returning battery voltage into user program
 
Yes however I was needing it in C... where is it under the java though? it might be under a similar file in C.
and It is thank you very much

rbmj 19-02-2012 17:45

Re: Returning battery voltage into user program
 
http://rbmj.github.com/612-code/doc/...0cf80 30f85bf

jase728 19-02-2012 18:12

Re: Returning battery voltage into user program
 
Uhmm I think in Java if you import the DriverStation class or it might be in the DriverStationLCD class

RufflesRidge 19-02-2012 18:32

Re: Returning battery voltage into user program
 
There is a method for this in the Driver Station class.

This line code should do what you want I believe:
Code:

float voltage;
...
...
voltage = DriverStation::GetInstance()->GetBatteryVoltage();


Dale(294engr] 19-02-2012 19:29

Re: Returning battery voltage into user program
 
Zem.. you may wish to consider / implement encoder feedback closed loop speed control on shooter motor (PID)
to automatically compensate for battery voltage droop and dynamic IR load drops from drive motors
and apply full power after each shot to most quickly get back to regulated set speed needed for consistent shooting.


All times are GMT -5. The time now is 13:38.

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