View Single Post
  #6   Spotlight this post!  
Unread 07-04-2008, 21:34
Qbranch Qbranch is offline
wow college goes fast.
AKA: Alex
FRC #1024 (Kil-A-Bytes)
Team Role: Alumni
 
Join Date: Apr 2006
Rookie Year: 2006
Location: Indianapolis
Posts: 1,174
Qbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond repute
Re: Gyro Sensor Questions

Quote:
Originally Posted by Demothesis View Post
As long as you're on the topic, where did you go to learn how to use the gyros? Is there another way besides using Kevin's code? Like always, the simplest solution will be the best and I find that Kevin kind of goes overboard with his code (hence the need to all but re-write the default code).

Demothesis
Really... you need almost all of the 'overboard' code he writes. If you're planning on integrating rate of rotation up to absolute angle with any kind of repeatability, you MUST have extremely precise sampling timing so that you don't under or over integrate a specific sample of rotation rate. Any variations in the sample rate will cause erroneous headings.

The reason kevin's code looks so confusing at first is that it allows the analog converter to run in a hardware triggered mode. This way, as much of the time critical sampling as possible is done on a hardware only basis, to cut out any possibility of interrupt overhead causing a variation in sampling interval.

It's a really great system... that would be even greater if the processor in the FIRST controller had DMA like some of the newer/fancier Microchip processors... imagine hands-off gyro oversampling that only bothers to interrupt your code after all the samples have been taken, since they were directly recorded to RAM by the DMA.

-q
__________________
Electrical Engineer Illini
1024 | Programmer '06, '07, '08 | Driver '08