Go to Post The neat thing about regionals, is that they ARE big robot parties! - MrForbes [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 09-01-2012, 18:34
techkid86's Avatar
techkid86 techkid86 is offline
Magic Programer
FRC #3044 (0xBE4)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2010
Location: ballston spa
Posts: 58
techkid86 is an unknown quantity at this point
Question Finding battery voltage?

hi all. last year team 3044 made a robot that used an arm attached to a window motor. i assisted with the autonomus code, and the issue we had was that when the battery voltage went down, the arm moved less. (and of course we had not other feedback control sensor) so we attemped to use the voltage to change the power outputed to the arm durring autonomus. we failed. we had the code, exept we could not get a voltage value as an int or any other value. we were using labview last year, but now we have switched to java. we have the voltage outputed to the driver station as it is. i think it may be of use this year.

can anyone help? thank you all in advance ^_^
__________________
"you can build a perfect machine out of imperfect parts" -Urza

Last edited by techkid86 : 09-01-2012 at 18:37.
Reply With Quote
  #2   Spotlight this post!  
Unread 09-01-2012, 18:43
EricVanWyk EricVanWyk is offline
Registered User
no team
 
Join Date: Jan 2007
Rookie Year: 2000
Location: Boston
Posts: 1,597
EricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond repute
Send a message via AIM to EricVanWyk
Re: Finding battery voltage?

What you are attempting is called an open-loop compensation: Measure everything that affects the result, and find a function that (hopefully) compensates for them. This is inherently difficult and prone to error - what if there is something else that also affects your result that you aren't measuring?

Put a sensor on what you are trying to control and close the loop. A potentiometer will likely serve your purpose well.
Reply With Quote
  #3   Spotlight this post!  
Unread 09-01-2012, 18:52
techkid86's Avatar
techkid86 techkid86 is offline
Magic Programer
FRC #3044 (0xBE4)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2010
Location: ballston spa
Posts: 58
techkid86 is an unknown quantity at this point
Question Re: Finding battery voltage?

we attempted this with the gyro, but we found our algorithum to work better when the gyro received static.... (it was unplugged) but is there a way for the voltage to be a value that java can interperate?
__________________
"you can build a perfect machine out of imperfect parts" -Urza
Reply With Quote
  #4   Spotlight this post!  
Unread 10-01-2012, 00:52
JewishDan18's Avatar
JewishDan18 JewishDan18 is offline
Registered User
FRC #1700
Team Role: Engineer
 
Join Date: Feb 2009
Rookie Year: 2007
Location: Sunnyvale, CA
Posts: 185
JewishDan18 is a splendid one to beholdJewishDan18 is a splendid one to beholdJewishDan18 is a splendid one to beholdJewishDan18 is a splendid one to beholdJewishDan18 is a splendid one to beholdJewishDan18 is a splendid one to behold
Re: Finding battery voltage?

Although I think you would be far better off with a closed loop control as Eric said, I took a quick peak in the driverstation code (I would like to read it so I can give myself a more obvious warning when the battery is dying and I can't think of why things stop working), and found something that would most likely work:

Code:
import edu.wpi.first.wpilibj.DriverStation;

...

DrivetStation DS = DriverStation.getInstance();

...

double voltage = DS.getBatteryVoltage();
It is important that the CRIO has the proper jumper to read the voltage; if you see voltage on your dashboard, this should work. I have not tested it, and I don't know what sort of value it returns, but I will most likely look into it tomorrow.

I question why the battery was low enough to make the arm much slower; how long do you run the robot before putting a charged battery in? We swap after the voltage drops below 12v (if we remember ).
Reply With Quote
  #5   Spotlight this post!  
Unread 10-01-2012, 20:41
techkid86's Avatar
techkid86 techkid86 is offline
Magic Programer
FRC #3044 (0xBE4)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2010
Location: ballston spa
Posts: 58
techkid86 is an unknown quantity at this point
Re: Finding battery voltage?

thank you so much. i am going to check it right now. the arm is slowed just enough to make a difference. we had to get the arm completely vertical, and a slight difference in battery changes that slightly.... unfortunatly it was unrepeatable due to minute changes.

thanks again! ^_^
__________________
"you can build a perfect machine out of imperfect parts" -Urza
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 12:45.

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