View Single Post
  #14   Spotlight this post!  
Unread 22-12-2014, 22:38
seg9585's Avatar
seg9585 seg9585 is offline
Registered User
AKA: Eric
FRC #4276 (Surf City Vikings)
Team Role: Engineer
 
Join Date: Feb 2006
Rookie Year: 2001
Location: Boeing (Seal Beach, CA)
Posts: 520
seg9585 has a reputation beyond reputeseg9585 has a reputation beyond reputeseg9585 has a reputation beyond reputeseg9585 has a reputation beyond reputeseg9585 has a reputation beyond reputeseg9585 has a reputation beyond reputeseg9585 has a reputation beyond reputeseg9585 has a reputation beyond reputeseg9585 has a reputation beyond reputeseg9585 has a reputation beyond reputeseg9585 has a reputation beyond repute
Re: Best gyro for frc.

Quote:
Originally Posted by Andrew Schreiber View Post
That's what I assumed, do note that micros() returns multiples of 4 (or 8 on 8mhz arduinos).

You might also want to look into using interrupt driven timers.

And while on the topic of timing and arduino, for timing dependent tasks write the code yourself. Tests I did a couple years back showed that there's a SIGNIFICANT overhead for the arduino digitalWrite compared to the comparable C code. I'd always assumed they were just macros but they actually include a fair bit of code.
I added a calibration task that samples 5 seconds of data at 1kHz and calculates the bias from this. And I used micros() instead of ms counts and removed the smoothing, so now the heading is updated at 1kHz as well.

Result: ~1 deg drift in 10 minutes. I think that'll be good enough.

Photo of the setup (3D printed protective case):


Serial Output:
__________________
My FIRST legacy:

Team 204 Student 2001, 2002 (Voorhees, NJ)
Team 1493 College Mentor 2006 - 2008 (Troy, NY)
Team 2150 Intern/Professional Mentor 2007, 2009 (Palos Verdes)
Team 4123 Lead Engineering Mentor 2012 (Bellflower, CA)
Team 4276 Engineering Mentor 2012-2016 (Huntington Beach, CA)