Go to Post And your other point, "why a debate over a nonexistent rule?". Its summer, we're not building robots, and we're geeks. What else are we supposed to do? - EHaskins [more]
Home
Go Back   Chief Delphi > Technical > Technical Discussion
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 06-02-2009, 20:55
Technic-R-C Technic-R-C is offline
Registered User
FRC #2358
 
Join Date: Dec 2008
Location: Chicago
Posts: 21
Technic-R-C is an unknown quantity at this point
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   Spotlight this post!  
Unread 06-02-2009, 21:37
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
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   Spotlight this post!  
Unread 06-02-2009, 22:00
Technic-R-C Technic-R-C is offline
Registered User
FRC #2358
 
Join Date: Dec 2008
Location: Chicago
Posts: 21
Technic-R-C is an unknown quantity at this point
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   Spotlight this post!  
Unread 07-02-2009, 00:07
oddjob oddjob is offline
Registered User
no team
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Earth
Posts: 118
oddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to behold
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;
You'll probably have to add code to manage drift, shocks due to collisions, etc., which will cause the velocity and distance variables to diverge from the actual robot velocity and distance traveled. Depending on what you need the numbers for, you might need to convert the units e.g. to actual velocity in m/s. Note that 1G is 9.81 m/(s*s) so that's a start.

Last edited by oddjob : 07-02-2009 at 00:12.
Closed Thread


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

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


All times are GMT -5. The time now is 02:58.

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