Troubleshooting Guide: Problems with Sensors and Encoders

arc_adminGuides, News

Have you ever had the problem of no readings from all of your motor and sensor encoders, and the wheels are running forever, or they are just not running at all? Here is some insight as to how to fix that:

  1. Check that all the encoder wires are plugged in facing the right direction. Our team has spent too much time trying to figure out what was going wrong when there was such a simple solution (this applies mainly to those using AndyMark motors)
  2. Ensure that you are reading from the correct encoders. If you are not getting any values and your motors are moving forever, then possibly, something could be wrong with your configuration. Unplug every module, wire, and power cable, and rewire/reconfigure the robot so you know which motor corresponds to which encoder. (You may accidentally be reading an arm encoder instead of a drive motor encoder)
  3. 3.Inputs could be in the wrong order. If you are using utility methods for straight motions, double-check the different inputs to methods and be sure that you are adding parameters in the correct order.
  4. 4.ALWAYS check for sign errors in while loops. If your robot is configured correctly, the signs for moving forward/back should be different, along with the operators. This can be tricky, since it may take some trial and error if you are new to the process.
  5. There could be a calculation error. If your robot is moving incorrect distances, you may have forgotten that you are using a sprocket/gear drive, which means that there will be a ratio you have to plug in. Also, you might not be using the correct Encoder Ticks Per Revolution number, which varies depending on the manufacturer/type of motor. Moreover, make sure all of the attributes of your robot are set correctly in the program, such as wheel diameter, track width, and more.