BEI Gyrochip AQRS - just counting up?

I have found and old BEI Systron Donner Gyro chip angular rate sensor. From way back I should add. Figured it’s a 3 pin Gyro - hook it up to analog input on the cRIO and start playing with a gyro. Apparently not. It’s acting like a counter - it just counts up, no matter how I move it it just counts up at what appears a steady rate.

I have imported the Gyro class, and I’m reading the angle with getAngle() - I’m just printing the value out to see if I could watch the value change as I moved the Gyro around.

Either its toast and theres a reason it was buried in my closet for the last 12 years or theres a few steps I’m missing. I have the Gyro/temp/accelerometer chip coming in the mail and it should be here tomorrow so it’s not the end of the world. It would have been nice to have an extra Gyro though.

The ultimate teaching/demo bot project continues.

Are you calibrating the gyro? The WPIlib Gyro class does this automatically during the creation of the Gyro object - be careful not to bump the robot while it is booting!

To verify that the hardware works, you could try hooking the signal pin up to an oscilloscope and you should see a stable voltage. Rotate one way, the voltage should climb; rotate the other way, the voltage should descend.

Thats one thing my kitchen shop needs is an oscilloscope - but until then that test might have to wait. the robot is still as it boots up. Maybe what I need to do is reset/realign the gyro after initial initialization?

Do you have a voltmeter? That should at least let you see that the output is relatively stable when the gyro is not being rotated, and that it increases or decreases when it is.

I’d try defining/reading it as a straight raw analog input through the cRIO to begin with, just to see the raw data it’s sending without the gyro software massaging.

See if it returns close to 2.5v while at rest.

It’s probably the 75 degress per second model, so it’ll be good on the straight and narrow, but not so good on turns.

P.S.
What gain did you use when you defined it as a gyro, e.g., .03 volts/degree/sec?
How did you wire the three pins, since the order might not be what you expected (pin A= +5v, pin B=ground, pin C= analog signal (.25 to 4.75v))?

These can be damaged by drops or other sudden shocks.

Self imposed issue - I had two documents one with an A,B,C pin out, and one with 1,2,3 pin out - I used the wrong one - explains the issue. Corrected the wiring snafu and all systems are go. It’s looking very stable out of the box without any filtering (which I plan on experimenting with). Seems like a nice one axis gyro to me!

As far as setting things like gain during initialization…I’m not - should I be?

If you’re not setting the sensitivity, then you’re getting whatever the default is (Gyro.h: kDefaultVoltsPerDegreePerSecond = 0.007, which maps to a 300 degree/sec gyro). It certainly won’t be the same between the old BEI gyro and the one you’re expecting in the mail.

You can use the SetSensitivity method to make sure it matches the gyro you are currently using.

With an incorrect gain, the GetAngle value will also be incorrect.
How much of a problem that is depends on how and for what purpose you plan to use the gyro.
If you’re just using it to drive straight, then your correction coefficent can overcome the incorrect angle reading-you’re looking for a zero angle all the time. You just won’t be able to swap gyros without recalculating/experimenting with a new coefficent.
If you’re using the gyro to turn to a specific angle, then it won’t work at all. Well, it will turn to an angle, but 90 degrees will read as something else, e.g., ~21 degrees.

If you have a cRIO, you have an oscilloscope. In LV you can just drop a graph indicator on an analog read. The default FRC setup isn’t really intended for this, so you won’t get as many samples per second as the hardware is capable of (500kS/s on a single channel), but it should be more than sufficient for these purposes.