You are on page 1of 67

MicroMouse Basics

Part 1: Hardware
Robot Kits

 Approx. $100 - $200


 Contains the chassis, motors, wheels and
a microcontroller (Basic Stamp)
Lego Robotics Kits
 Easy to prototype
 Programming Languages:
 Logo
 Not Quite C
 Interactive C
Custom Made Mouse

 Can choose the individual components


 Can achieve better performance over kits
 Much more satisfying and fun
Custom Made Mouse

 Main components:
 Microcontroller board
 Motors
 Wall sensors
 Batteries
 Chassis
Microcontrollers

 Basic Stamp
 Basic Programming Language
 Full documentation and examples online
 Basic Stamp 2e has more programming space
Microcontrollers

 OOPic
 Object oriented (VisualBasic)
 Full documentation and examples online
Microcontrollers

 Motorola 68HC11 based boards:


 Handy Board
 FingerBoard
 BotBoard
 MiniBoard
Microcontrollers

 Handy Board
 Perfect for small robots
 Easy to develop software
Propulsion

 DC Motors
 Servos
 Stepper Motors
Propulsion

 DC Motors
 Cheap, small
 Need gearbox
 Need shaft encoders
 H-Bridge
 Discrete
 SGS Thompson L293D
• Can drive two motors
• 600mA per motor
Propulsion

 Servos
 Need to modify for continuous rotation
 Need shaft encoders
 Can be driven without H-Bridge
 Come with attachments
 Perfect for Basic Stamp
Propulsion

 Stepper Motors
 Less torque than DC motors for a given size
and weight
 Do not need shaft encoders, gearbox
 LSI chips can handle logic and power
 Allegro UCN5804LB
• 1.25 A
• 35 V
Propulsion

 Acceleration / Deceleration
 Want to ramp up and ramp down
Sensors

 Wall Feelers
 IR Sensors
Sensors

 Wall Feelers
 Simple to make and adjust
 Tend to get hung up at wall openings
Sensors

 IR Sensors
 Proximity
 Easiest to implement
 Distance
Sensors

 IR Sensors
 Guide the mouse
 Map the walls
Sensors

 IR Sensors
 Detect navigation errors
Sensors

 IR Sensors
 Can sense adjacent walls
Sensors

 IR Sensors
 Pivot turn
Sensors

 IR Sensors
 Arc turn
Batteries

Feature Alkaline NiCd NiMH Unit


Cell Voltage 1.5 1.2 1.2 volt
Capacity 2000 500 1100 mAh
Energy Density 190 44 53 Wh/kg
Resistance 150 10 30 m
Charger None Simple Harder
Power

 10 prismatic NiMH or 8 AAA alkaline


 An external power supply was used to
power the mouse during testing
Chassis

 Must hold all of the parts securely


 Must be small enough to maneuver within
the walls
MicroMouse Basics
Part 2: Software
Movement Routines

 Basics
 Go forward using the wall-following method
 Travel a specific number of cells
 Make consistent turns
Maze Solving Algorithms

 Wall Following Method


 Good start
 Will not find the destination
 Depth First Search
 Explores every cell
 Will find destination eventually
 Flood-Fill Search
 Finds shortest path to destination
Flood-Fill

 Full Flood-Fill
 Cells are assigned distance values indicating
how far they are from the destination
 Destination cells are assigned a value of zero
Flood-Fill

6 5 4 5 6 7 6
7 4 3 2 3 4 5
6 5 8 1 2 3 6
7 8 7 0 3 4 7
8 9 6 5 4 5 8
9 10 7 8 9 10 9
10 11 12 13 12 11 10
Flood-Fill

6 5 4 5 6 7 6
7 4 3 2 3 4 5
6 5 8 1 2 3 6
7 8 7 0 3 4 7
8 9 6 5 4 5 8
9 10 7 8 9 10 9
10 11 12 13 12 11 10
Flood-Fill

6 5 4 5 6 7 6
7 4 3 2 3 4 5
6 5 8 1 2 3 6
7 8 7 0 3 4 7
8 9 6 5 4 5 8
9 10 7 8 9 10 9
10 11 12 13 12 11 10
Flood-Fill

6 5 4 5 6 7 6
7 4 3 2 3 4 5
6 5 8 1 2 3 6
7 8 7 0 3 4 7
8 9 6 5 4 5 8
9 10 7 8 9 10 9
10 11 12 13 12 11 10
Flood-Fill

6 5 4 5 6 7 6
7 4 3 2 3 4 5
6 5 8 1 2 3 6
7 8 7 0 3 4 7
8 9 6 5 4 5 8
9 10 7 8 9 10 9
10 11 12 13 12 11 10
Flood-Fill

6 5 4 5 6 7 6
7 4 3 2 3 4 5
6 5 8 1 2 3 6
7 8 7 0 3 4 7
8 9 6 5 4 5 8
9 10 7 8 9 10 9
10 11 12 13 12 11 10
Flood-Fill

6 5 4 5 6 7 6
7 4 3 2 3 4 5
6 5 8 1 2 3 6
7 8 7 0 3 4 7
8 9 6 5 4 5 8
9 10 7 8 9 10 9
10 11 12 13 12 11 10
Flood-Fill

 Full Flood-Fill
 Make a move
 Record any walls
 Flood the maze
 Repeat
