Go to Post The Chairman's award is about doing what you can to strengthen the FIRST community. It doesn't require money to simply lend tools, wise advice or a hand. - Koko Ed [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 04-02-2008, 22:22
EFastring EFastring is offline
Registered User
AKA: Eric Fastring
FRC #2078 (Robotic Wolves)
Team Role: Engineer
 
Join Date: Feb 2008
Rookie Year: 2007
Location: Slidell, Louisiana, USA
Posts: 24
EFastring is an unknown quantity at this point
Gyro problems, crossposted from Electrical

in this thread I asked about testing the kit gyro and was given a programming answer, so I will continue my programming question here.

I am wanting the easiest way to test my gyro to see if it is dead.

I have the kit gyro hooked up with a PWM cable, with the white cable connected to TW(twist), the black cable connected to GB (ground), and the red cable to 5R (+5V). I plug it into the Robot Controllers Analog input 1 with the colors corresponding to those on the inputs.

In my code, under user_routines.c I have added the following

double yawtest = 0;
yawtest = Get_Analog_Value( rc_ana_in01 );
printf("yawtest %d\r", yawtest);

I get a number back that does not change (17535).

I am definitely hooked to TW (twist) and not RW (relative temperature).

At this point I am really just wanting to see a number that changes when I move the gyro chip. Am I doing something wrong or do I have a dead gyro? Is there an easier way to see if it is dead?
  #2   Spotlight this post!  
Unread 04-02-2008, 22:33
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,586
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Gyro problems, crossposted from Electrical

Quote:
Originally Posted by EFastring View Post
in this thread I asked about testing the kit gyro and was given a programming answer, so I will continue my programming question here.

I am wanting the easiest way to test my gyro to see if it is dead.

I have the kit gyro hooked up with a PWM cable, with the white cable connected to TW(twist), the black cable connected to GB (ground), and the red cable to 5R (+5V). I plug it into the Robot Controllers Analog input 1 with the colors corresponding to those on the inputs.

In my code, under user_routines.c I have added the following

Code:
double yawtest = 0;
yawtest = Get_Analog_Value( rc_ana_in01 );
printf("yawtest %d\r", yawtest);
I get a number back that does not change (17535).

I am definitely hooked to TW (twist) and not RW (relative temperature).

At this point I am really just wanting to see a number that changes when I move the gyro chip. Am I doing something wrong or do I have a dead gyro? Is there an easier way to see if it is dead?
Get_Analog_Value returns an int, so you should declare yawtest as an int. Also, the %d in the printf expects an int.

double is a floating point type, which should be avoided whenever possible on the robot controller since it does not have a floating point unit, so all floating point must be done by software and is very big and slow.
  #3   Spotlight this post!  
Unread 05-02-2008, 09:38
EFastring EFastring is offline
Registered User
AKA: Eric Fastring
FRC #2078 (Robotic Wolves)
Team Role: Engineer
 
Join Date: Feb 2008
Rookie Year: 2007
Location: Slidell, Louisiana, USA
Posts: 24
EFastring is an unknown quantity at this point
Re: Gyro problems, crossposted from Electrical

I made the changes above to make my variable an int, but saw no difference.

Does anyone have any suggestions for testing our kit gyro to see if it is alive? Is there a way to do it with a voltage meter?

does Get_Analog_Value( rc_ana_in01 ) return a value that should change when the gyro chip is rotated, or do you have to initialize the gyro before it will function at all?
  #4   Spotlight this post!  
Unread 05-02-2008, 10:02
jtdowney jtdowney is offline
Boiler Up
AKA: John Downey
FRC #4302 (Robophins)
Team Role: Mentor
 
Join Date: Sep 2006
Rookie Year: 2006
Location: Chicago
Posts: 300
jtdowney has a brilliant futurejtdowney has a brilliant futurejtdowney has a brilliant futurejtdowney has a brilliant futurejtdowney has a brilliant futurejtdowney has a brilliant futurejtdowney has a brilliant futurejtdowney has a brilliant futurejtdowney has a brilliant futurejtdowney has a brilliant futurejtdowney has a brilliant future
Re: Gyro problems, crossposted from Electrical

I would load up the .hex from Kevin's 2008 code found at http://www.kevin.org/frc/ and see if his default sensor code gives you any readings.
__________________
John Downey
Lead Robot Inspector - Purdue IndianaFIRST District
Whitney Young Magnet High School/Robophins (FRC 4302) - Mentor (2013-current)
Midwest Regional Planning Committee - Member (2012-current)
Boilermaker Regional Planning Committee - Member (2011-2014)
Robot Inspector (2008-current)
Purdue FIRST Programs - Staff Advisor (2008-2011)
Lafayette-Jefferson High School/Precision Guessworks (FRC 1646) - Mentor (2006-2011)
  #5   Spotlight this post!  
Unread 05-02-2008, 10:16
billbo911's Avatar
billbo911 billbo911 is offline
I prefer you give a perfect effort.
AKA: That's "Mr. Bill"
FRC #2073 (EagleForce)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Elk Grove, Ca.
Posts: 2,381
billbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond repute
Re: Gyro problems, crossposted from Electrical

Quote:
Originally Posted by EFastring View Post
I made the changes above to make my variable an int, but saw no difference.

Does anyone have any suggestions for testing our kit gyro to see if it is alive? Is there a way to do it with a voltage meter?

does Get_Analog_Value( rc_ana_in01 ) return a value that should change when the gyro chip is rotated, or do you have to initialize the gyro before it will function at all?
An important point to understand about the gyro is it only returns a rate of rotation while it is moving. This rate is around 2.5 vdc when still. So, the software needs to integrate the variation in rate over time to give you an angle relative to it's original angle. So, the answers given in the programming section may contain your solution.
Sorry if this was already explained, but that is what happens when you "cross-post".
As for using a multi-meter to test it may be difficult. If I recall correctly, the KOP gyro's output changes by 12mv/deg/s of rotation and is limited to 80 deg/sec. You would need a very fast and sensitive meter to catch it. So, try connecting the meter between T and gnd. Rotate the gyro by hand and see if the output changes during rotation. The other alternative is to use a o'scope.
__________________
CalGames 2009 Autonomous Champion Award winner
Sacramento 2010 Creativity in Design winner, Sacramento 2010 Quarter finalist
2011 Sacramento Finalist, 2011 Madtown Engineering Inspiration Award.
2012 Sacramento Semi-Finals, 2012 Sacramento Innovation in Control Award, 2012 SVR Judges Award.
2012 CalGames Autonomous Challenge Award winner ($$$).
2014 2X Rockwell Automation: Innovation in Control Award (CVR and SAC). Curie Division Gracious Professionalism Award.
2014 Capital City Classic Winner AND Runner Up. Madtown Throwdown: Runner up.
2015 Innovation in Control Award, Sacramento.
2016 Chezy Champs Finalist, 2016 MTTD Finalist
Closed Thread


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 and accelerometer problems paulcd2000 Programming 6 16-02-2008 15:17
Gyro Autonomous Problems cprogrammer Programming 5 23-03-2007 14:28
Problems with the Gyro Guy_E Programming 21 04-12-2006 17:23
Problems with the gyro Conan Programming 7 06-02-2006 01:45
Gyro Code Problems railerobotics Programming 8 27-01-2006 10:45


All times are GMT -5. The time now is 19:11.

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


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