|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||||
|
|||||
|
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 |
|
#2
|
||||
|
||||
|
Re: Acceleration Sensor Connected, but values are odd....
Quote:
|
|
#3
|
|||||
|
|||||
|
Re: Acceleration Sensor Connected, but values are odd....
example:
pwm01 = (unsigned char) (Get_Analog_Value (rc_ana_in01) >> 2); |
|
#4
|
|||
|
|||
|
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
|
||||
|
||||
|
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 . ![]() |
|
#6
|
||||||
|
||||||
|
Re: Acceleration Sensor Connected, but values are odd....
Quote:
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
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.) Last edited by Chris Hibner : 04-02-2005 at 12:03. |
|
#7
|
||||||
|
||||||
|
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. |
|
#8
|
||||
|
||||
|
Re: Acceleration Sensor Connected, but values are odd....
Quote:
Thanks for your help. ![]() |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |