Go to Post Leaders are those whom inspire people; a good mentor inspires students. - Jeffy [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 21-01-2010, 18:34
Rafael Vasquez Rafael Vasquez is offline
Registered User
FRC #1245
 
Join Date: Jan 2010
Location: Louisville
Posts: 10
Rafael Vasquez is an unknown quantity at this point
Gyro Oddities

My team finally got out Gyro hooked up and working, but we have a problem with the outputs we are getting. After turning the gyro through 90 degrees, it reads just over 45 degrees.

Is there a better way to solve this problem other than multiplying it by a constant? Does anyone know why this is happening?
  #2   Spotlight this post!  
Unread 21-01-2010, 18:40
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,587
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 Oddities

Quote:
Originally Posted by Rafael Vasquez View Post
My team finally got out Gyro hooked up and working, but we have a problem with the outputs we are getting. After turning the gyro through 90 degrees, it reads just over 45 degrees.

Is there a better way to solve this problem other than multiplying it by a constant? Does anyone know why this is happening?
The default gyro gain is probably not the same as the gyro you are using. For example, in LabVIEW, the default gain (sensitivity) is .0125 v/deg/sec. The ADXRS610 gyro my team used last year was .006v/deg/sec. You should be able to sensitivity on the data sheet of the gyro you are using. Once you find the right value, you should explicitly set the gain in the software.

Last edited by Joe Ross : 21-01-2010 at 20:03.
  #3   Spotlight this post!  
Unread 21-01-2010, 19:29
Vikesrock's Avatar
Vikesrock Vikesrock is offline
Team 2175 Founder
AKA: Kevin O'Connor
no team
Team Role: Engineer
 
Join Date: Mar 2006
Rookie Year: 2007
Location: Manchester, NH
Posts: 3,305
Vikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond repute
Send a message via AIM to Vikesrock Send a message via MSN to Vikesrock Send a message via Yahoo to Vikesrock
Re: Gyro Oddities

If you are using the KOP gyro the gain is 7mV/deg/sec.

If you were using the default Labview gain a rotation of 90 degrees should have come out to ~50.4 degrees.
__________________


2007 Wisconsin Regional Highest Rookie Seed & Regional Finalists (Thanks 930 & 2039)
2008 MN Regional Semifinalists (Thanks 2472 & 1756)
2009 Northstar Regional Semifinalists (Thanks 171 & 525)
  #4   Spotlight this post!  
Unread 30-01-2010, 14:36
Sauce Sauce is offline
Registered User
FRC #1245 (Shazbots)
Team Role: Programmer
 
Join Date: Oct 2008
Rookie Year: 2008
Location: Louisville
Posts: 35
Sauce is an unknown quantity at this point
Re: Gyro Oddities

(I'm on Rafael's Team)

so, we are in fact using the default gain on the gyro, however I do not know how to change it.
  #5   Spotlight this post!  
Unread 30-01-2010, 18:05
mgurgol mgurgol is offline
Registered User
FRC #1094
 
Join Date: Jan 2006
Location: St Louis MO
Posts: 76
mgurgol is just really nicemgurgol is just really nicemgurgol is just really nicemgurgol is just really nicemgurgol is just really nice
Re: Gyro Oddities

If you are using Labview, there is a setGain vi available in the WPI library.
  #6   Spotlight this post!  
Unread 30-01-2010, 18:39
Phoenix Spud's Avatar
Phoenix Spud Phoenix Spud is offline
Everyone. Everywhere.
FRC #3132 (Thunder Down Under)
Team Role: College Student
 
Join Date: Jan 2009
Rookie Year: 2004
Location: Sydney, Australia
Posts: 703
Phoenix Spud has a reputation beyond reputePhoenix Spud has a reputation beyond reputePhoenix Spud has a reputation beyond reputePhoenix Spud has a reputation beyond reputePhoenix Spud has a reputation beyond reputePhoenix Spud has a reputation beyond reputePhoenix Spud has a reputation beyond reputePhoenix Spud has a reputation beyond reputePhoenix Spud has a reputation beyond reputePhoenix Spud has a reputation beyond reputePhoenix Spud has a reputation beyond repute
Re: Gyro Oddities

What programming language are you using?

I remember my team--we used C++--had the same problem last year, we just changed part of the Gyro class so it worked for the KoP gyro.
__________________
Sarah Heimlich
Outreach Mentor | Business Mentor
FIRST® TEAM 3132
  #7   Spotlight this post!  
Unread 30-01-2010, 20:01
Bochek's Avatar
Bochek Bochek is offline
Registered User
AKA: Adam Bochek
FRC #2200 (MMRambotics)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Burlington, Ontario, Canada
Posts: 577
Bochek has much to be proud ofBochek has much to be proud ofBochek has much to be proud ofBochek has much to be proud ofBochek has much to be proud ofBochek has much to be proud ofBochek has much to be proud ofBochek has much to be proud ofBochek has much to be proud ofBochek has much to be proud of
Re: Gyro Oddities

We came up with a very simple solution, Rotate the robot 360 while taking a reading from the gyro, lets say the gyro read 200 degrees.

In your code, whenever you use GetAngle(); just multiply by 360 and divide by your reading, in our case, 200.

so your code would look like

float fAngle = gyro.GetAngle()*360/200;

- Bochek
__________________
-----------------------------------------------
Adam Bochek - FRC 2200
http://www.mmrambotics.com
http://www.watchfirstnow.com
  #8   Spotlight this post!  
Unread 30-01-2010, 23:08
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Gyro Oddities

Quote:
Originally Posted by Sauce View Post
(I'm on Rafael's Team)

so, we are in fact using the default gain on the gyro, however I do not know how to change it.
There are a few ways to do it. Here's one. If you double-click on the Gyro Open vi, you'll see a Gyro Const vi in it. Remove the wire from the top of the Gyro Const to the Gain (VoltsPerDegree/Second) at the top of the GyroDevRef bundle and replace it with your own constant that matches the device you're using.

But it's a lot easier and cleaner to use the Set Gain vi in the gyro palette.

Last edited by Alan Anderson : 30-01-2010 at 23:11.
  #9   Spotlight this post!  
Unread 31-01-2010, 18:20
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: Gyro Oddities

C++ way:
gyro.SetSensitivity(0.007);
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib
  #10   Spotlight this post!  
Unread 01-02-2010, 13:04
keericks's Avatar
keericks keericks is offline
Registered User
AKA: Kent
FRC #1671 (Buchanan Bird Brains)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 1998
Location: Clovis
Posts: 55
keericks is a glorious beacon of lightkeericks is a glorious beacon of lightkeericks is a glorious beacon of lightkeericks is a glorious beacon of lightkeericks is a glorious beacon of light
Re: Gyro Oddities

On this same topic ... we have the Gyro wired properly and sensitivty set properly via the C++ method and are getting readouts via the GetAngle method. The problem is that the readouts are all over the map.

1. One time while the Gyro is at rest, it's returning a steadily increasing value well into the thousands if we let it keep going.

2. Another time while at rest, the reading is as expected, a few degrees positive and negative when twisting slowly about the z-axis.

3. Sometimes when reading the voltage return on the PWM, we get the standard 2.5v at rest, but then for no reason, the voltage jumps to 4.6+ and seems to get stuck there until we "jostle" the gyro.

Not sure if this is a bad Gyro and we don't have a 2nd one to test if this is the case. Any ideas?
  #11   Spotlight this post!  
Unread 01-02-2010, 14:56
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: Gyro Oddities

Quote:
Originally Posted by keericks View Post
On this same topic ... we have the Gyro wired properly and sensitivty set properly via the C++ method and are getting readouts via the GetAngle method. The problem is that the readouts are all over the map.

1. One time while the Gyro is at rest, it's returning a steadily increasing value well into the thousands if we let it keep going.

2. Another time while at rest, the reading is as expected, a few degrees positive and negative when twisting slowly about the z-axis.

3. Sometimes when reading the voltage return on the PWM, we get the standard 2.5v at rest, but then for no reason, the voltage jumps to 4.6+ and seems to get stuck there until we "jostle" the gyro.

Not sure if this is a bad Gyro and we don't have a 2nd one to test if this is the case. Any ideas?
I had a similar problem, but only until we realized, it is measuring degrees, not normalized degrees (so you don't have to multiply it by 360) this might be part of the problem
also, check the wiring
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib
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 problem Guarana Programming 9 03-03-2008 15:48
gyro captainking General Forum 4 03-02-2008 22:25
Gyro magical hands Programming 2 14-01-2005 20:57
gyro odin892 Programming 0 08-04-2003 09:59
Gyro archiver 2001 2 23-06-2002 23:11


All times are GMT -5. The time now is 21:22.

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