Terminal IR Distance Measurements Tests

Now, your SumoBot’s IR distance sensors are ready to test.  These tests are important, and the SumoBot has to pass all of them before it’ll be ready to chase objects in the sumo ring.

Program

This test will verify that each IR distance sensor reports 8 when no object is detected, or something in the 0 to 7 range when an object is detected.  The value 0 indicates the object is very close, while a value of 7 is almost out of range.  The actual distances will depend on how reflective the object is.  For example, a large white shoebox might get a 5 report at 2 or 3 times the distance of a stealthy, black, and minimally reflective SumoBot.

  • Download SumoBot-Front-IR-Terminal.svg.

SumoBot-Front-IR-Terminal.svg

  • In BlocklyProp Solo, click the Open button, and open the SumoBot-Front-IR-Terminal.svg file you just downloaded.
  • Set POWER to 1.
  • Click the Load & Run (Save code to EEPROM)  button to load the program into your SumoBot.
  • Leave the USB cable connected.

Tests

The animation below shows how to position a box at various distances in front of each IR sensor.  Keep in mind that the distances will depend on how well the box reflects infrared light.  In other words, don’t worry if your measured distances don’t match the ones in the animation.   


A white cardboard box (not glossy) or the backside of a sheet of white poster board will be highly reflective.  A book will be somewhat less reflective, and a black box might absorb most of the infrared and so the reflection will be faint, and the object will pass out of range (distance of 8) at some point much closer to the front of the SumoBot.

Uneven measurements are also okay.  For example, one side might report a distance of 5 while the other reports 3 or 4.  The main goal is to get measurements of 8 when objects are out of range, and “some” indication of distance as the object is moved closer to the front of the SumoBot.  

  • With USB still connected, place the SumoBot on the sumo ring with about 4 ft or 1.2 m of open space in front of the SumoBot.  
  • Place an object like a cardboard box with one face very close to the left IR LED -approximately 1” or 2.5 cm away.  
  • Verify that the distance under L is in the 0 to 2 range, and the distance under R is 8.
  • Move the box further away, and verify that the values increase, up to a point where the box is out of range and the distance is 8.  The distance under R should be 8 the entire time.
  • Repeat for the right sensor.  This time, the left sensor should report 8 while the distance values for the right sensor increase with object distance.  
  • If you were able to get distances from 0..2 close up, and up to 8 out of range for each side, skip to How the Tests Work on the next page.  If not, check the Troubleshooting section below first.

 

Troubleshooting

If one or both of the IR sensors seem to be “stuck” at a particular measurement, it might indicate a loose or incorrect connection.  In that case, make sure that all the pins are properly connected to the right sockets.  

If you are not able to get 8 regardless of how clear the path in front of the SumoBot is, try these tips.

  • Try tipping your SumoBot slightly upwards.  
    • If that fixes the problem and allows the distance reported to be 8 when nothing is detected, it means the infrared light from the IR LEDs is reflecting off the table surface in front of the SumoBot.  
    • If the SumoBot is not on the sumo ring for these tests, find a way to bring the ring to the SumoBot or bring the test to the ring.  
    • If this test was already on the ring, AND if tipping the SumoBot slightly upward prevented the unwanted detections:
      • Point the IR LED slightly upward so that less IR light shines on the surface in front of it.  It will still need to detect a SumoBot in front of it, so try to minimize how far upward you point the IR LEDs.
  • If it doesn’t seem like tipping the SumoBot upward results in distance values of 8, try turning off any fluorescent lights in the room.  If that allows the measurement to go to 8 for no objects, it means the fluorescent lights are actually triggering the IR receivers.  Not all fluorescent lights do this, but if one near your robotics area does, consider moving your area somewhere away from that particular light.  Another option would be to make a sun visor to prevent light from above from reaching the IR receivers.  
  • If the distance tops out at 5 or 6 when it's on the ring, make a note of the “no objects detected” distance.  You will need it in the Detect and Charge at an Opponent activity’s Program section.