|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools |
Rating:
|
Display Modes |
|
|
|
#1
|
|||
|
|||
|
Gyro Results
Hi,
Below is an EasyC sample program to test our ADXR300 from Sparkfun. When I manually rotate the gyro 90 degrees, the result I get is about 35 degrees. We tested the 80Deg/s from this years kit, and the 150Deg/s from last years kit, and they work correctly in EasyC. In ChiefDelphi there is a thread to multiply the answer by 2.5. But it doesn't look like it is correct. I tried using Kevin Watsons IFI code in MPLab, and the gyro works correctly, and I get expected results, however all of our code has been built with EasyC. I downloaded the Jan 2008 WPILib libraries, and installed it in EasyC, but still don't get the expected results. Is there something I am done incorrectly? ![]() Thanks, Eric Grajales #include "Main.h" void main ( void ) { int gyroval = 0; long cnt = 0; SetGyroType ( 1 , ADXRS300 ) ; InitGyro ( 1 ) ; Wait ( 2000 ) ; SetGyroDeadband ( 1 , 5 ) ; StartGyro ( 1 ) ; while ( TRUE ) { gyroval = GetGyroAngle ( 1 ); if ( (cnt % 5) == 0 ) { PrintToScreen ( "GyroVal = %d\n" , gyroval ) ; } cnt = cnt + 1; // Arcade2 ( 1 , 2 , 1 , 1 , 3 , 1 , 0 , 0 ) ; Wait ( 100 ) ; } } |
|
#2
|
|||
|
|||
|
Re: Gyro Results
We had a similar experience with our ACXRS300 and EasyC, but not as severe as yours. For our purposes it's no big deal. I would try decreasing the deadband and see if that helps.
Also take the wait(100) from the bottom of your code. Also the wait (2000) after InitGyro is unecessary as the InitGyro has a built in pause to center the gyro. Last edited by TubaMorg : 29-02-2008 at 00:29. Reason: More comments |
|
#3
|
||||
|
||||
|
Re: Gyro Results
Call SetGyroType ( 1 , ADXRS300 ) ;
after InitGyro ( 1 ) ; |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| gyro | captainking | General Forum | 4 | 03-02-2008 22:25 |
| arm-limitting gyro PD loop producing some strange results | ZZII 527 | Programming | 8 | 16-02-2005 02:30 |
| Gyro | magical hands | Programming | 2 | 14-01-2005 20:57 |
| gyro | odin892 | Programming | 0 | 08-04-2003 09:59 |
| Gyro | archiver | 2001 | 2 | 23-06-2002 23:11 |