High Speed

Once you complete my course, the next thing you should do is figure out how to program your mouse to make a speed run. That is, figure out how to make your mouse return to the starting cell and then travel to the target cell as fast as possible using the best route without stopping. After that, you're ready for a faster mouse. I highly recommend the design worked out by Jasper Holton using the 2wd miniQ Robot chassis and encoders from DFRobot (although I would spring for some standoffs and the Upper Deck for miniQ so that I could wire everything together on a single short breadboard). To program Jasper's robot, you will have to learn to use an H-Bridge Motor Driver as well as encoders and interrupts (see below).

Upgrading the Voltage Regulator

click image to enlarge
For those of you who would like to squeeze a little more speed out of your existing robot, swap out the 5 volt regulator with a 6 volt regulator and rewire accordingly (energizing the left power rail to 6 volts and the right rail to 5 volts using the Arduino's on-board voltage regulator). Power your sensors and the Bluetooth module from the 5 volt rail. Be sure to supply power to your Arduino via the VIN pin. You may also want to add some reverse polarity protection in the form of a diode in series with the power supply.

Building Encoders
For those of you who enjoying learning how things work, I encourage you to build your own encoders. I asked Steven Kibler (the computer engineer who originally introduced me to Micromouse) the best way to go about detecting stripes glued to the inside of a wheel. He suggested Sparkfun's Line Sensor Breakouts. Jasper (who was working as my student intern at them time) then made his own encoders by painting some black and white stripes on the inside of his wheels using model paints. Thereafter, he glued the line sensors to the bottom of his servo motors, pointing them at the stripes. This gave him a nice oscillating analog signal. To transform it into something suitable for input into an interrupt, we fed it through a comparator from Mouser (also suggested by Steven).


Comparator Pin Layout
Below is an example circuit that takes input from a potentiometer and transforms it into a digital signal using the comparator which is then fed into pin 2 (which is interrupt 0). The two 10K ohm resistors are used to create a reference voltage. The 3rd resistor (in this case 100K ohms) helps to adjust the hystereis to minimize debouncing. I should have added a 4th resistor between VINA+ and the potentiometer (in place of the yellow wire). Page 12 of the datasheet describes how the ratio between those resistors would change the trip voltage. To use this circuit with your mouse, simply replace the analog readings provided by the potentiometer with what you get from the line sensor.

click image to enlarge

The Parallax Mouse Sensor Library - An Alternative to Encoders
One way to keep track of how far your robot travels would be to strap a mouse sensor to the bottom of it. Parallax sold a mouse sensor kit (#28560), but they didn't provide Arduino code for it. That's where the ParallaxMouseSensor library comes in. To use it, the mouse sensor must be set up for the Advanced Three-wire Connection. After that, it's pretty simple--see the example code in the library (available below) once you drop it in your Arduino folder's library folder.
ċ
ParallaxMouseSensor.zip
(2k)
Michael Backus,
Aug 10, 2014, 7:22 AM
Comments