Saturday, July 31, 2021
Home » Emergent Behavior » Emergent Behavior – Part 5

Emergent Behavior – Part 5



Powering up the Swarm… Robo-Chaos!

Emergent Behavior 7-1Switch on a bunch of robots in a small space and you better have a good collision avoidance system!

The plan, for this experiment, is to have as many as a dozen robots in the arena at the same time, all interacting. The first step in that interaction is to avoid crashes. Besides not contributing to the experiment, crashed robots can be damaged. Also it may be difficult to reach robots that are in trouble in the middle of the arena.

Collision avoidance is one of my favorite robotic topics. It is necessary in all forms of robotics. Even a robot arm working on a simple tabletop task presents a danger to nearby observers. Robots can move fast and deliver a lot of force. Serious injury and even deaths have been recorded.

As we move our robots out of the lab and into the world, it is our collective responsibility to ensure that steps are taken to avoid crashing into people and property. If we do not take this seriously, accidents will hap- pen. Concerned citizen action groups, law enforcement, and governments will take it seriously, and that will be bad for us. While laws and rules governing the operation of robots in public are inevitable, we can show lawmakers that roboticists have the public interest in mind.

Emergent Behavior 5-6One of the best ways to protect the public and their property is to avoid collisions in the first place. Collision avoidance has taken a lot of forms, over the years.

One of the earliest and still the easiest is touch. Bumpers placed around the perimeter of the robot send a signal to the processor whenever pressure on the bumper moves a switch placed underneath it. This is not really collision avoidance but rather, collision detection and if the speed of the robot is too great in relation to the travel of the switch, there is still a brief collision.

Reflected light is another method. By shining a light, usually infrared, and measuring the intensity of the reflection, proximity to an object can be determined. It works best at short distances and is excellent for drop off detection. This is not as reliable as some other methods because if the surface of the object happens to absorb the light, the system is rendered useless.

Then there is ultrasonic range finding. This method uses sound pulses sent out in a frequency above that which human ears can hear. The sound is pulsed and then the system “listens” for the echo. By measuring the time that has expired and knowing the speed of sound, we can tell the distance to the object.

Emergent Behavior 5-11
The sensor suite. Ping))), infrared LED and infrared detector.

The most advance systems now in place include vision systems, RADAR and LiDAR. But because of the tremendous processing power required, those kinds of systems are clearly out of scope for a small Boe-Bot based swarm.

Some other types of beacon based systems are effective and might have worked, but defeat the individual interaction the robots need in order to show true emergence. So, while touch is available in the basic Boe-Bot kit, it became obvious to me fairly early in this experiment that touch was not going to be a good enough idea for first level collision avoidance. Effective as a last line of defense, perhaps, but the robots were going to need to think further ahead than touch. The answer still resides in a Parallax solution. One of the best tools that the robot build- er has in an off-the-shelf component is the Parallax Ping))).

It plugs straight onto the Boe-Bot’s proto-board and doesn’t even need a resistor, so installation is a snap. Code examples abound, so integrating the Ping))) into the program is easy. I worked with them when I built Khan (“Kahn – The terrain adapting robotic insect with collision avoidance”) in Issue 21 (MarApr 2010) of Robot Magazine, so I knew that the legendary accuracy of the Ping))) and it was not an exaggeration.

I had just two concerns. Would the Ping))) be able to “see” another Boe-Bot from way up on top of the board? And would the noise coming from the PING))) be scattered around the arena and cause false signals which would confuse the other robots. I would soon find out.

This is the fun part. I am getting to the point in the experiment where it is time to make the robots interact, so I obviously need more robots. I enlisted the help of my friend Paul, who came to my aid and spent an evening duplicating my prototype. Building robots is always good for a few laughs and a general good time, and Paul did not disagree.

The collision avoidance algorithm is simple: while running straight, if there is an encounter with an obstacle, turn left 90 degrees. Travel 20 centimeters. Turn right 90 degrees. Run straight. I had my doubts that this simple solution would prevent any collisions in the swarm, but only by putting them together in the same space would we prove it out.

Now armed with a squad of robots, we put together some makeshift walls, just to keep the machines (the madness?) contained in the same general area and started turning things on. The first try was to try powering up robots from random directions to see if there would be any collisions.

Off they went and when four robots met in the middle of the arena, some minor chaos ensued, with robots turning this way and that and for about ten seconds, the future was uncertain. Then, one by one, they emerged from the gaggle and most of them were going in their original direction of travel!

I have to admit, I was a bit elated! There were no collisions! All four robots managed to work their way around each other with- out any contact. After that first success, Paul and I began recording the effects of various types of meetings.

The reaction of two robots meeting head on is quite predictable. Each turns left, moves, then both turn right and are able to carry on to conduct any future robot business. Sometimes, the two robots ‘hear’ noise from the approaching robot’s Ping))) and turn unexpectedly. It happens infrequently enough that it may not be a problem. For that we shall have to see what turning on more robots does.

The action of three robots when they meet is a little more chaotic. Since more than one robot is within the minimum distance there can be a bit of dancing that goes on. This behavior could be considered emergent on a basic level. The robot between two other robots turns from robot to robot and repeats this turning until one of the other robots has moved away.

This is not planned behavior, so it could be considered emergent. There were other observable forms of emergence, too. The left then right turning pattern caused a wall fol- lowing effect that I didn’t expect at the time.

A 90 degree corner causes the robot to ‘panic’. Basically, oscillating between one wall and the other and going nowhere. While possibly emergent, the condition is not desirable. After a number of resets and observations, some programming notes were taken for improvement. The biggest and most important is that a method of maintaining a record of the number and direction of turns taken is necessary in order to be able to return the robot back to the desired general direction after a complicated interaction.

Some of the robots came away from avoidance maneuvers going in the wrong direction, but that is a minor problem. What I was most pleased with is this: armed with the Parallax Ping))), there was never a collision between robots. They avoided each other perfectly. Sometimes, it was pretty close, but there wasn’t a single crash between robots.

Walls are a different story. An ultrasonic system approaching a wall at an oblique angle results in the sound bouncing off and travelling away from the robot. There is no echo. Therefore, the robot will touch the wall. This proves that I still need to install the touch whiskers provided in the Boe-Bot kit as a last fail safe against collision.

Moving ahead, the next step is to add in the beacons and start the robots moving back and forth. However, I still lack the critical function. How do I to exchange information between the robots to communicate the all-important “food” conditions from one bot to the next.

When the bots can tell each other whether or not they have “food” and react accordingly, then that is where the emergence will occur.

Keep sending in your ideas. I am grateful and explore each one in-depth. Stay tuned to see what happens when I power up the whole swarm !

Parallax, Inc.,