View Single Post
  #4   Spotlight this post!  
Unread 02-11-2015, 22:07
Aren Siekmeier's Avatar
Aren Siekmeier Aren Siekmeier is offline
on walkabout
FRC #2175 (The Fighting Calculators)
Team Role: Mentor
 
Join Date: Apr 2008
Rookie Year: 2008
Location: 대한민국
Posts: 735
Aren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond repute
Re: ADW22307 KOP Gyro

This sounds like an improperly initialized gyro. Assuming you're using the WPILib Gyro class here. Call the Gyro constructor or initGyro method when you're sure the robot is not moving to make sure it is properly initialized.

The gyro senses turning rate, so the code needs to know not only a zero heading reference (established when the constructor is called and when the reset method is called), it also needs to know a reference signal for "not moving." It does this by averaging the gyro for a few samples, calling that rate zero, and subtracting it from all future signals for a turning rate to feed to the integrator. This average happens when the constructor is called, and when you call the initGyro method. Make sure to do this when the robot is not moving (either don't move it while the code is booting, or call initGyro later, by a button press or something, while the robot is not moving).

http://team2168.org/javadoc/edu/wpi/...tml#initGyro--