Go to Post High heels on a Segway takes quite a bit of adjustment - as I learned the hard way. - Jessica Boucher [more]
Home
Go Back   Chief Delphi > Technical > Programming
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 19-01-2006, 15:47
Chriszuma's Avatar
Chriszuma Chriszuma is offline
Jack of all trades
AKA: Chris Hammond
FRC #0068 (Truck Town Thunder)
Team Role: Alumni
 
Join Date: Oct 2004
Rookie Year: 2005
Location: Clarkston, MI
Posts: 290
Chriszuma is just really niceChriszuma is just really niceChriszuma is just really niceChriszuma is just really nice
Send a message via AIM to Chriszuma
Question Has anyone gotten useful data from the accelerometer?

I was playing around with the accelerometer the other day, trying to use its sum to determine velocity. However, I fiddled with my algorithm for a couple of hours and couldn't get it to give me anything close to an accurate reading. Has anyone actually gotten this to work? I think they're just way too sensitive to use for tracking. I'll probably end up just using the gear tooth sensor to measure distance, which makes more sense anyway.
Maybe I need to upgrade to kevin watson's oversampling uart?
__________________
2006 T3 World Tour: Great Lakes - Waterloo - Palmetto - IRI
2006 Awards: Motorola Quality - RadioShack Innovation in Control

My website: http://zuma.phire.org/
Truck Town Thunder's website: http://trucktownthunder.com/
  #2   Spotlight this post!  
Unread 19-01-2006, 15:52
Mike's Avatar
Mike Mike is offline
has common ground with Matt Krass
AKA: Mike Sorrenti
FRC #0237 (Sie-H2O-Bots (See-Hoe-Bots) [T.R.I.B.E.])
Team Role: Programmer
 
Join Date: Dec 2004
Rookie Year: 2004
Location: Watertown, CT
Posts: 1,003
Mike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond repute
Re: Has anyone gotten useful data from the accelerometer?

Quote:
Originally Posted by Chriszuma
I was playing around with the accelerometer the other day, trying to use its sum to determine velocity. However, I fiddled with my algorithm for a couple of hours and couldn't get it to give me anything close to an accurate reading. Has anyone actually gotten this to work? I think they're just way too sensitive to use for tracking. I'll probably end up just using the gear tooth sensor to measure distance, which makes more sense anyway.
Maybe I need to upgrade to kevin watson's oversampling uart?
I've played with an accelerometer, but from what I've heard they can be very tricky. I would go with the encoder/gear tooth sensors to calculate position. How is yours connected? Could you show us the code?
__________________
http://www.mikesorrenti.com/
  #3   Spotlight this post!  
Unread 19-01-2006, 15:55
Chriszuma's Avatar
Chriszuma Chriszuma is offline
Jack of all trades
AKA: Chris Hammond
FRC #0068 (Truck Town Thunder)
Team Role: Alumni
 
Join Date: Oct 2004
Rookie Year: 2005
Location: Clarkston, MI
Posts: 290
Chriszuma is just really niceChriszuma is just really niceChriszuma is just really niceChriszuma is just really nice
Send a message via AIM to Chriszuma
Re: Has anyone gotten useful data from the accelerometer?

Quote:
Originally Posted by Mike
I've played with an accelerometer, but from what I've heard they can be very tricky. I would go with the encoder/gear tooth sensors to calculate position. How is yours connected? Could you show us the code?
I just took in the data from it and summed it into a static variable. I tried bitshifting it, putting on a deadband, everything i could think of, but it looks like the data is just not accurate enough, or maybe it can't read from it quickly enough. I'll post the code later tonight, since it's currently saved on a computer half an hour from here.
  #4   Spotlight this post!  
Unread 19-01-2006, 16:55
Matt Krass's Avatar
Matt Krass Matt Krass is offline
"Old" and Cranky. Get off my lawn!
AKA: Dark Ages
FRC #0263 (Sachem Aftershock)
Team Role: Mentor
 
Join Date: Oct 2002
Rookie Year: 2002
Location: Long Island, NY
Posts: 1,187
Matt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond repute
Send a message via AIM to Matt Krass
Re: Has anyone gotten useful data from the accelerometer?

