Task 1:
Program the interface, so that the 40 Pulse model moves straight
ahead. Use the counter button E1 to mea-
sure the pulses; use the E8 button as reset
switch. Then modify the program, so that
the model moves differently long distances,
e.g., 80 cm. How high is the repetition
accuracy?
Task 2:
The model should turn 180° after 80 pulses
of moving straight ahead. Note the different
rotational directions of the drive motors during
the straight-ahead movement and the turn.
Solution:
The model moves an average of 1 cm on its
path per counted pulse. The repetition accuracy
is in the same range, approximately 1 cm with
80 pulses. It fluctuates dependent on the
surface on which the robot moves. Thick or
fluffy floor coverings are especially unfavorable
for accurate measurements.
Before we deal with this task, we want to clarify two things. First, we are
using a new function block in our program, the POSITION block. This is a
block, which remains active until the set number of pulses is detected at a
fixed input (E1 here). From the viewpoint of the program, this means that
we are using a defined delay condition here. In the first experiment, we
used this function as distance measurement for moving straight ahead.
If the robot should turn, practically the same procedure is used; we only
need to change the rotational direction of the motors. Now you only need
to enter the number of pulses, and the robot rotates on the spot.
And now to the second point. You don't want to simply try out values until
the robot turns 180°, but instead you want to calculate this value in ad-
vance.
The drive motors are configured as differential drive, i.e., the wheels of the
robot move around the circumference of a circle, the diameter of which is
determined by the distance between the wheels. Consequently, each wheel
must travel the distance of exactly half of this circumference for a turn of
180°.
Calculate the circumference u first:
u = S • d = 630mm
d: diameter (wheel distance approx. 200 mm)
We previously determined a distance of approx. 1 cm/pulse. As a result,
we need 305 pulses for the 314 mm distance (half of the circumference).
Because we can only calculate whole number values, we have to select
either 30 or 31 pulses. Test which value provides greater accuracy.
Conclusion:
You see that the result of our measurements with the pulse wheel does not
provide a very high degree of accuracy. The absolute measurement error
becomes greater especially when several distances are traveled one after
another or repeatedly. The error caused by the clock pulse, which was not
entered precisely, also results in problems.
We only have limited possibilities for minimizing these errors. On one hand,
you can increase the path pulses per unit of distance. The counter would
ideally be mounted directly on the motor shaft. In addition to the fact that
we cannot access this shaft, there is also the problem of the limited sam-
pling rate of the interface. If too many pulses are received within a time
unit, the interface might "forget" a few. Then precise path calculation be-
comes an illusion.
We cannot register other errors at all, such as the slippage of the wheels
on different surfaces or deviating wheel diameter. We can console ourselves
with the thought that these problems have in part not been solved satis-
factorily by substantially more complex and expensive commercial systems
either.
4.2 Robot with Edge Detection
Now that we have experimented extensively with our basic model, we want
to now try to teach our robot "fear" of sheer drops. We previously watched
the robot like a hawk as it scurried around a tabletop, so that it did not
plunge off the edge. This really does not seem to represent especially intelli-
gent behavior. Consequently, we want to change it.
The robot needs an edge detector for this. Two auxiliary wheels provide a
simple and useful procedure. The wheels are equipped with a switch, similar
to a sensor, in front of the robot's direction of movement. The wheels are
designed, so that they can move vertically. An edge lets the auxiliary wheel
fall downward and consequently triggers the sensor.
Task 3:
Build the "Robot with Edge Detection" model in accordance with the
construction instructions (gear reduction 50:1). The model should
move straight ahead. As soon as it reaches a drop on the left, it
should avoid this by moving to the right; if there is a drop on the
right, it should move to the left. To make this clearer, specific move-
ments are programmed as subprograms (forward, left and right).
The number of steps is recorded by the counter button. The number
of steps is set in a variable VAR10. This value differs for the left and
right subprograms.
GB+USA
21