Robojoy challenge class

4-2 Line trace with only 1 sensor

To proceed smoothly

I think unit 1 was created earlier, it proceed in a zigzag, and so slow move.
So, I tried to make unit 2 to improve the program.
The changes are part of red border.
[Download] line tracer Unit 2 (Created in NXT software for education2.0)
In addition, because there are individual differences in the sensor, please adjust the value of the block according to your own light sensor.

The program in unit 1, out of the motor and B or C, was stopped either. Therefore, the robot does not go forward too much before.
So, Unit 2 was adjusted a little turn on the motor which has stopped before.

This is a program that has been running.
Now it proceeds better than prior time of Unit 1.
[Movie] Running of Unit 2 movie (youtube)

However, this does have its drawbacks. Look at the robot well, when it is turning the curve, making "detour (off the track)" on the line. This means that the robot and the line are shifted; this phenomenon is not very good.
Increasing the power of the motor outside will fix this, but it will shake the robot too wobbly to return.
The power of the motor inside can be dropped, and that it slows down. Either way it will not going to solve this problem.


Detour (off the track) measures

As a measure to get out from the line of Unit 2, I tried to make a program of Unit 3.
[Download] line trace robot unit 3 (Created in NXT software for education 2.0)
In addition, because there are individual differences in the sensor, please adjust the value of the block according to your own light sensor.

When you figure how to control, it would look like this.
If the line is more distant than the center value, power is increased, if it is closer, power is reduced. This prevents out of line. (The value of the output is increased if you enter the large value to the input. This phenomenon is called "proportional". For the proportional you will learn in middle school.)

Whether the center of the line or not, determined by the value of the light sensor.
Until now, the light sensor was only to determine two kinds of "white" and "black" in the program.
However, in practice between the white and the black stage can be divided into about 30 to 40.
Therefore, we quantified the difference the value at the center of the light sensor, adopt in active power.