### Author Topic: Grid Maze solving robot  (Read 2377 times)

0 Members and 1 Guest are viewing this topic.

#### Ankit Virdi

• Jr. Member
• Posts: 9
##### Grid Maze solving robot
« on: March 09, 2013, 02:03:32 PM »
Hello , I am a beginner (I have just made a basic bot having four motors) at robotics but I am quite good with microcontrollers(Being an Electronics Engineering student).
I am interested making a Grid Solving Robot (Using stepper motors and IR sensors) for a competition which is on Saturday, 16th of this month
The Problem Statement is as follows:

The bot starts on the violet line shown in the figure(attached).
The autonomous bot has to solve the grid by following the white line and avoiding the
nodes.
It must carry one of the white blocks from a location on the grid and place on the green
line shown in the figure.
Then, it must take the queen block (the completely black one) from grid to a position
that will be given during the dry run (using a white indicator line, on any one of the lines
in the brown zone). The indicator line has to be detected in the dry run. It won't be
present during the main run. Your bot is supposed to feed the position of the indicator
line during the dry run.
After this it must pick up and place the last block on the red line.
Once this is done, the bot, having done its job, must now park itself in suitable position
among the array of parking slots placed at one end of the grid (The blue zone).

Now, I have figured out how to make a basic grid solver wherein the solution of the grid is to be programmed but, for the stated problem my code should have a certain memory.
Thanks a lot.

« Last Edit: March 09, 2013, 02:23:44 PM by Ankit Virdi »

#### jwatte

• Supreme Robot
• Posts: 1,345
##### Re: Grid Maze solving robot
« Reply #1 on: March 09, 2013, 07:51:36 PM »
What is the problem you're trying to get help with? What have you tried; what did it do; what did you think it should have done?

If the problem is "how do I remember things between runs," then add a button that sets the "run count" to 0, and another button that starts a run. Then remember the results from run 0 in subsequent runes.

If you need to remember across resets, then many microcontrollers have built-in EEPROM (flash) memory which is non-volatile. For example the AVR microcontrollers have typically 512 - 2048 bytes of eeprom, which can be read/written using the eeprom_read_data()/eeprom_write_data() functions (assuming you use avr-gcc and avr-libc.)

#### Ankit Virdi

• Jr. Member
• Posts: 9
##### Re: Grid Maze solving robot
« Reply #2 on: March 10, 2013, 12:56:49 AM »
I am almost done making the line following part I referred to "An advanced line following robot with PID control"
http://www.societyofrobots.com/member_tutorials/node/350. I have used 5 sensors instead of 8 will they be enough?
I am using ATMEGA16 with a flash of 512 bytes.
Problems I am facing are:
As there is a grid (please refer the diagram if you haven't) and the bot is supposed to follow on the VIOLET line first then white and it also has to go to  CAN the IR sensor detect different colors?
The bot is supposed to solve the grid of its own accord during run time as the obstacles(There are three 1 black and 2 white cubes) will be placed randomly at nodes. HOW will it solve during run time? Or basically remember the POSITION of the obstacles. I know how to preprogram the solution.
The bot is supposed to PICK the cubes and place it on the position given during the dry run? So basically the bot should map the complete grid with position of the obstacles and their destinations.
and you reckon i can build the mechanism to pick up cubes using servo motor? OR using Ecentric lever?
if you can provide a reference to that too I will be grateful.

https://www.youtube.com/watch?v=d3c4-IFyP6w  please see the video I have to make the same robot.

#### jwatte

• Supreme Robot
• Posts: 1,345
##### Re: Grid Maze solving robot
« Reply #3 on: March 10, 2013, 01:16:45 AM »
Those are much clearer questions!

Quote
CAN the IR sensor detect different colors?

No. It may be able to detect different shades of color, though.

Quote
Will 5 IR sensors be enough?

Probably. You'd probably want one in the middle, and make sure that stays "detecting" all the time, and use the others to detect going off-track.

Quote
solve the grid

You will probably have to number the grid intersection points in a coordinate system. Make the start corner 0,0 and go X horizontally and Y vertically, for example. The robot will then have to remember which direction it's going on (along + or - X, or along + or - Y) and increment/decrement the coordinate it's at when it detects an intersection. The robot should then be able to navigate to any given coordinate by counting intersections and turning appropriately.

Quote
detecting obstacles

You need different sensors for this. Limit switches with long blades (a k a "bumper switches") are possibly a good choice. You might need some kind of input to tell whether a cube is black or white, though.

Quote
pick up cubes

You need some kind of gripper, and some kind of lifter, at a minimum. And, ideally, space for three cubes, so you don't have to run back and forth between cubes and destinations, but can instead just grab them all as you find them (if that's an acceptable strategy for the problem.) This sounds pretty hairy, mechanically; if you have a week to build it, you might be in trouble! Buying a ready-made servo gripper arm might help.

Also, regarding detecting colors and obstacles: There exist color detector sensors, that work on very near-field distances (a centimeter, perhaps.) This might be an option. You probably also want a white LED to illuminate where you're going for the detector to work right. Or you can use a webcam, assuming you're using a high-performance single-board computer, such as a Raspberry Pi, or a BeagleBone.

#### Ankit Virdi

• Jr. Member
• Posts: 9
##### Re: Grid Maze solving robot
« Reply #4 on: March 10, 2013, 04:24:07 AM »
All right thanks a lot mate!
Now can I use a color sensor an the centre (Amoung my 5 sensors) to give different values for violet, red, green and blue line. How do I make one?
Also how can I differentiate whether the cube is black or white? I know how to make a obstacle detector I think I should use the same sensor which I make for color.
No I cannot move all 3 cubes at the same time but I got a pretty cool gripping mechanism I'll just fit a servo on it. I might not be able to pick up the cube but I can grip it tightly which is fine.
I kind of figured how to solve the grid.
Thanks again.