Quote:
Originally Posted by Chriszuma
I just took in the data from it and summed it into a static variable. I tried bitshifting it, putting on a deadband, everything i could think of, but it looks like the data is just not accurate enough, or maybe it can't read from it quickly enough. I'll post the code later tonight, since it's currently saved on a computer half an hour from here.
Are you accounting for ALL acceleration? Fun fact: That chip will provide you with a deluge of information all lumped in to one signal. You need to filter out gravity, acceleration from getting hit, deceleration and probably more I'm not thinking of.

Also, it measure acceleration, not velocity, so if you're cruising at a constant speed, it'll read back 0 acceleration...plus the above mentioned factors. Gravity is tough, it varies based on orientation, on the upside that makes it great for sensing absolute angle when you're not moving, maybe use it for that and use encoders for velocity?

Hope that helped..
__________________
Matt Krass
If I suggest something to try and fix a problem, and you don't understand what I mean, please PM me!

I'm a FIRST relic of sorts, I remember when we used PBASIC and we got CH Flightsticks in the KoP. In my day we didn't have motorized carts, we pushed our robots uphill, both ways! (Houston 2003!)

Last edited by Matt Krass : 19-01-2006 at 16:55. Reason: Punctuation
  #5   Spotlight this post!  
Unread 19-01-2006, 17:27
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: Has anyone gotten useful data from the accelerometer?

Quote:
Originally Posted by Chriszuma
I was playing around with the accelerometer the other day, trying to use its sum to determine velocity. However, I fiddled with my algorithm for a couple of hours and couldn't get it to give me anything close to an accurate reading. Has anyone actually gotten this to work? I think they're just way too sensitive to use for tracking. I'll probably end up just using the gear tooth sensor to measure distance, which makes more sense anyway.
Maybe I need to upgrade to kevin watson's oversampling uart?
Using an accelerometer to determine your position is very, very hard. I'd start out by integrating once to determine your velocity and once you're happy with your results, try to integrate if again for position. I haven't tried it, but perhaps someone could try it out with the gyro code and report back. If you do, make sure that it is still and lying flat on a table while the bias is being calculated.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #6   Spotlight this post!  
Unread 19-01-2006, 23:39
Chriszuma's Avatar
Chriszuma Chriszuma is offline
Jack of all trades
AKA: Chris Hammond
FRC #0068 (Truck Town Thunder)
Team Role: Alumni
 
Join Date: Oct 2004
Rookie Year: 2005
Location: Clarkston, MI
Posts: 290
Chriszuma is just really niceChriszuma is just really niceChriszuma is just really niceChriszuma is just really nice
Send a message via AIM to Chriszuma
Re: Has anyone gotten useful data from the accelerometer?

Yeah, I was trying to simply integrate the acceleration to get velocity. I couldn't even pull that off. I came to the conclusion that gear tooth sensors make way more sense and it was slightly retarded to even consider using the acceleros in my navigation code.
__________________
2006 T3 World Tour: Great Lakes - Waterloo - Palmetto - IRI
2006 Awards: Motorola Quality - RadioShack Innovation in Control

My website: http://zuma.phire.org/
Truck Town Thunder's website: http://trucktownthunder.com/
  #7   Spotlight this post!  
Unread 27-01-2006, 19:04
doubleslash's Avatar
doubleslash doubleslash is offline
driven
AKA: Justin Huang
FRC #0649 (Saratoga Robotics)
Team Role: Leadership
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Saratoga, CA
Posts: 11
doubleslash is an unknown quantity at this point
Send a message via AIM to doubleslash
Re: Has anyone gotten useful data from the accelerometer?

I'd have to chip my two cents in and agree that using the accelerometer to measure speed is exorbitantly difficult. Our omniwheels provide a bit of slippage and encoders are therefore somewhat inaccurate, but in terms of being able to determine our location in autonomous, they are still our number one choice (versus the unreliability of the accelerometer).
__________________
I, I'm allergic to bee stings. They cause me to uh, die.

Last edited by doubleslash : 28-01-2006 at 01:58.
  #8   Spotlight this post!  
Unread 27-01-2006, 20:46
KenWittlief KenWittlief is offline
.
no team
Team Role: Engineer
 
Join Date: Mar 2003
Location: Rochester, NY
Posts: 4,213
KenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond repute
Re: Has anyone gotten useful data from the accelerometer?

using the accelerometer to measure speed is exorbitantly difficult?!

velocity is the integration of acceleration. If you have the sensor horizontal pointing fore and aft, then all you need to do is add the output of the sensor to a variable (16 bits is best) each time you pass through the main loop of your code, and subtract out the zero reading (offset)

