DWIP - a simple robot

In 2005, I created a simple robot with 3 others for my former study (Artificial Intelligence at the Radboud University Nijmegen). This might have been the best time of my study there (although once, just at the moment that I had to go to Nijmegen for this project, our sink at home flooded due to excessive rain, making a mess in the kitchen, living room and scullery Sad ). Nevertheless, our robot harvested the most points and received the most appreciation from the public. Read more about the project and have a look at photos and a video of DWIP in action.

1. Specification & Analysis: Ecological niche


1.1 Task Description: Safeguard the eggs

DWIP is a reactive robot because it exhibits responsive (reactive) behaviour to new information from its environment. It is autonomous because its processes are in full control of itself. It has grown very hungry and fatigued, after its regular food resources were scattered. It is now desperately looking for eggs to feed on.

DWIP intends to wander around until it gets hold of an egg. With the egg, it will then pick up a black trail that will lead it back to a safe haven where it can start munching on the eggs. DWIP will attempt to transport as many eggs as it can to the safe haven to ensure being able to hold out for a while. During its journey on that trail, it will encounter some obstacles that it will have to either avoid or deal with.

1.2 Environment description

Figure 1.2.1 depicts a conceptual representation of the world DWIP lives in. Initially, DWIP will start its quest for eggs in one corner of the arena, with its front facing the arena (direction unknown in advance). The eggs have been scattered to two other corners of the arena (corners unknown in advance). The final corner hosts the safe haven to which DWIP is supposed to carry the eggs. The safe haven is a large black area. A path over a seesaw (location unknown) will lead DWIP to the safe haven. To travel over the seesaw is a very perilous enterprise that DWIP has to complete successfully, should it return to the safe haven with eggs. DWIP knows that the seesaw is very slippery for it and it should enter the seesaw from a straight angle. DWIP has also experienced that it could be knocked off course once the seesaw starts pivoting. DWIP will also encounter two block-formed obstacles. The location of these obstacles is unknown, but DWIP knows how to avoid them either while wandering in search of eggs or while travelling to its safe haven.

1.2.1 Conceptual representation of DWIP's environment1.2.1 Conceptual representation of DWIP's environment

1.3 Robot description


1.3.1 Light sensor

DWIP has a light sensor attached to it, capable of sensing light intensity in terms of percentage. It is aimed to the ground to distinguish whether DWIP is currently moving on a path or in the safe haven (black) or in neutral territory (white). These two states are separated internally by a threshold value: if the sensor output is below the threshold, DWIP finds itself on a path or in the safe haven, while if the sensor passes a value higher than the threshold, DWIP can 'assume' it's on neutral territory. During the construction of DWIP, the creators first handled these values quite differently: DWIP had a separate task that determined the sensor output value when starting. This dynamic light value would later be used to determine dark areas from light areas and turned out to work quite well, in fact it worked without any problem while testing the first real task at hand: following a path. However, while the environment DWIP had to work in suffered from serious differences in incidence of light, sometimes even the sensor could not clearly separate dark from light. While the light sensor had its own light source, isolating the light coming from outside would give DWIP a reliable sensor output to work with. Therefore we assembled a blinder for the sensor (or rather called 'sunglasses' by the creators, while it was built to block the sunlight) that made it possible only to rely on its own light source.

While this construction solved a significant problem in our quest, it also introduced a new problem: the sunglasses had to be near the ground to have some effect and the environment DWIP had to traverse also had – to some extend – relief, like for instance the seesaw, but also smaller relief like cotter pins with which the paths were attached. The plastic construction was simply not built for this and even though the cotter pins were not that much of a problem, driving onto the seesaw would make DWIP lose its sunglasses and sensor all at once. To solve this, the creators appended two wheels that would lift DWIP's front just enough to prevent the sunglasses from touching the seesaw's slope and breaking off. This worked quite well but another problem occurred now: during the short period DWIP was supported by the attached wheels, the caterpillar tracks lost almost all of its traction: only the backside still touched the ground. Now when DWIP would approach the seesaw at an angle, occasionally only one of the caterpillar links would still have traction and the robot would simply be unable to regain the proper direction to follow the path that continued on the seesaw. Placing the wheels that lifted DWIP a fraction to the back of the robot helped but increased the risk of losing the sunglasses with the light sensor. Concluded: the sunglasses had to be flexible enough to overcome obstacles like the cotter pins and the threat of DWIP almost leaning on the sunglasses, while leaving all traction of the caterpillar links intact.

Eventually a very simple solution came to the creators' minds: a flexible tire was mounted onto the sensor, held down to almost touch the ground. It would cover the sensor from almost all sunlight and have no effect on the traction. This proved to be a perfect solution and is now used in DWIP's final edition.


1.3.2 Old sunglasses1.3.2 Old sunglasses 1.3.3 New sunglasses using a tire1.3.3 New sunglasses using a tire

1.3.2 Touch sensors

DWIP is able to observe its environment by sensors. The observations DWIP makes through its sensors, it uses to adjust its behaviours in accordance with the situation it is in. DWIP's creators equipped it with two bumpers, one to its right and one to its left hand side; see figure. When hitting an obstacle, these bumpers depress touch sensors. DWIP can derive three types of observations from the touch sensors: depression of the right sensor, the left sensor and both sensors. Based on its touch and light sensors' input, DWIP chooses what behaviour pattern to execute.

1.3.4 DWIP's touch sensors1.3.4 DWIP's touch sensorsThe major trade-off of this double bumper construction is that DWIP receives information on how to avoid an object blocking its path. A single bumper construction proved insufficient for proper avoid-behaviour. DWIP did not have a clue which direction to move after hitting an obstacle. At some angles the touch sensor was not depressed at all. Having only two touch sensors at their disposal, the creators of DWIP could not equip DWIP with a touch sensor for egg possession. This problem was partially resolved by a rubber band being suspended between two chassis extensions.

In the process of designing and refining, DWIP's bumpers were enlarged to allow for better obstacle sensitivity. To each bumper, two rollers were mounted to afford for even more sensitivity and smoother movement along walls upon contact. Then the bumpers were extended toward the centre, where there was still a "black spot".
Finally, DWIP received counter weights on its rear to balance out the weight of the bumpers.

1.3.3 Tracks

At its creation, DWIP received one pair of solid tracks that allows it to easily move about in its world. Its creators believe these tracks should enable it to dexterously take the seesaw while retaining traction. The tracks also allow for an extremely small deceleration trajectory and steering radius due to opposite movements of the tracks during steering. With its tracks, DWIP is able to wander at a controlled speed, preventing it from crashing into obstacles. The tracks are mounted on a robust chassis that can withstand shocks and collisions with obstacles and other robot species.

Initially, the tracks were secured with two pins each to keep them in place when in motion. This construction proved to be unsuccessful, causing speed reduction and rapid exhaustion of DWIP's power supplies.
Loose gear wheels were a very persistent problem throughout the process of design and construction. DWIP's builders focused on three solutions to tackle this problem. In the first place, all axles with gear wheels were multiply secured to minimize movement of gear wheels. Secondly, the axles of the front track wheels were extended and extra secured. Thirdly, two rear axles were extended and given two extra axle guards to get rid of deflection stress.

1.3.5 DWIP's propulsion system1.3.5 DWIP's propulsion system

1.3.4 DWIP and the seesaw

DWIP's creators were determined to let its robot master the seesaw like no other robot in the contest. Therefore lots of testing was reserved to this obstacle. First of all we already had an advantage over the other teams: we chose for (and remained using) caterpillar tracks, giving us more traction than when using wheels, which – evidently – is of crucial importance when riding uphill, downhill and – above all – when the seesaw is pivoting. Tracks alone however proved to be insufficient after extending to the front with constructions like the bumpers and the egg-catching mechanism. The robot would still occasionally lose its track after the seesaw had swung over. Furthermore, our new followpath algorithm proved to be problematic on the seesaw when DWIP couldn't trace back the path in its first trial (a predefined small turning corner): DWIP would occasionally turn in the wrong direction which made the turning angle up to almost 180 degrees and sooner or later it would lose it's grip while turning.

Two adaptations had to be made, the first one constructional: counter weights were attached to the rear of the machine (4 large wheels which also made sort of a bumper would DWIP hit an obstacle with its rear end) to ensure a proper weight distribution. This had a stunning performance boost: DWIP now simply has no problem at all staying on course when the seesaw swings over.
The second revision made was an alteration in the followpath algorithm: a second – somewhat larger – turning angle was implemented, heavily fine-tuned to ensure that DWIP would not make a large turning angle on the seesaw (and in the paths) which inevitably cause the robot to sometimes place itself perpendicular to the path on the seesaw. Now DWIP is simply more than ready for this obstacle.


1.3.6 DWIP on the seesaw1.3.6 DWIP on the seesaw 1.3.7 DWIP keeping the egg in possession after the seesaw has pivoted1.3.7 DWIP keeping the egg in possession after the seesaw has pivoted

1.3.5 Egg collection

1.3.8 DWIP following a path while moving an egg1.3.8 DWIP following a path while moving an eggDWIP collects eggs by driving over them and catching them in an empty space in the construction. To prevent the eggs from rolling out again, this area is enclosed by a rubber band, placed at such a height as to allow eggs to roll in and out easily when DWIP is moving forwards or backwards respectively.

2. Implementation


2.1 Behavioral layers


2.1.1 The Wander layer

The function of the wander-task is to let DWIP have a default behaviour which will let it explore. It moves forward for a short while, then turns a little, before repeating this sequence. The distance and angle used are determined randomly, but within a range which produces useful exploration. When it starts wandering it will stop following paths, as wandering will only be activated when not on a path.

2.1.2 The followPath layer

The function of the followPath-task is to let DWIP move forward on the black surface (the path), and search for the right direction when it has moved off the path.

First it stops the wander task and the followReleaser, then it moves forward. When DWIP then detects it is on white (off the path) it stops moving. DWIP will then search for the path in 3 laps. Each lap it will turn a certain angle, in both directions. The angle is increased each lap the path is not found. It will keep track of the direction in which the path was first found (left or right), and the angle at which this happened. If it finds the path in either direction, DWIP will turn to the one for which it had the smallest angle, and remember this direction. There is also a small angle at which it will not compare both directions, but just turn. When DWIP finds out where it has to turn to, it will turn there and a little bit further, to make sure it is on the path again. Then it will continue following the path until it rolls off it again, restarting this whole procedure. It will now try the last direction found first, so it will go through curves in the path smoothly (without looking back and forth).

2.1.3 The followReleaser layer

This function runs while wandering, and allows DWIP to switch to followPath. This switch occurs when the sensorvalue of the light-sensor goes below a set value, which indicates the sensor is above a black surface. To avoid switching when it is above a ground-plate crevice, a small delay is employed to allow DWIP to ignore it. If the sensor indicates black for longer than this, then it will stop the wander task and restart avoid. It will then start followPath. This way DWIP starts to follow the path immediately when it senses black (even while avoiding), and still avoid objects when on the path.

2.1.4 The Avoid layer

The avoid-task allows DWIP to turn away from obstacles, or go around them when following a path.

If any bumper is pressed it will ride out smoothly and stop. If both bumpers are pressed when it is on white, the assumption is that it has hit a wall. It will stop wandering, move from the obstacle by turning and moving, and start wandering again. By not moving backwards DWIP will keep any eggs it's carrying with it when it avoids the wall.

When both bumpers are pressed when DWIP sees black, avoid is subsumed by the eggreleaser task, which is described later.

If only one bumper is pressed when on white, DWIP will stop wandering, turn away from the bumper pressed, and move forward, and then resume wandering. This way DWIP can move away from walls and objects when wandering.

When on black, and one bumper is pressed, DWIP will try to move around the obstacle. It will stop followPath, and turn away from the pressed bumper. DWIP will then move forward and turn back. This should result in DWIP going around the obstacle and ending up back on the path, though it might end up close to the path instead of that.

When it has reacted to these events, followReleaser is activated, allowing it to searching for paths.

2.1.5 The Egg releaser

The main concern we had about the releasing of eggs was that DWIP would be able to do so at any time. Initially, DWIP had only an avoid layer, which would take care of releasing the eggs. The condition under which DWIP would release eggs was that both bumpers were pressed and he was on a black surface, as well. This was to make use of the fact that the safe haven was black and located in a corner, against the wall of the arena. On meeting these conditions, DWIP would roll backwards, thus releasing the eggs.

The problem with this was that DWIP would rarely enter the safe haven in such a way that both bumpers would be pressed at the same time; instead, the normal path-following avoid was triggered, causing DWIP to move around, incidentally pressing both bumpers (the release condition) at the same time while still under the avoid behavior, and thus unable to stop and release the eggs. DWIP would then leave the safe haven without releasing the eggs.

We solved this by giving DWIP an egg-releasing layer, which could subsume every layer, including the avoid layer. Once this was solved, DWIP delivered the eggs perfectly.

2.2 Compiling the layers

When all the layers had been individually implemented and tested, the time came to join the layers into a whole, causing what we hoped would be intelligent behavior to emerge. Instrumental in this was an overview of which layers did what, and under what conditions which layers would have to be active.

There were the two releaser layers, which we considered needed to be active at all times, to be able to handle the activation deactivation of other layers. In addition, the avoid layer is to be active at all times, in order to avoid any obstacles, whether while following the path or simply wandering.

This proved to not work entirely according to plan; the follow releaser, which was meant to start the followPath layer and stop the wander layer when black was detected, kept restarting the followPath layer; as a result, we were forced to change the followPath to also stop the followReleaser on activation.

Also, the followPath and wander were implemented to subsume the other on activation, so that they wouldn't conflict with one another.

The egg-releaser was changed to subsume the avoid layer, so that even when the avoid layer was actively moving the robot to manoeuvre around an obstacle, the wall, the egg-releaser could restart the avoid task and start the robot moving backward, without the avoid task's conflicting additional movement.

3. Final Reflections


3.1 Draw-backs

DWIP has some draw-backs due to limited resources. It cannot detect obstacles when driving in reverse to release the eggs in the save haven.

We considered tracks to afford for the best performance in the current setting. However, tracks in general severely reduce speed and give rise to extensive power consumption.

DWIP's bumpers are mounted on a fixed height and have a limited radius. Any obstacle that is smaller or taller than the bumper height is not detected. Fortunately, DWIP's robust construction will absorb blows by obstacles.

3.2 Suggestions for improvement

In this section we intend to discuss extensions that would improve DWIP's performance, would we have had more resources.

First of all, we were limited to two touch sensors. An extra touch sensor would allow for egg possession detection. Also, when in the egg releaser mode, DWIP cannot detect any obstacles when driving in reverse. An extra touch sensor on its rear bumper would solve this.

Secondly, if we had an extra light sensor, we would have been able to refine the followPath mode. We would mount two light sensors close to one another. This way, DWIP would be able to detect at which side of the path it gets off the road. Steering would be more precise and DWIP would be able to complete its task quicker.

The light sensors available in the Mindstorms kit do not allow for explicit egg searching. With more advanced light sensors, DWIP could be given an egg search layer.

References

Murphy, Robin R., Introduction to AI Robotics (2000)
Lego Mindstorms Kit
Course webpage: AI Robotics

Files

DWIP following a path
AttachmentSize
Not Quite C (NQC) source code [plain text]16.36 KB
DWIP in action [XviD]544.86 KB

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • You can use BBCode tags in the text. URLs will automatically be converted to links.
  • Every instance heading tags will be modified to include an id attribute for anchor linking.
  • Every instance of "<!--tableofcontents-->" in the input text will be replaced with a collapsible mediawiki-style table of contents. Accepts options for title, list style, minimum heading level, and maximum heading level as follows: <!--tableofcontents list: ol; title: Table of Contents; minlevel: 1; maxlevel: 3;-->. All arguments are optional and defaults are shown.
  • Textual smileys will be replaced with graphical ones.
  • Images can be added to this post.

More information about formatting options