OCCRA
Go to Post Not everything has to be cashed in or has to have instant recognition. Sometimes being a part of a program of value and opportunity is enough. And, what you put into the program is what you get out of it. - JaneYoung [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Events   CD-Media   CD-Spy   FRC-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rating: Thread Rating: 4 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 02-28-2008, 10:26 PM
g_less1902 g_less1902 is offline
Registered User
no team
Team Role: Mentor
 
Join Date: Nov 2007
Rookie Year: 2007
Location: Orlando
Posts: 7
g_less1902 is an unknown quantity at this point
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 ) ;
}
}
Reply With Quote
  #2   Spotlight this post!  
Unread 02-28-2008, 11:25 PM
TubaMorg TubaMorg is offline
Programmermechanicalelect ricalcoach
AKA: Dan
FRC #1480 (Robatos Locos)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Houston
Posts: 450
TubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond repute
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 : 02-28-2008 at 11:29 PM. Reason: More comments
Reply With Quote
  #3   Spotlight this post!  
Unread 03-02-2008, 04:08 PM
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 858
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Re: Gyro Results

Call SetGyroType ( 1 , ADXRS300 ) ;
after InitGyro ( 1 ) ;
__________________
Intelitek Support

[BFIRST Team 146 Blue Lightning - Alumni[/b]
FIRST Team 40 Checkmate
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
gyro captainking General Forum 4 02-03-2008 09:25 PM
arm-limitting gyro PD loop producing some strange results ZZII 527 Programming 8 02-16-2005 01:30 AM
Gyro magical hands Programming 2 01-14-2005 07:57 PM
gyro odin892 Programming 0 04-08-2003 08:59 AM
Gyro archiver 2001 2 06-23-2002 10:11 PM


All times are GMT -5. The time now is 07:12 AM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi