Go to Post We did the best job we could out there, and unfortunatly we have human limits.. The refs don't catch every penalty, inspectors don't catch every issue, and this year the score keepers won't catch every single ball. - nobrakes8 [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 12-02-2005, 01:22
Unsung FIRST Hero
miketwalker miketwalker is offline
Robot Lifeguard
FRC #1902 (Exploding Bacon)
 
Join Date: Dec 2001
Rookie Year: 2002
Location: Orlando, FL
Posts: 878
miketwalker has a reputation beyond reputemiketwalker has a reputation beyond reputemiketwalker has a reputation beyond reputemiketwalker has a reputation beyond reputemiketwalker has a reputation beyond reputemiketwalker has a reputation beyond reputemiketwalker has a reputation beyond reputemiketwalker has a reputation beyond reputemiketwalker has a reputation beyond reputemiketwalker has a reputation beyond reputemiketwalker has a reputation beyond repute
Send a message via AIM to miketwalker
Accelerometer Bias

I've made our own gyro/accelerometer code because I wanted to do some various things other than what Kevin Watson's code (which is excellently made) did. The gyro code works fine now, however because of the accelerometers' extreme sensitivity, I was wondering how you can make a code to remove the accelerometer bias. My code gets it between 511-512... but since it's an int it goes one way or the other... and by having it at 511... it is enough to quickly make the robot velocity appear as though it is getting negative.

Has anyone else made their own accelerometer code and found a way to fix this? Thanks!
  #2   Spotlight this post!  
Unread 12-02-2005, 02:12
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: Accelerometer Bias

Quote:
Originally Posted by miketwalker
I've made our own gyro/accelerometer code because I wanted to do some various things other than what Kevin Watson's code (which is excellently made) did. The gyro code works fine now, however because of the accelerometers' extreme sensitivity, I was wondering how you can make a code to remove the accelerometer bias. My code gets it between 511-512... but since it's an int it goes one way or the other... and by having it at 511... it is enough to quickly make the robot velocity appear as though it is getting negative.

Has anyone else made their own accelerometer code and found a way to fix this? Thanks!
This is one of the reasons I oversample the gyro and accelerometer outputs. If you look at my gyro code you'll notice that I sum GYRO_SAMPLES_PER_UPDATE samples and treat that value as though it was a single sample. It's a simple way to get a little more accuracy in your calculations.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #3   Spotlight this post!  
Unread 12-02-2005, 03:40
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: 774
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
Re: Accelerometer Bias

Quote:
Originally Posted by Kevin Watson
This is one of the reasons I oversample the gyro and accelerometer outputs. If you look at my gyro code you'll notice that I sum GYRO_SAMPLES_PER_UPDATE samples and treat that value as though it was a single sample. It's a simple way to get a little more accuracy in your calculations.

-Kevin
Hey Kevin,
I havn't looked at your code, but wouldn't you need to divide SUM_OF_SAMPLES by NUMBER_OF_UPDATES, so you would get an avereage value?

I know theres nothing wrong with it, i mean.... hundreds of teams use it, just wondering what exactly you ment...

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.)
  #4   Spotlight this post!  
Unread 12-02-2005, 04:05
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: Accelerometer Bias

Quote:
Originally Posted by Leav
...but wouldn't you need to divide SUM_OF_SAMPLES by NUMBER_OF_UPDATES, so you would get an avereage value?
Yes, you can do this or just change the units (e.g., volts per eight samples rather than volts per sample).

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
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
Accelerometer Timer Question psquared Programming 3 12-02-2005 01:34
URGENT! We need help with the accelerometer lkdjm Electrical 5 11-02-2005 16:42
Accelerometer Wiring/Input DAN THE MAN Control System 1 06-02-2005 20:02
Accelerometer vs Gear Tooth Sensors zdeswarte Electrical 4 22-01-2005 15:35
Example accelerometer code released. Kevin Watson Programming 0 20-01-2005 03:45


All times are GMT -5. The time now is 19:20.

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