|
Re: Picking a gyro for field-centric swerve control
If the field is flat, I say do away with the gyro and put two encoders on follower wheels. Using this method we get better than one-tenth of a degree of accuracy over many minutes of driving. If the field isn't level (like this year), this becomes a little trickier from a mechanical standpoint of keeping the encoder wheels in contact with the floor.
What we did this year is incorporate a gyro with our encoders. While we were using the encoders for heading calculation (the normal mode of operation), we constantly updated a gyro correction term that forced the gyro heading to be equal to the encoder heading. This corrects for any gyro drift during the time when the encoders are being used to calculate the heading.
When the robot's calculated X coordinate was within an area that we knew an encoder could leave the ground, we switched to the gyro-calculated heading. While using the gyro calculated heading, the encoders were correlated with the gyro to determine if an encoder lost contact with the floor. If so, we calculated an encoder correction term to force the encoder data to agree with the gyro. Once the X coordinate left the trouble area of the field, the robot would switch back to using encoder based headings (using the corrections from the gyro).
Like the previous poster said, you can also include a "Heading Sync" button or a heading trim pot. Those work pretty well when needed.
__________________
-
An ounce of perception is worth a pound of obscure.
Last edited by Chris Hibner : 20-04-2010 at 11:28.
|