Go to Post They're so cute I could just pinch their little CIM motors!:D :p - Akash Rastogi [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 13-02-2009, 10:31
SL8's Avatar
SL8 SL8 is offline
...
AKA: Jesus
FRC #0647 (Cyber Wolf Corps)
Team Role: Programmer
 
Join Date: Dec 2007
Rookie Year: 2008
Location: Killeen, Texas (Fort Hood)
Posts: 352
SL8 has much to be proud ofSL8 has much to be proud ofSL8 has much to be proud ofSL8 has much to be proud ofSL8 has much to be proud ofSL8 has much to be proud ofSL8 has much to be proud ofSL8 has much to be proud ofSL8 has much to be proud ofSL8 has much to be proud of
Send a message via Yahoo to SL8
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.
__________________


Reply With Quote
  #2   Spotlight this post!  
Unread 13-02-2009, 11:00
EricVanWyk EricVanWyk is offline
Registered User
no team
 
Join Date: Jan 2007
Rookie Year: 2000
Location: Boston
Posts: 1,597
EricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond repute
Send a message via AIM to EricVanWyk
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.
Reply With Quote
  #3   Spotlight this post!  
Unread 13-02-2009, 13:53
SL8's Avatar
SL8 SL8 is offline
...
AKA: Jesus
FRC #0647 (Cyber Wolf Corps)
Team Role: Programmer
 
Join Date: Dec 2007
Rookie Year: 2008
Location: Killeen, Texas (Fort Hood)
Posts: 352
SL8 has much to be proud ofSL8 has much to be proud ofSL8 has much to be proud ofSL8 has much to be proud ofSL8 has much to be proud ofSL8 has much to be proud ofSL8 has much to be proud ofSL8 has much to be proud ofSL8 has much to be proud ofSL8 has much to be proud of
Send a message via Yahoo to SL8
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.
__________________


Reply With Quote
  #4   Spotlight this post!  
Unread 13-02-2009, 14:19
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: 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:
Originally Posted by SL8 View Post
I'm not looking for actual position so much as just knowing the actual distance traveled.
That's basically the same thing, isn't it?

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.
Reply With Quote
  #5   Spotlight this post!  
Unread 13-02-2009, 14:22
Andrew Schreiber Andrew Schreiber is offline
Joining the 900 Meme Team
FRC #0079
 
Join Date: Jan 2005
Rookie Year: 2000
Location: Misplaced Michigander
Posts: 4,068
Andrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond repute
Re: Finding distance using accelerometer..

Quote:
Originally Posted by SL8 View Post
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.
What are you struggling with? Do you understand the math behind it? If so I would highly suggest using a c block to do it in, yes you can use LV code but I have always found it rather poor for representing math. (It is just too expanded)

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
Please note that your dt is how often this code executes, so if you execute every 4 milliseconds dt will be .004 (assuming in seconds) The trick is that the accelerometer (KOP one at least) puts out a value in g's which is equal to 9.81 m/s^2 so you will have to convert that number before you put it into that equation. Good luck.
__________________




.
Reply With Quote
  #6   Spotlight this post!  
Unread 13-02-2009, 16:20
SL8's Avatar
SL8 SL8 is offline
...
AKA: Jesus
FRC #0647 (Cyber Wolf Corps)
Team Role: Programmer
 
Join Date: Dec 2007
Rookie Year: 2008
Location: Killeen, Texas (Fort Hood)
Posts: 352
SL8 has much to be proud ofSL8 has much to be proud ofSL8 has much to be proud ofSL8 has much to be proud ofSL8 has much to be proud ofSL8 has much to be proud ofSL8 has much to be proud ofSL8 has much to be proud ofSL8 has much to be proud ofSL8 has much to be proud of
Send a message via Yahoo to SL8
Re: Finding distance using accelerometer..

Quote:
Originally Posted by Alan Anderson View Post

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.
That was the idea behind the accelerometer.
__________________


Reply With Quote
Reply


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
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


All times are GMT -5. The time now is 21:33.

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