Stasis Logic

Updated/29/07

 Left: PicBot IV in the robot arena ready for stasis testing and programming. My cat T'Pring enjoys watching the small robot move around and occasionally pounces on it.

 Introduction

In a normal household environment a robot will encounter many obstacles which it will be able to easily detect and avoid with standard IR Proximity sensors, or an instrumented bumper system. There are however, numerous situations in which the robot will become stalled, stranded, or entangled in which these sensors will not detect. Stasis sensors fill this very important gap in sensory data and will allow the robot to attempt an escape to free itself and continue on with its assigned task. In this report, we will discuss methods of stasis detection, and the associated programming behaviors for use in a household robot.

Detailed Application

In our experience, every home robot that we have built that did not have a stasis sensor would in a matter of hours become entrapped on a ledge, corner of overhanging furniture, or on a simple lamp or extension cord, no matter how well built or thought out. The very nature of the unprepared home environment presents complexities which we cannot plan for in every case. Household robots have in general, two modes of operation: Performing a task, and getting to the destination to perform that task. These can be layers in a subsumption style architecture staggered such that the travel to and from a goal can be layered with the stasis behavior in the appropriate level. A simplified example of this can be a Wander Behavior at the bottom, an overlying Bumper impact behavior, a Stasis behavior, and finally, the primary task such as grabbing that can of alcoholic beverage from the fridge at the top+. With this type of architecture, if the robot gets entrapped on the way to the fridge and the bumper sensors do not register an impact, the Stasis behavior will engage and attempt to free the robot.

Stasis Sensing Techniques

Here we will discuss a variety of techniques to detect Stasis, and the issues with each method.

Stasis Wheel
This is our preferred method of stasis detection. The concept involves placing a small drag wheel under, or behind the robot with an optical or mechanical rotation sensor. As the robot rolls toward its goal, the wheel will also turn both measuring the distance traveled and the direction of travel. By encoding the wheel with either black lines or holes we can specify mechanically the minimum distance the wheel must rotate to indicate a detection. For example, for a 1 inch diameter wheel with a 3 inch circumference, putting two holes at 180 degrees will indicate a minimum distance traveled of 1.5 inches. This tactic will become important later in our discussion

Optical Floor Sensor
One obvious method of detection of motion is to simply measure the brightness of a reflected beam of light onto the floor directly under the robot. This can be easily accomplished with a red LED projecting an inch diameter circle on to the floor, and looking at that area with a phototransistor. As the robot moves over a patterned floor such as a hardwood tile floor or carpet, the reflectivity changes accordingly. A big drawback of this method is that if the floor is rather featureless, the stasis sensor will report a stalled condition. Also, even with a patterned floor, some form of time integration method will have to be used to smooth the data into an continuous variation without abrupt spikes. Many times a robot will become snared on a power cord, and the entire robots body will rock back and forth as it tries to move forward. Such conditions will trick an optical sensor into seeing motion.

IR Ranging Sensing
Another interesting method is to monitor the distances to nearby objects and walls. If the distance is constantly changing, the robot must be moving to some extent. Besides the swaying cord entrapment problem, in larger rooms the sensor may not see the walls and try to escape - nothing.

Sonar Ranging Sensing
Similar to the above IR Ranging case, but with much longer range. Most rooms would be fair game for such a sensing method, and in addition it may provide some impact avoidance as well. High cost is a major issue here.

Visual Detectors
A CMU Cam can also be used as a stasis detector, as long as there are sufficient contrasts in a room to provide moving targets. As the robot is approaching a distant wall or obstacle, the histogram will be continually changing. This can be used for stasis detection as well, however how to set the escape threshold here is not at all clear. This is probably the most expensive and complex method discussed.

Visible Light Photocells
Put a photo transistor in a short tube, and aim it ahead. As the robot moves, the output will vary. Integrating such a signal can be problematical, however with sufficient room contrasts this is a very inexpensive solution.

Magnetic field Sensing
Using an electronic compass can work especially well in an outdoor environment. Moderately priced, as the robot moves about, the compass will vary its output angle. A straight line course will naturally be an issue, however small changes will still be seen as the robot drives over rocks and bumps.

Programing Stasis detect
This is the cheapest solution, however it may take an extraordinary time to react. Here the robots work area is limited in size, and therefore if the robot does not impact on any obstacles within several minutes running, then it is probably trapped. Any sensors can be used here that would normally detect an impact avoid condition. Although seemingly cost effective, the robot can actually burn out its motors in the several minutes that such a stasis detection can perform some type of escape. Really cheap robot vacuums use this method and spend more time stuck than actually doing their job!

Stasis Wheel: Mechanical design

The basic mechanics of the PicBot IV stasis sensor can be seen here. On the left, a frontal view showing the wheel in contact with the floor between the drive wheels.

On the right, a side view shows the lexan curved strut which carries the opto interrupter, and applies a constant pressure on the wheel to the floor.

The basic mechanical design is simplicity in itself, as illustrated above. There are several ways to implement this design mechanically. One technique used in our Ostracode and Paami robots is a cantilevered strut with limited rotational movement which drops a drag wheel to the ground, and rides up and down on uneven surfaces by pivoting the arm. A photo interrupter is mounted on the arm, and intercepts the dark sectors on the rim of the transparent drag wheel. In PicBot IV, we implemented the concept on a much simpler and smaller scale to fit the physical constraints of the small robot design. Here, as seen in the illustration, the drag wheel is mounted directly on and axle on struts glued to the opto interrupter itself, and using a .015 lexan sheet curved rib as both a support arm and preloaded spring to both press the wheel into the ground firmly, and limit its drop range to about a quarter of an inch. This design was easy to mount and the curved rib was a strip of lexan bent with small pliers into the required shape since lexan bends and doesn't break like acrylic.

Left: Frontal view showing thin stasis wheel in contact with the floor. On the right, I am pressing down on the wheel to show it is spring loaded by the lexan curved strut to apply a small pressure on the floor for continuous tracking.

Left: Here is the stasis wheel of our Ostracode robot, here we used a black disk with holes drilled in for the sensor to detect.

Right: Pammi's stasis sensor is of the reflective type and uses an IR reflective sensor with an analog sine wave like output. We then run it through a comparter with hysteresis to shape it up a bit.

Stasis Wheel: Electronics Design

Left: On the test bench, we spun the stasis wheel at about the expected rotation rate with a small motor to test the output swing and frequency. On the right we see nearly a full 0 to 5v swing right out of the sensor pullup, 2v/div.

Depending on how you detect the stasis wheel rotation, will determine the electronics interface. In Paami, we used a Fairchild QRB1114 opto reflector module and detected the IR reflection from a printed paper wheel encoder. This required not only an LM324 opamp for a signal buffer, but was followed with a comparator with hysteresis to form a Schmidt trigger arrangement for the input into the processor. You can go this route which offers great flexibility or as a much simpler alternative, make your stasis wheel thin and clear such that you can use a photo interrupter that the wheel can fit into. We went this route with PicBot IV, and with the proper pull up resistor our NTE 3100 unit put out a full TTL range with no buffering. The best part, is that with most PIC processors, the many of the inputs are Schmidt trigger inputs, and will automatically shape this type of nearly square wave shaped form for an easy interface. For other processors, without Schmidt inputs, you can add a Schmidt trigger quad package to your circuit board and use one of four devices and have three spares for other applications.

Programming Considerations

Fortunately, programming for Stasis sensing is fairly straightforward. Essentially consisting of a Finite State Machine with two primary states: Scan, and Escape. During the Scan state, the stasis sensor is continually polled to determine a stalled condition. This is very simply done by counting the edge transitions over a small interval such as 5 seconds. If during that time, the count falls below the expected value or is zero, then the stall condition is met, and this is the trigger for the stasis escape state.

To escape Stasis, the general idea is to reverse course for a small amount of time and rotate away from the entrapment trigger. The most successful routine we have used in a home environment is to do a reversing waddle. Here, we back up one wheel at a time in succession, to escape the lamp cord or carpet thread we are stuck on. Then after a few inches we rotate the robot by a random amount so we do not re-enter the entrapment condition again. If the stasis sensor is tripped again in a minimum time frame, we may choose to try again or shut down and call for help. In addition, we may add a stasis detect output on the stasis processor, such that other processors higher in the subsumption architecture can use this sensory information to make higher level decisions.

Testing and Evaluation

Our Robot Arena was used once again for the preliminary evaluation, followed by an actual home environment on both tile, and carpeted floors. Here is a movie of the arena testing. Here you can see the PicBot running into a very thin obstacle (foam board) and stopping with the wheels still driving at full speed. After 3 seconds, the bot decides it is in a stasis condition, and stops, makes an appropriate sound, then waddles off the obstacle. It then rotates randomly, and moves on.

In the household environment, the robot performed very well on both tile, wood, and carpeted floors. While the wheels slipped easily on the smooth surfaces, I might shorten the 3 seconds timeout to perhaps shorter on carpet, since the wheels tended to completely stall upon impact.

Conclusion

Our testing and data from two of our previous very successful home roving robots Ostracode and PAAMI have shown without a doubt that a stasis sensor is absolutely essential to keep the robot from getting caught or stuck in a variety of situations in which no other sensor would detect a problem. It is such a simple addition to consider for your own robot, and the payback will be a robot that roams in your home not for hours, but for days on end without getting fatally snared on a carpet, cord or perhaps corner of some furniture.

HOME

You are visitor number since June 17, 2001


FastCounter by bCentral