Use this guide to ensure that your Quadrature Encoders are functioning properly before you install them on a robot. Materials Needed 2 Quadrature Encoders 1 VEX Micro Controller and Battery 1 VEX Programming Module ROBOTC for IFI v. 1.4 or higher installed 1 Axle 1 2.75 Green Wheel Electrical Tape 1. Plug the USB end of the Programming Module into your computer. Plug the other end of the cable into the SERIAL port of your VEX Micro Controller. NOTE: Before your VEX Micro Controller can correctly read data from the Quadrature Encoders, it s firmware must be updated to the one included with ROBOTC for IFI v. 1.4 or higher. Instructions on updating your robot s firmware can be found in the Setup > Firmware section of Teaching ROBOTC for IFI VEX Robots and online at: http://www. robotc.net/content/vex_quick/vex_quick.html.
2. Connect the Quadrature Encoders to the Vex Micro Controller. 2a. Situate the Encoders Face the Encoders so that the VEX label is right-side-up and the two wires are coming out of the left side. Top Wire Bottom Wire 2b. Connect Encoder 1 Plug the top wire into ANALOG/DIGITAL Port 3. Plug the bottom wire into INTERRUPTS Port 3. 2c. Connect Encoder 2 Plug the top wire into ANALOG/DIGITAL Port 4. Plug the bottom wire into INTERRUPTS Port 4. 3. Slide the axle through the wheel and then through the center of the first Quadrature Encoder. (We will test only one Encoder first. Then we will compare the two.) 3a. Mark the Wheel Attach a small piece of tape to the wheel to act as a position marker. This setup allows you to simulate the wheel-to-encoder relationship.
4. In ROBOTC for IFI, open the sample program Quad - Encoder Test.c from the Quadrature Encoders Sample Programs folder. 4a. Open Sample Program Go to File > Open Sample Program, open the Quadrature Encoders folder and select Quad - Encoder Test.c 5. Make sure your VEX is turned on and download the program to your robot. 5a. Download Sample Program Go to Robot > Download Program to download the program to the robot.
6. Open the Debug Windows > Devices window. 6a. Open the Devices Window Go to Robot > Debug Windows > Devices to open the Devices window so we can view the sensor values of the Quadrature Encoders. 7. Press Start on the Program Debug window. This begins the program and resets the values in the Devices window to default. 7a. Start the Program Press the Start button to start the program on the VEX. 7b. Set the Refresh Rate Make sure that this button reads Stop and not Continuous to ensure that the Devices window receives continuous feedback from the Quadrature Encoders.
8. While holding a Quadrature Encoder, rotate the wheel so that the piece of tape moves from top to bottom, or 180 degrees. In the Devices window, you should notice that the value of the Encoder you spun went from 0 to about 180 (or -180 depending on the direction you rotated it). 8a. Check the Encoder Value The updated value of the Quadrature Encoder you spun will appear under the value column. Note: The value of the Encoder may not be exactly 180. Some error expected due to the width of the tape and how far you actually rotated the wheel. Also, keep in mind that very small rotational movements of the wheel or Encoder will cause the value to change.
9. Now rotate the wheel in the opposite direction. The value should count back to zero. Notes: If the value in the Devices window matches how far you rotated the wheel, then your Encoder is working correctly. Continue on to step number 10. If the value never changes, repeatedly switching back and forth between 0 and 2, or if the Encoder only counts a fraction of the actual wheel rotation, your Encoder is defective. Contact your supplier s customer support for a replacement. 10. If your first Quadrature Encoder is working correctly, slide the second onto the axle. We will now check to make sure that they are both in sync.
11. Hold both Encoders firmly together, so that neither can move. Select Clear All on the Program Debug window to reset their values to 0. 11a. Press Clear All Pressing Clear All will reset the Quadrature Encoder values to 0. 12. Rotate the wheel and observe the values for QuadCount1 and QuadCount2. Again, keep in mind that very small rotational movements of the wheel or Encoder will cause the value to change. 12a. Observe Encoder Values The values in QuadCount1 and QuadCount2 should roughly align. Notes: If the value of the second Encoder is the opposite of the first Encoder (-180 instead of 180), the placement of the two wires can be switched as a correction. If the values in the Devices window differ by more than 6 counts or they don t correspond at all, your second Encoder is defective. Contact your supplier s customer support for a replacement. Otherwise, both Encoders are working correctly.