Beginners: please read this post and this post before posting to the forum.
0 Members and 1 Guest are viewing this topic.
To check if I understand the drawing correct. You have a large circle that you move along. On this circle there are paths going out, which you have to follow. At the end of the path there is a shape, that you have to follow round, return to the path and back to the large circle and continue to the next path. During this, you have to say what shape the object and the end of the path is. Correct?
Second, you have to know when you are traversing the geometrical shape and when you are moving between shapes. Since you start on the big circle, the first time you find a new path on you left is the path to the shape. Next time, it's the shape, so set a flag in your program that tells the bot that you are traversing the object. Fourth time, you are going back down the path, so you should reset the flag, until you come to the next object (which you will know by counting left turns).
Third, is the hard one. Identifying the objects. You should be able to do this, by looking at how much you have to turn right, whenever you are inside the shape. If it's a small amount, you are on a circle. If it's > 90 degrees, you are at a triangle and if it's 90 degrees, you are at a box. You can also count the number of right turns as a backup measurement. To tell the two boxes apart, you have to time how long the sides are, to know if it's the square or not.
Hope this helps and good luck. Please remember to post information and video on how you are progressing.
Hmm..How do i set the flag? And what is the use of this actually? Sorry..i didnt understand this step.
So..If im in a box and im turning right, so the angle would be 90degrees. How do i calculate the degrees turned and use it in my program?
What you basically need to do is, when you discover that the line is not longer in front of you, how long time (or how many step motor steps) does it take to turn the robot, until it is in front of you again.
I will be using DC motors for my bot. how can the time taken be found?
QuoteI will be using DC motors for my bot. how can the time taken be found? A stopwatch? Draw a box and a triangle on some paper and try to measure the time spend rotating. Remember that your robot might move left/right, if it is not going along the line to get back to the line. This is of course not considered as turning, so you should consider that a turn should only "count" if it is larger than a certain value (that you have to find by trying) so going left-right-left-right... to stay on the line does not count as turning a corner when you try to decide what shape you are going round.
cool man. thnx:) and hey could you help me out with the programming part. Il be using C language. I guess the program for this will use a lot of if else loops. So can u give me some ideas for using functions for specific tasks like identifying shapes etc.
Quotecool man. thnx:) and hey could you help me out with the programming part. Il be using C language. I guess the program for this will use a lot of if else loops. So can u give me some ideas for using functions for specific tasks like identifying shapes etc.Since you mentioned in the first post, that this is a competition, I think it would be unfair if you got too much help. The best thing you can do is to start out and then if you get stuck, ask questions here on the board and see if someone can help you.
QuoteSo..If im in a box and im turning right, so the angle would be 90degrees. How do i calculate the degrees turned and use it in my program?That depends on your robot. If you are using step-motors, you can count the number of steps you need for your robot to turn 90 degrees. If you are using regular motors, you need to time how long time it takes for the robot to make the turn.
Quote from: jka on July 25, 2009, 10:03:49 AMQuoteSo..If im in a box and im turning right, so the angle would be 90degrees. How do i calculate the degrees turned and use it in my program?That depends on your robot. If you are using step-motors, you can count the number of steps you need for your robot to turn 90 degrees. If you are using regular motors, you need to time how long time it takes for the robot to make the turn.No! Do not use timing. This is BAD! Will it work? Maybe. Will it work all the time? No! using timing in robotics for motion control is generally a bad idea because it can change. As your robots battery drains the motors get less and less power and your timing will get thrown off.if you need to keep track of how much your robot turns use encoders which count how far/how many times a wheel has turned. This value would never change.
if you need to keep track of how much your robot turns use encoders which count how far/how many times a wheel has turned. This value would never change.
Im tight on budget mate. Can modified servos be used?Will those might be useful?
Use a lot of the ir sensors that you use to see if you are on a line or not. Arrange them in a grid. When you are on top of a corner, the sensors will detect an "image" of the corner, which you can use to identify the shape. It's like a very small resolution camera.
I dont get it dude. the IR sensors just show an variation in the voltage, when exposed to white and black colors rite? what do u mean by "the sensors will detect an "image" of the corner"?
QuoteI dont get it dude. the IR sensors just show an variation in the voltage, when exposed to white and black colors rite? what do u mean by "the sensors will detect an "image" of the corner"?If you have a 5x5 array of sensors, you will get a 5x5 pixel image. If you are at a 90degree corner, the center sensor + the two down + the two to the right will detect a line, while the others won't. Try to take a piece of paper and draw 5x5 dots 5 times. Then draw the corner of each of the 5 shapes through the 5 dot-arrays and see the difference in which dots (=sensors) are on top of the shape.Of course there is a lot more to it than this. For example, the robot is moving, so the corner will "come into" the array from the top and not just "be there". Also, the corner will not go through the center each time, but you will have a very low res camera type of sensor with this array, where you can do some image recognition. Of course, you could also take a regular webcam and place it on the bottom of the robot, but that would be overkill.
as for the cost of encoders, if you use the GM17 from solarbotics you can get an encoder for $10if you use GM2/3/8/9 you can get a pair of encoders for 42 (you would need at least 2 for this application)I'm a budget bot builder and I don't find either of those options terribly expensive
I'm not sure what you mean by statements like if((C&&D)<(A&&B))Do you mean "If sensor C and D receive less light than A and B"? And if that is the case, is "less light" = detecting the line?