Go to Post Wow! Can I be wrong too? Please! - dlavery [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rating: Thread Rating: 3 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 19-02-2012, 16:22
zrem zrem is offline
Registered User
FRC #2130
 
Join Date: Jan 2012
Location: Idaho
Posts: 3
zrem is an unknown quantity at this point
Lightbulb 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+
Reply With Quote
  #2   Spotlight this post!  
Unread 19-02-2012, 16:36
jase728 jase728 is offline
Registered User
AKA: Jase728
FRC #3210 (Falcons)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2009
Location: Hillsboro
Posts: 11
jase728 is an unknown quantity at this point
Re: Returning battery voltage into user program

uhmm in Java the battery voltage can be returned as a get method in the driverstation class
__________________
"In theory there is reality, but in reality there is no theory" - Erich Keane (FRC 2010 Build Season - Team 3210)
Reply With Quote
  #3   Spotlight this post!  
Unread 19-02-2012, 17:15
zrem zrem is offline
Registered User
FRC #2130
 
Join Date: Jan 2012
Location: Idaho
Posts: 3
zrem is an unknown quantity at this point
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

Last edited by zrem : 19-02-2012 at 17:18.
Reply With Quote
  #4   Spotlight this post!  
Unread 19-02-2012, 17:45
rbmj rbmj is offline
Registered User
FRC #0612 (Chantilly Robotics)
Team Role: Alumni
 
Join Date: Apr 2011
Rookie Year: 2011
Location: DC Area/Fairfax County
Posts: 192
rbmj is a jewel in the roughrbmj is a jewel in the roughrbmj is a jewel in the rough
Re: Returning battery voltage into user program

http://rbmj.github.com/612-code/doc/...0cf80 30f85bf
Reply With Quote
  #5   Spotlight this post!  
Unread 19-02-2012, 18:12
jase728 jase728 is offline
Registered User
AKA: Jase728
FRC #3210 (Falcons)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2009
Location: Hillsboro
Posts: 11
jase728 is an unknown quantity at this point
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
__________________
"In theory there is reality, but in reality there is no theory" - Erich Keane (FRC 2010 Build Season - Team 3210)
Reply With Quote
  #6   Spotlight this post!  
Unread 19-02-2012, 18:32
RufflesRidge RufflesRidge is offline
Registered User
no team
 
Join Date: Jan 2012
Location: USA
Posts: 989
RufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant future
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();
Reply With Quote
  #7   Spotlight this post!  
Unread 19-02-2012, 19:29
Dale(294engr]'s Avatar
Dale(294engr] Dale(294engr] is offline
Mentor/Sponsor since '98
FRC #0294 (Beach Cities Robotics)
Team Role: Engineer
 
Join Date: Jan 2004
Rookie Year: 1998
Location: Redondo Beach, CA
Posts: 92
Dale(294engr] is a glorious beacon of lightDale(294engr] is a glorious beacon of lightDale(294engr] is a glorious beacon of lightDale(294engr] is a glorious beacon of lightDale(294engr] is a glorious beacon of lightDale(294engr] is a glorious beacon of light
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.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


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

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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