In Unit 4, I already have a big satisfactory, but a little greedily, I would power up the following points.
This is a program to improve for Unit 5.
Sorry, I am getting long program will introduce the split.
[Download] line tracer Unit 5
(Created in NXT software for education 2.0)
The first half of the program, we initialize each variable here.
Here is the program of the second half. Calculate the "position of the sensor" from the value of the light sensor, but further indexing the power of the left and right motor. "Position of the sensor" in the middle is 0, the value is negative the state relies on the black side, and the value is positive the state relies on the white side. Multiplied by a value of Gain to "the position of the sensor", the variable from the Power will add (or subtract) to the result. In other words, the motor rotates in the left and right variable power of Power on the straight line. When it is running on the curve line, the inner power of the motor is reduced; the outer power of the motor is increased.
It is the state of the running.
Because I did speed up, but have slightly staggered, are progressing quite smoothly. In Unit 1 it took 1 minute to 1 round, in Unit 5 was able to reduce up to about 10 seconds to 1round.
[Movie] running of Unit 5 movie (youtube)
I think it would be interesting to change the value of the variable Power and Gain, and try to see how it changes the movement.
Line Trace robot contains lots of difficult technology, but what is popular in the competition. And this technology has far from over. Please look forward to next time.