STEMLabs IQ
Lab 13 - Testbed - VEX IQ Sensors

Teacher Portal

### Program with the Gyro Sensor

Have the Programmer open VEXcode IQ  and follow these steps:

### Test the Gyro Sensor

Have the Tester connect the VEX IQ Brain to your computer and then follow these steps:

• Run the project to report and print what the current Gyro Sensor's heading is in degrees as the Gyro Sensor rotates.

• Based on your observations of how the sensor behaved on the Testbed and the information from the reading, answer the following questions and ask the Recorder to document them in your engineering notebook:

1. What causes the value of the Gyro Sensor to increase? What causes it to decrease?

2. Can the Gyro Sensor report values greater than 360?

3. Why would including a Gyro Sensor on a robot be helpful?

4. Can the Gyro Sensor measure more than one axis at a time?

• Can it measure up-and-down as well as left-and-right at the same time?

• What about if the Gyro Sensor is positioned differently on the robot?

1. Rotating the Gyro Sensor counterclockwise increases the value of the Gyro Sensor and turning it clockwise decreases the value.

2. The Gyro Sensor can report values between 0-359.99. Once the Gyro reaches 360 degrees it reports back as zero.

3. Including a Gyro Sensor on a robot allows the robot to make more accurate turns.

4. The Gyro Sensor can only measure one axis at a time.

• The Gyro Sensor can measure an x-axis (left to right) as well as a y-axis (up and down), just not at the same time.
• If a Gyro Sensor was first placed on a robot so that it measured an x-axis, the Gyro Sensor could then be turned on its side to measure the y-axis (up and down). This can be useful when measuring manipulators such as a claw arm. The Gyro Sensor could be used to raise and lower the arm with accurate measurement.

Teacher Tips

Ask students to identify the direction of the arrow on the sensor and test twisting the Gyro Sensor to understand which axis it detects and how the values it reports correspond to that movement.

Teacher Toolbox - Troubleshooting

When working with the Gyro Sensor, there could be instances where it does not behave as it should. If this occurs, begin troubleshooting by trying the following steps:

• First begin by checking that the Gyro Sensor's firmware is up-to-date. Read this article for more information on how to update firmware.

• If the firmware is up to date, further look into the Device Info screen on the IQ Brain to check the angle and number of turns are registering on the Brain. Use the article, “How to Troubleshoot VEX IQ Sensors.”

• If the Device Info reports accurate values, the issue could be that the student miscopied the project.

• To troubleshoot the project, check that the device is configured properly - meaning that they used the correct Testbed example project. For more information on how to configure the Gyro Sensor, read the "How to Configure VEX IQ Sensors - VEXcode IQ" article.

• Ensure that the students copied and built the project correctly. You can use the print block in VEXcode IQ to display the current sensor values on the Brain as the project proceeds through to the error or to the end of the project.

• If the Device Info does NOT report accurate values, then the issue could be hardware-related.

• To troubleshoot the hardware, try checking the port connection with the Smart Cable using the article, “How to Connect VEX IQ Devices to Smart Ports.”

• If the Gyro Sensor is connected properly and it is still not behaving as it should, there could be a physical issue with the Gyro Sensor. Test switching it out with another Gyro Sensor.