Go to Post FIRST cannot enforce Gracious Professionalism on the participants in this program, you will have to do it on your own. - Ken Leung [more]
Home
Go Back   Chief Delphi > Technical > Electrical
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 16-01-2005, 16:22
Leav's Avatar
Leav Leav is offline
Spud Gun Division
AKA: Leav Oz-Ari
FRC #3316 (D-Bug)
Team Role: Mentor
 
Join Date: Dec 2004
Rookie Year: 2005
Location: Technion, Haifa, Israel
Posts: 773
Leav has a reputation beyond reputeLeav has a reputation beyond reputeLeav has a reputation beyond reputeLeav has a reputation beyond reputeLeav has a reputation beyond reputeLeav has a reputation beyond reputeLeav has a reputation beyond reputeLeav has a reputation beyond reputeLeav has a reputation beyond reputeLeav has a reputation beyond reputeLeav has a reputation beyond repute
Send a message via ICQ to Leav Send a message via AIM to Leav Send a message via MSN to Leav
Acceleration Sensor Connected, but values are odd....

I got the Acceleration sensor working (if people are still having problems with this, PM me, i'd be happy to help) but the values i'm getting are odd....

when sitting still the value returned by Get_Analog_Value(rc_ana_in09) is around 716-717, and can get to about 915 or so when shaked.....

is this normal?

how can i transofrm these to normal 0-255 values? should i?

Thanks!
-Leav
__________________
"We choose to build robots this season and do the other things; Not because they are easy, but because they are hard."
-Paraphrasing JFK

Participated in FIRST as a student: 2005-2006 (But still learning every season!)
Mentor: 2008 - ? (Team 2630 2008-2011, and Team 3316 since 2013)
Engineer: 2011 - ? (B.Sc. and M.Sc. in Mech. Eng. from the Technion IIT)
FIRST Volunteer - 2007 - ? (MC, FTA, FIRST Aid etc.)
  #2   Spotlight this post!  
Unread 16-01-2005, 17:14
Dave Flowerday Dave Flowerday is offline
Software Engineer
VRC #0111 (Wildstang)
Team Role: Engineer
 
Join Date: Feb 2002
Rookie Year: 1995
Location: North Barrington, IL
Posts: 1,366
Dave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond repute
Re: Acceleration Sensor Connected, but values are odd....

Quote:
Originally Posted by Leav
is this normal?

how can i transofrm these to normal 0-255 values?
I can't really tell you if those values are normal since we haven't looked at the provided accelerometer yet, but I can tell you why it's not a value from 0-255. The RC analog inputs are 10-bit, meaning they have a range of 0-1023. You can obtain a 0-255 value by dropping the lower two bits (divide by four or use the bit-shift operator (>>)), but if you do that you're just throwing away accuracy which is usually a bad idea.
  #3   Spotlight this post!  
Unread 16-01-2005, 19:04
neilsonster's Avatar
neilsonster neilsonster is offline
Registered User
AKA: Andrew Neilson
FRC #0772 (Sabre Bytes)
Team Role: College Student
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Waterloo, ON, Canada
Posts: 188
neilsonster is a name known to allneilsonster is a name known to allneilsonster is a name known to allneilsonster is a name known to allneilsonster is a name known to allneilsonster is a name known to all
Send a message via MSN to neilsonster
Re: Acceleration Sensor Connected, but values are odd....

example:

pwm01 = (unsigned char) (Get_Analog_Value (rc_ana_in01) >> 2);
  #4   Spotlight this post!  
Unread 16-01-2005, 19:40
Tom Bottiglieri Tom Bottiglieri is offline
Registered User
FRC #0254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Jan 2004
Rookie Year: 2003
Location: San Francisco, CA
Posts: 3,183
Tom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond repute
Re: Acceleration Sensor Connected, but values are odd....

Theres no point in bit shifting the input from the accelerometer, seeing as that data is only being used locally in calculations, and not directly exported to a motor control.

Last edited by Tom Bottiglieri : 17-01-2005 at 11:31.
  #5   Spotlight this post!  
Unread 04-02-2005, 10:45
Gal Longin's Avatar
Gal Longin Gal Longin is offline
Gal L.
#1578 (IsraBot)
Team Role: Leadership
 
Join Date: Dec 2004
Rookie Year: 2005
Location: Israel
Posts: 32
Gal Longin is an unknown quantity at this point
Send a message via ICQ to Gal Longin Send a message via AIM to Gal Longin Send a message via MSN to Gal Longin Send a message via Yahoo to Gal Longin
Re: Acceleration Sensor Connected, but values are odd....

what exactly are we suppose to understand from these readings? are the values in m/s^2 ? are they in ft/s^2 ? how can we use those values to determine the robot's acceleration in m/s^2 ? is it in g's?

someone from another team told me that in order to get the acceleration in g's i have to calculate arctangent of the sinus of the value I'm getting , but that doesn't make any sense to me .
__________________
"Only two things are infinite: the universe and human stupidity; and I'm not sure about the the universe." -Albert Einstein.

2005 Israel regional Finalist
2005 Israel regional Johnson & Johnson Sportmanship Award
2005 Israel regional Website Award
  #6   Spotlight this post!  
Unread 04-02-2005, 12:00
Chris Hibner's Avatar Unsung FIRST Hero
Chris Hibner Chris Hibner is offline
Eschewing Obfuscation Since 1990
AKA: Lars Kamen's Roadie
FRC #0051 (Wings of Fire)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1997
Location: Canton, MI
Posts: 1,488
Chris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond repute
Re: Acceleration Sensor Connected, but values are odd....

Quote:
Originally Posted by Gal Longin
what exactly are we suppose to understand from these readings? are the values in m/s^2 ? are they in ft/s^2 ? how can we use those values to determine the robot's acceleration in m/s^2 ? is it in g's?

someone from another team told me that in order to get the acceleration in g's i have to calculate arctangent of the sinus of the value I'm getting , but that doesn't make any sense to me .
The values are in "A/D counts", which is a mythical unit. If you want to convert them into physical units, (like g's or m/s^2) you need to do a little math.

The first thing to do is to look at the accelerometer data sheet to see what the accelerometer gain is. If should say something like: "Gain: 100 mV/G"

Now you need to use unit conversion (like you learned in chemistry or physics class) to determine the conversion between and G's. For example:

Code:
             5000 mV            1 G
1 count * --------------- * --------------
           1024 counts        X  mV
where X is the accelerometer gain in mV/G.

Now you have a conversion factor from counts to G's and vice versa.

(NOTE: sorry about using the "code" window. That's not actually code: it's the only way I could get my equation to look right.)
__________________
-
An ounce of perception is worth a pound of obscure.

Last edited by Chris Hibner : 04-02-2005 at 12:03.
  #7   Spotlight this post!  
Unread 04-02-2005, 14:21
Chris Hibner's Avatar Unsung FIRST Hero
Chris Hibner Chris Hibner is offline
Eschewing Obfuscation Since 1990
AKA: Lars Kamen's Roadie
FRC #0051 (Wings of Fire)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1997
Location: Canton, MI
Posts: 1,488
Chris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond repute
Re: Acceleration Sensor Connected, but values are odd....

I need to add one thing:

When you sit the accelerometer flat on the table (NOT aligned with gravity), the A/D reading (in counts) is the zero G reading of the accelerometer. You should subtract this zero-G reading from your other readings before applying the conversion factor that I mentioned above.

For example:

on the table you see that the average is 705. This is 0 G's

let's say your accelerometer gain (also called accelerometer sensitivity) is 200 mV/G

Therefore, your conversion factor is 1 count = (5000 mV/1024 coutns) * (1 G / 200 mV)

Thus, 1 count = 0.024414 G (or 1 G = 40.96 counts).

Now, turn the accelerometer so that it is aligned with gravity. Your new reading should be approximately 746 A/D counts (i.e. 705 + 41 = 746)


For another example, let's say you put the accelerometer at the edge of a centrifuge and you want to see what the acceleration is at the edge of the centrifuge. The accelerometer reads 923 (after averaging out the noise). How many G's is that?

923 - 705 = 218 counts of acceleration.

1 G = 40.96 counts, so 218 counts = 218 counts * 1G / 40.96 counts

218 counts = 5.322 G's

Therefore, you see 5.322 G's at the edge of the centrifuge.
__________________
-
An ounce of perception is worth a pound of obscure.
  #8   Spotlight this post!  
Unread 04-02-2005, 15:28
Gal Longin's Avatar
Gal Longin Gal Longin is offline
Gal L.
#1578 (IsraBot)
Team Role: Leadership
 
Join Date: Dec 2004
Rookie Year: 2005
Location: Israel
Posts: 32
Gal Longin is an unknown quantity at this point
Send a message via ICQ to Gal Longin Send a message via AIM to Gal Longin Send a message via MSN to Gal Longin Send a message via Yahoo to Gal Longin
Re: Acceleration Sensor Connected, but values are odd....

Quote:
Originally Posted by Chris Hibner
I need to add one thing:

When you sit the accelerometer flat on the table (NOT aligned with gravity), the A/D reading (in counts) is the zero G reading of the accelerometer. You should subtract this zero-G reading from your other readings before applying the conversion factor that I mentioned above.

For example:

on the table you see that the average is 705. This is 0 G's

let's say your accelerometer gain (also called accelerometer sensitivity) is 200 mV/G

Therefore, your conversion factor is 1 count = (5000 mV/1024 coutns) * (1 G / 200 mV)

Thus, 1 count = 0.024414 G (or 1 G = 40.96 counts).

Now, turn the accelerometer so that it is aligned with gravity. Your new reading should be approximately 746 A/D counts (i.e. 705 + 41 = 746)


For another example, let's say you put the accelerometer at the edge of a centrifuge and you want to see what the acceleration is at the edge of the centrifuge. The accelerometer reads 923 (after averaging out the noise). How many G's is that?

923 - 705 = 218 counts of acceleration.

1 G = 40.96 counts, so 218 counts = 218 counts * 1G / 40.96 counts

218 counts = 5.322 G's

Therefore, you see 5.322 G's at the edge of the centrifuge.

Thanks for your help.
__________________
"Only two things are infinite: the universe and human stupidity; and I'm not sure about the the universe." -Albert Einstein.

2005 Israel regional Finalist
2005 Israel regional Johnson & Johnson Sportmanship Award
2005 Israel regional Website Award
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
Meeting FIRST People in odd places Jeff Waegelin General Forum 219 04-03-2012 13:10
trentonDrive.c: our joystick/wheel drive code gnormhurst Programming 16 03-02-2005 14:40
Color Values WesleyBalmer Programming 3 15-01-2005 22:26
A testimony to my unique FIRST experience: Ken Leung General Forum 22 14-04-2004 20:45


All times are GMT -5. The time now is 13:46.

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