|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Finding distance using accelerometer..
I am trying to use the data from the accelerometer to find the distance the robot has traveled, but I'm not sure how to do this.
Help? I am using labview. |
|
#2
|
|||
|
|||
|
Re: Finding distance using accelerometer..
Be very careful about this.
In the world that a high school physics class exists in, it is quite simple. Integrate acceleration once and you get velocity. Integrate velocity and you get position. Done and Done. Unfortunately, the real world is a jerk and gravity keeps on keeping us down. If your accelerometer isn't perfectly aligned, gravity will affect your side to side acceleration. This will show up as a constant small acceleration. Your velocity will continue to climb and your calculated position will soon be in a different country. Assuming you can compensate for gravity, you will probably need to use the gyro as well to detect orientation. If you turn 90 degrees, X becomes Y and vis-versa. The gyro will help you with this. The accelerometer is very good at sensing acceleration, impacts and tilt.I think it will mostly be used for traction control and "I just hit something in autonomous, RUN AWAY" applications this year. It is sketchy for velocity and a pain in the butt for position. That being said, go for it. |
|
#3
|
||||
|
||||
|
Re: Finding distance using accelerometer..
Thanks, but I should of made myself clearer.
I am asking for help on the actual programming in labview. And about the gyro, is it absolutely necessary? I thought that the axis rotated with the the accelerometer. I'm not looking for actual position so much as just knowing the actual distance traveled. |
|
#4
|
|||||
|
|||||
|
Re: Finding distance using accelerometer..
To "integrate" a signal, just keep adding it to an accumulator on a regular basis. Use a timed loop (there's one provided for you in the Basic robot template) with a shift register to hold the accumulated value.
Quote:
If your wheels don't slip, encoders on the axle or gearbox give a much easier way to measure distance traveled. That's not a good assumption with acetal wheels on FRP, though. |
|
#5
|
||||
|
||||
|
Re: Finding distance using accelerometer..
That was the idea behind the accelerometer.
|
|
#6
|
|||
|
|||
|
Re: Finding distance using accelerometer..
Quote:
If you want to know the distance you traveled along a given axis and not your position you could probably do w/o a gyro. If you want to do any sort of positioning I would suggest using a gyro. Now, Eric is correct when he says they have to be mounted flush, the exception being that you could write code to auto zero it at the beginning of a match. Your code is going to look similar to this: Code:
vel //Your old velocity pos //Old position pos = pos + old_vel*dt+ 1/2(a*dt^2) vel = vel+a*dt |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how to find distance using two color servo camera? | Steelix4532 | General Forum | 4 | 06-02-2009 17:20 |
| Shooting Distance | Laaba 80 | General Forum | 23 | 05-02-2009 16:10 |
| Filtering out Vibration while using a KOP Accelerometer | joshyboy9987 | Electrical | 31 | 22-01-2008 08:20 |
| calculating distance | sur2124 | Programming | 10 | 15-03-2006 18:36 |
| Using Accelerometer with '04 controller | sanddrag | Control System | 4 | 20-02-2004 12:18 |