View Full Version : RoboRio Accelerometer
roberthashley
26-01-2015, 08:26
Hi im a programmer on team 2611 and we are thinking of using the built-in accelerometer on the RoboRio to make are bot drive straight, but we have no idea how to do that. I have been looking all over the internet and the example codes, and nothing can someone help us.
anthonyttu
26-01-2015, 09:20
It would be easier to help if you gave more feedback about which programming language your team is using. This is a link to the WPI tutorials for accelerometers. The built in about half way down the page.
https://wpilib.screenstepslive.com/s/4485/m/13810/l/241870-accelerometers-measuring-acceleration-and-tilt#Accelerometer_interface
roberthashley
26-01-2015, 09:45
We are using labview
Alan Anderson
26-01-2015, 10:15
I can't think of any way to use accelerometer information to control the robot's direction. You'd need something that can measure turning, like a gyro (yaw rate sensor) or wheel encoders on the left and right sides of the robot.
Greg McKaskle
26-01-2015, 10:18
If your goal is to drive straight, you may find it easier to accomplish using a gyro or wheel encoders.
An accelerometer will give you translational forces, and depending on where the gyro is mounted, you may be able to calculate rotational forces from that. Also, if the robot tilts, gravity's effect will show up on the X and Y axes and appear as a translational force.
So while using the accelerometer may provide some data to improve your robot's ability to drive straight, it may not be the most direct route.
Greg McKaskle
roberthashley
26-01-2015, 10:34
Ok thanks. We were trying to save space in the electrical box but I guess we will have to use a gyro. Thanks again.
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.