View Single Post
  #4   Spotlight this post!  
Unread 02-02-2008, 16:07
Jared Russell's Avatar
Jared Russell Jared Russell is offline
Taking a year (mostly) off
FRC #0254 (The Cheesy Poofs), FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: San Francisco, CA
Posts: 3,077
Jared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond repute
Re: gyro and accelerometer problems

Put in some printf's in the ADC interrupt handler to make sure the analog input is updating.

Also, did you do these?

Code:
1) The gyro's rate output is wired to one of the analog inputs
of your robot controller and gyro.h/#define GYRO_CHANNEL is
updated with the analog channel your gyro is attached to.

2) The source code files gyro.c and gyro.h must be added to
your project.

3) A #include statement for the gyro.h header file must be 
included at the beginning of each source file that calls the 
functions in gyro.c. The statement should look like this: 
#include "gyro.h".

4) Initialize_Gyro() must be called from user_routines.c/
User_Initialization().

5) Process_Gyro_Data() must be called when the ADC software 
generates an update. An example of how to do this can be found
in user_routines_fast.c/Process_Data_From_Local_IO(). If you
use the gyro during autonomous period, Process_Gyro_Data()
must also be called from User_Autonomous_Code().

6) You must select the gyro you're using from a list in gyro.h
and if needed, remove the // in front of its #define. If you're
using the gyro from the 2006 KOP, use the default ADXRS150
gyro.

7) The default angular unit is milliradians. If desired, this
can be changed to tenths of a degree by editing gyro.h

8) A gyro bias calculation must take place using the functions 
Start_Gyro_Bias_Calc() & Stop_Gyro_Bias_Calc() described below.
This must be done several hundred milliseconds after the gyro 
powers-up and is allowed to stabilize.

9) For optimal performance, you'll need to calibrate the gyro 
scaling factor using the instructions above or those included
in gyro.h.

10) Follow the instructions found in adc_readme.txt for
installation instructions.