go away spammer

Author Topic: need help ... keeping robot within a track!!!  (Read 2208 times)

0 Members and 1 Guest are viewing this topic.

Offline rajahamza9780Topic starter

  • Beginner
  • *
  • Posts: 1
  • Helpful? 0
need help ... keeping robot within a track!!!
« on: March 23, 2010, 07:23:12 AM »
I need to keep my robot within a specific path with one side to be wall and on the other side is a divider solid line (much like a highway). It should not touch either of these and it also need to maintain speed, besides this there are bridges and under-passes with rotations.
the sample track is attached with:



now i need help regarding the:
1) technique of sensing the rotations while not touching the side barriers .....
2) which type of motors should i use to keep in the speed with power .....
.
.
.
=> I will be obliged to know the solid and implementable material. Plzz do help!!!

Offline waltr

  • Supreme Robot
  • *****
  • Posts: 1,944
  • Helpful? 99
Re: need help ... keeping robot within a track!!!
« Reply #1 on: March 23, 2010, 10:16:27 AM »
Go to the SoR tutorials above and read the many excellent articles on line following and obstacle avoidance techniques. Everything you need is there.

Offline Metal Slug 2

  • Supreme Robot
  • *****
  • Posts: 333
  • Helpful? 11
Re: need help ... keeping robot within a track!!!
« Reply #2 on: March 24, 2010, 01:14:29 AM »
This can be done using only two modified servos, an IR rangefinder and of course a microcontroller.

One idea would be to have a threshold, or distance from your robot to the wall, and a displacement factor.  Using a simple if, else if, else statement you would tell the robot to read the IR sensor value, if that value is  greater than the threshold - displacement factor and less than the threshold + displacement factor, then drive straight (the 'else' part).  If the IR sensor value is less than the threshold - displacement factor, then depending in which direction your IR rangefinder is facing (either left or right), turn left or right (or move in the direction opposite of the wall) (the 'if').  If the IR sensor value is greater than the threshold + the displacement factor, then move right or left again.

visualize:

Assume we are using the track shown in your picture, and your robot is placed on the left side of the pathway.
Lets assume that when placed at the start the distance from where the IR sensor is mounted on your robot to the wall LEFT of the robot is 15 cm, therefore we can say the 'threshold' would (or should) be 15 cm.  let us also assume that the displacement factor is 2 cm.
You start your robot going off in a straight line.  While you do this, you constantly read the values from the IR sensor. (even though the sensor values will be between 0-1023, lets just stick with cm to make things easy).  As the robot approaches the first right hand turn, the sensor begins to read a lesser and lesser distance. When that lesser distance is less than the threshold - displacement factor (ie. 15 - 2 = 13 cm), the robot stops its right wheel and moves its left wheel, thus making a turn to the right. When your robot makes a right turn, the sensor is brought away from the wall again, and is no longer less than 13 cm away from the wall, therefore the robot stops turning right and goes straight again.
on the second, left turn, as the robot travels the sensor eventually will read a value greater than the threshold + the displacement factor (ie. 15 + 2 = 17 cm).  When this happens you would tell your robot to turn its right servo and stop its left.
put that if-else if-else statement in a loop and you have a wall following robot! =)
Take a look at the picture to see what I mean.

 


Get Your Ad Here