like a real world robot. The screenshot in Figure 4
was obtained after introducing enough error to
cause the robot to have trouble finding the line
Notice how the error information from the code
in Figure 2 is displayed at the bottom of Figure 4.
Notice also that the Current Test Box is still
indicating the line sensors are being tested. This is
true because the test failed. If the test had been
successful, the test results would have been
displayed on the bottom of the screen and the next test (as
well as the information about it) would have been displayed
appropriately on the top half of the screen.
Testing the Wheel Encoders
Now that we know the line sensors are working, we
can use them to test the wheel encoders. Turning the robot
90° to the right should place it on the horizontal line in the
test environment. If all three sensors are on the line, the
encoders are very accurate. If the line sensors read 6 or 3,
the turn was almost perfect, and a reading of 4 or 1 would
indicate a need for improvement. If none of the sensors see
the line, then a major problem exists and should be
corrected by the user before testing is continued.
If some of the sensors were on the horizontal line, we
can turn the robot to the left 90° to return the robot to its
original position. At that point, if two or more of the
sensors are on the line, the robot is capable of reasonable
repeatability. If only one of the sensors sees the line, the
wheel encoders might need calibration or other attention. If
none of the sensors see the line, the wheel encoder
subsystem needs correction before testing can continue.
Testing the Ranging Sensor
Once we know the wheel encoders are working
properly, they can be used to test the ranging sensor. It is
mounted on a rotating turret at the front edge of the
simulator. We can start the test by having the robot take a
reading straight ahead to record the distance to the wall.
The robot can then turn 90° to the right, and rotate the
turret left to record that distance from the wall. Rotating
the robot 180° to the left and the turret to the right allows
still another distance measurement.
Note: This type of testing can also be used if your
robot has three separate ranging sensors instead of one
mounted on a turret. Comparing these measurements to
each other or even to the expected wall distance in your
environment can indicate the accuracy of the ranging
Testing the Compass
At this point, testing the compass is easy. The robot
should begin by recording the current compass heading. It
can then use the wheel encoders to turn to other headings
and compare the new compass readings to what is
expected. The new readings should be within a reasonable
tolerance for the compass to be considered accurate. The
type of compass you have and the nature of your operating
environment will dictate what you find as an acceptable
Testing the Beacon
Since the beacon in the test environment is 90° to the
right, this test is also easy. Simply rotate the robot to the
right an appropriate amount and check to see if the beacon
is visible. In this example, the program checks for the
detection of any beacon. The simulator (and RROS based
robots) can detect up to 15 different beacons, so this test
could be enhanced to look for specific beacons at different
positions if your robot has this capability.
Figure 5 shows the test results after running the
program in the FULL AUTO mode with the simulator set to
generate small but reasonable errors when it moves and
interrogates sensors. If any of the tests had failed, the
program would have provided appropriate detail (similar to
that shown in Figure 4) and directed the user to make
corrections before rerunning the test program.
If your robot roams your home while you are away
(perhaps vacuuming your floors or performing security
rounds), you can consider having it periodically find its way
to a testing area to verify its functionality. If any tests fail,
the robot could power down or perhaps even send a text
or email to you to keep you informed of its status.
Space does not permit listing the entire program here,
but you can download it at the article link or from the In
The News TAB at www.RobotBASIC.org to see the
details of how each test can be implemented.
Hopefully, the concepts discussed here and
demonstrated in the program can convince you that self-testing your robot is much easier than you might have
SERVO 12.2016 41