Search This Blog

Monday, January 31, 2011

Roadmap to Mouse

Just a quick post to set my goals going forward.  Ordered and received my latest set of parts.  Got 2 18F2455 Pics.  Gpsim doesn't fully support them yet.  That will make starting out with them tough.  In the meantime, I played around with PWM operation of motors with the 16F876a.  Got A/D reads working with the phototransistors.

My next goal is to create a wall following robot with the 16F876a, using one Sharp IR sensor and PID control of the motors with PWM.  Really, it will only be PD control.  I won't need the Integral component for flat surfaces.

Once I get that working, I'll move on to a line follower.  I'll use the 16F876a and 5 IR sensors.  I'm thinking I'll use all 5 A/D pins.  I don't want to try receiving all 5 on the same A/D pin and lighting up each IR LED in turn.  Michah Carrick seems to have made this work, but it seems too likely to create interference.  I'll take a read of one phototransistor dark and then light up all five IR LEDs and take a read.  Then jump to the next phototransistor.

If all goes well, I'll start the first prototype of the mouse.  I am still thinking of using 3 Sharp sensors for alignment.  I'd really like to get a compass module and use that for alignment as well.  Maybe someday.

The biggest question right now is what to use for the base of the robot.  I'd like to get some Sintra or other plastic to work with.  I'm not overly confident in my craftsmanship with plastics though.

Got some Pololu micrometal gear motors with 30:1 ratio and some 42mm diam. wheels.  440 RPMs at 6V.  Should be close to 1m/sec with no load.  What blew me away was how small the motor and gear were!  Take a look:

Wednesday, January 5, 2011

Maze Solver 1.2

    I made some changes to the maze solving simulator.  I found a maze from 2004 that the old one could not solve.  I tried to avoid the code, succeed, test, fail, code some more routine and come up with a new strategy.  This time, I turned off the explore counter.  The mouse is either exploring or speed running.  Each solve and return is either an explore run or a speed run. The speed run terminates the program with it gets back to the start.

Here is the latest simulator
Here is the new maze, maze 4

    Oh, I changed the text display, too.  The maze is now in red with white values.  The mouse is '800' in blue.  There is a variable called colors.  If you set it to false, it prints everything in monochrome.  I found this useful for step debugging in Pydev Eclipse.

Here is a screenshot of the mouse having explored, solved, and back solved once:


Here, you can see the most of the lower half is left unexplored.  A speed solve at this point will take a lot of side trips!  Let's explore some more:


That's better.  Now we have 217 cells of the maze explored.  Now we could do a reliable speed run.

    I'm thinking my mouse will capture the number of explored cells.  When it gets back to the start after an explore round, it will output the number of known cells on an LCD.  The operator ( me ) can elect to do another explore solve or a speed run by pressing a "speed run" button. This button could toggle between speed and explore modes.  The LCD should also display this value.  I'll want another button to vary the speed as I amp up to the best speed/time.  Perhaps the speed level should also be displayed...  We shall see.