|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
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 Last edited by wireties : 05-03-2014 at 16:46. Reason: grammar |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|