|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Re: Gyro Angle Problems
I gyro still stays at a very small angle, i had just modified the code a lot to fix some logical problems. ill upload some pictures to this post showing what i see with the gyro.
http://dl.dropbox.com/u/78573135/IMAG0067.jpg http://dl.dropbox.com/u/78573135/IMAG0068.jpg The second photo is after doing a complete turn around, though the value only went back by -.1 I'm using a school wifi system right now so i don't have access to image sites, sorry! EDIT: at this point i think the gyro might have been installed wrong, could anyone link a PDF on how to correctly install a gyro? i can't seem to find one. Last edited by Gmercer : 26-01-2013 at 15:12. |
|
#2
|
||||
|
||||
|
Re: Gyro Angle Problems
Quote:
1) go to andymark.com 2) type "gyro" in the search box and press ENTER 3) click on the link that says "Dual Use Gyro and Accelerometer Sensor Board (am-2067)" 4) on that page, click on the tab named "Files & Documents" 5) click on the link "Wiring diagram" 6) scroll to the bottom of the page |
|
#3
|
|||
|
|||
|
Re: Gyro Angle Problems
What is the range of values the getAngle function will return? The gyro updates correctly, but starts at a very small angle and only increment by maybe .15 at a time.
If we have an example angle of 6.8 degrees, and the gyro stays at such a small number, the robot goes into a death spin until reaching 6.8 degrees(which is a long time). |
|
#4
|
||||
|
||||
|
Re: Gyro Angle Problems
follow these steps:
1) Go to the folder on your development PC where the WPILib Java source code files are kept. 2) Open the file named "gyro.java" 3) Search for "getAngle" 4) Read the method header comments |
|
#5
|
||||||
|
||||||
|
Re: Gyro Angle Problems
Quote:
If you are using Robot Builder version 619 or earlier, there is a bug that defaults the sensitivity to 1.25 V/°/s. See the post by Alex Henning above. This would cause an issue similar to what you saw. It would take approximately 3.4 full revolutions before the robot measured 6.8 degrees. You should make sure that the sensitivity matches your gyro. Edit: sorry, I see that you are setting sensitivity. I'll leave this here in case it helps someone in the future. With a DMM, what is the voltage on the rate and +5v pins of the gyro? Last edited by Joe Ross : 01-02-2013 at 14:23. |
|
#6
|
|||
|
|||
|
Re: Gyro Angle Problems
First, don't print useless "I'm here" messages at the maximum loop rate! The first one conveys information all the rest consume bandwidth. (check your logs for when the spinning slows I would not be surprised if your prints are gradually backing up and consuming all your CPU and/or bandwidth)
Second, If your code stays in a while loop forever it means you are not meeting the exit criterea. Period. In this case that almost certainly means your spinning in the wrong direction, or +/- .75 degrees is smaller than the distance covered at 25% power in 6 tenths of a second. (how did you come up with .6 as the magic amount of time between checks?) Third, never create a loop that can run forever! Create a counter or timer that guarantees you'll exit after, say, 5 seconds, or 10 iterations, or something. If your gyro gets unplugged or damaged you will sit and spin. (been there) |
|
#7
|
|||
|
|||
|
Re: Gyro Angle Problems
Noticed something about the setup, wondering if anyone can explain it...
I plugged the gyro into the analog breakout and set everything up correctly, until i just realized the analog has never had a power cord to it(i feel very stupid). But how was the gyro returning values to us when the analog was never powered to begin with? |
|
#8
|
|||
|
|||
|
Re: Gyro Angle Problems
Quote:
Edit: The analog breakout is just a few connectors and a 5V supply. All the actual measuring is done by the cRIO module, which is powered by the cRIO backbone. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|