Virtual Sensors
Part 1
Virtual Sensors
www.servomagazine.com/index.php?/magazine/article/july2012_Blankenship
by John Blankenship and Samuel Mishal
Discuss this article in the SERVO Magazine forums at http://forum.servomagazine.com
In order to perform properly, your robot needs as much sensory data as
possible. Unfortunately, increasing the number of sensors on your robot has
many potential problems. Mapping the analog information from more complex
sensors into virtual digital states can decrease costs, increase performance, and
make the sensory data easier to analyze.
Have you ever wanted to add a few new sensors to your robot, and found you couldn’t do it because you were a few I/O pins short? Does your robot take too long to scan the area in front of it because its rotating turret is too slow?
These are only some of the problems we had to solve while
finding a painless way to seamlessly connect a wide variety
of sensors to RobotBASIC. Our final solution is a
RobotBASIC Robot Operating System (RROS) that can
manage all the details (both hardware and software) of
interfacing with a wide variety of motors and sensors.
While developing the RROS, we created a number of
innovative solutions to the problems we were facing —
solutions that many non-RobotBASIC users can apply to
FIGURE 1.
54 SERVO 07.2012
their robot. One of the most interesting of these
innovations is the creation of virtual sensors. Before we
delve into the details of creating virtual sensors though,
let’s examine sensors in general.
In the book Robot Programmer’s Bonanza, we
demonstrated — using a robot simulator — that perimeter
sensors organized in a two-level hierarchical structure make
it easier to implement autonomous navigation behaviors
through cluttered environments. Let’s start by examining
that structure.
The outermost layer of our two-layer design typically
consists of five IR reflective proximity sensors as depicted in
Figure 1. These sensors should detect obstacles before any
contact with the robot is actually made. The inner layer
(also shown in Figure 1) provides a last-ditch safety
arrangement that we implemented with four contact
bumpers. The proximity sensors detect objects that are
close, while the bumper sensors indicate when objects are
very close. Combining these two systems with a turret-mounted, distance-measuring ranging sensor provides an
enormous amount of sensory information that is still very
easy to analyze.
Realizing such a design on a simulated robot confirmed
its usefulness, but creating a real world implementation has
its challenges. First, at least 11 I/O lines are needed (four
bumper, five proximity, one ranger input, and one turret