This is an old revision of the document!
The ADXRS450 gyro board is a single-axis industrial sensor, designed to get teams up and running quickly without having to load 3rd-party libraries. This gyro is readily accessible through multiple sources and is recommended for all teams, including those with no gyro experience. It plugs directly into the SPI port on the RoboRIO and libraries are already included in WPILib - all you have to do is declare it in your robot code and use it!
Supporting code for the ADXRS450 only exists in the three main programming languages supported by FIRST. If your team wants to use this board with other programming languages, please refer to the ADXRS450 product datasheet for more information on how to communicate with this gyro via SPI.
If you're looking for information on other ADI donation resources, click here to go back to the main page.
There are currently three versions of the FRC Gyro board. The libraries detailed on this page apply to all of these versions, however there are some considerations to take into account for each one.
This version was made available to FRC teams through 2016. It includes both the ADXRS450 and the ADXL362 accelerometer. This board continues to be supported by WPILib and you can even use the WPI Accelerometer library to connect to it if you want. Just note that the accelerometer component is no longer supported, so there's a chance that new RoboRIO firmware released each year may not work with this sensor.
This version of the gyro board was available for the 2017 and 2018 seasons. The accelerometer was removed in favor of a jumper that allows you to configure the “chip select” pin used to communicate with the sensor in case you want to have other devices on the same SPI bus. To use the libraries built-in to WPILib, the default configuration should be to connect the jumper between the CS0 pin and the unlabeled center pin. If you want to use a different setting, you will need to change the “chip select” pin address when initializing the sensor in your robot code. The sections below detail how to do this for each of the three supported languages.
This is the lower-cost, more reliable version of the sensor board made available to teams starting with the 2019 season. To make using the sensor even easier for teams, we removed the chip select pin jumpers and added a solderable jumper. This change improves reliability as there is no risk of the jumper accidentally getting lost or removed, but still allows teams the flexibility of adding additional sensors to the SPI bus.
To help the robot identify a starting angle position more accurately and remove gyro drift, it is recommended that you allow the robot to perform what is called an offset calibration first. It will do this by taking several readings from the sensor and averaging them together to obtain a value which will be subtracted from every subsequent reading after the calibration is complete. Calibration typically takes about 30 seconds.
Calibration should be performed as soon as the robot is powered on, to prevent the calibration routine from interfering with any autonomous code execution. You can usually tell that your robot was bumped during calibration if you notice that your gyro angle readings are drifting off into space very rapidly. In LabVIEW, this calibration is done as part of the initialization. But in other languages, you must explicitly call the calibrate routine. You can read more info on your team's specific language at the links below.
For more information on how to add gyro functionality to your robot code, select your team's preferred programming language from the list below.
Using the Gyro in LabVIEW
Using the Gyro C++
Using the Gyro in Java