Go to Post I was dragged to the first team meeting in September my freshman year and a week later, found myself at Fall Classic. Needless to say, after experiencing the heat of a competition, I was in love. ... Robotics has become far more than just that. I get to do the coolest thing in the world. - Audrey Chu [more]
Home
Go Back   Chief Delphi > Technical > Control System > Sensors
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 29-07-2013, 10:56
TogetherSword8 TogetherSword8 is offline
Registered User
FRC #0888 (Robotiators)
Team Role: Alumni
 
Join Date: Feb 2012
Rookie Year: 2012
Location: Glenelg High School
Posts: 85
TogetherSword8 is an unknown quantity at this point
Reducing Drift in KOP Gyroscope

I have done some digging into why our autonomous code didn't work last year and discovered the drift that I found was referenced in some other parts around this forum, and i think it is in all KOP Gyroscopes.

Does anyone know the best way to reduce this drift besides make its mount completely level? because I cannot find any other way, and I don't know how to go into it to see if there is any settings to change.

Thanks for any help or ideas
Reply With Quote
  #2   Spotlight this post!  
Unread 29-07-2013, 12:07
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,559
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Reducing Drift in KOP Gyroscope

What is the magnitude of the drift you are seeing?
Reply With Quote
  #3   Spotlight this post!  
Unread 29-07-2013, 12:17
nathan_hui nathan_hui is offline
Registered User
AKA: Nathan Hui
FRC #2473 (CHS Robotics)
Team Role: Alumni
 
Join Date: Feb 2012
Rookie Year: 2009
Location: Cupertino, CA
Posts: 228
nathan_hui will become famous soon enoughnathan_hui will become famous soon enough
Send a message via AIM to nathan_hui
Re: Reducing Drift in KOP Gyroscope

The quick and almost useless answer is sensor fusion/Kalman filters (It's useless because it's not a simple answer).

Are you just using the gyroscopes? Gyroscopes are inherently susceptible to drift (There's no perfect sensor for any application, only the most optimal). You theoretically can use a set of accelerometers to zero out the gyroscopes continuously, and as another set of data to measure robot orientation. Could also use your wheel encoders to tell you when you're stopped.

See http://stackoverflow.com/questions/1...lerometer-data for more information, or search Kalman Filters, Sensor Fusion.
__________________
Nathan Hui
B.S. Electrical Engineering, UCSD '16
FRC 2473 (CHS Robotics), Team Captain '12
FTC 4950, 6038
Reply With Quote
  #4   Spotlight this post!  
Unread 29-07-2013, 17:43
sur sur is offline
Registered User
AKA: Sujit Rao
FRC #3324 (Metrobots)
Team Role: Alumni
 
Join Date: May 2012
Rookie Year: 2011
Location: Ohio
Posts: 12
sur is an unknown quantity at this point
Re: Reducing Drift in KOP Gyroscope

Quote:
Originally Posted by nathan_hui View Post
Are you just using the gyroscopes? Gyroscopes are inherently susceptible to drift (There's no perfect sensor for any application, only the most optimal). You theoretically can use a set of accelerometers to zero out the gyroscopes continuously, and as another set of data to measure robot orientation.
An accelerometer won't give you heading. If the acceleration on your robot is mainly due to gravity, then you can look at the magnitude of acceleration in each axis to measure tilt. You could use a magnetometer to measure heading and combine it with the gyro, but you might have to make sure you don't get noise from the motors. See http://robotics.stackexchange.com/qu...be-characteriz for some information on magnetic shielding to prevent this.
Reply With Quote
  #5   Spotlight this post!  
Unread 29-07-2013, 18:38
z_beeblebrox's Avatar
z_beeblebrox z_beeblebrox is online now
Custom User Title
AKA: Cal
FRC #4183 (Bit Buckets)
Team Role: Alumni
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Cambridge MA
Posts: 811
z_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond repute
Re: Reducing Drift in KOP Gyroscope

What about averaging the heading from multiple gyros?

I heard from a member of 1717 that doing this helped them a lot.
__________________
2012 Utah Regional Rookie All-Star
2013 Phoenix Regional Judge's Award for "design process and prototyping"
2014 Hub City Regional Quality Award, Arizona Regional Excellence in Engineering Award
2015 Arizona East Regional Creativity Award, Winner
2016 Arizona North Regional Finalist, Arizona West Excellence in Engineering Award, Finalist

Last edited by z_beeblebrox : 29-07-2013 at 18:55.
Reply With Quote
  #6   Spotlight this post!  
Unread 29-07-2013, 21:21
nathan_hui nathan_hui is offline
Registered User
AKA: Nathan Hui
FRC #2473 (CHS Robotics)
Team Role: Alumni
 
Join Date: Feb 2012
Rookie Year: 2009
Location: Cupertino, CA
Posts: 228
nathan_hui will become famous soon enoughnathan_hui will become famous soon enough
Send a message via AIM to nathan_hui
Re: Reducing Drift in KOP Gyroscope

Quote:
Originally Posted by sur View Post
An accelerometer won't give you heading. If the acceleration on your robot is mainly due to gravity, then you can look at the magnitude of acceleration in each axis to measure tilt. You could use a magnetometer to measure heading and combine it with the gyro, but you might have to make sure you don't get noise from the motors. See http://robotics.stackexchange.com/qu...be-characteriz for some information on magnetic shielding to prevent this.
True. It won't give you heading. But it will tell you when you're not moving. And that's the key to preventing the gyros from drifting. If you're not moving, the gyro shouldn't be moving either. If you have two accelerometers and you know the distance between them, you can calculate the amount of turn. Magnetometer may or may not work - you're in an environment with way too many motors and ferromagnetic materials (i.e. screws). Shielding also only does so much. In the end, you'll probably end up running a software filter over the data anyways.
__________________
Nathan Hui
B.S. Electrical Engineering, UCSD '16
FRC 2473 (CHS Robotics), Team Captain '12
FTC 4950, 6038
Reply With Quote
  #7   Spotlight this post!  
Unread 29-07-2013, 22:48
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,025
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Reducing Drift in KOP Gyroscope

Quote:
Originally Posted by nathan_hui View Post
True. It won't give you heading. But it will tell you when you're not moving.
An accelerometer does not tell you when you're not moving. It tells you when you are not accelerating.


Reply With Quote
  #8   Spotlight this post!  
Unread 29-07-2013, 23:16
sur sur is offline
Registered User
AKA: Sujit Rao
FRC #3324 (Metrobots)
Team Role: Alumni
 
Join Date: May 2012
Rookie Year: 2011
Location: Ohio
Posts: 12
sur is an unknown quantity at this point
Re: Reducing Drift in KOP Gyroscope

Quote:
Originally Posted by nathan_hui View Post
True. It won't give you heading. But it will tell you when you're not moving. And that's the key to preventing the gyros from drifting. If you're not moving, the gyro shouldn't be moving either. If you have two accelerometers and you know the distance between them, you can calculate the amount of turn. Magnetometer may or may not work - you're in an environment with way too many motors and ferromagnetic materials (i.e. screws). Shielding also only does so much. In the end, you'll probably end up running a software filter over the data anyways.
This thread seems to suggest that the HiTechnic sensor is pretty accurate.

But to answer OP's question more directly, I don't think you should be seeing much drift during a single match. The gyro should be mounted as level and close to the center of the robot as possible, since it measures rotation around the axis perpendicular to its board:
Quote:
The angular rate sensor (gyroscope) using Analog Devices part number ADW22307 detects angular changes about the board’s top surface axis.
from http://www.andymark.com/product-p/am-2067.htm.
Reply With Quote
  #9   Spotlight this post!  
Unread 30-07-2013, 13:47
TogetherSword8 TogetherSword8 is offline
Registered User
FRC #0888 (Robotiators)
Team Role: Alumni
 
Join Date: Feb 2012
Rookie Year: 2012
Location: Glenelg High School
Posts: 85
TogetherSword8 is an unknown quantity at this point
Re: Reducing Drift in KOP Gyroscope

Quote:
Originally Posted by sur View Post
But to answer OP's question more directly, I don't think you should be seeing much drift during a single match.
The problem that we had this year was it drifted prior to the match, and our initial driving based on the gyroscope angle was off, because it drifted a different amount depending on the time from robot placement to when they actually started the match.

I have thought about putting in a software cancel, would something like that be a if encoders are not moving, keep angle the same, and count the accumulation in the code instead of letting the gyro do it itself, and reset the gyro every iteration? That is the only way i could think of doing it.
Reply With Quote
  #10   Spotlight this post!  
Unread 30-07-2013, 14:57
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,025
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Reducing Drift in KOP Gyroscope

Quote:
Originally Posted by TogetherSword8 View Post
The problem that we had this year was it drifted prior to the match, and our initial driving based on the gyroscope angle was off, because it drifted a different amount depending on the time from robot placement to when they actually started the match.
Simply reset the gyro at the start of the match.

Quote:
count the accumulation in the code instead of letting the gyro do it itself
The gyro itself does not do any accumulating. That is done in the FPGA, which probably does it much more effectively that you could do in your code.

Some teams have added a manual reset function that the driver can activate by simply pressing a button when the bot is at the zero position any time during a match.
Reply With Quote
  #11   Spotlight this post!  
Unread 01-08-2013, 07:49
Gdeaver Gdeaver is online now
Registered User
FRC #1640
Team Role: Mentor
 
Join Date: Mar 2004
Rookie Year: 2001
Location: West Chester, Pa.
Posts: 1,357
Gdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond repute
Re: Reducing Drift in KOP Gyroscope

Our team is looking at using a gyro on the bot next year. The gyro we are looking at using walks down .01 degrees every 2 to 3 seconds. How does this compare to other gyro's teams have used? At begin autonomous just zero the gyro accumulator.
Reply With Quote
  #12   Spotlight this post!  
Unread 01-08-2013, 11:06
otherguy's Avatar
otherguy otherguy is offline
sparkE
AKA: James
FRC #2168 (The Aluminum Falcons)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: CT
Posts: 429
otherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to behold
Re: Reducing Drift in KOP Gyroscope

Quote:
Originally Posted by Gdeaver View Post
Our team is looking at using a gyro on the bot next year. The gyro we are looking at using walks down .01 degrees every 2 to 3 seconds. How does this compare to other gyro's teams have used? At begin autonomous just zero the gyro accumulator.
That's similar to what I have seen.
If you consider the duration of the autonomous period (15 sec.) and assume a drift of 0.01 degrees every 2 sec. (the worst case of what you reported) you're going to accumulate a total drift of 0.075 degrees. If you can't handle that kind of error, you're doing something wrong.

A good rule of thumb to follow with the gyros, reset/zero them any time you know you are stopped (beginning of autonomous). This will reduce the effect the drift has on your reported heading.
Also, make sure that your sits still after you turn it on (make sure your drive team understands this). The gyro is calibrated during this time and movement will affect the magnitude of drift you see. Try shaking it around when power is applied to the cRIO and see what happens.
__________________
http://team2168.org

Last edited by otherguy : 01-08-2013 at 12:21. Reason: Fixed typo 0.01 deg/sec and associated math. Thanks Ether.
Reply With Quote
  #13   Spotlight this post!  
Unread 01-08-2013, 11:12
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,025
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Reducing Drift in KOP Gyroscope

Quote:
Originally Posted by otherguy View Post
If you ... assume a drift of 0.1 degrees every 2 sec. (the worst case of what you reported)

Typo. He reported .01 degrees every 2 (or 3) sec.


Reply With Quote
  #14   Spotlight this post!  
Unread 02-08-2013, 08:38
Gdeaver Gdeaver is online now
Registered User
FRC #1640
Team Role: Mentor
 
Join Date: Mar 2004
Rookie Year: 2001
Location: West Chester, Pa.
Posts: 1,357
Gdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond repute
Re: Reducing Drift in KOP Gyroscope

The gyro we will be using is a Invensense MPU-6050 on a break out board from Sparkfun. The MPU6050 has an on chip motion processing engine and output in quaternions. It takes allot of code to bring up the chip. We are using an Arduino Uno to handle this. We mounted the break out board on a Arduino Proto typing board. We then use the Arduino Ethernet shield to transfer the the data to the c-rio using UDP. The Arduino takes the quaternions and calculates the gravity corrected Yaw, pitch and roll. We also have put single channel encoders on the 2 rear wheels. Hopefully this will give the students enough input to actually do some autonomous navigation. Our swerve drive does not like to go straight and has given us lots of problems in the past. The gyro will also be used to develop field centric swerve control. The students will have a full plate this fall. Work begins next week. As a back up to acquire a high resolution X and Y motion, we have looked at a lazer gaming mouse with a ADNS9500 chip in it. Tracks good on carpet.
Reply With Quote
  #15   Spotlight this post!  
Unread 07-08-2013, 21:05
Hugh Meyer's Avatar
Hugh Meyer Hugh Meyer is offline
Registered User
FRC #1741 (Red Alert Robotics)
Team Role: Mentor
 
Join Date: Feb 2009
Rookie Year: 2008
Location: Greenwood Indiana
Posts: 158
Hugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud of
Re: Reducing Drift in KOP Gyroscope

When the robot starts up the gyro runs a bias measurement and calculation. During this time the robot must be absolutely still. This process is measuring the offset in the device, which when integrated translates to drift.

We tell our drive team to start up the robot at the last possible moment and make certain that the robot is not bumped or disturbed during this initialization time. The compressor cannot be running during this time if you want the best result.

Kevin Watson has some really good code and information about this on his website kevin.org. Look in the FRC code section. It is code from the old IFI controller, but it is very educational.

http://kevin.org/frc/ Look in the frc_gyro.zip file.

Another helpful trick is to mount the gyro on a mass and mount that in foam. We use a one pound piece of aluminum and some foam that hard disk drives are often packaged in. This acts as a low pass filter and helps smooth out the data. See the attached photo for our arrangement.

Keep working with the gyro and accelerometer. You can do some really cool stuff once you understand these devices. Have fun!

-Hugh
Attached Thumbnails
Click image for larger version

Name:	IMG_4030_LR.jpg
Views:	181
Size:	137.2 KB
ID:	15132  
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


All times are GMT -5. The time now is 07:56.

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