line follow robot
i am confused in this project can anyone pls help me out.it's urgent.
the aim of the project is to follow the black line using 8051 written in c language.
i can move it forward and stop it based on ir reflex sensor but i can't move it left or right ....
pls it's urgent...
thanks in advance.....
my mail id:
[email protected]
[email protected]
The robot decides which direction to go based on the 5 sensors. Each sensor is read one at a time and the bit value is stored in a variable. The bits are left shifted into the variable starting with the left sensor. Therefore, the leftmost sensor is the most significant bit in the variable. Based on the final result of all 5 sensors being left-shifted into the variable, the robot decides how to steer.
Bit Pattern Hex Value Decision
00100 0x04 The line is in the center. Go forward.
01110 0x0E The line is center but really thick? Go forward.
11111 0x1F Possible intersection. Go forward.
00001 0x01 Line on right-most sensor. Go hard right.
00011 0x03 Line on right-most sensor. Go hard right.
00111 0x07 Line on right-most sensor. Go hard right.
00010 0x02 Line on mid-right sensor. Go right.
00110 0x06 Line on mid-right sensor. Go right.
01100 0x0C Line on mid-left sensor. Go left.
01000 0x08 Line on mid-left sensor. Go left.
10000 0x10 Line on left-most sensor. Go hard left.
11000 0x18 Line on left-most sensor. Go hard left.
11100 0x1C Line on left-most sensor. Go hard left.
? N/A All other conditions, continue in the last direction determined. Line could be between sensors or there could be a problem.
There are 6 directions defined for the robot.
GO_LEFT The left motor is stopped and the right motor goes forward. Robot pivots to the left on the left wheel.
GO_HARD_LEFT The left motor goes reverse and the right motor goes forward. Robot turns in place to the left.
GO_FORWARD Both motors go forward and robot goes forward.
GO_HARD_RIGHT The right motor goes reverse and the left motor goes forward. Robot turns in place to the right.
GO_RIGHT The right motor is stopped and the left motor goes forward. Robot pivots to the right on the right wheel.
GO_BRAKE Both motors are stopped. Currently not used. Disable is used instead.
only one sensor we are using here and i can't do it.....
while reading the sensors.. lets say white give you 1 and black give you 0
so.. here are combinations..
101 -> move straight
001 -> rotate left till you get 1 on left sensor
100 -> rotate right till you get 1 on right sensor
011 -> rotate left till you get 1 on left sensor and 0 on front sensor front sensor is of higher priority
110 -> rotate right till you get 1 on right sensor and 0 on front sensor front sensor is of higher priority
111 -> rotate 180 till you get 0 on front sensor.. this is to find line.. its like you have reached dead end..
Make sure of the sample rate.. at which you are going to check your sensors..
but its possible using two sensors, for that u have to ensure that black line is between the two sensors placed,
algorithm
if left sensor = 1 move right and then straight
if right sensor = 1 move left and then straight
the time for the robot to move right or left should be decided by using a delay function or counters. an perfect timing can be achieved by trial and error.
we have dont this and achieved the task using two sensors for our robotics level 3 competitions.
timing is more important,