Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Drifting Gyro with EasyC (http://www.chiefdelphi.com/forums/showthread.php?t=58429)

SgtMillhouse648 14-08-2007 09:40

Drifting Gyro with EasyC
 
Okay, so the programming team was fiddling around with the KOP gyro last night for the first time using EasyC. We hooked up the gyro, and using the test code, were able to get a fairly accurate reading off of it, however, once we turned the gyro back to center, the reading started to drift. We were not turning it faster than the 80 degrees per second, and it still drifted pretty significantly (20 degrees or so) What do I need to do to calibrate the gyro with EasyC to prevent it for drifting like this?
Thanks
Malhon

Kingofl337 14-08-2007 10:17

Re: Drifting Gyro with EasyC
 
If you are running the newest version you can adjust the deadband on the gyro by calling SetGyroDeadband() in the gyro function. Vibration will also cause drift. Default deadband is 3.

You can get the newest version at http://www.intelitekdownloads.com/easyCPRO

SgtMillhouse648 14-08-2007 12:36

Re: Drifting Gyro with EasyC
 
I guess I said what wasn't working right. The gyro isn't in a way drifting. When you bring it back to zero, it increasingly is off each time as it passes its starting point ex. we started up the controller, and let the gyro initialize. slowly we moved the gyro about 90 degrees, and it was dead on. next, we brought it back to 0, and it was within a degree or so. Next, we rotated it 180 degrees, and it was within a bout 5-10 degrees. we then brought it back to 0, and it was off by about 20 degrees. Will the deadband take care of this? It is almost like it is not scaled correctly, but im not sure. Is there a way to change this in easyC?

Kingofl337 15-08-2007 10:56

Re: Drifting Gyro with EasyC
 
I'd still recommend playing with gyro deadband. You can write your own gyro function if you want to play with it. Just get the analog value GetAnalogInput() and average the samples and set that as your bias.
Subtract the Current Rate from the bias and the difference should be the rate of rotation.

Then it should be 12.5mv/deg sec.

I heard we got a 150deg/sec gyro this year is that true or was it an 80deg/sec again?

I think I might have a snippet of the gyro code around I'll see if I can find it.

Alex.Norton 15-08-2007 12:02

Re: Drifting Gyro with EasyC
 
I know that the gyro was a different one this year than last cause we couldn't simply change between the two without some very major changes to the code.

I will tell you that the gryo will slowly drift even when just sitting. We did some experiments in 2005 to see if we could get absolute positioning working with our swerve and found that it would get almost 45 degrees off with like 720 degrees of motion. Of course this was a drastically different gyro but we have found the same things to be true of both this years and last years gyro.

While I don't know if this is significant for a small bot I will tell you that it is meaningless noise for the operator of a FIRST bot. I barely notice when the gyro drifts because there are so many other factors that influence that bot.

Qbranch 15-08-2007 12:15

Re: Drifting Gyro with EasyC
 
Did you consider using a MicroGyro? (datasheet) These are the same type of gyros as used in the Wiimote, and in the Gyration line of human interface devices for computers (wireless 'flying' mice).

They proveide a ton of accuracy, however I dont know how well they'll do in the harsh environment of a FIRST field... think the vibration might kill it, but who knows. I havent found a source for these yet but I'll look....

-q

SgtMillhouse648 15-08-2007 12:17

Re: Drifting Gyro with EasyC
 
Thanks for the help, I'll try tinkering with the deadband when I can get ahold of the gyro again.
Thanks
Malhon


All times are GMT -5. The time now is 00:22.

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