Go to Post Given how easily these things pop, is "Blow Out Pricing" really the best choice of words? - ahecht [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 26-01-2013, 14:50
Gmercer Gmercer is offline
Registered User
None #1631
 
Join Date: Jan 2013
Location: Las Vegas
Posts: 15
Gmercer is an unknown quantity at this point
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.
Reply With Quote
  #2   Spotlight this post!  
Unread 26-01-2013, 15:42
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,042
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Gyro Angle Problems

Quote:
Originally Posted by Gmercer View Post
could anyone link a PDF on how to correctly install a gyro? i can't seem to find one.
Follow these steps:

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


Reply With Quote
  #3   Spotlight this post!  
Unread 01-02-2013, 13:35
Gmercer Gmercer is offline
Registered User
None #1631
 
Join Date: Jan 2013
Location: Las Vegas
Posts: 15
Gmercer is an unknown quantity at this point
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).
Reply With Quote
  #4   Spotlight this post!  
Unread 01-02-2013, 13:40
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,042
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Gyro Angle Problems

Quote:
Originally Posted by Gmercer View Post
What is the range of values the getAngle function will return?
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


Reply With Quote
  #5   Spotlight this post!  
Unread 01-02-2013, 13:53
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,561
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 Angle Problems

Quote:
Originally Posted by Gmercer View Post
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).
getAngle requires that the sensitivity of the gyro is set correctly with the setSensitivity method. For the ADW22307 gyro available on FIRST Choice, the sensitivity is 0.007 V/°/s. If you are using a different gyro, you will need to find the sensitivity from the data sheet of the gyro.

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.
Reply With Quote
  #6   Spotlight this post!  
Unread 01-02-2013, 15:30
omalleyj omalleyj is offline
Registered User
AKA: Jim O'Malley
FRC #1279 (Cold Fusion)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2008
Location: New Jersey
Posts: 132
omalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to behold
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)
Reply With Quote
  #7   Spotlight this post!  
Unread 02-02-2013, 13:24
Gmercer Gmercer is offline
Registered User
None #1631
 
Join Date: Jan 2013
Location: Las Vegas
Posts: 15
Gmercer is an unknown quantity at this point
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?
Reply With Quote
  #8   Spotlight this post!  
Unread 02-02-2013, 13:42
EricVanWyk EricVanWyk is offline
Registered User
no team
 
Join Date: Jan 2007
Rookie Year: 2000
Location: Boston
Posts: 1,597
EricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond repute
Send a message via AIM to EricVanWyk
Re: Gyro Angle Problems

Quote:
Originally Posted by Gmercer View Post
But how was the gyro returning values to us when the analog was never powered to begin with?
I would imagine it was just integrating noise. It wasn't returning good values, was it?

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.
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


All times are GMT -5. The time now is 10:04.

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