View Single Post
  #4   Spotlight this post!  
Unread 12-03-2004, 11:00
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,847
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Differences programming ADXRS150EBs to BEI Gyrochips?

Quote:
Originally Posted by Salik Syed
yes I am sampling the gyro every CPU cycle, do you know what the sample rate of the BEI Gyrochip is ? I assume it is 100hz .... from the code u gave me? so i guess i could just divide by a larger constant.... but given the simplicity of the code we are using i think it may work even with the lower sample rate..

its kinda like this
heading=heading + (127-gyrovalue)
then we divide heading by 439 to get a degree measure....
we are not doing any integrations
My BEI gyro spec sheet is at home and I don't remember the exact update rate off-hand. I will check it when I get home. It's on the same order as the ADXRS150, so you may not be far off when you swap them later. My code above takes gyro samples only when the clock tells it to (that's the 100Hz), so I always know exactly how many samples per second I've collected. In real life I happen to be sampling our gyro at 250Hz, simply because it happens to be convenient.

With the method you're using the fast loop will give you a raw number for heading that includes all your over-sampling, but you somewhat correct for it when you do your conversion to degrees. There is a larger error introduced because the loops are not at a constant, regular rate (probably in the neighborhood of 400 Hz), but you'll have to judge if the added error is significant enough to affect how you use it in autonomous. If you're only using it to turn towards the 10pt ball it only has to work once.

The method you're using is more trial and error in finding the proper number to divide by to get degrees, so you'll have to repeat your tests with the new chip (and each time you add a lot of code that changes the fast loop rate).
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 12-03-2004 at 11:14.