|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Converting accelerometer values???
Hello,
I am currently working on some autonomous code and I need some help in understanding some information about accelerometers... To start off I have a question in regards to the central voltage and gain... What do these numbers mean and how do i adjust these numbers in order to get a proper reading (apparently 1G) which can later be converted to Velocity and Distance? Thank you Technic-R-C |
|
#2
|
|||||
|
|||||
|
Re: Converting accelerometer values???
Are you using LabVIEW or C++? The specific answers are different for each environment, though the concepts are the same.
The "central voltage" is the voltage the accelerometer outputs when there is no acceleration. It translates to "zero G". The "gain" is the voltage the accelerometer output changes by for a given measured acceleration. The accelerometers we received in the 2009 Kit of Parts have a central voltage of 1.5 volts, with a gain of 300 millivolts per G. This information is in the 2009 Sensor Manual which you will find under Section 8 - The Robot on the 2009 FIRST Robotics Competition Manual and Related Documents page. |
|
#3
|
|||
|
|||
|
Re: Converting accelerometer values???
Great!! Thank you for your responses,
Now to go on and convert this accelerometer value into a change in distance and velocity value... Does anybody have an idea of where i should begin in my setup of this code? (btw I am using LABVIEW to program our robot) or maybe if i'm lucky, is somebody willing to share a bit of their code dealing with the conversion of accelerometer numbers to velocity and distance values Thank you Technic-R-C |
|
#4
|
|||
|
|||
|
Re: Converting accelerometer values???
I'm using Windriver, not LabView. The basic idea is to integrate the accelerometer output to get velocity, and integrate velocity to get distance.
Code:
#define X_ACC_ZERO 1.5 #define Y_ACC_ZERO 1.5 AnalogChannel *m_accelerometerX; AnalogChannel *m_accelerometerY; m_accelerometerX = new AnalogChannel(2); m_accelerometerY = new AnalogChannel(3); // initialize: XVelocity = 0.0; YVelocity = 0.0; XDistance = 0.0; YDistance = 0.0; // periodic: XVelocity += m_accelerometerX->GetVoltage() - X_ACC_ZERO; YVelocity += m_accelerometerY->GetVoltage() - Y_ACC_ZERO; XDistance += XVelocity; YDistance += YVelocity; Last edited by oddjob : 07-02-2009 at 00:12. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Converting LabView to C/C++? | Pneumaticsman | Programming | 5 | 24-01-2009 11:06 |
| Converting .wmv | Jay W. | IT / Communications | 6 | 04-05-2005 15:43 |
| Format converting | roberthan | 3D Animation and Competition | 7 | 16-05-2004 13:42 |
| Converting CAD!? | Tton | 3D Animation and Competition | 3 | 25-03-2003 17:29 |
| Converting Files | Hailfire | Programming | 9 | 28-12-2002 18:59 |