# 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?

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.

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.

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

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

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.

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

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.

C++ way:
gyro.SetSensitivity(0.007);

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