the register will then contain your velocity, all the time.
  #9   Spotlight this post!  
Unread 27-01-2006, 21:15
Joel J's Avatar
Joel J Joel J is offline
do you..
no team
 
Join Date: May 2001
Rookie Year: 2000
Location: San Jose, CA
Posts: 1,445
Joel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond repute
Re: Has anyone gotten useful data from the accelerometer?

Yea, but the velocity reported is, simply put, crappy. Velocity calculation from accelerometers is very hard in the sense that the results are noisy, and the noise readily amplifies with each integration. I'm sure you understand this.

The accelerometer isn't useless though. It can be fused with the gyro, to eliminate most of the bias. Saying this can be done is one thing, but actually doing it is an altogether different thing.

The accelerometer shares the same weakness with the encoders--they are both sensitive to BUMPs, and other "high frequency" changes--and also the same strengths: they are both pretty consistent over the long term. Therefore, fusing the accelerometer with the encoders might not be as fruitful.
__________________
Joel Johnson

Division By Zero (229) Alumni, 2003-2007
RAGE (173) Alumni, 1999-2003
  #10   Spotlight this post!  
Unread 27-01-2006, 22:54
KenWittlief KenWittlief is offline
.
no team
Team Role: Engineer
 
Join Date: Mar 2003
Location: Rochester, NY
Posts: 4,213
KenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond repute
Re: Has anyone gotten useful data from the accelerometer?

you need to step back a bit and look at the big picture. If there is noise and bumps they will be random and will average themselves out over time.

You could also filter the analog signal in HW or in the code. At any given instant the velocity integration may be a little off, but if you are reading it on every loop through your code, and using it for some purpose (like a PID closed loop speed control) the inertia of the motors and the robot will also help smooth out any random noise on the signals.
  #11   Spotlight this post!  
Unread 27-01-2006, 23:26
Joel J's Avatar
Joel J Joel J is offline
do you..
no team
 
Join Date: May 2001
Rookie Year: 2000
Location: San Jose, CA
Posts: 1,445
Joel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond repute
Re: Has anyone gotten useful data from the accelerometer?

Have you tried using accelerometers for this purpose? Do you have any specific experiences to share? I'm eager to hear of your results.
__________________
Joel Johnson

Division By Zero (229) Alumni, 2003-2007
RAGE (173) Alumni, 1999-2003
  #12   Spotlight this post!  
Unread 28-01-2006, 00:49
Chriszuma's Avatar
Chriszuma Chriszuma is offline
Jack of all trades
AKA: Chris Hammond
FRC #0068 (Truck Town Thunder)
Team Role: Alumni
 
Join Date: Oct 2004
Rookie Year: 2005
Location: Clarkston, MI
Posts: 290
Chriszuma is just really niceChriszuma is just really niceChriszuma is just really niceChriszuma is just really nice
Send a message via AIM to Chriszuma
Re: Has anyone gotten useful data from the accelerometer?

Yes Ken, we all understand that it works perfectly in theory. I, however, have actually tried to implement this and failed miserably. The accelerometers simply are not reliable enough, coupled with the fact that a lot of the acceleration can occur in short spurts, which might not even be picked up by a given program loop.
Also: If you have a little bit of offset in your velocity calculation, then when you calculate position from that, it will be offset twice as bad.

If you have successfuly overcome these obstacles, please enlighten us.
__________________
2006 T3 World Tour: Great Lakes - Waterloo - Palmetto - IRI
2006 Awards: Motorola Quality - RadioShack Innovation in Control

My website: http://zuma.phire.org/
Truck Town Thunder's website: http://trucktownthunder.com/
  #13   Spotlight this post!  
Unread 28-01-2006, 01:53
KenWittlief KenWittlief is offline
.
no team
Team Role: Engineer
 
Join Date: Mar 2003
Location: Rochester, NY
Posts: 4,213
KenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond repute
Re: Has anyone gotten useful data from the accelerometer?

In the past the teams I have mentored used the ADXRSxxx family of yaw rate sensors for two functions: to close the loop on steering with a PID feedback control system, and we integrated the turn rate to get a relative compass heading.

For both applications the yaw rate sensor works very well. We could spin the robot 360 degrees left, then 360 right and it came back to 0 degrees so well that we could not measure any error.

