|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Re: gyro and accelerometer problems
As far as the gyro goes, are you sure that the wires are connected to the pins labeled T, and not the ones labeled R? This has been a really common mistake for years.
|
|
#2
|
||||
|
||||
|
Re: gyro and accelerometer problems
no, i'm certain that that's not the issue. They use the weirdest naming system...
|
|
#3
|
|||||
|
|||||
|
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. |
|
#4
|
||||
|
||||
|
Re: gyro and accelerometer problems
Quote:
-Kevin |
|
#5
|
||||
|
||||
|
Re: gyro and accelerometer problems
OK! so! i think i figured out the problem! it was probably the combination of
A: the gyro being plugged into the wrong port (curse you electrical people!), and B: the fact that i hadn't called Process_Gyro_Data() from Disabled_Spin() |
|
#6
|
||||
|
||||
|
Re: gyro and accelerometer problems
OK! so now it isn't working! I've called several print statements and writing chars. all the appropriate pieces get called, but the value of:
Code:
temp_gyro_rate = (int)Get_ADC_Result(GYRO_CHANNEL) - gyro_bias; the gyro rate is generally around 30 or -31, but jumps around between these, even though the robot is still during calibration, and these don't change when i'm rotating the robot i'm completely stumped... could we need a new gyro? |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Gyro/accelerometer/Gear tooth sensor | sparrowkc | Technical Discussion | 2 | 11-01-2008 22:47 |
| Gyro Autonomous Problems | cprogrammer | Programming | 5 | 23-03-2007 14:28 |
| Gyro/Accelerometer | Drew Shapiro | Programming | 5 | 06-02-2006 22:44 |
| accelerometer problems | kjohnson | Programming | 3 | 02-02-2005 10:53 |