Go to Post In my opinion, if it can light a fire in your heart to burn with passion, and you can maintain that fine line between passionate and crazy; then go for it. Power to Passion. - RKElectricalman [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 30-08-2014, 12:24
lgphoneeric's Avatar
lgphoneeric lgphoneeric is offline
Registered User
FRC #2996 (Cougars Gone Wired)
Team Role: Mentor
 
Join Date: Nov 2012
Rookie Year: 2010
Location: United States
Posts: 70
lgphoneeric will become famous soon enough
Gyro drift for a simple EV3

So, the other day I got my hands on a mindstorm ev3. Since I've had experience with different robot programming from FLL to FRC, I thought I would build a simple Segway robot. The issue I am having though is the stupid gyro drift. My program is functioning correctly in the sense that if it tilts one direction to far it corrects, however, the point at where it tilts back is moving in a constant negative direction by about 2deg/sec.
Is there something I need to call up to stop this or is there a fix? I am using the robot C for the EV3.
If anyone has had experience with this or know anything about this please help.

Thanks
__________________
If you have everything under control, something's about to break.

Former FRC Driver, Alumni, Mentor
  #2   Spotlight this post!  
Unread 30-08-2014, 12:27
Arhowk's Avatar
Arhowk Arhowk is offline
FiM CSA
AKA: Jake Niman
FRC #1684 (The Chimeras) (5460 Mentor)
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Lapeer
Posts: 544
Arhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to behold
Re: Gyro drift for a simple EV3

[disclaimer : i have little Mindstorm experience]

Quote:
, however, the point at where it tilts back is moving in a constant negative direction by about 2deg/sec.
Whats the issue? if you tilt back than the gyro will read negative.
  #3   Spotlight this post!  
Unread 30-08-2014, 12:39
Jared's Avatar
Jared Jared is offline
Registered User
no team
Team Role: Programmer
 
Join Date: Aug 2013
Rookie Year: 2012
Location: Connecticut
Posts: 602
Jared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond repute
Re: Gyro drift for a simple EV3

Quote:
Originally Posted by lgphoneeric View Post
So, the other day I got my hands on a mindstorm ev3. Since I've had experience with different robot programming from FLL to FRC, I thought I would build a simple Segway robot. The issue I am having though is the stupid gyro drift. My program is functioning correctly in the sense that if it tilts one direction to far it corrects, however, the point at where it tilts back is moving in a constant negative direction by about 2deg/sec.
Is there something I need to call up to stop this or is there a fix? I am using the robot C for the EV3.
If anyone has had experience with this or know anything about this please help.

Thanks
I don't have any EV3 experience, but gyro drift is a common issue. If the drift is consistent, you could compensate for it by adding 2 degrees every second.

If you're using the sensor to measure the robot tilting forward or backward, you should be using an accelerometer instead.

A gyro measures angular rate, which is integrated to give angular displacement. A small error in angular rate can result in a huge error in angular displacement over a period of several seconds because it relies on previous measurements to calculate the current measurement. It's useful when you want to measure which direction the robot is pointing.

An 2 or 3 axis accelerometer can be used to measure the direction of the acceleration of gravity. Unlike the gyro, it does not rely on the accuracy of previous measurements.
  #4   Spotlight this post!  
Unread 30-08-2014, 13:18
lgphoneeric's Avatar
lgphoneeric lgphoneeric is offline
Registered User
FRC #2996 (Cougars Gone Wired)
Team Role: Mentor
 
Join Date: Nov 2012
Rookie Year: 2010
Location: United States
Posts: 70
lgphoneeric will become famous soon enough
Re: Gyro drift for a simple EV3

Quote:
Originally Posted by Arhowk View Post
[disclaimer : i have little Mindstorm experience]



Whats the issue? if you tilt back than the gyro will read negative.
The issue being that it adds degrees when it is stationary.

Also Jared, I will try to add deg/sec to see if I can compensate. Unfortunately I don't have a accelerometer to try it with, but I will see if I can get one.

Thanks
__________________
If you have everything under control, something's about to break.

Former FRC Driver, Alumni, Mentor
  #5   Spotlight this post!  
Unread 30-08-2014, 13:55
Arhowk's Avatar
Arhowk Arhowk is offline
FiM CSA
AKA: Jake Niman
FRC #1684 (The Chimeras) (5460 Mentor)
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Lapeer
Posts: 544
Arhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to behold
Re: Gyro drift for a simple EV3

Quote:
Originally Posted by lgphoneeric View Post
The issue being that it adds degrees when it is stationary.
Thats an issue with nearly every gyro I've ever dealt with.. you have a couple options

1) Do what the above poster said, calculate the amount of deg/sec added (very percisely) and compensate it (not recommended)
2) Attach a potentiometer to the pivot point of the tower (recommended)
  #6   Spotlight this post!  
