Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Gyro Oddities (http://www.chiefdelphi.com/forums/showthread.php?t=80804)

Rafael Vasquez 21-01-2010 18:34

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?

Joe Ross 21-01-2010 18:40

Re: Gyro Oddities
 
Quote:

Originally Posted by Rafael Vasquez (Post 904204)
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.

Vikesrock 21-01-2010 19:29

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.

Sauce 30-01-2010 14:36

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.

mgurgol 30-01-2010 18:05

Re: Gyro Oddities
 
If you are using Labview, there is a setGain vi available in the WPI library.

Phoenix Spud 30-01-2010 18:39

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.

Bochek 30-01-2010 20:01

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

Alan Anderson 30-01-2010 23:08

Re: Gyro Oddities
 
Quote:

Originally Posted by Sauce (Post 909965)
(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.

byteit101 31-01-2010 18:20

Re: Gyro Oddities
 
C++ way:
gyro.SetSensitivity(0.007);

keericks 01-02-2010 13:04

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?

byteit101 01-02-2010 14:56

Re: Gyro Oddities
 
Quote:

Originally Posted by keericks (Post 911169)
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


All times are GMT -5. The time now is 01:55.

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