Ok.
Idea:
Scrap the top-edge detector. Instead use pairs of IR sensors that are positioned on the front and side of the mouse. Directed forwards and sidewise towards the walls.
Diagram of one sensor: http://www.zen86415.zen.co.uk/mouse1.gif
The RX is on top and angled down so that it can be shaded from ambient light. Because of the angles of the TX and RX, only the shaded area will produce an output. Both the TX and RX will have a half-angle quoted in the specs, plus a certain amount of experimentation should give you the ideal angles. This gives you accurate distance information from that sensor to the wall.
Place two of these sensors as indicated in this diagram: http://www.zen86415.zen.co.uk/mouse3.gif
3 Pairs like this, one pair on the front and one pair on each opposite side should provide all the information you need. The pairs work in two modes. Mode1 is just detecting the presence or absence of a wall. With the sensor angle set correctly, an output from the sensor indicates that the mouse is the correct distance from the wall. Mode2 compares the outputs from both sensors so that the mouse’s angle to the wall can be corrected. When both sensors are providing an equal output, then the mouse knows it is square on to the wall. Only one pair of alignment sensors need be operating at any one time. After all, if you know how far apart the walls are, then you only need to know how close you are to one of them.
Forward motion is controlled thus: Both motors accelerate up to max speed. When the side alignment sensors detect an imbalance (i.e one sensor is producing more output than the other), one motor is slowed down a little until the alignment sensors balance again. The degree of slow-down (the motor PWM% change) is directly proportional to the difference in the sensor outputs. With careful calibration I reckon this will speed up the seeking quite a lot.
I have never built a mouse, but would probably use this sort of system if I were to try.
Other (more expensive) idea:
Webcam on a pole pointing down. Process the image for edge detection. If the pole is long enough (no limits in the rules) then you can get a snapshot of the complete maze. All the maze-solving can be done very quickly in RAM before the mouse even moves. Then it can zoom straight to the end making no mistakes.
Edited by - boriz on 15/06/2007 15:50:17