To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 19629
19628  |  19630
Subject: 
Re: Line following algorithms
Newsgroups: 
lugnet.robotics
Date: 
Wed, 27 Nov 2002 13:59:37 GMT
Viewed: 
1188 times
  
The best working algorithm I found until now is the simplest one:
1) When light sensor on track goes ahead.
2) When not on track, seek track in right or left (randomly) direction for
some time.
3) If found, go to step 1.
4) If not doubles seeking time, reverse seeking direction and go to step 2.

Have a variable remembering if the 'bot found the line turning left or right
and try that direction first instead of random.

This way the bot will go much fast through long turns but will always seek
wrong direction for the first correction of a bend in the other way.

1) When light > trigger value both motors OnFwd
2) If light < trigger value and 'a' == 0 turn left for "seek time"
3) If light < trigger value and 'a' == 1 turn right for "seek time"
4) If found 'a' = 0, goto step 1
5) If not found, turn right for "seek time" x 2.
6) If found 'a' = 1, goto step 1
7) If not found, increase seek time and turn right

Of course you need to reset the seek time or use constants instead. Step 5-7
can be loop based.

I've tried this behaviour and it works very well.

Best,
/Tobbe
http://www.lotek.nu
(remove SPAM when e-mailing)



Message has 1 Reply:
  Re: Line following algorithms
 
(...) I guess that an improvement can be: If the sensor is on track for more than an specified time, the bot can seek at first at the opposite site as he found it the last time. Of course, it will not be bullet proof, but it may work, I´ll give it a (...) (22 years ago, 27-Nov-02, to lugnet.robotics)

Message is in Reply To:
  Re: Line following algorithms
 
(...) Thanks Steve, I saw these site before, it´s a nice job but the described algorithm is based more on "edge following" than on "line following". For this kind of algorithm the best solution would be a grayscale track such as the "Nascar racers" (...) (22 years ago, 25-Nov-02, to lugnet.robotics)

14 Messages in This Thread:



Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    
Active threads in Robotics

 
Contact Recovery Nerd for Speedy USDT / BTC Recovery
15 hours ago
Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR