Go to Post Changing the world starts with changing yourself. - Jeremy_Mc [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 05-03-2014, 16:44
wireties's Avatar
wireties wireties is offline
Principal Engineer
AKA: Keith Buchanan
FRC #1296 (Full Metal Jackets)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Rockwall, TX
Posts: 1,169
wireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond repute
Send a message via AIM to wireties
Looking at the KOP Gyro

We were playing with the KOP Gyro today and came up with some helpful hints. There have been many great threads on the gyro but I did not see this particular technique/procedure.

The datasheet for the gyro says the default sensitivity is 0.007, that is the value used by the Gyro class. But the datasheet also says the initial value can be between 0.0062 and 0.0078. Since the error accumulates it can lead to the significant drift (documented by many CDers). So getting the sensitivity correction right for your gyro is very important.

After waiting a couple seconds(after power-on) try this calibration loop (with the gyro level and not moving):

- reset the accumulator (myGryo->reset())
- wait for a while (taskDelay(sysClkRateGet() / 4)
- read the angle (myGyro-GetAngle())
- if the angle is positive, decrease the sensitivity by 0.0001 (myGyro->SetSensitivity())
- if the angle is negative, increase the sensitivity by 0.0001 (myGyro->SetSensitivity())
- keep track of the choice to increase or decrease the sensitivity
- if the angle is positive and you increased the sensitivity, break out of the loop
- if the angle is negative and you decreased the sensitivity, break out of the loop
- if the angle is outside 0.0062 to 0.0078, break out of the loop

After we did this 3 different KOP gyros drifted less than 1 degree in 10 minutes. We could add temperature-based correction and make it a little better but the datasheet says that is only +/- 2% - not sure we will try. We could also make a wiser choice between the last two values to improve things a bit.

We still advocate resetting the accumulator (as recommended by many wide CDers) and only using the KOP gyro for 10s of seconds at a time but this calibration does make life easier and leaves us with less concern about the drift. PM me if you want the code.

HTH
__________________
Fast, cheap or working - pick any two!

Last edited by wireties : 05-03-2014 at 16:46. Reason: grammar
Reply With Quote
 


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 12:11.

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