Robojoy challenge class

2-4.Line tracing program


Program 5

Here is the improved program that I would be prevented off the track.
Since increasing the process too much it becomes the blockbuster.

[DOWNLOAD] Created Program 5(for the NXT software)

This program must have three variables. These are all called "logic" will contain either of the two types of "positive" and "fake".

  1. Variable name "logic 1": fake = detection the white / positive = detection the black.
  2. Variable name "variables _1": fake = during detection / positive = detection end.
  3. Variable name "variables _2": fake = left turn/ positive =right turn.

The program is so long, I will split into three.

This is the first 1/3.
After the initialization of variables, the motor make the right turn or left turn.

This is the second 2/3.
Detection has been doing on white or black. It will be "positive" at the end of the flag is detected. The timer switch will judge the track is on or off. If you could not detect the boundaries of the black/white to within one second, the loop will be terminated.
In this way, it should no longer keep looking for a black / white.

This is the last 3/3.
Reverse the flag of detection white竊絶・black. And, when the white detection is finished, invert the flag of the left and right turning.
Now it can move zigzag on the line.

I tried to run the program. If it slides off the track, the direction of the turn will be returned automatically.
However, it is not enough for returning, in many cases could not be returned to the line again. It is necessary to devise more. I tried to shake the nose from side to side, the efficiency of the move does not seem to improve much. I think it is so hard to make an accurate robot.
I will introduce the idea to further improve the robot. Please refer for next time.

  1. Install two light sensor to the left and right. If you change the direction in the sensor response, it does not need to move zigzag anymore?
  2. See that you do not completely stop the motor of the left and right. No longer turning suddenly, but, it increases the straightness?
  3. With a mechanism could move the angle of the tire, make a change in direction.