The two axis accelerometer in the KOP this year is also made by Analog Devices, its the same family of products. I looked into the part used, the ADXL311. This is an excellent device. Analog Devices literally sells them by the millions.

Maybe my last post gave the impression that all you have to do is hook up the wires and add some numbers together. OK, I admit that was over simplifying the entire design - that was only the starting point.

Ive read the data sheet for the ADXL311. Looks like this would be a good topic for a white paper. The device has a user selectable bandwidth, controlled by parts that are soldered on the board. I dont know the default bandwidth as the board is shipped in the KOP, but it would not be hard to set this device up to get a 10 or 20Hz bandwidth.

Bandwidth is the indication of what the device will let through to its outputs, and its also related to the noise-floor of the output signal. The lower the bandwidth you use, the less noise the sensor will have.

Im afraid I cannot give all the details of everything you would need to do to use these devices on your robot in the character limit of this post. Even if I could, that is part of what this program is all about - students and mentors on a team looking at the data sheet for the part, and the application notes that Analog Devices has on their website, and refining the response of the sensor, and the code that integrates it to get the results you want. I cant do that for you over the CD forum.

One key to success with these devices is getting the bandwidth set so that it integrates the acceleration for you between the times the uC reads the output signal. Keep in mind that your robot has a lot of mass, its not possible for your robot to be jerking around on the floor jumping from +2g to -2g to +2 gs at 5mS intervals. The force required to do that would be off the scale. (BTW: Jerk is accelerated acceleration). If you have the sensor solidly attached to a heavy part of your robot frame, the signal you get from it will be fairly smooth and noise (vibration) free.

These devices are excellent for measuring tilt and acceleration. They are also very good for calculating velocity. As Watson pointed out, going one integration further to get distance is pushing it somewhat, but all things considered, having more sensors on your robot is better than having no sensors.
  #14   Spotlight this post!  
Unread 28-01-2006, 10:33
cbolin's Avatar
cbolin cbolin is offline
Programming & Electrical
FRC #0342 (Burning Magnetos)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Charleston, SC
Posts: 72
cbolin is a splendid one to beholdcbolin is a splendid one to beholdcbolin is a splendid one to beholdcbolin is a splendid one to beholdcbolin is a splendid one to beholdcbolin is a splendid one to beholdcbolin is a splendid one to behold
Re: Has anyone gotten useful data from the accelerometer?

Hi,
We are using the accelerometer to indicate that we are on the ramp sitting still and not rotating from side to side.

Consider mounting the accelerometer at a less than perfect horizontal orientation. We noticed that resolution (sensitivity) is much better if the acc. is tilted between 30 to 60 degrees. This has proved somewhat consistent for us.

Another use for the acc. is in autonomous mode. You are for example driving from point a to b. You are cruising at a nice speed when suddenly there is an unexpected spike (up or down) in accel. We are using this (in conjunction with wheel gear teeth data) to indicate a possible collision so we can execute a reversing action, and then put the bot back on the right path.


Regards,
ChuckB
__________________
Team 342 Programming & Control Systems
Good luck and have fun!
  #15   Spotlight this post!  
Unread 28-01-2006, 13:38
6600gt's Avatar
6600gt 6600gt is offline
Registered User
AKA: Lohit
FRC #0226 (Hammerhead)
Team Role: Alumni
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Troy, MI
Posts: 221
6600gt is a jewel in the rough6600gt is a jewel in the rough6600gt is a jewel in the rough
Re: Has anyone gotten useful data from the accelerometer?

[quote=
These devices are excellent for measuring tilt and acceleration. They are also very good for calculating velocity. As Watson pointed out, going one integration further to get distance is pushing it somewhat, but all things considered, having more sensors on your robot is better than having no sensors.[/QUOTE]

I have heard poeple do floating point trig calculations, then why can't you do floating point integration calculations?

Wouldn't it be accurate enough?
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
TTL port to a serial port on a demo board ImmortalAres Programming 16 09-07-2005 23:44
Example accelerometer code released. Kevin Watson Programming 0 20-01-2005 03:45
Accelerometer data sheet Joe Ross Electrical 16 19-01-2005 12:26
heres the code. y this not working omega Programming 16 31-03-2004 15:18
Limiting PWM in pbasic archiver 2001 4 24-06-2002 00:38


All times are GMT -5. The time now is 17:41.

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