Wiki

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
first:adxrs450_gyro_board_frc:labview [24 Oct 2018 18:11] – [Using the ADXRS450 Gyro for FRC in LabVIEW] Kristen Chongfirst:adxrs450_gyro_board_frc:labview [24 Oct 2018 18:32] (current) – [Using the Gyro in Your Robot Code] Kristen Chong
Line 68: Line 68:
 \\ \\
 ===== Using the Gyro in Your Robot Code ===== ===== Using the Gyro in Your Robot Code =====
-{{:first:gyrogetanglevi.png?nolink |}}There are several use-cases for using the gyro output in your code. You may want to use the gyro output to accurately track your robot's direction of travel so that you drive straight, or rotate to the right angle. This offers you more precision than simply telling the motors to drive together at the same rate to move forward. For this kind of action, you will use the Get Angle VI.+{{:first:gyrogetanglevi.png?nolink |}}There are several use-cases for using the gyro output in your code. You may want to use the gyro output to accurately track your robot's direction of travel so that you drive straight, or rotate to the right angle. This offers you more precision than simply telling the motors to drive together at the same rate to move forward. For this kind of action, you will use the Get Angle VI. Get Angle counts continuously, so when you've completed a full rotation, it will continue to increase above 360 degrees rather than starting over. 
 +\\ 
 +\\ 
 +{{:first:gyroresetvi.png?nolink |}}Sometimes it may be necessary to reset the gyro's "zero degrees" position. All gyros will have some amount of drift over time and it's physically impossible to calibrate out all sources of drift. In this case, you can use the Reset VI to reset the current gyro heading to 0 degrees. When doing this, your robot should be facing the direction you want zero degrees to be, particularly if you are driving with field-oriented drive using an omnidirectional drive base. Otherwise, your robot may begin to behave incorrectly. For this reason, you should never automate this routine. Note that this **does not** recalibrate the gyro, so you don't have to be sitting still to perform this method properly.
 \\ \\
 \\ \\
-{{:first:gyroresetvi.png?nolink |}}You may also want to be able to reset the gyro, since any gyro will have some drift as the match progresses. Think of it like zeroing a weight scale - it's good practice to "tare" or "zero" the scale when you first turn the scale on, or when you want to use a cup or container for whatever you're measuring. For this, you would use the Reset Gyro VI. 
  
 <note>In my example below, I'm going to be reporting the gyro angle to the driver station from the Teleop.vi. In practice, you should really put this type of action in the PeriodicTasks.vi, but this is just an example. These steps will apply to anywhere you want to use either of the VIs listed above.</note> <note>In my example below, I'm going to be reporting the gyro angle to the driver station from the Teleop.vi. In practice, you should really put this type of action in the PeriodicTasks.vi, but this is just an example. These steps will apply to anywhere you want to use either of the VIs listed above.</note>
first/adxrs450_gyro_board_frc/labview.txt · Last modified: 24 Oct 2018 18:32 by Kristen Chong