Our gyro isn’t working. It is plugged into the Analog Channel and once we run the robot and try to get the gyro angle it starts at about 0.01 and constantly increases. Moving the robot doesn’t change the rate at all.
If we try to get the voltage from the Analog Channel the Gyro returns 1.96-1.97 volts which doesn’t change if we rotate the robot.
What can we do to fix this?
Make sure the gyro is plugged into either analog channel 1 or analog channel 2. Those are the only ones with the accumulators to convert the rate output to a heading.
If you just look at the analog channel output (not the gyro object angle) you should see the voltage centered near 2.5V. Quickly rotating the robot in one direction will make the voltage go down while it’s rotating. Rotating in the other direction should make the voltage go up while it’s moving.
When the robot isn’t rotating the voltage will go back to 2.5V again since it is measuring rate of rotation.
Once that’s working, creating a gyro object should show headings. Be sure that the gyro sensitivity parameter in the class matches the gyro sensitivity specification otherwise it will incorrectly calculate headings.
If you aren’t seeing that, make sure that everything is wired correctly.
Make sure that the Analog Board on the cRio is recieving power. Our’s was plugged in backwards, which led to the exact same issue. You can tell that the wiring is correct if the light the analog breakout board is on
Thanks, it turned that the issue was in the wiring. Two of our wires were uncovered and touching which completely messed up the voltage going to the Analog Channel.
Thanks for the help!