Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Gyro drift for a simple EV3 (http://www.chiefdelphi.com/forums/showthread.php?t=130410)

lgphoneeric 30-08-2014 12:24

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

Arhowk 30-08-2014 12:27

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.

Jared 30-08-2014 12:39

Re: Gyro drift for a simple EV3
 
Quote:

Originally Posted by lgphoneeric (Post 1398486)
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.

lgphoneeric 30-08-2014 13:18

Re: Gyro drift for a simple EV3
 
Quote:

Originally Posted by Arhowk (Post 1398487)
[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

Arhowk 30-08-2014 13:55

Re: Gyro drift for a simple EV3
 
Quote:

Originally Posted by lgphoneeric (Post 1398492)
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)

Breakaway3937 30-08-2014 14:34

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!

lgphoneeric 31-08-2014 01:30

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?

Navid Shafa 31-08-2014 03:20

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.


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

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi