0

Line Robot - Basic lessons - 90° curve

Following line exactly is of paramount importance in Robocup Rescue Line competition. The sharper the curve is, the more difficult task will be. We will study here the ways to follow 90° bends.

Strategy 1: incremental turning at high speed

Let's assume that the robot is right in front of a 90° curve to the left and that it is approaching fast. Middle transistor (red) senses the line and both motors drive the robot straight ahead. Arrows designate in which direction the wheels try to move the robot. It is in an ideal position to overcome the curve. Incremental movement is influenced only by current state of transistors, with no memory of the past. While determined how to drive the wheels, robot doesn't use any previous data. If transistors 2 and 3 detect line, it will always do the same action, being in the middle of the turning or following a straight section of the line.
Stepping on the line, all the left transistors will detect line. It makes sense to drive left wheels at maximum speed in reverse in order to turn in place.
However, inertia being a key foe in this situation, the robot will continue going straight ahead while turning. Therefore, turn in place will not be possible and the robot will drift off the line, probably interpreting lack of any dark surface as a gap in line and will continue straight ahead. This is no good way to follow line.

Strategy 2: incremental turning at low speed

Starting position is the same but this time decrease robot's speed.
Again, 90° curve is found.
After turning a little, the robot is still on the line and may detect the with some of the inner transistors. It will still be turning to the left but with less vigour than when end transistor detected the line. This movement depends on Your program for line following.
In the next moments the robot will detect line under edge transistor or some other transistors on the left and will continue turning and going ahead.
The same pattern continues.
The robot is close to the next 90° curve. The line has never been lost, but note that the position in front of the next challenge is not optimal. Better that in strategy 1, but not good enough. Why is the position not optimal? The robot is not aligned with the line and it is already too close to the next difficult situation. Here are no markers, but if there were some, its color sensors would miss them.

Strategy 3: block (non-incremental) turning

The same initial position. The robot is using incremental strategy to follow the straight part of the line.
Again, curve to the left. Contrary to the previous strategies, we will drive the robot straight ahead (a block, non-incremental movement). It is a block movement because for the next maybe 200 ms the robot will continue going straight ahead, not minding what the the transistors sense. This strategy is more about planning: for each (difficult) situation we develop a plan and then follow it for a (usually) short time. This plan concerns 90° curve.
Only after a few moments we will start turning.
Having 90° turning completed, the robot will be in the right position for the next bend. This will be acceptable for this situation because the line between 2 curves is rather long. How about the shorter one? That would not be so good. Robot's end position may be the one with no transistor sensing the line anymore (overshoothing the line after turn).

Strategy 4: block turning with brunt forward

The same initial position. The difference with the previous strategy is that we built the robot with brunt (center of gravity) close to the front side of the robot (but behind reflectance sensor).
Like in the previous strategy, a block movement ahead is started.
Now we stop much sooner and start again turning around its brunt. Note that robot always revolves around its brunt.
Due to brunt being close to the front of the robot, after turning the robot will be in the best position possible. It will successfully pass even a very short line between two 90° bends.

Discussion

Block-movement strategy features obvious advantages as it is the best way to enter each crossing so that color sensors hit the markers. If they don't, they may read adjacent white or black. Even worse, they can be positioned partially over black and white. That combination may yield hue and value (in HSV domain) very similar to green. Thus, the sensor will read a ghost marker.

However, the situation is not straightforward as the incremental strategy also offers some advantages. It is easier to implement and is more error-forgiving because it is made of many small steps. One small step will be corrected very soon. In block-movement, a wrong block can easily cause fatal problems.

There is the same problem with block-movement (planning) strategy in general. It works very well, but only if we detect its preconditions. If it is triggered when not intended, nasty problems loom large.

Task: write a program for strategy 4.

Make a program that implements strategy 4. Assume that the robot is on the line already.