Unread 30-08-2014, 14:34
Breakaway3937's Avatar
Breakaway3937 Breakaway3937 is offline
Director
AKA: Brian "Robo" Jones
FRC #3937 (Breakaway)
Team Role: Mentor
 
Join Date: Aug 2011
Rookie Year: 2012
Location: Searcy, AR
Posts: 99
Breakaway3937 is just really niceBreakaway3937 is just really niceBreakaway3937 is just really niceBreakaway3937 is just really niceBreakaway3937 is just really nice
Re: Gyro drift for a simple EV3

I feel you, we had the same issue last season. We could never get the gyro to stay consistent. There were some times we would see a constant 2 degrees/sec of variance while sitting still, we would unplug the gyro from the brick, replug it in, then it would be just fine. We experimented with moving it away from motors and other sensors and got much better results, however, it is not consistent enough for us to use in competition. I have a strong feeling that this sensor does not play nicely with its other friends. We are going to try again this year with the knowledge we gained from last year and place it away from all other key electrical items on the bot.

Hope this helps!
__________________
"There is no luck. It is only when preparation meets opportunity."
  #7   Spotlight this post!  
Unread 31-08-2014, 01:30
lgphoneeric's Avatar
lgphoneeric lgphoneeric is offline
Registered User
FRC #2996 (Cougars Gone Wired)
Team Role: Mentor
 
Join Date: Nov 2012
Rookie Year: 2010
Location: United States
Posts: 70
lgphoneeric will become famous soon enough
Re: Gyro drift for a simple EV3

So after a lot of testing and resetting the brick today, I discovered that the angle will stay constant when the ev3 is in the debugging window to view the angle, but when I go to actually start the program, robotc will switch from only angle to rate and angle and the program will freeze on with motors running, requiring the brick reset (aka, pulling the battery) from the beginning of this post. RobotC seems to freeze with rate and angle so I am wondering if anyone has seen something like this before?

Edit..
Correction, I fixed the freezing issue by switching it to rate and angle mode before I compiled it. However, it still is drifting. Fortunately, it is at a calculable rate.

What are some of the best commands you guys have found to add extra value to a gyro? Just have it read out an x and balance off of that number?
__________________
If you have everything under control, something's about to break.

Former FRC Driver, Alumni, Mentor

Last edited by lgphoneeric : 31-08-2014 at 01:47.
  #8   Spotlight this post!  
Unread 31-08-2014, 03:20
Navid Shafa Navid Shafa is offline
FIRST Hiatus/Retired?
no team
Team Role: Alumni
 
Join Date: Oct 2007
Rookie Year: 2007
Location: Seattle, WA
Posts: 1,525
Navid Shafa has a reputation beyond reputeNavid Shafa has a reputation beyond reputeNavid Shafa has a reputation beyond reputeNavid Shafa has a reputation beyond reputeNavid Shafa has a reputation beyond reputeNavid Shafa has a reputation beyond reputeNavid Shafa has a reputation beyond reputeNavid Shafa has a reputation beyond reputeNavid Shafa has a reputation beyond reputeNavid Shafa has a reputation beyond reputeNavid Shafa has a reputation beyond repute
Re: Gyro drift for a simple EV3

I find this robot and set of programming instructions to be a great tool to get started working with the gyro sensor.

Calibration and value reset is a must. You will definitely experience drift over long periods of time, but it is fairly consistent for what most FLL teams ask of it.
__________________
2015 & 2016 Fantasy FIRST Champions [Rotten Fruit Alliance]
Elgin Clock Award Winners: '13, '15, '16

Team 1983 | Alumnus, Former Mentor| Team_ 360 | Former Coach | Team 5803 | Former Mentor

"Once a Skunk, Always a Skunk"

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


All times are GMT -5. The time now is 02:52.

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