Society of Robots - Robot Forum

Software => Software => Topic started by: arigid on January 26, 2012, 04:02:39 PM

Title: Line Follower 90 degree turn!
Post by: arigid on January 26, 2012, 04:02:39 PM
Hey, I was working on my final Year project on Making a little robotic project which involved 90 degree turn, Well i wanted the bot to turn an exact 90 at the intersection, I wrote a code , move right until middle of 5 sensors became HIGh and later do normal Line Following, But i had the problem of the bot overshooting the line, and moving extra to the Right than stoppig exactly when middle sensor comes on the line!
Any suggestions on how to get this to work perfectly ! and also please recommend a way without using an Encoder!
Thanks! :D
Title: Re: Line Follower 90 degree turn!
Post by: joe61 on January 26, 2012, 04:47:42 PM
I haven't written line follower code before so take this for whatever it's worth.

So you have multiple sensors. Let's say the one you want to stop on is sensor 3, with sensor 2 on the left and 4 on the right.  When you see that sensor 2 has acquired the line, and you know the bot is turning, stop sampling the other sensors and sample sensors 2 and 3 as fast as possible. That way you can catch the initial contact with the edge of the line, and start adjusting your motors.

I have no idea if that's a workable solution, but without encoders I suspect you'll have to predict when the middle sensor will encounter the line, and start adjustments before it gets there.

Joe
Title: Re: Line Follower 90 degree turn!
Post by: Gertlex on January 26, 2012, 04:48:04 PM
Quote
and moving extra to the Right than stoppig exactly when middle sensor comes on the line!

This bit is confusing...

But it seems like if you're overturning, that amount of overturning should be fairly constant.  You can either turn slower, or set a timer to turn in the opposite direction once the middle sensor reads HIGH.  (Mind you, this is a guess - I've never built/debugged a line follower)
Title: Re: Line Follower 90 degree turn!
Post by: newInRobotics on January 27, 2012, 04:38:14 AM
I think that to have perfect 90° turn without encoders is next to impossible.

I'll explain why: Same make motors at same voltage will have slightly different speed and torque making robot to drift left/right a bit, that is, You will never make exact 90° turn unless uC knows how much each wheel have spun.

Regarding robot positioning just before turning:
_____________________
|                                        |
|     X     X     X     X     X     |
|                                        |
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
      1      2     3    4     5

While line has no sharp corners robot should be guided by sensors 2 and 4 with sensor 3 always detecting white line.

When robot approaches 90° turn on the left, sensors 1, 2, 3 and possibly 4 will detect white line. Then using encoders You measure width of the left turn line by moving robot forward until sensor 1 does not detect white line anymore. Assuming that distance from bot's wheelbase to IR sensor is more that width of white line, You calculate further distance Your bot needs to move by dividing line width by 2 and subtracting result from wheelbase-to-sensor distance; move Your bot forward by that distance and turn both wheels to opposite directions exactly by quarter of rotation.

To get more precise rotation without encoders  You should probably use line sensor with more IR Emitter/Detector pairs in it, this will give You better resolution of how far from line centre Your robot is. However, I still see no way of having perfect 90° turn without encoders.
Title: Re: Line Follower 90 degree turn!
Post by: arigid on January 27, 2012, 07:20:38 AM
Thanks for the Quick replies guys!  :)   , I believe it really is Difficult without Encoders but still was looking for a Possible Solution!

If any of you come up with a way let me know, I still have 3 months for the Project , Till the mean time i will keep you guys posted!
Title: Re: Line Follower 90 degree turn!
Post by: adanvasco on February 08, 2012, 11:09:02 AM
If you are following a line and the line just turns 90° in any direction, why don't you just follow the line? I mean, as long as the bot is following the line, it would be on the right track. If not following a line, then you would definitely need some sort of feedback to counteract mistakes, or stepper motors at least.