Go to Post I used to be a FIRST Robotics mentor...then I took a Frisbee to the knee. - Travis Hoffman [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 11-02-2008, 23:14
johnsmith11111 johnsmith11111 is offline
Registered User
no team
 
Join Date: Feb 2008
Location: pacific ocean
Posts: 4
johnsmith11111 is an unknown quantity at this point
gyro not working

I'm programming in easy-C with a gyro. I had a simple autonomous function initialize the gyro, wait 1200 milliseconds, start the gyro, then go to a loop where it got the gyro value and printed it to screen. No matter how I turned the gyro, it only gave a readout of zero. I then downloaded the same code but without the 1.2 second wait, and it worked fine. When I try to embed this code into the rest of my autonomous code, it does not work. Can anyone help me?
  #2   Spotlight this post!  
Unread 12-02-2008, 09:53
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 588
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
Re: gyro not working

Quote:
Originally Posted by johnsmith11111 View Post
I'm programming in easy-C with a gyro. I had a simple autonomous function initialize the gyro, wait 1200 milliseconds, start the gyro, then go to a loop where it got the gyro value and printed it to screen. No matter how I turned the gyro, it only gave a readout of zero. I then downloaded the same code but without the 1.2 second wait, and it worked fine. When I try to embed this code into the rest of my autonomous code, it does not work. Can anyone help me?
That's a little confusing. The Initialize routine actually waits until the robot has been turned on for a second (settling time for vibration), then it does a one second calibration where it computes the average non-moving value. So you shouldn't need to 1.2 second wait.

I'm not sure why adding it changes anything, but you can look at a pretty simple sample program here that does work:
http://users.wpi.edu/~bamiller/WPILib/Samples.html

Please let us know if you find a bug in something that is causing your problem.
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
  #3   Spotlight this post!  
Unread 13-02-2008, 11:55
bdleppke bdleppke is offline
Registered User
FRC #1731
 
Join Date: Feb 2008
Location: Virginia
Posts: 3
bdleppke is an unknown quantity at this point
Re: gyro not working

Quote:
Originally Posted by BradAMiller View Post
That's a little confusing. The Initialize routine actually waits until the robot has been turned on for a second (settling time for vibration), then it does a one second calibration where it computes the average non-moving value. So you shouldn't need to 1.2 second wait.

I'm not sure why adding it changes anything, but you can look at a pretty simple sample program here that does work:
http://users.wpi.edu/~bamiller/WPILib/Samples.html

Please let us know if you find a bug in something that is causing your problem.
We are having a similar problem. We are using WPILIB with Eclipse. We are also using the KOP gyro's and gear tooth sensors. We tested them all individually with WPILIB and they worked great. When we started integrating the different features together we started getting very strange and intermittent results. For example, after reset, we would get just a single value that would never change as we rotated the yaw rate sensor. By just moving two lines of code down a couple lines (code that registered interrupts for the IR sensor was moved from the end of Initialize() to the start of Autonomous()), the gyro started working again. We started back from scratch and started adding functionality. Now the gear tooth sensors don't work at all. That code related to the gear tooth sensors is identical to what it used to be when it worked. It made us think of the memory corruption back in 2006 with the "8.2/8.3 battery voltage bug". Is there anything we need to do for that bug when using WPILib or do you have any other suggestions.
  #4   Spotlight this post!  
Unread 14-02-2008, 09:15
bdleppke bdleppke is offline
Registered User
FRC #1731
 
Join Date: Feb 2008
Location: Virginia
Posts: 3
bdleppke is an unknown quantity at this point
Re: gyro not working

Quote:
Originally Posted by bdleppke View Post
We are having a similar problem. We are using WPILIB with Eclipse. We are also using the KOP gyro's and gear tooth sensors. We tested them all individually with WPILIB and they worked great. When we started integrating the different features together we started getting very strange and intermittent results. For example, after reset, we would get just a single value that would never change as we rotated the yaw rate sensor. By just moving two lines of code down a couple lines (code that registered interrupts for the IR sensor was moved from the end of Initialize() to the start of Autonomous()), the gyro started working again. We started back from scratch and started adding functionality. Now the gear tooth sensors don't work at all. That code related to the gear tooth sensors is identical to what it used to be when it worked. It made us think of the memory corruption back in 2006 with the "8.2/8.3 battery voltage bug". Is there anything we need to do for that bug when using WPILib or do you have any other suggestions.
We fixed the problem that was creating the erratic behavior. We had a short in two of our PWM cables (we made them ourselves). After removing those faulty cables, the code worked fine.
  #5   Spotlight this post!  
Unread 14-02-2008, 17:13
johnsmith11111 johnsmith11111 is offline
Registered User
no team
 
Join Date: Feb 2008
Location: pacific ocean
Posts: 4
johnsmith11111 is an unknown quantity at this point
Unhappy Re: gyro not working

well, there doesn't appear to be a short in our wires....
If we add a few lines of code in autonomous that initailize and start the gyro, then inside a whileloop that will be constantly running (While 1) that gets the gyro and prints it to screen, then the gyro works. For some reason, it is only working in this scenario, we have the same settings for the start and initalize, and the same port, it still does not work. This is very frustrating

Last edited by johnsmith11111 : 14-02-2008 at 17:16.
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
Subscriptions not working? Jeff Waegelin CD Forum Support 2 07-02-2007 14:11
Gyro not working in Autonomous? kaszeta Programming 7 11-02-2006 01:28
CMUCam not working Inverted Programming 10 04-02-2005 19:32
Radios not working... E Jones 234 Control System 3 21-01-2005 21:58
Radios not working... E Jones 234 Electrical 3 21-01-2005 21:58


All times are GMT -5. The time now is 09:59.

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