Flood-Fill

 Make a move

6 5 4 5 6 7 6
7 4 3 2 3 4 5
6 5 8 1 2 3 6
7 8 7 0 3 4 7
8 9 6 5 4 5 8
9 10 7 8 9 10 9
10 11 12 13 12 11 10
Flood-Fill

 Map any walls

6 5 4 5 6 7 6
7 4 3 2 3 4 5
6 5 8 1 2 3 6
7 8 7 0 3 4 7
8 9 6 5 4 5 8
9 10 7 8 9 10 9
10 11 12 13 12 11 10
Flood-Fill

 Flood the maze

6 5 4 3 4 5 6
5 4 3 2 3 4 5
4 3 2 1 2 3 4
3 2 1 0 1 2 3
4 3 2 1 2 3 4
5 4 3 2 3 4 5
6 5 4 3 4 5 6
Flood-Fill

 Move to the open neighboring cell with


the lowest distance value
6 5 4 3 4 5 6
5 4 3 2 3 4 5
4 3 2 1 2 3 4
3 2 1 0 1 2 3
4 3 2 1 2 3 4
5 4 3 2 3 4 5
6 5 4 3 4 5 6
Flood-Fill

 Map any walls

6 5 4 3 4 5 6
5 4 3 2 3 4 5
4 3 2 1 2 3 4
3 2 1 0 1 2 3
4 3 2 1 2 3 4
5 4 3 2 3 4 5
6 5 4 3 4 5 6
Flood-Fill

 Flood the maze

6 5 4 3 4 5 6
5 4 3 2 3 4 5
4 3 2 1 2 3 4
3 2 1 0 1 2 3
4 3 2 1 2 3 4
5 4 3 2 3 4 5
6 5 4 3 4 5 6
Flood-Fill

 Move to the open neighboring cell with


the lowest distance value
6 5 4 3 4 5 6
5 4 3 2 3 4 5
4 3 2 1 2 3 4
3 2 1 0 1 2 3
4 3 2 1 2 3 4
5 4 3 2 3 4 5
6 5 4 3 4 5 6
Flood-Fill

 Map any walls

6 5 4 3 4 5 6
5 4 3 2 3 4 5
4 3 2 1 2 3 4
3 2 1 0 1 2 3
4 3 2 1 2 3 4
5 4 3 2 3 4 5
6 5 4 3 4 5 6
Flood-Fill

 Flood the maze

6 5 4 3 4 5 6
5 4 3 2 3 4 5
4 3 2 1 2 3 4
5 2 1 0 1 2 3
6 3 2 1 2 3 4
5 4 3 2 3 4 5
6 5 4 3 4 5 6
Flood-Fill

6 5 4 3 4 5 6 6 5 4 3 4 5 6
5 4 3 2 3 4 5 5 4 3 2 3 4 5
4 3 2 1 2 3 4 4 3 2 1 2 3 4
3 2 1 0 1 2 3 5 2 1 0 1 2 3
4 3 2 1 2 3 4 6 3 2 1 2 3 4
5 4 3 2 3 4 5 5 4 3 2 3 4 5
6 5 4 3 4 5 6 6 5 4 3 4 5 6
Flood-Fill

 Move to the open neighboring cell with


the lowest distance value
6 5 4 3 4 5 6
5 4 3 2 3 4 5
4 3 2 1 2 3 4
5 2 1 0 1 2 3
6 3 2 1 2 3 4
5 4 3 2 3 4 5
6 5 4 3 4 5 6
Flood-Fill

6 5 4 3 4 5 6
7 4 3 2 3 4 5
6 5 2 1 2 3 4
7 2 1 0 1 2 3
6 3 2 1 2 3 4
5 4 3 2 3 4 5
6 5 4 3 4 5 6
Flood-Fill

 Full Flood-Fill
 Make a move
 Record any walls
 Flood the maze
 Repeat
Flood-Fill

 Modified Flood-Fill
 Change distance values as you explore the
maze
Flood-Fill
Flood-Fill

 An example 3x3 maze


 Starting state:
Flood-Fill

 Move to the open neighboring cell with


the lowest distance value
Flood-Fill

 Walls are found and mapped during


exploration
Flood-Fill

 Following distance values


Flood-Fill

 Another wall
Flood-Fill

 If a cell is not the destination, its value


should be one plus the minimum value of
its open neighbors
Flood-Fill

 Need to update numbers


Flood-Fill

 Other cells now need to be updated


Flood-Fill

 More updating
Flood-Fill

 More updating
Flood-Fill

 Done updating
 Can now find destination cell
Flood-Fill

 Use same technique to get back to start


Flood-Fill

 Modified Flood-Fill
 Move to the open neighboring cell with the
lowest distance value
 Record any walls
 Update distance values if necessary
 Repeat
Flood-Fill

 Modified Flood-Fill
 Updating distance
values QuickTime™ and a
GIF decompressor
are needed to see this picture.
Contact Information

 http://www.micromouseinfo.com
 steve@micromouseinfo.com

You might also like