|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
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 ^_^ Last edited by techkid86 : 09-01-2012 at 18:37. |
|
#2
|
|||
|
|||
|
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. |
|
#3
|
||||
|
||||
|
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?
|
|
#4
|
||||
|
||||
|
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(); 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 ). |
|
#5
|
||||
|
||||
|
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! ^_^ |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|