Weird Gyro Values

We have a gyro on our robot and when we turn it we get weird values back. We think we have the right gain and everything is wired correctly but when we turn a full turn we get different values. The values aren’t normal either, they are like 3 or 5 or something like that. What would cause this? Could we have the wrong gain? Is the gyro we are using just to fast to be used on our robot (110 degrees per second)?

Did you try to read the gyro using sample code or your code? I like to use the sample code first to eliminate possibility of software problem. Base on the random readings, I would also verify wired correctly. Could just be seeing electrical noise.

As to if the gyro is to fast. It can never be fast enough! Seriously, this is just the frequency response of the sensor. The higher the value, just means it is capable of responding to faster turn rates. Has nothing really to do with the software reading it.

Ok, so I just looked at our gyro (other programer had it first) and it keeps counting even when not moving. I think it might be noise on the cable. We have a shielded cable but where can we ground the cable to since we are not allowed to use the normal chassis as ground.

It’s normal for there to be some drift in the reading over time. A few degrees per minute is normal.

What about a like a degree a second? Also is there anyway to reduce all the noise?

Yes. I looked at the datasheet for the gyroscope, and it says that the gain is 7ms per degree per second. The “default” gain foo the gyroscope function is something like .125. I changed that to .007, according to the datasheet.

Try that. I’m not sure it will work though, sorry. We haven’t tested the gyro recently.

we bought a different gyro and have set the gain. It reads fairly accurate now but you watch the value and it counts down by almost 1 degree per second. we’ve also tried bigger and small Volts per degree per second (V/D/S). Also for some odd reason, no matter what we set the V/D/S it still gives us a pretty decent reading. Even 12 V/D/S on a 3 volt gyro :yikes:

2 solutions:

  1. Try a smaller gain. Our robot’s gyro has again of 1/200, to give you some perspective.

  2. Reboot. And, while you reboot, don’t touch the gyro

The WPI Gyro implementation is horrible, because it polls the gyro for 2s while booting up and determines the center point. It would be much better to calibrate this center, as you wouldn’t have issues where it polls the gyro while it is moving (such as if you are holding it, or positioning your robot on the field).

FYI: I managed to saturate a 150deg/sec gyro with our robot. Good thing we don’t need to turn that fast, ever. 110 seems a bit slow, but if you are only using it during slow processes it could work.

The WPI Gyro code collects two seconds of data in Open, not Bootup.

If you want to calibrate at a known time, open the gyro at that time. Perhaps it should be another call, and I definitely want the help to be updated to call out when the calibration takes place and that the gyro should be immobile.

If you think the robot was moving when the calibration took place, just rerun the code, no need to reboot.

Greg McKaskle

The other people have said it in a round about kind of way, but I’ll clarify it here:

If you are using a gyro:

DO NOT move the robot after power on until you enable it (it really needs a few seconds of zero motion, but I’d wait until you enable it to be safe).

After power up, there is a period of time when the CPU is determining what the voltage is of a non-moving gyro. Let’s say that during this period you move the robot 2 degrees, and this “gyro-zeroing” period lasts 2 seconds. That means you’ve moved the robot an average of 1 deg/sec. When the zeroing routine is finished and the robot is sitting still, it thinks it’s spinning at -1 deg/sec (since 1 deg/sec is what it thought was "still). Therefore your gyro reading will be changing at -1 deg/s

So, be absolutely sure that once you turn on the power, your robot does not move at all.

Greg - I realize this is an old post. There is mention about how a gyro center voltage (for rate) is determined … specifically that the Gyro Open vi polls the gyro for two seconds for its calibration. I gather that this would average the gyro voltage over the two seconds and save it as the reference voltage for a zero deg/sec turn rate.

I took a look at the current Gyro Open (WPI library included with LabVIEW 2012), and am not seeing this polling operation. In fact, it seems to expect you to provide this center voltage, although the vi has an I/O design apparently intended to allow you to customize the use and time period of this calibration. There is also Honeywell compass and SparkFun IMU code that looks … unfinished (to me). I suppose the WPI library has gone through additional development since the original post, but now I’m not sure how this is supposed to work.

How is the gyro center voltage for zero deg/sec determined today?
Is IMU support in development?
Is there a reference describing how these vi’s are supposed to work under the hood?

Thanks

Sorry I’m not Greg, but the “polling” is performed by the FPGA.
The Gyro Open simply waits while the FPGA is collecting data and takes the result after a (default) time of 2 seconds.
The default of the Gyro Open has True for Calibrate on Open, so the True Case gets executed.

Thanks substitute-Greg.

Thank you for the information … but, here is the Gyro Open back panel. Where is the True case? How exactly is the Center Voltage updated?
What am I missing?





You’re the victim of versionitis.
That is the PC version of Gyro Open, not the cRIO version.
When the Gyro Open code is loaded for a PC Target, and PCs don’t have an FPGA, you get a version that runs on a PC Target cRIO simulator.
This misdirection is usually encountered when you open a blank vi (defaults to a PC Target) and drop a cRIO specific library vi onto it just to look at it.

Open a robot framework project (cRIO target) and drop a Gyro Open on it, then drill down to take a look.





Of course, Greg had mentioned somewhere that the vi’s change with the target.