• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Line Following Robot Algorithm

Status
Not open for further replies.

theo92

New Member
After a very very long time I'm here on electro tech.
Long long ago, I had a dream of line following robot, but it was never executed.

So, I cant figure how this line followers work exactly. I have a overall idea that where the IR reflects off from a shiny surface to the sensor, The wheel turns to that side.

Now can anybody tell me the Full Algorithm and or the flowchart.

I'll code it myself in PICBasic either on proton or swordfish.
I think nobody written a line follower code on these two.

So, follow my line please
 

Sceadwian

Banned
Two sensors theo. When the sensor on the left triggers the robots tries to move right until the sensor goes off, when the sensor on the right triggers the robot tries to move left until the sensors goes off, when neither sensor is triggered it trys to go forward.
It's pretty simple.
 

srikanthsamaga

New Member
More sensors = more accuracy
since you are using microcontroller you can use more number of sensors which enables your bot to correct its path even when it deviates slightly from the line.
 

Sceadwian

Banned
More sensors can ONLY mean more accuracy with better code.
 

be80be

Well-Known Member
I did a line follower and posted it on here some where it in picbasic pro
 

theo92

New Member
Thanks everybody.
I'll stick with it, and will try to do the flowchart.

But for motor control, whick is more flexible:

PWM? or using 1/0 signals to trigger a mosfet to turn on the two motors for two wheel?

I've understood clearly for two sensors, But when it comes to multiple sensors(ie 6-8), how does the algorithm change.is it like :

When the Left most sensor triggers, then the right motor turns most, when the next left sensor trigger, then the right motor turns a little than the previous...and so on.
 

be80be

Well-Known Member
PWM? or using 1/0 signals to trigger a mosfet to turn on the two motors for two wheel?
You have to use some from of pwm to control your motor. Or a very slow
geared motor. Turning a motor on full right or left to track your line it will over shoot the line. four sensors work very good two in front and two in back.Your main goal is to track the line. If you have to find the line first then you may want six two to catch when you run over it.
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top